| Previous | 199869 Revisions | Next |
| r31374 Tuesday 22nd July, 2014 at 06:14:55 UTC by Miodrag Milanović |
|---|
| Cleanups and version bump |
| [src] | version.c |
| [src/emu] | clifront.c emupal.c image.c luaengine.c machine.c mame.c memory.c softlist.c video.c webengine.c |
| [src/emu/bus/a1bus] | a1bus.c a1cassette.c a1cffa.c |
| [src/emu/bus/a2bus] | a2diskiing.c a2dx1.c a2mcms.c |
| [src/emu/bus/amiga/zorro] | a2052.c a2232.c a590.c action_replay.c buddha.c cards.c zorro.c |
| [src/emu/bus/c64] | ieee488.c xl80.c |
| [src/emu/bus/comx35] | clm.c |
| [src/emu/bus/cpc] | cpc_pds.c cpc_rs232.c |
| [src/emu/bus/ecbbus] | grip.c |
| [src/emu/bus/gameboy] | gb_slot.c |
| [src/emu/bus/isa] | aga.c cga.c mach32.c mda.c omti8621.c p1_hdc.c vga_ati.c |
| [src/emu/bus/msx_cart] | arc.c ascii.c bm_012.c cartridge.c crossblaim.c dooly.c fmpac.c halnote.c hfox.c holy_quran.c konami.c korean.c majutsushi.c msx_audio.c msx_audio_kb.c msxdos2.c nomapper.c rtype.c super_swangi.c superloderunner.c yamaha.c |
| [src/emu/bus/msx_slot] | bunsetsu.c cartridge.c disk.c fs4600.c music.c panasonic08.c ram.c ram_mm.c rom.c slot.c sony08.c |
| [src/emu/bus/neogeo] | banked_cart.c bootleg_cart.c bootleg_prot.c cmc_cart.c cmc_prot.c fatfury2_cart.c fatfury2_prot.c kof2002_cart.c kof2002_prot.c kof98_cart.c kof98_prot.c mslugx_cart.c mslugx_prot.c neogeo_carts.c neogeo_intf.c neogeo_slot.c pcm2_cart.c pcm2_prot.c pvc_cart.c pvc_prot.c rom.c sbp_prot.c sma_cart.c sma_prot.c |
| [src/emu/bus/nes] | 2a03pur.c |
| [src/emu/bus/plus4] | c1551.c |
| [src/emu/bus/ql] | cst_qdisc.c cumana_fdi.c qubide.c rom.c sandy_superdisk.c sandy_superqboard.c trumpcard.c |
| [src/emu/bus/scsi] | scsi.c scsihle.c |
| [src/emu/bus/vtech/ioexp] | carts.c ioexp.c joystick.c printer.c |
| [src/emu/bus/vtech/memexp] | carts.c floppy.c memexp.c memory.c rs232.c wordpro.c |
| [src/emu/bus/wangpc] | lvc.c mvc.c |
| [src/emu/cpu/alto2] | alto2cpu.c |
| [src/emu/cpu/g65816] | g65816.c |
| [src/emu/cpu/i86] | i86.c |
| [src/emu/cpu/m6809] | hd6309.c konami.c |
| [src/emu/cpu/mb86233] | mb86233.c |
| [src/emu/cpu/mb86235] | mb86235.c |
| [src/emu/cpu/minx] | minx.c |
| [src/emu/cpu/mips] | mips3.c mips3drc.c |
| [src/emu/cpu/powerpc] | ppccom.c ppcdrc.c |
| [src/emu/cpu/rsp] | rsp.c |
| [src/emu/cpu/sh2] | sh2.c sh2comn.c sh2drc.c |
| [src/emu/cpu/sh4] | sh4.c sh4dmac.c |
| [src/emu/cpu/tms34010] | tms34010.c |
| [src/emu/cpu/tms57002] | tms57002.c |
| [src/emu/cpu/tms7000] | tms7000.c |
| [src/emu/cpu/z80] | tmpz84c011.c tmpz84c015.c |
| [src/emu/imagedev] | cassette.c |
| [src/emu/machine] | 53c810.c 6532riot.c 68307.c 6840ptm.c aakart.c adc0808.c akiko.c amigafdc.c atahle.c autoconfig.c corvushd.c cr511b.c dmac.c eepromser.c gayle.c hd63450.c i8255.c i8271.c keyboard.c mb89363b.c mc68681.c ncr539x.c netlist.c roc10937.c upd765.c wd17xx.c wd7600.c wozfdc.c ym2148.c z80ctc.c |
| [src/emu/netlist] | nl_base.c nl_parser.c nl_setup.c |
| [src/emu/netlist/analog] | nld_bjt.c nld_fourterm.c nld_opamps.c nld_solver.c nld_twoterm.c |
| [src/emu/netlist/devices] | net_lib.c nld_4020.c nld_7400.c nld_74123.c nld_7474.c nld_7490.c nld_74ls629.c nld_9316.c nld_legacy.c nld_ne555.c nld_r2r_dac.c nld_system.c |
| [src/emu/sound] | 2203intf.c 2608intf.c 2610intf.c ay8910.c es5506.c k053260.c k054539.c pokey.c rf5c68.c |
| [src/emu/video] | crt9007.c hd44780.c i8275.c mc6845.c resnet.c snes_ppu.c tms3556.c voodoo.c |
| [src/lib/formats] | ap2_dsk.c msx_dsk.c oric_dsk.c rx50_dsk.c |
| [src/lib/lua] | lapi.c lauxlib.c lbaselib.c lbitlib.c lcode.c lcorolib.c lctype.c ldblib.c ldebug.c ldo.c ldump.c lfunc.c lgc.c linit.c liolib.c llex.c lmathlib.c lmem.c loadlib.c lobject.c lopcodes.c loslib.c lparser.c lstate.c lstring.c lstrlib.c ltable.c ltablib.c ltm.c lua.c luac.c lundump.c lvm.c lzio.c |
| [src/lib/lua/lib] | lsqlite3.c |
| [src/lib/sqlite3] | shell.c |
| [src/lib/util] | corealloc.c zippath.c |
| [src/lib/web] | mongoose.c |
| [src/mame/audio] | cage.c cinemat.c dcs.c midway.c |
| [src/mame/drivers] | 1942.c 8080bw.c 88games.c aces1.c ajax.c aliens.c alpha68k.c alvg.c amaticmg.c arachnid.c astinvad.c astrof.c atari_s1.c atarigt.c backfire.c bagman.c bfm_sc1.c bfm_sc4.c bfm_sc45_helper.c bfm_sc4h.c blktiger.c blockhl.c bnstars.c boogwing.c bottom9.c byvid.c capcom.c cave.c chanbara.c chihiro.c chqflag.c cliffhgr.c cninja.c cobra.c cocoloco.c coinmstr.c coolridr.c crimfght.c csplayh5.c cubo.c darkseal.c dassault.c dbz.c de_3.c deco32.c dreamwld.c dwarfd.c ecoinf2.c ecoinf3.c fireball.c fortecar.c funworld.c g627.c galaxold.c gbusters.c gcpinbal.c ghosteo.c goldstar.c goodejan.c gp_1.c gstriker.c gticlub.c hornet.c icecold.c igs011.c igs017.c itech32.c jpmmps.c jpmsys5.c kenseim.c kingdrby.c kingpin.c lucky74.c magicard.c malzak.c maygay1b.c maygay1bsw.c maygayv1.c megaphx.c meritm.c metalmx.c midas.c midvunit.c midxunit.c midzeus.c model2.c mpu4hw.c mpu4sw.c mpu4vid.c mrgame.c mustache.c mystwarr.c naomi.c naughtyb.c nbmj9195.c neogeo.c neogeo_noslot.c niyanpai.c nl_pongd.c norautp.c nwk-tr.c nyny.c parodius.c pcxt.c pgm.c phoenix.c play_5.c playmark.c pong.c popeye.c proconn.c quakeat.c rastersp.c re900.c rohga.c rollerg.c rpunch.c sam.c sanremo.c savquest.c scramble.c seattle.c segas16b.c segaxbd.c sg1000a.c simpl156.c simpsons.c skylncr.c spy.c statriv2.c supercrd.c surpratk.c taito_b.c taito_l.c taitopjc.c tapatune.c tatsumi.c tempest.c thunderx.c tigeroad.c timeplt.c triforce.c turbo.c vectrex.c vegas.c vroulet.c williams.c wpc_95.c wpc_dcs.c wpc_s.c wyvernf0.c zr107.c |
| [src/mame/machine] | archimds.c balsente.c bfm_bd1.c fd1094.c midwayic.c ng_memcard.c pcshare.c tigeroad.c wpc_out.c wpc_pic.c |
| [src/mame/video] | armedf.c cps1.c deco16ic.c deco_zoomspr.c decospr.c dkong.c excellent_spr.c gaiden.c galspnbl.c gstriker.c k001005.c k001006.c k051316.c k051960.c k052109.c k053246_k053247_k055673.c k053936.c k054156_k054157_k056832.c k054338.c kaneko16.c konamigx.c mappy.c mb60553.c midzeus2.c model3.c namcos21.c nemesis.c neogeo.c neogeo_spr.c nitedrvr.c nmk16.c pc080sn.c pc090oj.c spbactn.c tc0080vco.c tc0100scn.c tc0480scp.c tecmo_mix.c tecmo_spr.c tetrisp2.c vulgus.c wpc_dmd.c |
| [src/mess/drivers] | a2600.c a310.c a7800.c abc1600.c abc80x.c ace.c alphatro.c altos5.c amiga.c ampro.c amstrad.c apf.c apogee.c apple2.c applix.c at.c atom.c bebox.c bml3.c bullet.c c80.c cc40.c coco12.c coco3.c compis.c crvision.c cybiko.c d6800.c dragon.c einstein.c ep64.c esq5505.c exelv.c fanucspmg.c fb01.c fc100.c fmtowns.c fp1100.c galaxy.c gimix.c hprot1.c interact.c iq151.c isbc.c kim1.c lviv.c mac.c mbc200.c mbee.c mc1000.c mikro80.c mikrosha.c minicom.c mmd1.c ms0515.c ms9540.c msx.c mtx.c myb3k.c mz2000.c mz700.c nascom1.c nes.c newbrain.c next.c ng_aes.c ondra.c orao.c oric.c orion.c osbexec.c osborne1.c partner.c pasopia7.c pc1500.c pc1512.c pc8801.c pcm.c pecom.c pet.c phc25.c poisk1.c ptcsol.c pve500.c px4.c pyl601.c ql.c qx10.c radio86.c rainbow.c samcoupe.c saturn.c sdk85.c sdk86.c selz80.c sg1000.c sorcerer.c special.c spectrum.c sun3.c super80.c svi318.c tecnbras.c ti630.c tiki100.c trs80.c ut88.c vt100.c vtech1.c wicat.c x1.c x1twin.c x68k.c xerox820.c z9001.c zorba.c zx.c |
| [src/mess/machine] | amstrad.c apollo.c apple1.c apple2.c apple3.c beta.c dec_lk201.c genpc.c hp48.c msx.c msx_matsushita.c msx_s1985.c msx_switched.c msx_systemflags.c nes.c radio86.c rmnimbus.c super80.c |
| [src/mess/tools/castool] | main.c |
| [src/mess/tools/imgtool/modules] | hp48.c |
| [src/mess/video] | a7800.c abc1600.c abc806.c bbc.c k1ge.c pc1512.c pc_t1t.c rmnimbus.c vtvideo.c |
| [src/osd] | osdepend.c |
| [src/osd/modules/debugger] | debugqt.c none.c |
| [src/osd/modules/sound] | direct_sound.c js_sound.c none.c |
| [src/osd/osdmini] | minifile.c |
| [src/osd/sdl] | drawogl.c sdlmain.c video.c |
| [src/osd/windows] | output.c vconv.c winmain.c |
| [src/tools] | chdman.c nltool.c |
| r31373 | r31374 | |
|---|---|---|
| 37 | 37 | // video options |
| 38 | 38 | { NULL, NULL, OPTION_HEADER, "OSD VIDEO OPTIONS" }, |
| 39 | 39 | // OS X can be trusted to have working hardware OpenGL, so default to it on for the best user experience |
| 40 | { OSDOPTION_VIDEO, | |
| 40 | { OSDOPTION_VIDEO, OSDOPTVAL_AUTO, OPTION_STRING, "video output method: " }, | |
| 41 | 41 | { OSDOPTION_NUMSCREENS "(1-4)", "1", OPTION_INTEGER, "number of screens to create; usually, you want just one" }, |
| 42 | 42 | { OSDOPTION_WINDOW ";w", "0", OPTION_BOOLEAN, "enable window mode; otherwise, full screen mode is assumed" }, |
| 43 | 43 | { OSDOPTION_MAXIMIZE ";max", "1", OPTION_BOOLEAN, "default to maximized windows; otherwise, windows will be minimized" }, |
| r31373 | r31374 | |
| 79 | 79 | |
| 80 | 80 | // sound options |
| 81 | 81 | { NULL, NULL, OPTION_HEADER, "OSD SOUND OPTIONS" }, |
| 82 | { OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " }, | |
| 82 | { OSDOPTION_SOUND, OSDOPTVAL_AUTO, OPTION_STRING, "sound output method: " }, | |
| 83 | 83 | { OSDOPTION_AUDIO_LATENCY "(1-5)", "2", OPTION_INTEGER, "set audio latency (increase to reduce glitches, decrease for responsiveness)" }, |
| 84 | 84 | |
| 85 | 85 | // End of list |
| r31373 | r31374 | |
| 106 | 106 | |
| 107 | 107 | osd_interface::osd_interface() |
| 108 | 108 | : m_machine(NULL), |
| 109 | m_sound(NULL), | |
| 110 | m_debugger(NULL) | |
| 109 | m_sound(NULL), | |
| 110 | m_debugger(NULL) | |
| 111 | 111 | |
| 112 | 112 | { |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | void osd_interface::update_option(osd_options &options, const char * key, dynamic_array<const char *> &values) |
| 116 | 116 | { |
| 117 | astring current_value(options.description(key)); | |
| 117 | astring current_value(options.description(key)); | |
| 118 | 118 | astring new_option_value(""); |
| 119 | 119 | for (int index = 0; index < values.count(); index++) |
| 120 | 120 | { |
| 121 | 121 | astring t(values[index]); |
| 122 | if (new_option_value.len() > 0) | |
| 122 | if (new_option_value.len() > 0) | |
| 123 | 123 | { |
| 124 | 124 | if( index != (values.count()-1)) |
| 125 | 125 | new_option_value.cat(", "); |
| 126 | 126 | else |
| 127 | new_option_value.cat(" or "); | |
| 127 | new_option_value.cat(" or "); | |
| 128 | 128 | } |
| 129 | new_option_value.cat(t); | |
| 129 | new_option_value.cat(t); | |
| 130 | 130 | } |
| 131 | 131 | // TODO: core_strdup() is leaked |
| 132 | options.set_description(key, core_strdup(current_value.cat(new_option_value).cstr())); | |
| 132 | options.set_description(key, core_strdup(current_value.cat(new_option_value).cstr())); | |
| 133 | 133 | } |
| 134 | ||
| 134 | ||
| 135 | 135 | void osd_interface::register_options(osd_options &options) |
| 136 | 136 | { |
| 137 | 137 | // Register video options and update options |
| 138 | video_options_add("none", NULL); | |
| 138 | video_options_add("none", NULL); | |
| 139 | 139 | video_register(); |
| 140 | 140 | update_option(options, OSDOPTION_VIDEO, m_video_names); |
| 141 | ||
| 141 | ||
| 142 | 142 | // Register sound options and update options |
| 143 | sound_options_add("none", OSD_SOUND_NONE); | |
| 143 | sound_options_add("none", OSD_SOUND_NONE); | |
| 144 | 144 | sound_register(); |
| 145 | 145 | update_option(options, OSDOPTION_SOUND, m_sound_names); |
| 146 | ||
| 146 | ||
| 147 | 147 | // Register debugger options and update options |
| 148 | debugger_options_add("none", OSD_DEBUGGER_NONE); | |
| 149 | debugger_options_add("internal", OSD_DEBUGGER_INTERNAL); | |
| 148 | debugger_options_add("none", OSD_DEBUGGER_NONE); | |
| 149 | debugger_options_add("internal", OSD_DEBUGGER_INTERNAL); | |
| 150 | 150 | debugger_register(); |
| 151 | 151 | update_option(options, OSDOPTION_DEBUGGER, m_debugger_names); |
| 152 | 152 | } |
| r31373 | r31374 | |
| 158 | 158 | |
| 159 | 159 | osd_interface::~osd_interface() |
| 160 | 160 | { |
| 161 | ||
| 162 | 161 | for(int i= 0; i < m_video_names.count(); ++i) |
| 163 | 162 | osd_free(const_cast<char*>(m_video_names[i])); |
| 164 | 163 | //m_video_options,reset(); |
| r31373 | r31374 | |
| 210 | 209 | // |
| 211 | 210 | |
| 212 | 211 | m_machine = &machine; |
| 213 | ||
| 212 | ||
| 214 | 213 | osd_options &options = downcast<osd_options &>(machine.options()); |
| 215 | 214 | // extract the verbose printing option |
| 216 | 215 | if (options.verbose()) |
| 217 | 216 | g_print_verbose = true; |
| 218 | ||
| 217 | ||
| 219 | 218 | // ensure we get called on the way out |
| 220 | 219 | machine.add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(FUNC(osd_interface::osd_exit), this)); |
| 221 | 220 | } |
| r31373 | r31374 | |
| 251 | 250 | // create all of its structures. |
| 252 | 251 | // |
| 253 | 252 | osd_debugger_type debugger = m_debugger_options.find(machine().options().debugger()); |
| 254 | if (debugger==NULL) | |
| 253 | if (debugger==NULL) | |
| 255 | 254 | { |
| 256 | 255 | osd_printf_warning("debugger_init: option %s not found switching to auto\n",machine().options().debugger()); |
| 257 | 256 | debugger = m_debugger_options.find("auto"); |
| 258 | 257 | } |
| 259 | 258 | m_debugger = (*debugger)(*this); |
| 260 | ||
| 259 | ||
| 261 | 260 | m_debugger->init_debugger(); |
| 262 | 261 | } |
| 263 | 262 | |
| r31373 | r31374 | |
| 397 | 396 | osd_printf_error("video_init: Initialization failed!\n\n\n"); |
| 398 | 397 | fflush(stderr); |
| 399 | 398 | fflush(stdout); |
| 400 | exit(-1); | |
| 399 | exit(-1); | |
| 401 | 400 | } |
| 402 | 401 | |
| 403 | 402 | sound_init(); |
| r31373 | r31374 | |
| 405 | 404 | // we need pause callbacks |
| 406 | 405 | machine().add_notifier(MACHINE_NOTIFY_PAUSE, machine_notify_delegate(FUNC(osd_interface::input_pause), this)); |
| 407 | 406 | machine().add_notifier(MACHINE_NOTIFY_RESUME, machine_notify_delegate(FUNC(osd_interface::input_resume), this)); |
| 408 | ||
| 407 | ||
| 409 | 408 | output_init(); |
| 410 | 409 | #ifdef USE_NETWORK |
| 411 | 410 | network_init(); |
| r31373 | r31374 | |
| 421 | 420 | bool osd_interface::sound_init() |
| 422 | 421 | { |
| 423 | 422 | osd_sound_type sound = m_sound_options.find(machine().options().sound()); |
| 424 | if (sound==NULL) | |
| 423 | if (sound==NULL) | |
| 425 | 424 | { |
| 426 | 425 | osd_printf_warning("sound_init: option %s not found switching to auto\n",machine().options().sound()); |
| 427 | 426 | sound = m_sound_options.find("auto"); |
| r31373 | r31374 | |
| 491 | 490 | midi_exit(); |
| 492 | 491 | debugger_exit(); |
| 493 | 492 | } |
| 494 | ||
| 493 | ||
| 495 | 494 | void osd_interface::video_exit() |
| 496 | 495 | { |
| 497 | 496 | } |
| r31373 | r31374 | |
| 575 | 574 | osd_debugger_interface::~osd_debugger_interface() |
| 576 | 575 | { |
| 577 | 576 | } |
| 578 |
| r31373 | r31374 | |
|---|---|---|
| 177 | 177 | *dst = (char *)osd_malloc_array(strlen(path) + 1); |
| 178 | 178 | if (*dst != NULL) |
| 179 | 179 | strcpy(*dst, path); |
| 180 | } | |
| 180 | } | |
| 181 | 181 | |
| 182 | 182 | return FILERR_NONE; |
| 183 | 183 | } |
| r31373 | r31374 | |
|---|---|---|
| 623 | 623 | |
| 624 | 624 | // d3d options: extract the data |
| 625 | 625 | stemp = options.video(); |
| 626 | if (strcmp(stemp, "auto") == 0) | |
| 626 | if (strcmp(stemp, "auto") == 0) | |
| 627 | 627 | { |
| 628 | 628 | #ifdef SDLMAME_MACOSX |
| 629 | 629 | stemp = "opengl"; |
| 630 | 630 | #else |
| 631 | 631 | stemp = "soft"; |
| 632 | #endif | |
| 632 | #endif | |
| 633 | 633 | } |
| 634 | 634 | if (strcmp(stemp, SDLOPTVAL_SOFT) == 0) |
| 635 | 635 | video_config.mode = VIDEO_MODE_SOFT; |
| r31373 | r31374 | |
|---|---|---|
| 397 | 397 | |
| 398 | 398 | void sdl_osd_interface::osd_exit() |
| 399 | 399 | { |
| 400 | ||
| 401 | 400 | osd_interface::osd_exit(); |
| 402 | 401 | |
| 403 | 402 | if (!SDLMAME_INIT_IN_WORKER_THREAD) |
| r31373 | r31374 | |
|---|---|---|
| 1143 | 1143 | #else |
| 1144 | 1144 | if (!sdl->init_context) |
| 1145 | 1145 | { |
| 1146 | screen_device_iterator myiter(window->machine().root_device()); | |
| 1146 | screen_device_iterator myiter(window->machine().root_device()); | |
| 1147 | 1147 | for (screen = myiter.first(); screen != NULL; screen = myiter.next()) |
| 1148 | 1148 | { |
| 1149 | 1149 | if (window->index == 0) |
| r31373 | r31374 | |
| 1166 | 1166 | { |
| 1167 | 1167 | // do some one-time OpenGL setup |
| 1168 | 1168 | #if (SDLMAME_SDL2) |
| 1169 | // FIXME: SRGB conversion is working on SDL2, may be of use | |
| 1170 | // when we eventually target gamma and monitor profiles. | |
| 1171 | //glEnable(GL_FRAMEBUFFER_SRGB); | |
| 1169 | // FIXME: SRGB conversion is working on SDL2, may be of use | |
| 1170 | // when we eventually target gamma and monitor profiles. | |
| 1171 | //glEnable(GL_FRAMEBUFFER_SRGB); | |
| 1172 | 1172 | #endif |
| 1173 | 1173 | glShadeModel(GL_SMOOTH); |
| 1174 | 1174 | glClearColor(0.0f, 0.0f, 0.0f, 0.0f); |
| r31373 | r31374 | |
| 1644 | 1644 | } |
| 1645 | 1645 | |
| 1646 | 1646 | if ( texture->type == TEXTURE_TYPE_NONE && sdl->useglsl && |
| 1647 | texture->xprescale == 1 && texture->yprescale == 1 && | |
| 1648 | texsource->rowpixels <= sdl->texture_max_width ) | |
| 1649 | { | |
| 1650 | texture->type = TEXTURE_TYPE_SHADER; | |
| 1651 | texture->texTarget = GL_TEXTURE_2D; | |
| 1652 | texture->texpow2 = sdl->texpoweroftwo; | |
| 1653 | } | |
| 1647 | texture->xprescale == 1 && texture->yprescale == 1 && | |
| 1648 | texsource->rowpixels <= sdl->texture_max_width ) | |
| 1649 | { | |
| 1650 | texture->type = TEXTURE_TYPE_SHADER; | |
| 1651 | texture->texTarget = GL_TEXTURE_2D; | |
| 1652 | texture->texpow2 = sdl->texpoweroftwo; | |
| 1653 | } | |
| 1654 | 1654 | |
| 1655 | 1655 | // determine if we can skip the copy step |
| 1656 | 1656 | // if this was not already decided by the shader condition above |
| r31373 | r31374 | |
| 2312 | 2312 | { |
| 2313 | 2313 | int srcpix = *src++; |
| 2314 | 2314 | for (int x2 = 0; x2 < xprescale; x2++) |
| 2315 | *dst++ = 0xff000000 | palette[srcpix]; | |
| 2315 | *dst++ = 0xff000000 | palette[srcpix]; | |
| 2316 | 2316 | } |
| 2317 | 2317 | if (xborderpix) |
| 2318 | 2318 | *dst++ = 0xff000000 | palette[*--src]; |
| r31373 | r31374 | |
| 2604 | 2604 | { |
| 2605 | 2605 | for (y2 = 0; y2 < texture->yprescale; y2++) |
| 2606 | 2606 | { |
| 2607 | dst = (UINT8 *)(texture->data + (y * texture->yprescale + texture->borderpix + y2) * texture->rawwidth); | |
| 2607 | dst = (UINT8 *)(texture->data + (y * texture->yprescale + texture->borderpix + y2) * texture->rawwidth); | |
| 2608 | 2608 | |
| 2609 | 2609 | switch (PRIMFLAG_GET_TEXFORMAT(flags)) |
| 2610 | 2610 | { |
| r31373 | r31374 | |
|---|---|---|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | |
| 23 | const osd_sound_type OSD_SOUND_NONE = &osd_sound_creator<sound_none>; | |
| No newline at end of file | ||
| 23 | const osd_sound_type OSD_SOUND_NONE = &osd_sound_creator<sound_none>; |
| r31373 | r31374 | |
|---|---|---|
| 389 | 389 | IDirectSoundBuffer_Release(primary_buffer); |
| 390 | 390 | primary_buffer = NULL; |
| 391 | 391 | } |
| 392 |
| r31373 | r31374 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | void sound_js::update_audio_stream(const INT16 *buffer, int samples_this_frame) |
| 24 | 24 | { |
| 25 | EM_ASM_ARGS({ | |
| 26 | // Forward audio stream update on to JS backend implementation. | |
| 27 | jsmess_update_audio_stream($0, $1); | |
| 28 | }, (unsigned int)buffer, samples_this_frame); | |
| 25 | EM_ASM_ARGS({ | |
| 26 | // Forward audio stream update on to JS backend implementation. | |
| 27 | jsmess_update_audio_stream($0, $1); | |
| 28 | }, (unsigned int)buffer, samples_this_frame); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | void sound_js::set_mastervolume(int attenuation) |
| 32 | 32 | { |
| 33 | EM_ASM_ARGS({ | |
| 34 | // Forward volume update on to JS backend implementation. | |
| 35 | jsmess_set_mastervolume($0); | |
| 36 | }, attenuation); | |
| 33 | EM_ASM_ARGS({ | |
| 34 | // Forward volume update on to JS backend implementation. | |
| 35 | jsmess_set_mastervolume($0); | |
| 36 | }, attenuation); | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | const osd_sound_type OSD_SOUND_JS = &osd_sound_creator<sound_js>; |
| r31373 | r31374 | |
|---|---|---|
| 281 | 281 | |
| 282 | 282 | if (firststop) |
| 283 | 283 | { |
| 284 | bring_main_window_to_front(); | |
| 284 | bring_main_window_to_front(); | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | // Set the main window to display the proper cpu |
| r31373 | r31374 | |
| 338 | 338 | void debugger_qt::debugger_exit() |
| 339 | 339 | { |
| 340 | 340 | } |
| 341 |
| r31373 | r31374 | |
|---|---|---|
| 33 | 33 | void debugger_none::debugger_exit() |
| 34 | 34 | { |
| 35 | 35 | } |
| 36 |
| r31373 | r31374 | |
|---|---|---|
| 350 | 350 | // identify the version number of the EXE |
| 351 | 351 | if (!icl_compile) |
| 352 | 352 | exe_version = get_exe_version(executable); |
| 353 | else | |
| 353 | else | |
| 354 | 354 | exe_version = 0x00110000; // assume this for ICL |
| 355 | 355 | |
| 356 | 356 | // special cases |
| r31373 | r31374 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | // register a notifier for output changes |
| 130 | 130 | output_set_notifier(NULL, notifier_callback, NULL); |
| 131 | ||
| 131 | ||
| 132 | 132 | return true; |
| 133 | 133 | } |
| 134 | 134 |
| r31373 | r31374 | |
|---|---|---|
| 549 | 549 | sound_options_add("dsound", OSD_SOUND_DIRECT_SOUND); |
| 550 | 550 | #if (USE_SDL) |
| 551 | 551 | sound_options_add("sdl", OSD_SOUND_SDL); |
| 552 | #endif | |
| 552 | #endif | |
| 553 | 553 | sound_options_add("auto", OSD_SOUND_DIRECT_SOUND); // making Direct Sound audio default one |
| 554 | 554 | } |
| 555 | 555 | |
| r31373 | r31374 | |
| 622 | 622 | |
| 623 | 623 | // initialize the subsystems |
| 624 | 624 | osd_interface::init_subsystems(); |
| 625 | ||
| 625 | ||
| 626 | 626 | // notify listeners of screen configuration |
| 627 | 627 | astring tempstring; |
| 628 | 628 | for (win_window_info *info = win_window_list; info != NULL; info = info->next) |
| r31373 | r31374 | |
| 683 | 683 | win_cleanup_sockets(); |
| 684 | 684 | |
| 685 | 685 | osd_interface::osd_exit(); |
| 686 | ||
| 686 | ||
| 687 | 687 | // take down the watchdog thread if it exists |
| 688 | 688 | if (watchdog_thread != NULL) |
| 689 | 689 | { |
| r31373 | r31374 | |
|---|---|---|
| 44 | 44 | lua_engine* lua_engine::luaThis = NULL; |
| 45 | 45 | |
| 46 | 46 | |
| 47 | static void lstop(lua_State *L, lua_Debug *ar) | |
| 47 | static void lstop(lua_State *L, lua_Debug *ar) | |
| 48 | 48 | { |
| 49 | 49 | (void)ar; /* unused arg. */ |
| 50 | 50 | lua_sethook(L, NULL, 0, 0); |
| r31373 | r31374 | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| 55 | static void laction(int i) | |
| 55 | static void laction(int i) | |
| 56 | 56 | { |
| 57 | 57 | signal(i, SIG_DFL); /* if another SIGINT happens before lstop, |
| 58 | ||
| 58 | terminate process (default action) */ | |
| 59 | 59 | lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | int lua_engine::report(int status) { |
| 63 | if (status != LUA_OK && !lua_isnil(m_lua_state, -1)) | |
| 63 | if (status != LUA_OK && !lua_isnil(m_lua_state, -1)) | |
| 64 | 64 | { |
| 65 | 65 | const char *msg = lua_tostring(m_lua_state, -1); |
| 66 | 66 | if (msg == NULL) msg = "(error object is not a string)"; |
| r31373 | r31374 | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | |
| 76 | static int traceback (lua_State *L) | |
| 76 | static int traceback (lua_State *L) | |
| 77 | 77 | { |
| 78 | const char *msg = lua_tostring(L, 1); | |
| 79 | if (msg) | |
| 80 | luaL_traceback(L, L, msg, 1); | |
| 81 | else if (!lua_isnoneornil(L, 1)) | |
| 82 | { /* is there an error object? */ | |
| 83 | if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */ | |
| 84 | lua_pushliteral(L, "(no error message)"); | |
| 85 | } | |
| 86 | return 1; | |
| 78 | const char *msg = lua_tostring(L, 1); | |
| 79 | if (msg) | |
| 80 | luaL_traceback(L, L, msg, 1); | |
| 81 | else if (!lua_isnoneornil(L, 1)) | |
| 82 | { /* is there an error object? */ | |
| 83 | if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */ | |
| 84 | lua_pushliteral(L, "(no error message)"); | |
| 85 | } | |
| 86 | return 1; | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| 90 | int lua_engine::docall(int narg, int nres) | |
| 90 | int lua_engine::docall(int narg, int nres) | |
| 91 | 91 | { |
| 92 | 92 | int status; |
| 93 | 93 | int base = lua_gettop(m_lua_state) - narg; /* function index */ |
| r31373 | r31374 | |
| 105 | 105 | #define EOFMARK "<eof>" |
| 106 | 106 | #define marklen (sizeof(EOFMARK)/sizeof(char) - 1) |
| 107 | 107 | |
| 108 | int lua_engine::incomplete(int status) | |
| 108 | int lua_engine::incomplete(int status) | |
| 109 | 109 | { |
| 110 | if (status == LUA_ERRSYNTAX) | |
| 110 | if (status == LUA_ERRSYNTAX) | |
| 111 | 111 | { |
| 112 | 112 | size_t lmsg; |
| 113 | 113 | const char *msg = lua_tolstring(m_lua_state, -1, &lmsg); |
| 114 | if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) | |
| 114 | if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) | |
| 115 | 115 | { |
| 116 | 116 | lua_pop(m_lua_state, 1); |
| 117 | 117 | return 1; |
| r31373 | r31374 | |
| 192 | 192 | { |
| 193 | 193 | ioport_field *field = static_cast<ioport_field *>(getparam(L, 1, tname_ioport)); |
| 194 | 194 | luaL_argcheck(L, lua_isnumber(L, 2), 2, "value expected"); |
| 195 | ||
| 195 | field->set_value(lua_tointeger(L, 2)); | |
| 196 | 196 | return 0; |
| 197 | 197 | } |
| 198 | 198 | |
| r31373 | r31374 | |
| 225 | 225 | |
| 226 | 226 | void lua_engine::emu_after_done(void *_h, INT32 param) |
| 227 | 227 | { |
| 228 | hook *h = static_cast<hook *>(_h); | |
| 229 | h->call(this, h->precall(), 0); | |
| 230 | delete h; | |
| 228 | hook *h = static_cast<hook *>(_h); | |
| 229 | h->call(this, h->precall(), 0); | |
| 230 | delete h; | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | int lua_engine::emu_after(lua_State *L) |
| 234 | 234 | { |
| 235 | 235 | luaL_argcheck(L, lua_isnumber(L, 1), 1, "waiting duration expected"); |
| 236 | struct hook *h = new hook; | |
| 237 | h->set(L, 2); | |
| 236 | struct hook *h = new hook; | |
| 237 | h->set(L, 2); | |
| 238 | 238 | machine().scheduler().timer_set(attotime::from_double(lua_tonumber(L, 1)), timer_expired_delegate(FUNC(lua_engine::emu_after_done), this), 0, h); |
| 239 | 239 | return 0; |
| 240 | 240 | } |
| r31373 | r31374 | |
| 291 | 291 | |
| 292 | 292 | void *lua_engine::checkparam(lua_State *L, int idx, const char *tname) |
| 293 | 293 | { |
| 294 | ||
| 294 | const char *name; | |
| 295 | 295 | |
| 296 | if(!lua_getmetatable(L, idx)) | |
| 297 | return 0; | |
| 296 | if(!lua_getmetatable(L, idx)) | |
| 297 | return 0; | |
| 298 | 298 | |
| 299 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 300 | name = lua_tostring(L, -1); | |
| 301 | if(!name || strcmp(name, tname)) { | |
| 302 | lua_pop(L, 1); | |
| 303 | return 0; | |
| 304 | } | |
| 305 | lua_pop(L, 1); | |
| 299 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 300 | name = lua_tostring(L, -1); | |
| 301 | if(!name || strcmp(name, tname)) { | |
| 302 | lua_pop(L, 1); | |
| 303 | return 0; | |
| 304 | } | |
| 305 | lua_pop(L, 1); | |
| 306 | 306 | |
| 307 | ||
| 307 | return *static_cast<void **>(lua_touserdata(L, idx)); | |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | 310 | void *lua_engine::getparam(lua_State *L, int idx, const char *tname) |
| 311 | 311 | { |
| 312 | 312 | void *p = checkparam(L, idx, tname); |
| 313 | char msg[256]; | |
| 314 | sprintf(msg, "%s expected", tname); | |
| 315 | luaL_argcheck(L, p, idx, msg); | |
| 316 | return p; | |
| 313 | char msg[256]; | |
| 314 | sprintf(msg, "%s expected", tname); | |
| 315 | luaL_argcheck(L, p, idx, msg); | |
| 316 | return p; | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | void lua_engine::push(lua_State *L, void *p, const char *tname) |
| 320 | 320 | { |
| 321 | void **pp = static_cast<void **>(lua_newuserdata(L, sizeof(void *))); | |
| 322 | *pp = p; | |
| 323 | luaL_getmetatable(L, tname); | |
| 324 | lua_setmetatable(L, -2); | |
| 321 | void **pp = static_cast<void **>(lua_newuserdata(L, sizeof(void *))); | |
| 322 | *pp = p; | |
| 323 | luaL_getmetatable(L, tname); | |
| 324 | lua_setmetatable(L, -2); | |
| 325 | 325 | } |
| 326 | 326 | |
| 327 | 327 | int lua_engine::l_emu_exit(lua_State *L) |
| r31373 | r31374 | |
| 333 | 333 | int lua_engine::l_emu_start(lua_State *L) |
| 334 | 334 | { |
| 335 | 335 | const char *system_name = luaL_checkstring(L,1); |
| 336 | ||
| 336 | ||
| 337 | 337 | int index = driver_list::find(system_name); |
| 338 | 338 | if (index != -1) { |
| 339 | machine_manager::instance()->schedule_new_driver(driver_list::driver(index)); | |
| 339 | machine_manager::instance()->schedule_new_driver(driver_list::driver(index)); | |
| 340 | 340 | luaThis->machine().schedule_hard_reset(); |
| 341 | 341 | } |
| 342 | 342 | return 1; |
| r31373 | r31374 | |
| 377 | 377 | fflush(stdout); |
| 378 | 378 | char buff[LUA_MAXINPUT]; |
| 379 | 379 | astring oldbuff; |
| 380 | ||
| 380 | ||
| 381 | 381 | const char *b = LUA_PROMPT; |
| 382 | ||
| 382 | ||
| 383 | 383 | do { |
| 384 | 384 | // Wait for input |
| 385 | fputs(b, stdout); fflush(stdout); /* show prompt */ | |
| 385 | fputs(b, stdout); fflush(stdout); /* show prompt */ | |
| 386 | 386 | fgets(buff, LUA_MAXINPUT, stdin); |
| 387 | ||
| 387 | ||
| 388 | 388 | // Create message |
| 389 | 389 | osd_lock_acquire(lock); |
| 390 | 390 | if (msg.ready == 0) { |
| r31373 | r31374 | |
| 395 | 395 | msg.done = 0; |
| 396 | 396 | } |
| 397 | 397 | osd_lock_release(lock); |
| 398 | ||
| 398 | ||
| 399 | 399 | // Wait for response |
| 400 | 400 | int done = 0; |
| 401 | 401 | do { |
| r31373 | r31374 | |
| 417 | 417 | } |
| 418 | 418 | msg.done = 0; |
| 419 | 419 | osd_lock_release(lock); |
| 420 | ||
| 420 | ||
| 421 | 421 | } while (1); |
| 422 | 422 | } |
| 423 | 423 | |
| r31373 | r31374 | |
| 439 | 439 | luaThis = this; |
| 440 | 440 | m_lua_state = luaL_newstate(); /* create state */ |
| 441 | 441 | output_notifier_set = false; |
| 442 | ||
| 442 | ||
| 443 | 443 | luaL_checkversion(m_lua_state); |
| 444 | 444 | lua_gc(m_lua_state, LUA_GCSTOP, 0); /* stop collector during initialization */ |
| 445 | 445 | luaL_openlibs(m_lua_state); /* open libraries */ |
| 446 | ||
| 446 | ||
| 447 | 447 | luaopen_lsqlite3(m_lua_state); |
| 448 | ||
| 448 | ||
| 449 | 449 | luaopen_ioport(m_lua_state); |
| 450 | 450 | |
| 451 | lua_gc(m_lua_state, LUA_GCRESTART, 0); | |
| 451 | lua_gc(m_lua_state, LUA_GCRESTART, 0); | |
| 452 | 452 | msg.ready = 0; |
| 453 | 453 | msg.status = 0; |
| 454 | 454 | msg.done = 0; |
| r31373 | r31374 | |
| 466 | 466 | |
| 467 | 467 | |
| 468 | 468 | void lua_engine::update_machine() |
| 469 | { | |
| 469 | { | |
| 470 | 470 | lua_newtable(m_lua_state); |
| 471 | if (m_machine!=NULL) | |
| 471 | if (m_machine!=NULL) | |
| 472 | 472 | { |
| 473 | 473 | // Create the ioport array |
| 474 | 474 | ioport_port *port = machine().ioport().first_port(); |
| r31373 | r31374 | |
| 501 | 501 | .addCFunction ("time", l_emu_time ) |
| 502 | 502 | .addCFunction ("wait", l_emu_wait ) |
| 503 | 503 | .addCFunction ("after", l_emu_after ) |
| 504 | .addCFunction ("exit", l_emu_exit ) | |
| 505 | .addCFunction ("start", l_emu_start ) | |
| 504 | .addCFunction ("exit", l_emu_exit ) | |
| 505 | .addCFunction ("start", l_emu_start ) | |
| 506 | 506 | .beginClass <machine_manager> ("manager") |
| 507 | 507 | .addFunction ("machine", &machine_manager::machine) |
| 508 | 508 | .addFunction ("options", &machine_manager::options) |
| r31373 | r31374 | |
| 531 | 531 | |
| 532 | 532 | void lua_engine::periodic_check() |
| 533 | 533 | { |
| 534 | osd_lock_acquire(lock); | |
| 535 | if (msg.ready == 1) { | |
| 534 | osd_lock_acquire(lock); | |
| 535 | if (msg.ready == 1) { | |
| 536 | 536 | lua_settop(m_lua_state, 0); |
| 537 | 537 | int status = luaL_loadbuffer(m_lua_state, msg.text.cstr(), strlen(msg.text.cstr()), "=stdin"); |
| 538 | 538 | if (incomplete(status)==0) /* cannot try to add lines? */ |
| r31373 | r31374 | |
| 548 | 548 | luai_writestringerror("%s\n", lua_pushfstring(m_lua_state, |
| 549 | 549 | "error calling " LUA_QL("print") " (%s)", |
| 550 | 550 | lua_tostring(m_lua_state, -1))); |
| 551 | | |
| 551 | } | |
| 552 | 552 | } |
| 553 | else | |
| 553 | else | |
| 554 | 554 | { |
| 555 | | |
| 555 | status = -1; | |
| 556 | 556 | } |
| 557 | 557 | msg.status = status; |
| 558 | 558 | msg.response = msg.text; |
| 559 | 559 | msg.text = ""; |
| 560 | 560 | msg.ready = 0; |
| 561 | 561 | msg.done = 1; |
| 562 | } | |
| 563 | osd_lock_release(lock); | |
| 562 | } | |
| 563 | osd_lock_release(lock); | |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | //------------------------------------------------- |
| r31373 | r31374 | |
| 570 | 570 | void lua_engine::close() |
| 571 | 571 | { |
| 572 | 572 | lua_settop(m_lua_state, 0); /* clear stack */ |
| 573 | lua_close(m_lua_state); | |
| 573 | lua_close(m_lua_state); | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | //------------------------------------------------- |
| r31373 | r31374 | |
| 580 | 580 | void lua_engine::load_script(const char *filename) |
| 581 | 581 | { |
| 582 | 582 | int s = luaL_loadfile(m_lua_state, filename); |
| 583 | report(s); | |
| 583 | report(s); | |
| 584 | 584 | update_machine(); |
| 585 | 585 | start(); |
| 586 | 586 | } |
| r31373 | r31374 | |
| 592 | 592 | void lua_engine::load_string(const char *value) |
| 593 | 593 | { |
| 594 | 594 | int s = luaL_loadstring(m_lua_state, value); |
| 595 | report(s); | |
| 595 | report(s); | |
| 596 | 596 | update_machine(); |
| 597 | 597 | start(); |
| 598 | 598 | } |
| r31373 | r31374 | |
| 605 | 605 | { |
| 606 | 606 | resume(m_lua_state); |
| 607 | 607 | } |
| 608 |
| r31373 | r31374 | |
|---|---|---|
| 94 | 94 | |
| 95 | 95 | machine_manager* machine_manager::instance(emu_options &options,osd_interface &osd) |
| 96 | 96 | { |
| 97 | ||
| 97 | if(!m_manager) | |
| 98 | 98 | { |
| 99 | m_manager = global_alloc(machine_manager(options,osd)); | |
| 100 | } | |
| 101 | return m_manager; | |
| 99 | m_manager = global_alloc(machine_manager(options,osd)); | |
| 100 | } | |
| 101 | return m_manager; | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | machine_manager* machine_manager::instance() |
| 105 | 105 | { |
| 106 | ||
| 106 | return m_manager; | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | //------------------------------------------------- |
| r31373 | r31374 | |
| 111 | 111 | //------------------------------------------------- |
| 112 | 112 | |
| 113 | 113 | machine_manager::machine_manager(emu_options &options,osd_interface &osd) |
| 114 | : m_osd(osd), | |
| 115 | m_options(options), | |
| 116 | m_web(options), | |
| 117 | m_new_driver_pending(NULL), | |
| 118 | m_machine(NULL) | |
| 114 | : m_osd(osd), | |
| 115 | m_options(options), | |
| 116 | m_web(options), | |
| 117 | m_new_driver_pending(NULL), | |
| 118 | m_machine(NULL) | |
| 119 | 119 | { |
| 120 | 120 | } |
| 121 | 121 | |
| r31373 | r31374 | |
| 148 | 148 | /*************************************************************************** |
| 149 | 149 | CORE IMPLEMENTATION |
| 150 | 150 | ***************************************************************************/ |
| 151 | void machine_manager::update_machine() | |
| 152 | { | |
| 151 | void machine_manager::update_machine() | |
| 152 | { | |
| 153 | 153 | m_lua.set_machine(m_machine); |
| 154 | 154 | m_web.set_machine(m_machine); |
| 155 | 155 | if (m_machine!=NULL) m_web.push_message("update_machine"); |
| r31373 | r31374 | |
| 227 | 227 | m_options.set_value(OPTION_RAMSIZE, "", OPTION_PRIORITY_CMDLINE, error_string); |
| 228 | 228 | } |
| 229 | 229 | firstrun = true; |
| 230 | } | |
| 231 | else | |
| 230 | } | |
| 231 | else | |
| 232 | 232 | { |
| 233 | 233 | if (machine.exit_pending()) m_options.set_system_name(""); |
| 234 | 234 | } |
| 235 | ||
| 235 | ||
| 236 | 236 | if (machine.exit_pending() && (!started_empty || (system == &GAME_NAME(___empty)))) |
| 237 | 237 | exit_pending = true; |
| 238 | 238 | |
| r31373 | r31374 | |
| 297 | 297 | -------------------------------------------------*/ |
| 298 | 298 | |
| 299 | 299 | void CLIB_DECL vlogerror(const char *format, va_list arg) |
| 300 | { | |
| 300 | { | |
| 301 | 301 | if (machine_manager::instance()!=NULL && machine_manager::instance()->machine() != NULL) |
| 302 | 302 | machine_manager::instance()->machine()->vlogerror(format, arg); |
| 303 | 303 | } |
| 304 |
| r31373 | r31374 | |
|---|---|---|
| 662 | 662 | sh4_dmac_check(2); |
| 663 | 663 | sh4_dmac_check(3); |
| 664 | 664 | } |
| 665 |
| r31373 | r31374 | |
|---|---|---|
| 3193 | 3193 | /* j = 0x9000 */ |
| 3194 | 3194 | SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), |
| 3195 | 3195 | SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), SH4OP(MOVWI), |
| 3196 | | |
| 3196 | /* j = 0xa000 */ | |
| 3197 | 3197 | SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), |
| 3198 | 3198 | SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), SH4OP(BRA), |
| 3199 | 3199 | /* j = 0xb000 */ |
| r31373 | r31374 | |
| 3968 | 3968 | { |
| 3969 | 3969 | m_ftcsr_read_callback = callback; |
| 3970 | 3970 | } |
| 3971 |
| r31373 | r31374 | |
|---|---|---|
| 223 | 223 | { |
| 224 | 224 | m_timer_handle[tmr] = machine().scheduler().timer_alloc(timer_expired_delegate(FUNC(tms7000_device::simple_timer_cb), this)); |
| 225 | 225 | m_timer_handle[tmr]->adjust(attotime::never, tmr); |
| 226 | ||
| 226 | ||
| 227 | 227 | m_timer_data[tmr] = 0; |
| 228 | 228 | m_timer_control[tmr] = 0; |
| 229 | 229 | m_timer_decrementer[tmr] = 0; |
| 230 | 230 | m_timer_prescaler[tmr] = 0; |
| 231 | 231 | m_timer_capture_latch[tmr] = 0; |
| 232 | 232 | } |
| 233 | ||
| 233 | ||
| 234 | 234 | // register for savestates |
| 235 | 235 | save_item(NAME(m_irq_state)); |
| 236 | 236 | save_item(NAME(m_idle_state)); |
| r31373 | r31374 | |
| 274 | 274 | m_sr & 0x01 ? '?':'.' |
| 275 | 275 | ); |
| 276 | 276 | break; |
| 277 | ||
| 277 | ||
| 278 | 278 | default: break; |
| 279 | 279 | } |
| 280 | 280 | } |
| r31373 | r31374 | |
| 306 | 306 | write_p(0x05, 0x00); // ddr a |
| 307 | 307 | write_p(0x09, 0x00); // ddr c |
| 308 | 308 | write_p(0x0b, 0x00); // ddr d |
| 309 | ||
| 309 | ||
| 310 | 310 | if (!chip_is_cmos()) |
| 311 | 311 | { |
| 312 | 312 | write_p(0x08, 0xff); // port c |
| 313 | 313 | write_p(0x0a, 0xff); // port d |
| 314 | 314 | } |
| 315 | ||
| 315 | ||
| 316 | 316 | // when _RESET goes inactive (0 to 1) |
| 317 | 317 | m_sr = 0; |
| 318 | 318 | |
| r31373 | r31374 | |
| 345 | 345 | if (m_irq_state[extline] != irqstate) |
| 346 | 346 | { |
| 347 | 347 | m_irq_state[extline] = irqstate; |
| 348 | ||
| 348 | ||
| 349 | 349 | // set/clear internal irq flag |
| 350 | 350 | flag_ext_interrupt(extline); |
| 351 | ||
| 351 | ||
| 352 | 352 | if (m_irq_state[extline]) |
| 353 | 353 | { |
| 354 | 354 | // latch timer 1 on INT3 |
| r31373 | r31374 | |
| 358 | 358 | // on 70cx2, latch timer 2 on INT1 |
| 359 | 359 | if (extline == TMS7000_INT1_LINE && chip_is_family_70cx2()) |
| 360 | 360 | m_timer_capture_latch[1] = m_timer_decrementer[1]; |
| 361 | ||
| 361 | ||
| 362 | 362 | // clear external if it's edge-triggered (70cx2-only) |
| 363 | 363 | if (m_io_control[2] & (0x02 << (4 * extline))) |
| 364 | 364 | m_irq_state[extline] = false; |
| r31373 | r31374 | |
| 385 | 385 | // global interrupt bit |
| 386 | 386 | if (!(m_sr & SR_I)) |
| 387 | 387 | return; |
| 388 | ||
| 388 | ||
| 389 | 389 | // check for and handle interrupt |
| 390 | 390 | for (int irqline = 0; irqline < 5; irqline++) |
| 391 | 391 | { |
| r31373 | r31374 | |
| 445 | 445 | { |
| 446 | 446 | // stop possible running timer |
| 447 | 447 | m_timer_handle[tmr]->adjust(attotime::never, tmr); |
| 448 | ||
| 448 | ||
| 449 | 449 | if (m_timer_control[tmr] & 0x80) |
| 450 | 450 | { |
| 451 | 451 | m_timer_decrementer[tmr] = m_timer_data[tmr]; |
| r31373 | r31374 | |
| 472 | 472 | |
| 473 | 473 | // set INT2/INT5 |
| 474 | 474 | m_io_control[tmr] |= 0x08; |
| 475 | ||
| 475 | ||
| 476 | 476 | // cascaded timer |
| 477 | 477 | if (tmr == 0 && (m_timer_control[1] & 0xa0) == 0xa0) |
| 478 | 478 | timer_tick_pre(tmr + 1); |
| r31373 | r31374 | |
| 482 | 482 | TIMER_CALLBACK_MEMBER(tms7000_device::simple_timer_cb) |
| 483 | 483 | { |
| 484 | 484 | int tmr = param; |
| 485 | ||
| 485 | ||
| 486 | 486 | // tick and restart timer |
| 487 | 487 | timer_tick_low(tmr); |
| 488 | 488 | timer_run(tmr); |
| r31373 | r31374 | |
| 521 | 521 | return (m_io->read_byte(port) & ~m_port_ddr[port]) | (m_port_latch[port] & m_port_ddr[port]); |
| 522 | 522 | break; |
| 523 | 523 | } |
| 524 | ||
| 524 | ||
| 525 | 525 | // port direction (note: 7000 doesn't support it for port A) |
| 526 | 526 | case 0x05: case 0x09: case 0x0b: |
| 527 | 527 | return m_port_ddr[offset / 2 - 2]; |
| r31373 | r31374 | |
| 545 | 545 | // d1,d3,d5: INT1,2,3 flag (write 1 to clear flag) |
| 546 | 546 | // d6-d7: memory mode (currently not implemented) |
| 547 | 547 | m_io_control[0] = (m_io_control[0] & (~data & 0x2a)) | (data & 0xd5); |
| 548 | ||
| 548 | ||
| 549 | 549 | // possibly need to reactivate flags |
| 550 | 550 | if (data & 0x02) |
| 551 | 551 | flag_ext_interrupt(TMS7000_INT1_LINE); |
| 552 | 552 | if (data & 0x20) |
| 553 | 553 | flag_ext_interrupt(TMS7000_INT3_LINE); |
| 554 | ||
| 554 | ||
| 555 | 555 | check_interrupts(); |
| 556 | 556 | break; |
| 557 | ||
| 557 | ||
| 558 | 558 | // i/o control (IOCNT1) |
| 559 | 559 | case 0x10: |
| 560 | 560 | // d0,d2: INT4,5 enable |
| r31373 | r31374 | |
| 568 | 568 | // decrementer reload value |
| 569 | 569 | m_timer_data[offset >> 4] = data; |
| 570 | 570 | break; |
| 571 | ||
| 571 | ||
| 572 | 572 | // timer 1/2 control |
| 573 | 573 | case 0x03: |
| 574 | 574 | // d5: t1: cmos low-power mode when IDLE opcode is used (not emulated) |
| r31373 | r31374 | |
| 587 | 587 | // d7: stop/start timer |
| 588 | 588 | m_timer_control[offset >> 4] = data; |
| 589 | 589 | timer_reload(offset >> 4); |
| 590 | ||
| 590 | ||
| 591 | 591 | // on cmos chip, clear INT2/INT5 as well |
| 592 | 592 | if (~data & 0x80 && chip_is_cmos()) |
| 593 | 593 | m_io_control[offset >> 4] &= ~0x08; |
| 594 | ||
| 594 | ||
| 595 | 595 | break; |
| 596 | 596 | |
| 597 | 597 | // port data (note: 7000 doesn't support it for port A) |
| r31373 | r31374 | |
| 604 | 604 | m_port_latch[port] = data; |
| 605 | 605 | break; |
| 606 | 606 | } |
| 607 | ||
| 607 | ||
| 608 | 608 | // port direction (note: 7000 doesn't support it for port A) |
| 609 | 609 | case 0x05: case 0x09: case 0x0b: |
| 610 | 610 | // note: changing port direction does not change(refresh) the output pins |
| r31373 | r31374 | |
| 652 | 652 | case 0x0b: reti(); break; |
| 653 | 653 | case 0x0d: ldsp(); break; |
| 654 | 654 | case 0x0e: push_st(); break; |
| 655 | ||
| 655 | ||
| 656 | 656 | case 0x12: am_r2a(&tms7000_device::op_mov); break; |
| 657 | 657 | case 0x13: am_r2a(&tms7000_device::op_and); break; |
| 658 | 658 | case 0x14: am_r2a(&tms7000_device::op_or); break; |
| r31373 | r31374 | |
| 757 | 757 | case 0x7d: am_i2r(&tms7000_device::op_cmp); break; |
| 758 | 758 | case 0x7e: am_i2r(&tms7000_device::op_dac); break; |
| 759 | 759 | case 0x7f: am_i2r(&tms7000_device::op_dsb); break; |
| 760 | ||
| 760 | ||
| 761 | 761 | case 0x80: am_p2a(&tms7000_device::op_mov); break; |
| 762 | 762 | case 0x82: am_a2p(&tms7000_device::op_mov); break; |
| 763 | 763 | case 0x83: am_a2p(&tms7000_device::op_and); break; |
| r31373 | r31374 | |
| 798 | 798 | case 0xac: br_inx(); break; |
| 799 | 799 | case 0xad: cmpa_inx(); break; |
| 800 | 800 | case 0xae: call_inx(); break; |
| 801 | ||
| 801 | ||
| 802 | 802 | case 0xb0: am_a2a(&tms7000_device::op_mov); break; // aka clrc/tsta |
| 803 | 803 | case 0xb1: am_b2a(&tms7000_device::op_mov); break; // undocumented |
| 804 | 804 | case 0xb2: am_a(&tms7000_device::op_dec); break; |
| r31373 | r31374 | |
| 849 | 849 | case 0xdd: am_r(&tms7000_device::op_rrc); break; |
| 850 | 850 | case 0xde: am_r(&tms7000_device::op_rl); break; |
| 851 | 851 | case 0xdf: am_r(&tms7000_device::op_rlc); break; |
| 852 | ||
| 852 | ||
| 853 | 853 | case 0xe0: jmp(true); break; |
| 854 | 854 | case 0xe1: jmp(m_sr & SR_N); break; // jn/jlt |
| 855 | 855 | case 0xe2: jmp(m_sr & SR_Z); break; // jz/jeq |
| r31373 | r31374 | |
| 863 | 863 | case 0xf0: case 0xf1: case 0xf2: case 0xf3: case 0xf4: case 0xf5: case 0xf6: case 0xf7: |
| 864 | 864 | case 0xf8: case 0xf9: case 0xfa: case 0xfb: case 0xfc: case 0xfd: case 0xfe: case 0xff: |
| 865 | 865 | trap(op << 1); break; |
| 866 | ||
| 866 | ||
| 867 | 867 | default: illegal(op); break; |
| 868 | 868 | } |
| 869 | 869 | } |
| r31373 | r31374 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | Toshiba TMPZ84C011, MPUZ80/TLCS-Z80 ASSP Family |
| 4 | 4 | Z80 CPU, CTC, CGC, I/O8x5 |
| 5 | ||
| 5 | ||
| 6 | 6 | TODO: |
| 7 | 7 | - CGC (clock generator/controller) |
| 8 | 8 |
| r31373 | r31374 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | Toshiba TMPZ84C015, MPUZ80/TLCS-Z80 ASSP Family |
| 4 | 4 | Z80 CPU, SIO, CTC, CGC, PIO, WDT |
| 5 | ||
| 5 | ||
| 6 | 6 | TODO: |
| 7 | 7 | - SIO configuration, or should that be up to the driver? |
| 8 | 8 | - CGC (clock generator/controller) |
| r31373 | r31374 | |
| 133 | 133 | WRITE8_MEMBER(tmpz84c015_device::irq_priority_w) |
| 134 | 134 | { |
| 135 | 135 | data &= 7; |
| 136 | ||
| 136 | ||
| 137 | 137 | if (data > 5) |
| 138 | 138 | { |
| 139 | 139 | logerror("tmpz84c015: irq_priority_w undefined state %X\n", data); |
| 140 | 140 | data &= 3; // guess |
| 141 | 141 | } |
| 142 | ||
| 142 | ||
| 143 | 143 | if (m_irq_priority != data) |
| 144 | 144 | { |
| 145 | 145 | static const char *dev[3] = { "tmpz84c015_ctc", "tmpz84c015_sio", "tmpz84c015_pio" }; |
| r31373 | r31374 | |
| 152 | 152 | { 2, 0, 1 }, // 4: pio -> ctc -> sio -> ext |
| 153 | 153 | { 1, 2, 0 } // 5: sio -> pio -> ctc -> ext |
| 154 | 154 | }; |
| 155 | ||
| 155 | ||
| 156 | 156 | // reconfigure first 3 entries in daisy chain |
| 157 | 157 | const z80_daisy_config daisy_chain[] = |
| 158 | 158 | { |
| r31373 | r31374 | |
| 162 | 162 | { NULL } |
| 163 | 163 | }; |
| 164 | 164 | m_daisy.init(this, daisy_chain); |
| 165 | ||
| 165 | ||
| 166 | 166 | m_irq_priority = data; |
| 167 | 167 | } |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | static MACHINE_CONFIG_FRAGMENT( tmpz84c015 ) |
| 171 | ||
| 171 | ||
| 172 | 172 | /* basic machine hardware */ |
| 173 | 173 | MCFG_Z80SIO0_ADD("tmpz84c015_sio", DERIVED_CLOCK(1,1), 0, 0, 0, 0) |
| 174 | 174 | MCFG_Z80DART_OUT_INT_CB(INPUTLINE(DEVICE_SELF, INPUT_LINE_IRQ0)) |
| r31373 | r31374 | |
|---|---|---|
| 360 | 360 | break; |
| 361 | 361 | |
| 362 | 362 | case 0x0F: /* D = int(D) */ |
| 363 | | |
| 363 | switch((m_fpucontrol>>1)&3) | |
| 364 | 364 | { |
| 365 | 365 | //case 0: GETD().i = floor(GETD().f+0.5f); break; |
| 366 | 366 | //case 1: GETD().i = ceil(GETD().f); break; |
| r31373 | r31374 | |
|---|---|---|
| 76 | 76 | |
| 77 | 77 | void mb86235_cpu_device::device_reset() |
| 78 | 78 | { |
| 79 | ||
| 80 | 79 | } |
| 81 | 80 | |
| 82 | 81 | #if 0 |
| r31373 | r31374 | |
|---|---|---|
| 2988 | 2988 | UINT64 mask = U64(0xffffffffffffffff) << shift; |
| 2989 | 2989 | WDOUBLE_MASKED(offs & ~7, RTVAL64 << shift, mask); |
| 2990 | 2990 | } |
| 2991 |
| r31373 | r31374 | |
|---|---|---|
| 3246 | 3246 | drcuml->log_printf("-----\n"); |
| 3247 | 3247 | } |
| 3248 | 3248 | } |
| 3249 |
| r31373 | r31374 | |
|---|---|---|
| 2237 | 2237 | case SMC(1,1,1,1, 1, 1): |
| 2238 | 2238 | f = (a) | cout; |
| 2239 | 2239 | break; |
| 2240 | ||
| 2240 | ||
| 2241 | 2241 | default: |
| 2242 | 2242 | f = 0; |
| 2243 | 2243 | break; |
| r31373 | r31374 | |
|---|---|---|
| 1141 | 1141 | // - 0x60 - 0x6f are an alias to 0x70 - 0x7f. |
| 1142 | 1142 | // - 0xc0, 0xc1, 0xc8, 0xc9 are also aliases where the CPU ignores BIT 1 (*). |
| 1143 | 1143 | // |
| 1144 | // Instructions are used in the boot sector for some versions of | |
| 1145 | // MS-DOS (e.g. the DEC Rainbow-100 version of DOS 2.x) | |
| 1144 | // Instructions are used in the boot sector for some versions of | |
| 1145 | // MS-DOS (e.g. the DEC Rainbow-100 version of DOS 2.x) | |
| 1146 | 1146 | case 0x60: |
| 1147 | 1147 | case 0x70: // i_jo |
| 1148 | 1148 | JMP( OF); |
| r31373 | r31374 | |
| 1672 | 1672 | CLK(MOV_RI16); |
| 1673 | 1673 | break; |
| 1674 | 1674 | |
| 1675 | ||
| 1675 | case 0xc0: // 0xc0 is 0xc2 - see (*) | |
| 1676 | 1676 | case 0xc2: // i_ret_d16 |
| 1677 | 1677 | { |
| 1678 | 1678 | UINT32 count = fetch_word(); |
| r31373 | r31374 | |
| 1725 | 1725 | } |
| 1726 | 1726 | break; |
| 1727 | 1727 | |
| 1728 | ||
| 1728 | case 0xc9: // 0xc9 = 0xcb - see (*) | |
| 1729 | 1729 | case 0xcb: // i_retf |
| 1730 | 1730 | m_ip = POP(); |
| 1731 | 1731 | m_sregs[CS] = POP(); |
| r31373 | r31374 | |
|---|---|---|
| 1638 | 1638 | |
| 1639 | 1639 | return CPU_DISASSEMBLE_NAME(tms34020)(this, buffer, pc, oprom, opram, options); |
| 1640 | 1640 | } |
| 1641 |
| r31373 | r31374 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | _5a22_device::_5a22_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 136 | ||
| 136 | : g65816_device(mconfig, _5A22, "5A22", tag, owner, clock, "5a22", __FILE__, CPU_TYPE_5A22, ADDRESS_MAP_NAME(_5a22_map)) | |
| 137 | 137 | { |
| 138 | 138 | } |
| 139 | 139 | |
| r31373 | r31374 | |
| 149 | 149 | case 3: FTABLE_OPCODES = g65816i_opcodes_M1X1; break; |
| 150 | 150 | case 4: FTABLE_OPCODES = g65816i_opcodes_E; break; |
| 151 | 151 | } |
| 152 | FTABLE_GET_REG = s_g65816_get_reg[mode]; | |
| 153 | FTABLE_SET_REG = s_g65816_set_reg[mode]; | |
| 154 | FTABLE_SET_LINE = s_g65816_set_line[mode]; | |
| 155 | FTABLE_EXECUTE = s_g65816_execute[mode]; | |
| 152 | FTABLE_GET_REG = s_g65816_get_reg[mode]; | |
| 153 | FTABLE_SET_REG = s_g65816_set_reg[mode]; | |
| 154 | FTABLE_SET_LINE = s_g65816_set_line[mode]; | |
| 155 | FTABLE_EXECUTE = s_g65816_execute[mode]; | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| r31373 | r31374 | |
| 941 | 941 | break; |
| 942 | 942 | case G65816_P: |
| 943 | 943 | m_debugger_temp = (m_flag_n&0x80) | |
| 944 | ((m_flag_v>>1)&0x40) | | |
| 945 | m_flag_m | | |
| 946 | m_flag_x | | |
| 947 | m_flag_d | | |
| 948 | m_flag_i | | |
| 949 | ((!m_flag_z)<<1) | | |
| 950 | ((m_flag_c>>8)&1); | |
| 944 | ((m_flag_v>>1)&0x40) | | |
| 945 | m_flag_m | | |
| 946 | m_flag_x | | |
| 947 | m_flag_d | | |
| 948 | m_flag_i | | |
| 949 | ((!m_flag_z)<<1) | | |
| 950 | ((m_flag_c>>8)&1); | |
| 951 | 951 | break; |
| 952 | 952 | case G65816_A: |
| 953 | 953 | m_debugger_temp = m_a | m_b; |
| r31373 | r31374 | |
| 1028 | 1028 | |
| 1029 | 1029 | void _5a22_device::state_export(const device_state_entry &entry) |
| 1030 | 1030 | { |
| 1031 | switch (entry.index()) | |
| 1032 | { | |
| 1033 | case _5A22_FASTROM: | |
| 1034 | m_debugger_temp = g65816_get_reg(_5A22_FASTROM); | |
| 1035 | break; | |
| 1031 | switch (entry.index()) | |
| 1032 | { | |
| 1033 | case _5A22_FASTROM: | |
| 1034 | m_debugger_temp = g65816_get_reg(_5A22_FASTROM); | |
| 1035 | break; | |
| 1036 | 1036 | default: |
| 1037 | 1037 | g65816_device::state_export(entry); |
| 1038 | 1038 | break; |
| r31373 | r31374 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | tms57002_device::tms57002_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 24 | 24 | : cpu_device(mconfig, TMS57002, "TMS57002", tag, owner, clock, "tms57002", __FILE__), |
| 25 | device_sound_interface(mconfig, *this), | |
| 26 | program_config("program", ENDIANNESS_LITTLE, 32, 8, -2, ADDRESS_MAP_NAME(internal_pgm)), | |
| 27 | data_config("data", ENDIANNESS_LITTLE, 8, 20) | |
| 25 | device_sound_interface(mconfig, *this), | |
| 26 | program_config("program", ENDIANNESS_LITTLE, 32, 8, -2, ADDRESS_MAP_NAME(internal_pgm)), | |
| 27 | data_config("data", ENDIANNESS_LITTLE, 8, 20) | |
| 28 | 28 | { |
| 29 | 29 | } |
| 30 | 30 |
| r31373 | r31374 | |
|---|---|---|
| 288 | 288 | sp_reg_w_func.resolve(); |
| 289 | 289 | sp_set_status_func.resolve(); |
| 290 | 290 | } |
| 291 | ||
| 291 | ||
| 292 | 292 | static CPU_INIT( rsp ) |
| 293 | 293 | { |
| 294 | 294 | rsp_state *rsp = get_safe_token(device); |
| 295 | 295 | int regIdx; |
| 296 | int accumIdx; | |
| 297 | ||
| 296 | int accumIdx; | |
| 297 | ||
| 298 | 298 | if (LOG_INSTRUCTION_EXECUTION) |
| 299 | 299 | rsp->exec_output = fopen("rsp_execute.txt", "wt"); |
| 300 | 300 | |
| r31373 | r31374 | |
| 3259 | 3259 | |
| 3260 | 3260 | rsp_cpu_device::rsp_cpu_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, UINT32 clock, cpu_get_info_func get_info) |
| 3261 | 3261 | : legacy_cpu_device(mconfig, type, tag, owner, clock, get_info), |
| 3262 | dp_reg_r_func(*this), | |
| 3263 | dp_reg_w_func(*this), | |
| 3264 | sp_reg_r_func(*this), | |
| 3265 | sp_reg_w_func(*this), | |
| 3266 | sp_set_status_func(*this) | |
| 3262 | dp_reg_r_func(*this), | |
| 3263 | dp_reg_w_func(*this), | |
| 3264 | sp_reg_r_func(*this), | |
| 3265 | sp_reg_w_func(*this), | |
| 3266 | sp_set_status_func(*this) | |
| 3267 | 3267 | { |
| 3268 | 3268 | } |
| 3269 | 3269 |
| r31373 | r31374 | |
|---|---|---|
| 177 | 177 | |
| 178 | 178 | void minx_cpu_device::execute_run() |
| 179 | 179 | { |
| 180 | ||
| 181 | 180 | do |
| 182 | 181 | { |
| 183 | 182 | m_curpc = GET_MINX_PC; |
| r31373 | r31374 | |
|---|---|---|
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | //ppc403_device::ppc403_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 233 | // | |
| 233 | // : ppc_device(mconfig, PPC403, "PPC403", tag, owner, clock, "ppc403", 32?, 64?) | |
| 234 | 234 | //{ |
| 235 | 235 | //} |
| 236 | 236 | // |
| 237 | 237 | //ppc405_device::ppc405_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 238 | // | |
| 238 | // : ppc_device(mconfig, PPC405, "PPC405", tag, owner, clock, "ppc405", 32?, 64?) | |
| 239 | 239 | //{ |
| 240 | 240 | //} |
| 241 | 241 | |
| r31373 | r31374 | |
| 2886 | 2886 | { |
| 2887 | 2887 | m_dcr_write_func = dcr_write_func; |
| 2888 | 2888 | } |
| 2889 |
| r31373 | r31374 | |
|---|---|---|
| 3919 | 3919 | drcuml->log_printf("-----\n"); |
| 3920 | 3920 | } |
| 3921 | 3921 | } |
| 3922 |
| r31373 | r31374 | |
|---|---|---|
| 180 | 180 | |
| 181 | 181 | void hd6309_device::device_pre_save() |
| 182 | 182 | { |
| 183 | if (m_reg8 == &m_d.b.h) m_reg = HD6309_A; | |
| 184 | else if (m_reg8 == &m_d.b.l) m_reg = HD6309_B; | |
| 185 | else if (m_reg8 == &m_w.b.h) m_reg = HD6309_E; | |
| 186 | else if (m_reg8 == &m_w.b.l) m_reg = HD6309_F; | |
| 187 | else if (m_reg8 == &m_cc) m_reg = HD6309_CC; | |
| 188 | else if (m_reg8 == &m_dp) m_reg = HD6309_DP; | |
| 189 | else if (m_reg8 == &m_md) m_reg = HD6309_MD; | |
| 190 | else if (m_reg8 == &m_temp.b.l) m_reg = HD6309_ZERO_BYTE; | |
| 183 | if (m_reg8 == &m_d.b.h) m_reg = HD6309_A; | |
| 184 | else if (m_reg8 == &m_d.b.l) m_reg = HD6309_B; | |
| 185 | else if (m_reg8 == &m_w.b.h) m_reg = HD6309_E; | |
| 186 | else if (m_reg8 == &m_w.b.l) m_reg = HD6309_F; | |
| 187 | else if (m_reg8 == &m_cc) m_reg = HD6309_CC; | |
| 188 | else if (m_reg8 == &m_dp) m_reg = HD6309_DP; | |
| 189 | else if (m_reg8 == &m_md) m_reg = HD6309_MD; | |
| 190 | else if (m_reg8 == &m_temp.b.l) m_reg = HD6309_ZERO_BYTE; | |
| 191 | 191 | |
| 192 | else if (m_reg16 == &m_d) m_reg = HD6309_D; | |
| 193 | else if (m_reg16 == &m_x) m_reg = HD6309_X; | |
| 194 | else if (m_reg16 == &m_y) m_reg = HD6309_Y; | |
| 195 | else if (m_reg16 == &m_u) m_reg = HD6309_U; | |
| 196 | else if (m_reg16 == &m_s) m_reg = HD6309_S; | |
| 197 | else if (m_reg16 == &m_pc) m_reg = HD6309_PC; | |
| 198 | else if (m_reg16 == &m_w) m_reg = HD6309_W; | |
| 199 | else if (m_reg16 == &m_v) m_reg = HD6309_V; | |
| 200 | else if (m_reg16 == &m_temp) m_reg = HD6309_ZERO_WORD; | |
| 192 | else if (m_reg16 == &m_d) m_reg = HD6309_D; | |
| 193 | else if (m_reg16 == &m_x) m_reg = HD6309_X; | |
| 194 | else if (m_reg16 == &m_y) m_reg = HD6309_Y; | |
| 195 | else if (m_reg16 == &m_u) m_reg = HD6309_U; | |
| 196 | else if (m_reg16 == &m_s) m_reg = HD6309_S; | |
| 197 | else if (m_reg16 == &m_pc) m_reg = HD6309_PC; | |
| 198 | else if (m_reg16 == &m_w) m_reg = HD6309_W; | |
| 199 | else if (m_reg16 == &m_v) m_reg = HD6309_V; | |
| 200 | else if (m_reg16 == &m_temp) m_reg = HD6309_ZERO_WORD; | |
| 201 | 201 | else |
| 202 | 202 | m_reg = 0; |
| 203 | 203 | } |
| r31373 | r31374 | |
|---|---|---|
| 98 | 98 | void konami_cpu_device::device_start() |
| 99 | 99 | { |
| 100 | 100 | super::device_start(); |
| 101 | ||
| 101 | ||
| 102 | 102 | // resolve callbacks |
| 103 | 103 | m_set_lines.resolve(); |
| 104 | 104 | } |
| r31373 | r31374 | |
| 377 | 377 | execute_one(); |
| 378 | 378 | } while(m_icount > 0); |
| 379 | 379 | } |
| 380 |
| r31373 | r31374 | |
|---|---|---|
| 887 | 887 | |
| 888 | 888 | if(m_sh2_state->sleep_mode == 1) { m_sh2_state->sleep_mode = 2; } |
| 889 | 889 | } |
| 890 |
| r31373 | r31374 | |
|---|---|---|
| 149 | 149 | |
| 150 | 150 | READ32_MEMBER(sh2_device::sh2_internal_a5) |
| 151 | 151 | { |
| 152 | ||
| 152 | return 0xa5a5a5a5; | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | |
| r31373 | r31374 | |
| 158 | 158 | -------------------------------------------------*/ |
| 159 | 159 | |
| 160 | 160 | static ADDRESS_MAP_START( sh2_internal_map, AS_PROGRAM, 32, sh2_device ) |
| 161 | AM_RANGE(0x40000000, 0xbfffffff) AM_READ(sh2_internal_a5) | |
| 162 | AM_RANGE(0xe0000000, 0xffffffff) AM_READWRITE(sh2_internal_r, sh2_internal_w) | |
| 161 | AM_RANGE(0x40000000, 0xbfffffff) AM_READ(sh2_internal_a5) | |
| 162 | AM_RANGE(0xe0000000, 0xffffffff) AM_READWRITE(sh2_internal_r, sh2_internal_w) | |
| 163 | 163 | ADDRESS_MAP_END |
| 164 | 164 | |
| 165 | 165 | |
| r31373 | r31374 | |
| 170 | 170 | , m_cpu_type(CPU_TYPE_SH2) |
| 171 | 171 | , m_cache(CACHE_SIZE + sizeof(internal_sh2_state)) |
| 172 | 172 | , m_drcuml(NULL) |
| 173 | // | |
| 173 | // , m_drcuml(*this, m_cache, ( LOG_UML ? DRCUML_OPTION_LOG_UML : 0 ) | ( LOG_NATIVE ? DRCUML_OPTION_LOG_NATIVE : 0 ), 1, 32, 1) | |
| 174 | 174 | , m_drcfe(NULL) |
| 175 | 175 | , m_drcoptions(0) |
| 176 | 176 | , m_sh2_state(NULL) |
| r31373 | r31374 | |
| 207 | 207 | , m_cpu_type(cpu_type) |
| 208 | 208 | , m_cache(CACHE_SIZE + sizeof(internal_sh2_state)) |
| 209 | 209 | , m_drcuml(NULL) |
| 210 | // | |
| 210 | // , m_drcuml(*this, m_cache, ( LOG_UML ? DRCUML_OPTION_LOG_UML : 0 ) | ( LOG_NATIVE ? DRCUML_OPTION_LOG_NATIVE : 0 ), 1, 32, 1) | |
| 211 | 211 | , m_drcfe(NULL) |
| 212 | 212 | , m_drcoptions(0) |
| 213 | 213 | , m_sh2_state(NULL) |
| r31373 | r31374 | |
| 2586 | 2586 | /* initialize the front-end helper */ |
| 2587 | 2587 | m_drcfe = auto_alloc(machine(), sh2_frontend(this, COMPILE_BACKWARDS_BYTES, COMPILE_FORWARDS_BYTES, SINGLE_INSTRUCTION_MODE ? 1 : COMPILE_MAX_SEQUENCE)); |
| 2588 | 2588 | |
| 2589 | /* compute the register parameters */ | |
| 2590 | for (int regnum = 0; regnum < 16; regnum++) | |
| 2591 | { | |
| 2592 | m_regmap[regnum] = uml::mem(&m_sh2_state->r[regnum]); | |
| 2593 | } | |
| 2589 | /* compute the register parameters */ | |
| 2590 | for (int regnum = 0; regnum < 16; regnum++) | |
| 2591 | { | |
| 2592 | m_regmap[regnum] = uml::mem(&m_sh2_state->r[regnum]); | |
| 2593 | } | |
| 2594 | 2594 | |
| 2595 | 2595 | /* if we have registers to spare, assign r0, r1, r2 to leftovers */ |
| 2596 | 2596 | /* WARNING: do not use synthetic registers that are mapped here! */ |
| r31373 | r31374 | |
| 2712 | 2712 | |
| 2713 | 2713 | #include "sh2comn.c" |
| 2714 | 2714 | #include "sh2drc.c" |
| 2715 |
| r31373 | r31374 | |
|---|---|---|
| 2978 | 2978 | m_fastram_select++; |
| 2979 | 2979 | } |
| 2980 | 2980 | } |
| 2981 |
| r31373 | r31374 | |
|---|---|---|
| 372 | 372 | // reset the state |
| 373 | 373 | m_avi_frame = 0; |
| 374 | 374 | m_avi_next_frame_time = machine().time(); |
| 375 | ||
| 375 | ||
| 376 | 376 | // build up information about this new movie |
| 377 | 377 | avi_movie_info info; |
| 378 | 378 | info.video_format = 0; |
| r31373 | r31374 | |
| 410 | 410 | { |
| 411 | 411 | // compute the frame time |
| 412 | 412 | m_avi_frame_period = attotime::from_seconds(1000) / info.video_timescale; |
| 413 | ||
| 413 | ||
| 414 | 414 | // create the file and free the string |
| 415 | 415 | avi_error avierr = avi_create(fullpath, &info, &m_avi_file); |
| 416 | 416 | if (avierr != AVIERR_NONE) |
| r31373 | r31374 | |
| 426 | 426 | { |
| 427 | 427 | // stop any existing recording |
| 428 | 428 | end_recording(format); |
| 429 | ||
| 429 | ||
| 430 | 430 | // reset the state |
| 431 | 431 | m_mng_frame = 0; |
| 432 | m_mng_next_frame_time = machine().time(); | |
| 433 | ||
| 432 | m_mng_next_frame_time = machine().time(); | |
| 433 | ||
| 434 | 434 | // create a new movie file and start recording |
| 435 | 435 | m_mng_file.reset(global_alloc(emu_file(machine().options().snapshot_directory(), OPEN_FLAG_WRITE | OPEN_FLAG_CREATE | OPEN_FLAG_CREATE_PATHS))); |
| 436 | 436 | file_error filerr; |
| r31373 | r31374 | |
| 475 | 475 | { |
| 476 | 476 | avi_close(m_avi_file); |
| 477 | 477 | m_avi_file = NULL; |
| 478 | ||
| 478 | ||
| 479 | 479 | // reset the state |
| 480 | 480 | m_avi_frame = 0; |
| 481 | 481 | } |
| r31373 | r31374 | |
| 1238 | 1238 | end_recording(MF_AVI); |
| 1239 | 1239 | break; |
| 1240 | 1240 | } |
| 1241 | ||
| 1241 | ||
| 1242 | 1242 | // advance time |
| 1243 | 1243 | m_avi_next_frame_time += m_avi_frame_period; |
| 1244 | 1244 | m_avi_frame++; |
| 1245 | 1245 | } |
| 1246 | 1246 | } |
| 1247 | ||
| 1247 | ||
| 1248 | 1248 | // handle a MNG recording |
| 1249 | 1249 | if (m_mng_file != NULL) |
| 1250 | 1250 | { |
| r31373 | r31374 | |
| 1272 | 1272 | end_recording(MF_MNG); |
| 1273 | 1273 | break; |
| 1274 | 1274 | } |
| 1275 | ||
| 1275 | ||
| 1276 | 1276 | // advance time |
| 1277 | 1277 | m_mng_next_frame_time += m_mng_frame_period; |
| 1278 | 1278 | m_mng_frame++; |
| 1279 | 1279 | } |
| 1280 | 1280 | } |
| 1281 | ||
| 1281 | ||
| 1282 | 1282 | g_profiler.stop(); |
| 1283 | 1283 | } |
| 1284 | 1284 |
| r31373 | r31374 | |
|---|---|---|
| 433 | 433 | if (share_ext != NULL) |
| 434 | 434 | m_paletteram_ext.set_membits(m_membits); |
| 435 | 435 | } |
| 436 | ||
| 436 | ||
| 437 | 437 | // override endianness if provided |
| 438 | 438 | if (m_endianness_supplied) |
| 439 | 439 | { |
| r31373 | r31374 | |
|---|---|---|
| 32 | 32 | m_formats(cassette_default_formats), |
| 33 | 33 | m_create_opts(NULL), |
| 34 | 34 | m_default_state(CASSETTE_PLAY), |
| 35 | m_interface(NULL) | |
| 35 | m_interface(NULL) | |
| 36 | 36 | { |
| 37 | 37 | } |
| 38 | 38 |
| r31373 | r31374 | |
|---|---|---|
| 7 | 7 | * ATi Graphics Ultra Pro ISA Video card |
| 8 | 8 | * - ATi 68800-3 (Mach32, combined VGA and 8514/A) |
| 9 | 9 | * |
| 10 | * ATi mach64 ISA Video card | |
| 11 | * - ATi 88800 (Mach64, combined VGA and 8514/A) | |
| 10 | * ATi mach64 ISA Video card | |
| 11 | * - ATi 88800 (Mach64, combined VGA and 8514/A) | |
| 12 | 12 | * |
| 13 | 13 | * Created on: 9/09/2012 |
| 14 | 14 | */ |
| r31373 | r31374 | |
|---|---|---|
| 362 | 362 | { |
| 363 | 363 | if (m_update_row_type == -1) |
| 364 | 364 | return; |
| 365 | ||
| 365 | ||
| 366 | 366 | switch (m_update_row_type) |
| 367 | 367 | { |
| 368 | 368 | case MDA_TEXT_INTEN: |
| r31373 | r31374 | |
| 379 | 379 | { |
| 380 | 380 | if (m_update_row_type == -1) |
| 381 | 381 | return; |
| 382 | ||
| 382 | ||
| 383 | 383 | switch (m_update_row_type) |
| 384 | 384 | { |
| 385 | 385 | case HERCULES_GFX_BLINK: |
| r31373 | r31374 | |
|---|---|---|
| 306 | 306 | *************************************/ |
| 307 | 307 | |
| 308 | 308 | /* colors need fixing in the mda_text_* functions ! */ |
| 309 | MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row ) | |
| 309 | MC6845_UPDATE_ROW( isa8_aga_device::mda_text_inten_update_row ) | |
| 310 | 310 | { |
| 311 | 311 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| 312 | 312 | UINT8 *videoram = m_videoram; |
| r31373 | r31374 | |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | |
| 370 | MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row ) | |
| 370 | MC6845_UPDATE_ROW( isa8_aga_device::mda_text_blink_update_row ) | |
| 371 | 371 | { |
| 372 | 372 | UINT8 *videoram = m_videoram; |
| 373 | 373 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| r31373 | r31374 | |
| 429 | 429 | } |
| 430 | 430 | |
| 431 | 431 | |
| 432 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row ) | |
| 432 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_update_row ) | |
| 433 | 433 | { |
| 434 | 434 | UINT8 *videoram = m_videoram; |
| 435 | 435 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| r31373 | r31374 | |
| 460 | 460 | } |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row ) | |
| 463 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_inten_alt_update_row ) | |
| 464 | 464 | { |
| 465 | 465 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| 466 | 466 | UINT8 *videoram = m_videoram; |
| r31373 | r31374 | |
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row ) | |
| 493 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_update_row ) | |
| 494 | 494 | { |
| 495 | 495 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| 496 | 496 | UINT8 *videoram = m_videoram; |
| r31373 | r31374 | |
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row ) | |
| 527 | MC6845_UPDATE_ROW( isa8_aga_device::cga_text_blink_alt_update_row ) | |
| 528 | 528 | { |
| 529 | 529 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| 530 | 530 | UINT8 *videoram = m_videoram; |
| r31373 | r31374 | |
| 560 | 560 | } |
| 561 | 561 | } |
| 562 | 562 | |
| 563 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row ) | |
| 563 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bppl_update_row ) | |
| 564 | 564 | { |
| 565 | 565 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| 566 | 566 | UINT8 *videoram = m_videoram; |
| r31373 | r31374 | |
| 586 | 586 | } |
| 587 | 587 | } |
| 588 | 588 | |
| 589 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row ) | |
| 589 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_4bpph_update_row ) | |
| 590 | 590 | { |
| 591 | 591 | UINT8 *videoram = m_videoram; |
| 592 | 592 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| r31373 | r31374 | |
| 620 | 620 | } |
| 621 | 621 | } |
| 622 | 622 | |
| 623 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row ) | |
| 623 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_2bpp_update_row ) | |
| 624 | 624 | { |
| 625 | 625 | UINT8 *videoram = m_videoram; |
| 626 | 626 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| r31373 | r31374 | |
| 646 | 646 | } |
| 647 | 647 | } |
| 648 | 648 | |
| 649 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row ) | |
| 649 | MC6845_UPDATE_ROW( isa8_aga_device::cga_gfx_1bpp_update_row ) | |
| 650 | 650 | { |
| 651 | 651 | UINT8 *videoram = m_videoram; |
| 652 | 652 | const rgb_t *palette = m_palette->palette()->entry_list_raw(); |
| r31373 | r31374 | |
| 723 | 723 | case 8: |
| 724 | 724 | m_mda_mode_control = data; |
| 725 | 725 | |
| 726 | switch (m_mda_mode_control & 0x2a) | |
| 726 | switch (m_mda_mode_control & 0x2a) | |
| 727 | 727 | { |
| 728 | 728 | case 0x08: |
| 729 | 729 | m_update_row_type = MDA_TEXT_INTEN; |
| r31373 | r31374 | |
| 807 | 807 | break; |
| 808 | 808 | case 8: |
| 809 | 809 | m_cga_mode_control = data; |
| 810 | ||
| 810 | ||
| 811 | 811 | //logerror("mode set to %02X\n", m_cga_mode_control & 0x3F ); |
| 812 | 812 | switch ( m_cga_mode_control & 0x3F ) { |
| 813 | 813 | case 0x08: case 0x09: case 0x0C: case 0x0D: |
| r31373 | r31374 | |
|---|---|---|
| 229 | 229 | // and a PC BIOS to make the card bootable on a PC. |
| 230 | 230 | // we have the Z8 program, we still need the PC BIOS. |
| 231 | 231 | ROM_START( omti8621 ) |
| 232 | ROM_REGION(0x4000, OMTI_CPU_REGION, 0) | |
| 232 | ROM_REGION(0x4000, OMTI_CPU_REGION, 0) // disassembles fine as Z8 code | |
| 233 | 233 | ROM_LOAD( "omti_8621_102640-b.bin", 0x000000, 0x004000, CRC(e6f20dbb) SHA1(cf1990ad72eac6b296485410f5fa3309a0d6d078) ) |
| 234 | 234 | |
| 235 | 235 | ROM_REGION(0x1000, OMTI_BIOS_REGION, 0) |
| r31373 | r31374 | |
| 875 | 875 | set_data_transfer(disk->m_esdi_defect_list, sizeof(disk->m_esdi_defect_list)); |
| 876 | 876 | break; |
| 877 | 877 | |
| 878 | #if 0 | |
| 878 | #if 0 // this command seems unused by Domain/OS, and it's unclear what the intent of the code is (it makes some versions of GCC quite unhappy) | |
| 879 | 879 | case OMTI_CMD_ASSIGN_ALTERNATE_TRACK: // 0x11 |
| 880 | 880 | log_data(); |
| 881 | 881 | alternate_track_address[0] = get_disk_track(cdb); |
| r31373 | r31374 | |
| 1212 | 1212 | } |
| 1213 | 1213 | else |
| 1214 | 1214 | { |
| 1215 | // | |
| 1215 | // LOG1(("omti8621_get_sector %x on lun %d", diskaddr, lun)); | |
| 1216 | 1216 | |
| 1217 | 1217 | // restrict length to size of 1 sector (i.e. 1024 Byte) |
| 1218 | 1218 | length = length < OMTI_DISK_SECTOR_SIZE ? length : OMTI_DISK_SECTOR_SIZE; |
| r31373 | r31374 | |
|---|---|---|
| 180 | 180 | { |
| 181 | 181 | if (m_update_row_type == -1) |
| 182 | 182 | return; |
| 183 | ||
| 183 | ||
| 184 | 184 | switch (m_update_row_type) |
| 185 | 185 | { |
| 186 | 186 | case CGA_TEXT_INTEN: |
| r31373 | r31374 | |
| 221 | 221 | { |
| 222 | 222 | if (m_update_row_type == -1) |
| 223 | 223 | return; |
| 224 | ||
| 224 | ||
| 225 | 225 | switch (m_update_row_type) |
| 226 | 226 | { |
| 227 | 227 | case PC1512_GFX_4BPP: |
| r31373 | r31374 | |
|---|---|---|
| 44 | 44 | MCFG_WD2010_IN_WF_CB(VCC) |
| 45 | 45 | MCFG_WD2010_IN_TK000_CB(VCC) |
| 46 | 46 | MCFG_WD2010_IN_SC_CB(VCC) |
| 47 | ||
| 47 | ||
| 48 | 48 | MCFG_HARDDISK_ADD("hard0") |
| 49 | 49 | MCFG_HARDDISK_ADD("hard1") |
| 50 | 50 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 34 | 34 | // SVGA device |
| 35 | 35 | mach32_device::mach32_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 36 | 36 | : ati_vga_device(mconfig, ATIMACH32, "ATi mach32", tag, owner, clock, "mach32", __FILE__), |
| 37 | | |
| 37 | m_8514a(*this,"8514a") | |
| 38 | 38 | { |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | mach32_device::mach32_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 42 | 42 | : ati_vga_device(mconfig, type, name, tag, owner, clock, shortname, source), |
| 43 | | |
| 43 | m_8514a(*this,"8514a") | |
| 44 | 44 | { |
| 45 | 45 | } |
| 46 | 46 | |
| r31373 | r31374 | |
| 98 | 98 | // SVGA device |
| 99 | 99 | mach64_device::mach64_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 100 | 100 | : mach32_device(mconfig, ATIMACH64, "ATi mach64", tag, owner, clock, "mach64", __FILE__), |
| 101 | | |
| 101 | m_8514a(*this,"8514a") | |
| 102 | 102 | { |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | mach64_device::mach64_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 106 | 106 | : mach32_device(mconfig, type, name, tag, owner, clock, shortname, source), |
| 107 | | |
| 107 | m_8514a(*this,"8514a") | |
| 108 | 108 | { |
| 109 | 109 | } |
| 110 | 110 |
| r31373 | r31374 | |
|---|---|---|
| 219 | 219 | m_cmc_prot->neogeo_cmc50_m1_decrypt(audiocrypt_region, audiocrypt_region_size, audiocpu_region, audio_region_size); |
| 220 | 220 | m_cmc_prot->kof2000_neogeo_gfx_decrypt(spr_region, spr_region_size, fix_region, fix_region_size, KOF2000_GFX_KEY); |
| 221 | 221 | } |
| 222 |
| r31373 | r31374 | |
|---|---|---|
| 91 | 91 | maincpu->space(AS_PROGRAM).install_readwrite_handler(0x2fffe0, 0x2fffef, read16_delegate(FUNC(mslugx_prot_device::mslugx_protection_16_r),this), write16_delegate(FUNC(mslugx_prot_device::mslugx_protection_16_w),this)); |
| 92 | 92 | |
| 93 | 93 | } |
| 94 | ||
| 95 | ||
| 96 | ||
| 97 | ||
| 98 |
| r31373 | r31374 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | void kof2002_prot_device::device_start() |
| 17 | 17 | { |
| 18 | ||
| 19 | 18 | } |
| 20 | 19 | |
| 21 | 20 | void kof2002_prot_device::device_reset() |
| r31373 | r31374 | |
| 80 | 79 | memcpy( src+i*0x80000, dst+sec[i], 0x80000 ); |
| 81 | 80 | } |
| 82 | 81 | } |
| 83 | ||
| 84 |
| r31373 | r31374 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | void sbp_prot_device::device_start() |
| 18 | 18 | { |
| 19 | ||
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | void sbp_prot_device::device_reset() |
| r31373 | r31374 | |
| 82 | 81 | rom[0x2a6fa / 2] = 0x4e71; |
| 83 | 82 | rom[0x2a6fc / 2] = 0x4e71; |
| 84 | 83 | } |
| 85 | } | |
| No newline at end of file | ||
| 84 | } |
| r31373 | r31374 | |
|---|---|---|
| 173 | 173 | m_banked_cart->install_banks(machine, maincpu, cpuregion, cpuregion_size); |
| 174 | 174 | m_sma_prot->kof2000_install_protection(maincpu, m_banked_cart); |
| 175 | 175 | } |
| 176 | ||
| 177 |
| r31373 | r31374 | |
|---|---|---|
| 312 | 312 | memcpy (&rom[0x100000], &buf[0x800000], 0x100000); |
| 313 | 313 | memcpy (&rom[0x200000], &buf[0x100000], 0x700000); |
| 314 | 314 | } |
| 315 | ||
| 316 | ||
| 317 |
| r31373 | r31374 | |
|---|---|---|
| 65 | 65 | void neogeo_rom_device::activate_cart(ACTIVATE_CART_PARAMS) |
| 66 | 66 | { |
| 67 | 67 | m_banked_cart->install_banks(machine, maincpu, cpuregion, cpuregion_size); |
| 68 | } | |
| No newline at end of file | ||
| 68 | } |
| r31373 | r31374 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | READ16_MEMBER(ngbootleg_prot_device::kof10th_RAM2_r) |
| 194 | 194 | { |
| 195 | // | |
| 195 | // printf("kof10th_RAM2_r\n"); | |
| 196 | 196 | return m_cartridge_ram2[offset]; |
| 197 | 197 | } |
| 198 | 198 | |
| r31373 | r31374 | |
| 1128 | 1128 | /* decrypt gfx */ |
| 1129 | 1129 | cthd2003_c(sprrom,sprrom_size, 0 ); |
| 1130 | 1130 | } |
| 1131 |
| r31373 | r31374 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | void cmc_prot_device::device_start() |
| 17 | 17 | { |
| 18 | ||
| 19 | 18 | } |
| 20 | 19 | |
| 21 | 20 | void cmc_prot_device::device_reset() |
| r31373 | r31374 | |
| 786 | 785 | } |
| 787 | 786 | #endif |
| 788 | 787 | } |
| 789 |
| r31373 | r31374 | |
|---|---|---|
| 36 | 36 | /* only CMC50 for gfx (& audiocpu) */ |
| 37 | 37 | SLOT_INTERFACE_INTERNAL("r_cmc_kof2001", NEOGEO_CMC_KOF2001_CART) |
| 38 | 38 | SLOT_INTERFACE_INTERNAL("r_cmc_kof2000n", NEOGEO_CMC_KOF2000N_CART) |
| 39 | /* CMC50 for gfx (& audiocpu) + NEOPCM2 for YM scramble */ | |
| 39 | /* CMC50 for gfx (& audiocpu) + NEOPCM2 for YM scramble */ | |
| 40 | 40 | SLOT_INTERFACE_INTERNAL("r_pc2_mslug4", NEOGEO_PCM2_MSLUG4_CART) |
| 41 | 41 | SLOT_INTERFACE_INTERNAL("r_pc2_rotd", NEOGEO_PCM2_ROTD_CART) |
| 42 | 42 | SLOT_INTERFACE_INTERNAL("r_pc2_pnyaa", NEOGEO_PCM2_PNYAA_CART) |
| 43 | 43 | SLOT_INTERFACE_INTERNAL("r_ms4plus", NEOGEO_PCM2_MS4PLUS_CART) // regular encryption but external S1 rom |
| 44 | 44 | |
| 45 | /* CMC50 for gfx (& audiocpu) + NEOPCM2 for YM scramble + additonal prg scramble */ | |
| 45 | /* CMC50 for gfx (& audiocpu) + NEOPCM2 for YM scramble + additonal prg scramble */ | |
| 46 | 46 | SLOT_INTERFACE_INTERNAL("r_k2_kof2002", NEOGEO_KOF2002_KOF2002_CART) |
| 47 | 47 | SLOT_INTERFACE_INTERNAL("r_k2_matrim", NEOGEO_KOF2002_MATRIM_CART) |
| 48 | 48 | SLOT_INTERFACE_INTERNAL("r_k2_samsh5", NEOGEO_KOF2002_SAMSHO5_CART) |
| 49 | 49 | SLOT_INTERFACE_INTERNAL("r_k2_sams5s", NEOGEO_KOF2002_SAMSHO5SP_CART) |
| 50 | 50 | SLOT_INTERFACE_INTERNAL("r_kf2k2pls", NEOGEO_KOF2002_KF2K2PLS_CART) // regular encryption but external S1 rom |
| 51 | 51 | |
| 52 | /* CMC50 for gfx (& audiocpu) + NEOPCM2 for YM scramble + PVC protection/encryption */ | |
| 52 | /* CMC50 for gfx (& audiocpu) + NEOPCM2 for YM scramble + PVC protection/encryption */ | |
| 53 | 53 | SLOT_INTERFACE_INTERNAL("r_pv_mslug5", NEOGEO_PVC_MSLUG5_CART) |
| 54 | 54 | SLOT_INTERFACE_INTERNAL("r_pv_svc", NEOGEO_PVC_SVC_CART) |
| 55 | 55 | SLOT_INTERFACE_INTERNAL("r_pv_kf2k3", NEOGEO_PVC_KOF2003_CART) |
| 56 | 56 | SLOT_INTERFACE_INTERNAL("r_pv_kf2k3h", NEOGEO_PVC_KOF2003H_CART) |
| 57 | ||
| 57 | ||
| 58 | 58 | /* 100% bootleg logic */ |
| 59 | 59 | SLOT_INTERFACE_INTERNAL("r_garoubl", NEOGEO_BOOTLEG_GAROUBL_CART) |
| 60 | 60 | SLOT_INTERFACE_INTERNAL("r_cthd2003", NEOGEO_BOOTLEG_CTHD2003_CART) |
| r31373 | r31374 | |
| 85 | 85 | SLOT_INTERFACE_INTERNAL("r_kf2k3bl", NEOGEO_BOOTLEG_HYBRID_KF2K3BL_CART) |
| 86 | 86 | SLOT_INTERFACE_INTERNAL("r_kf2k3pl", NEOGEO_BOOTLEG_HYBRID_KF2K3PL_CART) |
| 87 | 87 | SLOT_INTERFACE_INTERNAL("r_kf2k3upl", NEOGEO_BOOTLEG_HYBRID_KF2K3UPL_CART) |
| 88 | ||
| 89 | ||
| 90 | ||
| 91 | ||
| 92 | ||
| 93 | ||
| 94 | 88 | |
| 89 | ||
| 90 | ||
| 91 | ||
| 92 | ||
| 93 | ||
| 94 | ||
| 95 | 95 | SLOT_INTERFACE_END |
| r31373 | r31374 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | m_banked_cart->install_banks(machine, maincpu, cpuregion, cpuregion_size); |
| 77 | 77 | m_kof98_prot->install_kof98_protection(maincpu); |
| 78 | } | |
| No newline at end of file | ||
| 78 | } |
| r31373 | r31374 | |
|---|---|---|
| 131 | 131 | m_cmc_prot->kof2000_neogeo_gfx_decrypt(spr_region, spr_region_size, fix_region, fix_region_size, PNYAA_GFX_KEY); |
| 132 | 132 | m_pcm2_prot->neo_pcm2_snk_1999(ym_region, ym_region_size, 4); |
| 133 | 133 | } |
| 134 | ||
| 135 |
| r31373 | r31374 | |
|---|---|---|
| 70 | 70 | { |
| 71 | 71 | m_banked_cart->install_banks(machine, maincpu, cpuregion, cpuregion_size); |
| 72 | 72 | m_fatfury2_prot->fatfury2_install_protection(maincpu, m_banked_cart); |
| 73 | } | |
| No newline at end of file | ||
| 73 | } |
| r31373 | r31374 | |
|---|---|---|
| 78 | 78 | { |
| 79 | 79 | // create memory regions |
| 80 | 80 | len = get_software_region_length("maincpu"); |
| 81 | m_cart->rom_alloc(len); | |
| 81 | m_cart->rom_alloc(len); ROM = m_cart->get_rom_base(); | |
| 82 | 82 | memcpy(ROM, get_software_region("maincpu"), len); |
| 83 | 83 | |
| 84 | 84 | len = get_software_region_length("fixed"); |
| 85 | m_cart->fixed_alloc(len); | |
| 85 | m_cart->fixed_alloc(len); ROM8 = m_cart->get_fixed_base(); | |
| 86 | 86 | memcpy(ROM8, get_software_region("fixed"), len); |
| 87 | 87 | |
| 88 | 88 | if (get_software_region("audiocpu") != NULL) |
| 89 | 89 | { |
| 90 | 90 | len = get_software_region_length("audiocpu"); |
| 91 | m_cart->audio_alloc(len + 0x10000); | |
| 91 | m_cart->audio_alloc(len + 0x10000); ROM8 = m_cart->get_audio_base(); | |
| 92 | 92 | memcpy(ROM8, get_software_region("audiocpu"), len); |
| 93 | 93 | memcpy(ROM8 + 0x10000, get_software_region("audiocpu"), len); // avoid reloading in XML, should just improve banking instead tho? |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | len = get_software_region_length("ymsnd"); |
| 97 | m_cart->ym_alloc(len); | |
| 97 | m_cart->ym_alloc(len); ROM8 = m_cart->get_ym_base(); | |
| 98 | 98 | memcpy(ROM8, get_software_region("ymsnd"), len); |
| 99 | 99 | |
| 100 | 100 | if (get_software_region("ymsnd.deltat") != NULL) |
| 101 | 101 | { |
| 102 | 102 | len = get_software_region_length("ymsnd.deltat"); |
| 103 | m_cart->ymdelta_alloc(len); | |
| 103 | m_cart->ymdelta_alloc(len); ROM8 = m_cart->get_ymdelta_base(); | |
| 104 | 104 | memcpy(ROM8, get_software_region("ymsnd.deltat"), len); |
| 105 | 105 | } |
| 106 | 106 | else |
| r31373 | r31374 | |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | len = get_software_region_length("sprites"); |
| 113 | m_cart->sprites_alloc(len); | |
| 113 | m_cart->sprites_alloc(len); ROM8 = m_cart->get_sprites_base(); | |
| 114 | 114 | memcpy(ROM8, get_software_region("sprites"), len); |
| 115 | 115 | |
| 116 | 116 | if (get_software_region("audiocrypt") != NULL) // encrypted Z80 code |
| 117 | 117 | { |
| 118 | 118 | len = get_software_region_length("audiocrypt"); |
| 119 | m_cart->audiocrypt_alloc(len); | |
| 119 | m_cart->audiocrypt_alloc(len); ROM8 = m_cart->get_audiocrypt_base(); | |
| 120 | 120 | memcpy(ROM8, get_software_region("audiocrypt"), len); |
| 121 | 121 | // allocate the audiocpu region to decrypt data into |
| 122 | 122 | m_cart->audio_alloc(len + 0x10000); |
| r31373 | r31374 | |
|---|---|---|
| 236 | 236 | |
| 237 | 237 | void sma_prot_device::sma_install_random_read_handler(cpu_device* maincpu, int addr1, int addr2 ) |
| 238 | 238 | { |
| 239 | ||
| 240 | 239 | maincpu->space(AS_PROGRAM).install_read_handler(addr1, addr1 + 1, read16_delegate(FUNC(sma_prot_device::sma_random_r),this)); |
| 241 | 240 | maincpu->space(AS_PROGRAM).install_read_handler(addr2, addr2 + 1, read16_delegate(FUNC(sma_prot_device::sma_random_r),this)); |
| 242 | 241 | } |
| r31373 | r31374 | |
| 459 | 458 | rom[i] = rom[0x73a000/2 + BITSWAP24(i,23,22,21,20,19,18,8,4,15,13,3,14,16,2,6,17,7,12,10,0,5,11,1,9)]; |
| 460 | 459 | } |
| 461 | 460 | } |
| 462 | ||
| 463 |
| r31373 | r31374 | |
|---|---|---|
| 70 | 70 | { |
| 71 | 71 | m_banked_cart->install_banks(machine, maincpu, cpuregion, cpuregion_size); |
| 72 | 72 | m_mslugx_prot->mslugx_install_protection(maincpu); |
| 73 | } | |
| No newline at end of file | ||
| 73 | } |
| r31373 | r31374 | |
|---|---|---|
| 29 | 29 | device_neogeo_cart_interface::~device_neogeo_cart_interface() |
| 30 | 30 | { |
| 31 | 31 | } |
| 32 |
| r31373 | r31374 | |
|---|---|---|
| 153 | 153 | m_cmc_prot->kof2000_neogeo_gfx_decrypt(spr_region, spr_region_size, fix_region, fix_region_size, SAMSHO5SP_GFX_KEY); |
| 154 | 154 | m_pcm2_prot->neo_pcm2_swap(ym_region, ym_region_size, 6); |
| 155 | 155 | } |
| 156 |
| r31373 | r31374 | |
|---|---|---|
| 47 | 47 | |
| 48 | 48 | if (!m_bank_cartridge) |
| 49 | 49 | printf("bank_cartridge is null\n"); |
| 50 | ||
| 50 | ||
| 51 | 51 | if (m_region && m_bank_cartridge) m_bank_cartridge->set_base(m_region + m_main_cpu_bank_address); |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | void neogeo_banked_cart_device::neogeo_set_main_cpu_bank_address( UINT32 bank_address ) |
| 56 | 56 | { |
| 57 | // | |
| 57 | // if (LOG_MAIN_CPU_BANKING) logerror("MAIN CPU PC %06x: neogeo_set_main_cpu_bank_address %06x\n", m_maincpu->pc(), bank_address); | |
| 58 | 58 | |
| 59 | 59 | m_main_cpu_bank_address = bank_address; |
| 60 | 60 | |
| r31373 | r31374 | |
| 96 | 96 | { |
| 97 | 97 | maincpu->space(AS_PROGRAM).install_read_bank(0x200000, 0x2fffff, 0, 0, "cartridge"); |
| 98 | 98 | maincpu->space(AS_PROGRAM).install_write_handler(0x2ffff0, 0x2fffff, write16_delegate(FUNC(neogeo_banked_cart_device::main_cpu_bank_select_w),this)); |
| 99 | ||
| 99 | ||
| 100 | 100 | m_bank_cartridge = machine.root_device().membank("cartridge"); |
| 101 | 101 | m_region = region; |
| 102 | 102 | m_region_size = region_size; |
| 103 | 103 | |
| 104 | 104 | init_banks(); |
| 105 | 105 | } |
| 106 |
| r31373 | r31374 | |
|---|---|---|
| 135 | 135 | m_cmc_prot->neogeo_cmc50_m1_decrypt(audiocrypt_region, audiocrypt_region_size, audiocpu_region, audio_region_size); |
| 136 | 136 | m_cmc_prot->kof2000_neogeo_gfx_decrypt(spr_region, spr_region_size, fix_region, fix_region_size, KOF2003_GFX_KEY); |
| 137 | 137 | } |
| 138 | ||
| 139 | ||
| 140 | ||
| 141 | ||
| 142 | ||
| 143 | ||
| 144 |
| r31373 | r31374 | |
|---|---|---|
| 16 | 16 | |
| 17 | 17 | void kof98_prot_device::device_start() |
| 18 | 18 | { |
| 19 | ||
| 20 | 19 | } |
| 21 | 20 | |
| 22 | 21 | void kof98_prot_device::device_reset() |
| r31373 | r31374 | |
| 137 | 136 | |
| 138 | 137 | maincpu->space(AS_PROGRAM).install_write_handler(0x20aaaa, 0x20aaab, write16_delegate(FUNC(kof98_prot_device::kof98_prot_w),this)); |
| 139 | 138 | } |
| 140 | ||
| 141 |
| r31373 | r31374 | |
|---|---|---|
| 361 | 361 | m_bootleg_prot->neogeo_bootleg_sx_decrypt(fix_region, fix_region_size,1); |
| 362 | 362 | m_bootleg_prot->neogeo_bootleg_cx_decrypt(spr_region, spr_region_size); |
| 363 | 363 | } |
| 364 | ||
| 365 |
| r31373 | r31374 | |
|---|---|---|
| 84 | 84 | src[j]=buf[d]^xordata[value][j&0x7]; |
| 85 | 85 | } |
| 86 | 86 | } |
| 87 |
| r31373 | r31374 | |
|---|---|---|
| 106 | 106 | m_fatfury2_prot_data = 0; |
| 107 | 107 | |
| 108 | 108 | } |
| 109 |
| r31373 | r31374 | |
|---|---|---|
| 107 | 107 | UINT8 code = m_video_ram[((ma + column) & 0x7ff)]; |
| 108 | 108 | UINT16 addr = (code << 3) | (ra & 0x07); |
| 109 | 109 | UINT8 data = m_char_rom->base()[addr & 0x7ff]; |
| 110 | ||
| 110 | ||
| 111 | 111 | if (BIT(ra, 3) && column == cursor_x) |
| 112 | 112 | { |
| 113 | 113 | data = 0xff; |
| 114 | 114 | } |
| 115 | ||
| 115 | ||
| 116 | 116 | for (int bit = 0; bit < 8; bit++) |
| 117 | 117 | { |
| 118 | 118 | int x = (column * 8) + bit; |
| 119 | ||
| 119 | ||
| 120 | 120 | bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(BIT(data, 7) && de); |
| 121 | ||
| 121 | ||
| 122 | 122 | data <<= 1; |
| 123 | 123 | } |
| 124 | 124 | } |
| r31373 | r31374 | |
|---|---|---|
| 68 | 68 | |
| 69 | 69 | In MESS: supported. |
| 70 | 70 | |
| 71 | This mapper supports up to 1MB of PRG-ROM, in 4k | |
| 72 | banks located at $8000, $9000, $A000, $B000, $C000, | |
| 73 | $D000, $E000, and $F000. Each bank is selected by n | |
| 74 | 8-bit register at $5FF8, $5FF9, $5FFA, $5FFB, $5FFC, | |
| 75 | $5FFD, $5FFE, and $5FFF, respectively, just like NSF | |
| 76 | banking. These registers are mirrored across the | |
| 77 | entire $5000-$5FFF region (the register is selected | |
| 78 | by the low 3 bits), but it is recommended to use the | |
| 79 | original addresses. The mirroring is merely a | |
| 71 | This mapper supports up to 1MB of PRG-ROM, in 4k | |
| 72 | banks located at $8000, $9000, $A000, $B000, $C000, | |
| 73 | $D000, $E000, and $F000. Each bank is selected by n | |
| 74 | 8-bit register at $5FF8, $5FF9, $5FFA, $5FFB, $5FFC, | |
| 75 | $5FFD, $5FFE, and $5FFF, respectively, just like NSF | |
| 76 | banking. These registers are mirrored across the | |
| 77 | entire $5000-$5FFF region (the register is selected | |
| 78 | by the low 3 bits), but it is recommended to use the | |
| 79 | original addresses. The mirroring is merely a | |
| 80 | 80 | convenience for the hardware implementation. |
| 81 | ||
| 82 | The 8kb CHR region may be RAM or ROM. This project | |
| 83 | uses CHR-RAM, and the board used by infiniteneslives | |
| 81 | ||
| 82 | The 8kb CHR region may be RAM or ROM. This project | |
| 83 | uses CHR-RAM, and the board used by infiniteneslives | |
| 84 | 84 | for this project may only support CHR-RAM. |
| 85 | ||
| 86 | At power-on, the mapper automatically sets all bits | |
| 87 | in the $5FFF bank register, placing the highest bank | |
| 88 | in $F000. This occurs on power-on but not on reset, | |
| 89 | so any bank that is mapped to $F000 after power-on | |
| 85 | ||
| 86 | At power-on, the mapper automatically sets all bits | |
| 87 | in the $5FFF bank register, placing the highest bank | |
| 88 | in $F000. This occurs on power-on but not on reset, | |
| 89 | so any bank that is mapped to $F000 after power-on | |
| 90 | 90 | should contain a valid reset vector. |
| 91 | ||
| 92 | At present, the project uses iNES mapper 30 to | |
| 93 | designate this mapper. No mapper number has been | |
| 91 | ||
| 92 | At present, the project uses iNES mapper 30 to | |
| 93 | designate this mapper. No mapper number has been | |
| 94 | 94 | officially reserved yet. |
| 95 | 95 | -------------------------------------------------*/ |
| 96 | 96 |
| r31373 | r31374 | |
|---|---|---|
| 17 | 17 | |
| 18 | 18 | |
| 19 | 19 | static MACHINE_CONFIG_FRAGMENT( cpc_pds ) |
| 20 | MCFG_DEVICE_ADD("pio", Z80PIO, XTAL_4MHz) | |
| 20 | MCFG_DEVICE_ADD("pio", Z80PIO, XTAL_4MHz) // no clock on the PCB, so will presume that it uses the CPC's clock | |
| 21 | 21 | |
| 22 | 22 | // no pass-through seen on remake PCBs, unknown if actual hardware had a pass-through port or not |
| 23 | 23 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 33 | 33 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("dart",z80dart_device,rxa_w)) |
| 34 | 34 | MCFG_RS232_DCD_HANDLER(DEVWRITELINE("dart",z80dart_device,dcda_w)) |
| 35 | 35 | MCFG_RS232_CTS_HANDLER(DEVWRITELINE("dart",z80dart_device,ctsa_w)) |
| 36 | // | |
| 36 | // MCFG_RS232_RI_HANDLER(DEVWRITELINE("dart",z80dart_device,ria_w)) | |
| 37 | 37 | |
| 38 | 38 | // pass-through |
| 39 | 39 | MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0) |
| r31373 | r31374 | |
|---|---|---|
| 74 | 74 | break; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 |
| r31373 | r31374 | |
|---|---|---|
| 76 | 76 | m_bank_selected[offset] = data; |
| 77 | 77 | m_bank_base[offset] = m_ram + 0x4000 * ( m_bank_selected[offset] & m_bank_mask ); |
| 78 | 78 | } |
| 79 |
| r31373 | r31374 | |
|---|---|---|
| 33 | 33 | m_ram[offset - m_start_address] = data; |
| 34 | 34 | } |
| 35 | 35 | } |
| 36 |
| r31373 | r31374 | |
|---|---|---|
| 45 | 45 | { |
| 46 | 46 | m_ym2413->write(space, offset & 1, data); |
| 47 | 47 | } |
| 48 |
| r31373 | r31374 | |
|---|---|---|
| 32 | 32 | dev.m_size = size; |
| 33 | 33 | dev.m_end_address = dev.m_start_address + dev.m_size; |
| 34 | 34 | } |
| 35 |
| r31373 | r31374 | |
|---|---|---|
| 159 | 159 | } |
| 160 | 160 | } |
| 161 | 161 | } |
| 162 |
| r31373 | r31374 | |
|---|---|---|
| 178 | 178 | break; |
| 179 | 179 | } |
| 180 | 180 | } |
| 181 |
| r31373 | r31374 | |
|---|---|---|
| 421 | 421 | |
| 422 | 422 | |
| 423 | 423 | msx_slot_disk3_device::msx_slot_disk3_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 424 | ||
| 424 | : msx_slot_tc8566_disk_device(mconfig, MSX_SLOT_DISK3, "MSX Internal floppy type 3", tag, owner, clock, "msx_slot_disk3", __FILE__) | |
| 425 | 425 | { |
| 426 | 426 | } |
| 427 | 427 | |
| r31373 | r31374 | |
| 459 | 459 | return m_fdc->fifo_r(space, 5); |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | ||
| 462 | return msx_slot_rom_device::read(space, offset); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| r31373 | r31374 | |
| 638 | 638 | break; |
| 639 | 639 | } |
| 640 | 640 | } |
| 641 | ||
| 642 |
| r31373 | r31374 | |
|---|---|---|
| 62 | 62 | } |
| 63 | 63 | return 0xFF; |
| 64 | 64 | } |
| 65 | ||
| 66 |
| r31373 | r31374 | |
|---|---|---|
| 186 | 186 | break; |
| 187 | 187 | } |
| 188 | 188 | } |
| 189 |
| r31373 | r31374 | |
|---|---|---|
| 137 | 137 | else |
| 138 | 138 | { |
| 139 | 139 | UINT32 length = this->length(); |
| 140 | ||
| 140 | ||
| 141 | 141 | // determine how much space to allocate |
| 142 | 142 | UINT32 length_aligned = 0x10000; |
| 143 | ||
| 143 | ||
| 144 | 144 | if (length <= 0x2000) |
| 145 | 145 | length_aligned = 0x2000; |
| 146 | 146 | else if (length <= 0x4000) |
| r31373 | r31374 | |
| 165 | 165 | return IMAGE_INIT_FAIL; |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | // Check if there's some mapper related | |
| 168 | // Check if there's some mapper related | |
| 169 | 169 | astring extrainfo; |
| 170 | 170 | if (hashfile_extrainfo(*this, extrainfo)) |
| 171 | 171 | { |
| r31373 | r31374 | |
| 349 | 349 | { |
| 350 | 350 | return m_cartridge->read_cart(space, offset); |
| 351 | 351 | } |
| 352 | ||
| 352 | return 0xFF; | |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | |
| r31373 | r31374 | |
| 365 | 365 | |
| 366 | 366 | |
| 367 | 367 | msx_slot_yamaha_expansion_device::msx_slot_yamaha_expansion_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 368 | ||
| 368 | : msx_slot_cartridge_device(mconfig, MSX_SLOT_YAMAHA_EXPANSION, "MSX Yamaha Expansion slot", tag, owner, clock, "msx_slot_yamaha_expansion", __FILE__) | |
| 369 | 369 | { |
| 370 | 370 | } |
| 371 | 371 | |
| r31373 | r31374 | |
| 379 | 379 | m_cartridge->set_out_irq_cb(DEVCB_WRITELINE(msx_slot_cartridge_device, irq_out)); |
| 380 | 380 | } |
| 381 | 381 | } |
| 382 | ||
| 383 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ I/O Expansion Slot Devices | |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ Joystick Interface | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ Printer Interface | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | VTech PI 20 | |
| 9 | Dick Smith Electronics X-7320 | |
| 8 | VTech PI 20 | |
| 9 | Dick Smith Electronics X-7320 | |
| 10 | 10 | |
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ I/O Expansion Slot | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | 30-pin slot | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ Laser Memory Expansions | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ Floppy Controller Cartridge | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | Laser DD 20 | |
| 9 | 9 | Dick Smith Electronics X-7304 |
| 10 | 10 | |
| 11 | 11 | ***************************************************************************/ |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ Memory Expansion Slot | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | 44-pin slot | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Dick Smith VZ-200/300 RS-232 Cartridge | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | VTech Laser/VZ Memory Expansion Slot Devices | |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Dick Smith VZ-300 WordPro Cartridge | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| r31373 | r31374 | |
|---|---|---|
| 5 | 5 | a2dx1.c |
| 6 | 6 | |
| 7 | 7 | Implementation of the Decillionix DX-1 sampler card |
| 8 | ||
| 8 | ||
| 9 | 9 | *********************************************************************/ |
| 10 | 10 | |
| 11 | 11 | #include "a2dx1.h" |
| r31373 | r31374 | |
| 84 | 84 | { |
| 85 | 85 | switch (offset) |
| 86 | 86 | { |
| 87 | case 1: | |
| 87 | case 1: // ADC input | |
| 88 | 88 | return 0; |
| 89 | 89 | |
| 90 | 90 | case 3: // busy flag |
| 91 | return 0x80; | |
| 91 | return 0x80; // indicate not busy | |
| 92 | 92 | |
| 93 | case 7: | |
| 93 | case 7: // 1-bit ADC input (bit 7 of c0n1, probably) | |
| 94 | 94 | return 0; |
| 95 | 95 | } |
| 96 | 96 | |
| r31373 | r31374 | |
| 101 | 101 | { |
| 102 | 102 | switch (offset) |
| 103 | 103 | { |
| 104 | case 5: | |
| 104 | case 5: // volume | |
| 105 | 105 | m_volume = data; |
| 106 | 106 | m_dac->write_unsigned16(data*m_lastdac); |
| 107 | 107 | break; |
| r31373 | r31374 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | const device_type A2BUS_DISKIING = &device_creator<a2bus_diskiing_device>; |
| 23 | 23 | |
| 24 | #define WOZFDC_TAG | |
| 24 | #define WOZFDC_TAG "wozfdc" | |
| 25 | 25 | #define DISKII_ROM_REGION "diskii_rom" |
| 26 | 26 | |
| 27 | 27 | static SLOT_INTERFACE_START( a2_floppies ) |
| r31373 | r31374 | |
| 120 | 120 | { |
| 121 | 121 | return m_rom[offset]; |
| 122 | 122 | } |
| 123 |
| r31373 | r31374 | |
|---|---|---|
| 7 | 7 | Implementation of the Mountain Computer Music System. |
| 8 | 8 | This was sold standalone and also used as part of the alphaSyntauri |
| 9 | 9 | and SoundChaser systems. |
| 10 | ||
| 10 | ||
| 11 | 11 | *********************************************************************/ |
| 12 | 12 | |
| 13 | 13 | #include "a2mcms.h" |
| r31373 | r31374 | |
| 35 | 35 | const device_type A2BUS_MCMS1 = &device_creator<a2bus_mcms1_device>; |
| 36 | 36 | const device_type A2BUS_MCMS2 = &device_creator<a2bus_mcms2_device>; |
| 37 | 37 | |
| 38 | #define ENGINE_TAG | |
| 38 | #define ENGINE_TAG "engine" | |
| 39 | 39 | |
| 40 | 40 | #define MCFG_MCMS_IRQ_CALLBACK(_cb) \ |
| 41 | 41 | devcb = &mcms_device::set_irq_cb(*device, DEVCB_##_cb); |
| r31373 | r31374 | |
| 109 | 109 | m_mcms->control_w(space, CTRL_IRQS, 1); |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | return 0xff; | |
| 112 | return 0xff; | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | // read at Cn00: light gun in bit 7, bits 0-5 = 'random' number |
| r31373 | r31374 | |
| 130 | 130 | mcms_device *a2bus_mcms1_device::get_engine(void) |
| 131 | 131 | { |
| 132 | 132 | return m_mcms; |
| 133 | } | |
| 133 | } | |
| 134 | 134 | |
| 135 | 135 | WRITE_LINE_MEMBER(a2bus_mcms1_device::irq_w) |
| 136 | 136 | { |
| r31373 | r31374 | |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | /* |
| 211 | ||
| 211 | Sound device implementation | |
| 212 | 212 | */ |
| 213 | 213 | |
| 214 | 214 | mcms_device::mcms_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| r31373 | r31374 | |
| 257 | 257 | { |
| 258 | 258 | if (tid == 0) |
| 259 | 259 | { |
| 260 | m_write_irq(ASSERT_LINE); | |
| 260 | m_write_irq(ASSERT_LINE); | |
| 261 | 261 | // clear this IRQ in 10 cycles (?) |
| 262 | 262 | m_clrtimer->adjust(attotime::from_usec(10), 0); |
| 263 | 263 | } |
| 264 | 264 | else if (tid == 1) |
| 265 | 265 | { |
| 266 | m_write_irq(CLEAR_LINE); | |
| 266 | m_write_irq(CLEAR_LINE); | |
| 267 | 267 | } |
| 268 | 268 | } |
| 269 | 269 | |
| r31373 | r31374 | |
| 307 | 307 | } |
| 308 | 308 | else |
| 309 | 309 | { |
| 310 | for (i = 0; i < samples; i++) | |
| 310 | for (i = 0; i < samples; i++) | |
| 311 | 311 | { |
| 312 | 312 | outL[i] = outR[i] = 0; |
| 313 | 313 | } |
| r31373 | r31374 | |
| 319 | 319 | m_stream->update(); |
| 320 | 320 | if (offset >= 0x20) |
| 321 | 321 | { |
| 322 | if (offset & 1) | |
| 322 | if (offset & 1) // amp | |
| 323 | 323 | { |
| 324 | 324 | m_vols[(offset-0x21)/2] = data; |
| 325 | 325 | } |
| 326 | else | |
| 326 | else // wavetable page | |
| 327 | 327 | { |
| 328 | 328 | m_table[(offset-0x20)/2] = data; |
| 329 | 329 | } |
| 330 | 330 | } |
| 331 | 331 | else |
| 332 | 332 | { |
| 333 | if (offset & 1) | |
| 333 | if (offset & 1) // freq L | |
| 334 | 334 | { |
| 335 | 335 | if (offset == 0x1f) |
| 336 | 336 | { |
| r31373 | r31374 | |
| 344 | 344 | m_freq[reg] |= data; |
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | else | |
| 347 | else // freq H | |
| 348 | 348 | { |
| 349 | 349 | int reg = (offset/2); |
| 350 | 350 | m_freq[reg] &= 0x00ff; |
| r31373 | r31374 | |
| 369 | 369 | } |
| 370 | 370 | else |
| 371 | 371 | { |
| 372 | m_timer->adjust(attotime::zero, 0, attotime::from_hz(125)); | |
| 372 | m_timer->adjust(attotime::zero, 0, attotime::from_hz(125)); | |
| 373 | 373 | } |
| 374 | 374 | break; |
| 375 | 375 | |
| 376 | 376 | case CTRL_DMA: |
| 377 | m_enabled = (data == 0) ? false : true; | |
| 377 | m_enabled = (data == 0) ? false : true; | |
| 378 | 378 | break; |
| 379 | 379 | |
| 380 | 380 | case CTRL_MASTERVOL: |
| r31373 | r31374 | |
| 382 | 382 | break; |
| 383 | 383 | } |
| 384 | 384 | } |
| 385 |
| r31373 | r31374 | |
|---|---|---|
| 57 | 57 | MC6845_UPDATE_ROW( wangpc_lvc_device::crtc_update_row ) |
| 58 | 58 | { |
| 59 | 59 | offs_t scroll_y = (((m_scroll >> 8) + 0x15) & 0xff) * 0x80; |
| 60 | ||
| 60 | ||
| 61 | 61 | if (OPTION_80_COL) |
| 62 | 62 | { |
| 63 | 63 | for (int column = 0; column < x_count; column++) |
| 64 | 64 | { |
| 65 | 65 | offs_t addr = scroll_y + (m_scroll & 0x3f) + ((ma / 80) * 0x480) + (((ra & 0x0f) << 7) | (column & 0x7f)); |
| 66 | 66 | UINT16 data = m_video_ram[addr & 0x7fff]; |
| 67 | ||
| 67 | ||
| 68 | 68 | for (int bit = 0; bit < 8; bit++) |
| 69 | 69 | { |
| 70 | 70 | int x = (column * 8) + bit; |
| 71 | 71 | int color = (BIT(data, 15) << 1) | BIT(data, 7); |
| 72 | ||
| 72 | ||
| 73 | 73 | if (column == cursor_x) color = 0x03; |
| 74 | ||
| 74 | ||
| 75 | 75 | bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black; |
| 76 | ||
| 76 | ||
| 77 | 77 | data <<= 1; |
| 78 | 78 | } |
| 79 | 79 | } |
| r31373 | r31374 | |
| 82 | 82 | { |
| 83 | 83 | //offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + ((ma / 40) * 0x480) + (((ra & 0x0f) << 7)); |
| 84 | 84 | offs_t addr = scroll_y + ((m_scroll & 0x3f) << 1) + (y * 0x80); |
| 85 | ||
| 85 | ||
| 86 | 86 | for (int column = 0; column < x_count; column++) |
| 87 | 87 | { |
| 88 | 88 | UINT32 data = (m_video_ram[(addr + 1) & 0x7fff] << 16) | m_video_ram[addr & 0x7fff]; |
| 89 | ||
| 89 | ||
| 90 | 90 | for (int bit = 0; bit < 8; bit++) |
| 91 | 91 | { |
| 92 | 92 | int x = (column * 8) + bit; |
| 93 | 93 | int color = (BIT(data, 31) << 3) | (BIT(data, 23) << 2) | (BIT(data, 15) << 1) | BIT(data, 7); |
| 94 | ||
| 94 | ||
| 95 | 95 | if (column == cursor_x) color = 0x03; |
| 96 | ||
| 96 | ||
| 97 | 97 | bitmap.pix32(vbp + y, hbp + x) = de ? m_palette[color] : rgb_t::black; |
| 98 | ||
| 98 | ||
| 99 | 99 | data <<= 1; |
| 100 | 100 | } |
| 101 | ||
| 101 | ||
| 102 | 102 | addr += 2; |
| 103 | 103 | } |
| 104 | 104 | } |
| r31373 | r31374 | |
|---|---|---|
| 75 | 75 | { |
| 76 | 76 | offs_t addr = (y * 50) + sx; |
| 77 | 77 | UINT16 data = m_bitmap_ram[addr]; |
| 78 | ||
| 78 | ||
| 79 | 79 | for (int bit = 0; bit < 16; bit++) |
| 80 | 80 | { |
| 81 | 81 | int x = (sx * 16) + bit; |
| 82 | 82 | int color = BIT(data, 15) && de; |
| 83 | ||
| 83 | ||
| 84 | 84 | bitmap.pix32(vbp + y, hbp + x) = PALETTE_MVC[color]; |
| 85 | ||
| 85 | ||
| 86 | 86 | data <<= 1; |
| 87 | 87 | } |
| 88 | 88 | } |
| 89 | ||
| 89 | ||
| 90 | 90 | for (int column = 0; column < x_count; column++) |
| 91 | 91 | { |
| 92 | 92 | UINT16 code = m_video_ram[((ma + column) & 0x7ff)]; |
| 93 | 93 | UINT8 attr = code & 0xff; |
| 94 | ||
| 94 | ||
| 95 | 95 | UINT8 new_ra = ra + 1; |
| 96 | ||
| 96 | ||
| 97 | 97 | if (ATTR_SUPERSCRIPT) |
| 98 | 98 | { |
| 99 | 99 | new_ra = ra + 3; |
| r31373 | r31374 | |
| 102 | 102 | { |
| 103 | 103 | new_ra = ra; |
| 104 | 104 | } |
| 105 | ||
| 105 | ||
| 106 | 106 | offs_t addr = ((code >> 8) << 4) | (new_ra & 0x0f); |
| 107 | 107 | UINT16 data = m_char_ram[addr & 0xfff]; |
| 108 | ||
| 108 | ||
| 109 | 109 | if ((column == cursor_x) || (!ra && ATTR_OVERSCORE) || ((ra == 9) && ATTR_UNDERSCORE)) |
| 110 | 110 | { |
| 111 | 111 | data = 0xffff; |
| 112 | 112 | } |
| 113 | ||
| 113 | ||
| 114 | 114 | for (int bit = 0; bit < 10; bit++) |
| 115 | 115 | { |
| 116 | 116 | int x = (column * 10) + bit; |
| 117 | 117 | int color = ((BIT(data, 9) & !ATTR_BLANK) ^ ATTR_REVERSE); |
| 118 | ||
| 118 | ||
| 119 | 119 | if ((color | bitmap.pix32(vbp + y, hbp + x)) & ATTR_BOLD) color = 2; |
| 120 | 120 | if (color) bitmap.pix32(vbp + y, hbp + x) = de ? PALETTE_MVC[color] : rgb_t::black; |
| 121 | ||
| 121 | ||
| 122 | 122 | data <<= 1; |
| 123 | 123 | } |
| 124 | 124 | } |
| r31373 | r31374 | |
|---|---|---|
| 115 | 115 | break; |
| 116 | 116 | } |
| 117 | 117 | } |
| 118 |
| r31373 | r31374 | |
|---|---|---|
| 25 | 25 | // determine start address |
| 26 | 26 | // default to $4000 |
| 27 | 27 | m_start_address = 0x4000; |
| 28 | ||
| 28 | ||
| 29 | 29 | switch (size) |
| 30 | 30 | { |
| 31 | 31 | /* 8KB/16KB */ |
| 32 | 32 | case 0x2000: case 0x4000: |
| 33 | 33 | { |
| 34 | 34 | UINT16 start = rom[3] << 8 | rom[2]; |
| 35 | ||
| 35 | ||
| 36 | 36 | // start address of $0000: call address in the $4000 region: $4000, else $8000 |
| 37 | 37 | if (start == 0) |
| 38 | 38 | { |
| r31373 | r31374 | |
| 41 | 41 | else |
| 42 | 42 | m_start_address = 0x8000; |
| 43 | 43 | } |
| 44 | ||
| 44 | ||
| 45 | 45 | // start address in the $8000 region: $8000, else default |
| 46 | 46 | else if ((start & 0xc000) == 0x8000) |
| 47 | 47 | m_start_address = 0x8000; |
| 48 | ||
| 48 | ||
| 49 | 49 | break; |
| 50 | 50 | } |
| 51 | 51 | |
| r31373 | r31374 | |
| 55 | 55 | if (rom[0] != 'A' && rom[1] != 'B' && rom[0x4000] == 'A' && rom[0x4001] == 'B') |
| 56 | 56 | { |
| 57 | 57 | UINT16 start = rom[0x4003] << 8 | rom[0x4002]; |
| 58 | ||
| 58 | ||
| 59 | 59 | // start address of $0000 and call address in the $4000 region, or start address outside the $8000 region: $0000, else default |
| 60 | 60 | if ((start == 0 && (rom[0x4005] & 0xc0) == 0x40) || start < 0x8000 || start >= 0xc000) |
| 61 | 61 | m_start_address = 0; |
| 62 | 62 | } |
| 63 | ||
| 63 | ||
| 64 | 64 | break; |
| 65 | 65 | |
| 66 | 66 | /* 48KB */ |
| r31373 | r31374 | |
| 70 | 70 | m_start_address = 0x4000; |
| 71 | 71 | else |
| 72 | 72 | m_start_address = 0; |
| 73 | ||
| 73 | ||
| 74 | 74 | break; |
| 75 | ||
| 75 | ||
| 76 | 76 | /* 64KB */ |
| 77 | 77 | default: |
| 78 | 78 | m_start_address = 0; |
| r31373 | r31374 | |
| 90 | 90 | } |
| 91 | 91 | return 0xff; |
| 92 | 92 | } |
| 93 |
| r31373 | r31374 | |
|---|---|---|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 |
| r31373 | r31374 | |
|---|---|---|
| 169 | 169 | m_ym2413->write(space, offset & 1, data); |
| 170 | 170 | } |
| 171 | 171 | } |
| 172 |
| r31373 | r31374 | |
|---|---|---|
| 180 | 180 | { |
| 181 | 181 | // Trigger IRQ on the maincpu |
| 182 | 182 | // The 8950 seems to trigger an irq on reset, this causes an infinite loop of continuously triggering |
| 183 | ||
| 183 | // the MSX's interrupt handler. The 8950 irq will never be cleared the nms1205's irq handler hook hasn't | |
| 184 | 184 | // been installed yet. |
| 185 | // | |
| 185 | // m_out_irq_cb(state); | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | |
| r31373 | r31374 | |
| 383 | 383 | { |
| 384 | 384 | return m_io_config->read(); |
| 385 | 385 | } |
| 386 |
| r31373 | r31374 | |
|---|---|---|
| 136 | 136 | UINT32 size = get_rom_size(); |
| 137 | 137 | |
| 138 | 138 | if ( size > 256 * 0x4000 ) |
| 139 | { | |
| 139 | { | |
| 140 | 140 | fatalerror("ascii16: ROM is too big\n"); |
| 141 | 141 | } |
| 142 | 142 | |
| r31373 | r31374 | |
| 371 | 371 | UINT32 size = get_rom_size(); |
| 372 | 372 | |
| 373 | 373 | if ( size > 128 * 0x4000 ) |
| 374 | { | |
| 374 | { | |
| 375 | 375 | fatalerror("ascii16_sram: ROM is too big\n"); |
| 376 | 376 | } |
| 377 | 377 | |
| r31373 | r31374 | |
| 439 | 439 | } |
| 440 | 440 | } |
| 441 | 441 | } |
| 442 |
| r31373 | r31374 | |
|---|---|---|
| 155 | 155 | break; |
| 156 | 156 | } |
| 157 | 157 | } |
| 158 |
| r31373 | r31374 | |
|---|---|---|
| 58 | 58 | m_selected_bank = data; |
| 59 | 59 | restore_banks(); |
| 60 | 60 | } |
| 61 |
| r31373 | r31374 | |
|---|---|---|
| 78 | 78 | } |
| 79 | 79 | setup_bank(); |
| 80 | 80 | } |
| 81 |
| r31373 | r31374 | |
|---|---|---|
| 63 | 63 | restore_banks(); |
| 64 | 64 | } |
| 65 | 65 | } |
| 66 |
| r31373 | r31374 | |
|---|---|---|
| 147 | 147 | switch (offset & 0x3fff) |
| 148 | 148 | { |
| 149 | 149 | case 0x3ff0: // YM-2151 status read |
| 150 | case 0x3ff1: | |
| 150 | case 0x3ff1: // YM-2151 status read mirror? | |
| 151 | 151 | return m_ym2151->status_r(space, 0); |
| 152 | 152 | |
| 153 | 153 | case 0x3ff2: // YM-2148 keyboard column read |
| r31373 | r31374 | |
| 155 | 155 | case 0x3ff4: // YM-2148 -- |
| 156 | 156 | case 0x3ff5: // YM-2148 MIDI UART data read register |
| 157 | 157 | case 0x3ff6: // YM-2148 MIDI UART status register |
| 158 | // ------x- - 1 = received a byte/receive buffer full? | |
| 159 | // -------x - 1 = ready to send next byte/send buffer empty? | |
| 158 | // ------x- - 1 = received a byte/receive buffer full? | |
| 159 | // -------x - 1 = ready to send next byte/send buffer empty? | |
| 160 | 160 | return m_ym2148->read(space, offset & 7); |
| 161 | 161 | } |
| 162 | 162 | |
| r31373 | r31374 | |
| 186 | 186 | case 0x3ff4: // YM-2148 External IRQ vector |
| 187 | 187 | case 0x3ff5: // YM-2148 MIDI UART data write register |
| 188 | 188 | case 0x3ff6: // YM-2148 MIDI UART command register |
| 189 | // On startup the sfg01 writes 0x80 | |
| 190 | // followed by 0x05. | |
| 191 | // Other write seen in the code: 0x15 | |
| 192 | // | |
| 193 | // x------- - 1 = reset | |
| 194 | // -----x-- - 1 = enable receiving / sending midi data | |
| 195 | // -------x - 1 = enable receiving / sending midi data | |
| 189 | // On startup the sfg01 writes 0x80 | |
| 190 | // followed by 0x05. | |
| 191 | // Other write seen in the code: 0x15 | |
| 192 | // | |
| 193 | // x------- - 1 = reset | |
| 194 | // -----x-- - 1 = enable receiving / sending midi data | |
| 195 | // -------x - 1 = enable receiving / sending midi data | |
| 196 | 196 | m_ym2148->write(space, offset & 7, data); |
| 197 | 197 | break; |
| 198 | 198 | |
| r31373 | r31374 | |
| 201 | 201 | break; |
| 202 | 202 | } |
| 203 | 203 | } |
| 204 |
| r31373 | r31374 | |
|---|---|---|
| 38 | 38 | SLOT_INTERFACE_INTERNAL("superloderunner", MSX_CART_SUPERLODERUNNER) |
| 39 | 39 | SLOT_INTERFACE_INTERNAL("synthesizer", MSX_CART_SYNTHESIZER) |
| 40 | 40 | SLOT_INTERFACE_INTERNAL("cross_blaim", MSX_CART_CROSSBLAIM) |
| 41 | // | |
| 41 | // SLOT_INTERFACE_INTERNAL("disk_rom", MSX_CART_DISK_ROM) | |
| 42 | 42 | SLOT_INTERFACE_INTERNAL("korean_80in1", MSX_CART_KOREAN_80IN1) |
| 43 | 43 | SLOT_INTERFACE_INTERNAL("korean_90in1", MSX_CART_KOREAN_90IN1) |
| 44 | 44 | SLOT_INTERFACE_INTERNAL("korean_126in1", MSX_CART_KOREAN_126IN1) |
| r31373 | r31374 | |
| 92 | 92 | SLOT_INTERFACE("sfg01", MSX_CART_SFG01) |
| 93 | 93 | SLOT_INTERFACE("sfg05", MSX_CART_SFG05) |
| 94 | 94 | SLOT_INTERFACE_END |
| 95 |
| r31373 | r31374 | |
|---|---|---|
| 309 | 309 | SLOT_INTERFACE("hxmu901", MSX_AUDIO_KB_HXMU901) |
| 310 | 310 | SLOT_INTERFACE("nms1160", MSX_AUDIO_KB_NMS1160) |
| 311 | 311 | SLOT_INTERFACE_END |
| 312 | ||
| 313 |
| r31373 | r31374 | |
|---|---|---|
| 712 | 712 | } |
| 713 | 713 | switch (offset & 0x1800) |
| 714 | 714 | { |
| 715 | case 0x1000: | |
| 715 | case 0x1000: // 0x9000-0x97ff | |
| 716 | 716 | m_selected_bank[2] = data; |
| 717 | 717 | m_scc_active = ( ( data & 0x3f ) == 0x3f ); |
| 718 | 718 | setup_bank(2); |
| 719 | 719 | break; |
| 720 | 720 | |
| 721 | case 0x1800: | |
| 721 | case 0x1800: // 0x9800-0x9fff | |
| 722 | 722 | if ( m_scc_active ) |
| 723 | 723 | { |
| 724 | 724 | offset &= 0xff; |
| 725 | ||
| 725 | ||
| 726 | 726 | if (offset < 0x80) |
| 727 | 727 | { |
| 728 | 728 | m_k052539->k051649_waveform_w(space, offset, data); |
| r31373 | r31374 | |
| 837 | 837 | // The Snatcher Sound cartridge has 64KB RAM available by selecting ram banks 0-7 |
| 838 | 838 | |
| 839 | 839 | for (int i = 0; i < 8; i++) |
| 840 | { | |
| 840 | { | |
| 841 | 841 | m_ram_bank[i] = get_ram_base() + i * 0x2000; |
| 842 | 842 | } |
| 843 | 843 | } |
| r31373 | r31374 | |
| 933 | 933 | { |
| 934 | 934 | return m_vlm5030->bsy() ? 0x10 : 0x00; |
| 935 | 935 | } |
| 936 |
| r31373 | r31374 | |
|---|---|---|
| 294 | 294 | setup_bank(bank); |
| 295 | 295 | } |
| 296 | 296 | } |
| 297 |
| r31373 | r31374 | |
|---|---|---|
| 108 | 108 | m_mdthru->write_txd(state); |
| 109 | 109 | m_tmpz84c015af->rxb_w(state); |
| 110 | 110 | } |
| 111 | ||
| 112 |
| r31373 | r31374 | |
|---|---|---|
| 111 | 111 | break; |
| 112 | 112 | } |
| 113 | 113 | } |
| 114 |
| r31373 | r31374 | |
|---|---|---|
| 74 | 74 | m_bank_base[1] = get_rom_base() + m_selected_bank * 0x4000; |
| 75 | 75 | } |
| 76 | 76 | } |
| 77 |
| r31373 | r31374 | |
|---|---|---|
| 75 | 75 | break; |
| 76 | 76 | } |
| 77 | 77 | } |
| 78 |
| r31373 | r31374 | |
|---|---|---|
| 60 | 60 | { |
| 61 | 61 | return ((m_7f & 0x03) == 0x03) ? 0xda : 0xff; |
| 62 | 62 | } |
| 63 |
| r31373 | r31374 | |
|---|---|---|
| 68 | 68 | logerror("msx_cart_super_swangi: unhandled write %02x to %04x\n", data, offset); |
| 69 | 69 | } |
| 70 | 70 | } |
| 71 |
| r31373 | r31374 | |
|---|---|---|
| 543 | 543 | |
| 544 | 544 | if (count == 4876) |
| 545 | 545 | { |
| 546 | // | |
| 546 | // printf("Li Cheng %d\n", count); | |
| 547 | 547 | type = GB_MBC_LICHENG; |
| 548 | 548 | } |
| 549 | 549 | if (count == 4138 || count == 4125) |
| 550 | 550 | { |
| 551 | 551 | // Zhi Huan Wang uses 4138 |
| 552 | 552 | // most sintax use 4125 |
| 553 | // | |
| 553 | // printf("Sintax %d!\n", count); | |
| 554 | 554 | type = GB_MBC_SINTAX; |
| 555 | 555 | } |
| 556 | 556 | } |
| r31373 | r31374 | |
|---|---|---|
| 232 | 232 | { |
| 233 | 233 | UINT16 address = (m_page << 12) | (((ma + column) & 0xfff) << 3) | (ra & 0x07); |
| 234 | 234 | UINT8 data = m_video_ram[address]; |
| 235 | ||
| 235 | ||
| 236 | 236 | for (int bit = 0; bit < 8; bit++) |
| 237 | 237 | { |
| 238 | 238 | int x = (column * 8) + bit; |
| 239 | 239 | int color = (m_flash ? 0 : BIT(data, bit)) && de; |
| 240 | ||
| 240 | ||
| 241 | 241 | bitmap.pix32(vbp + y, hbp + x) = m_palette->pen(color); |
| 242 | 242 | } |
| 243 | 243 | } |
| r31373 | r31374 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | license: BSD-3-Clause |
| 6 | 6 | copyright-holders: R. Belmont |
| 7 | ||
| 7 | ||
| 8 | 8 | ***************************************************************************/ |
| 9 | 9 | |
| 10 | 10 | #include "emu.h" |
| r31373 | r31374 | |
| 203 | 203 | { |
| 204 | 204 | m_a1bus->install_bank(start, end, mask, mirror, tag, data); |
| 205 | 205 | } |
| 206 |
| r31373 | r31374 | |
|---|---|---|
| 3 | 3 | a1cassette.c |
| 4 | 4 | |
| 5 | 5 | Apple I Cassette Interface |
| 6 | ||
| 6 | ||
| 7 | 7 | *********************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "a1cassette.h" |
| r31373 | r31374 | |
| 196 | 196 | |
| 197 | 197 | cassette_toggle_output(); |
| 198 | 198 | } |
| 199 |
| r31373 | r31374 | |
|---|---|---|
| 2 | 2 | |
| 3 | 3 | a1cffa.c |
| 4 | 4 | |
| 5 | Rich Dreher's Compact Flash for Apple I | |
| 6 | ||
| 5 | Rich Dreher's Compact Flash for Apple I | |
| 6 | ||
| 7 | 7 | *********************************************************************/ |
| 8 | 8 | |
| 9 | 9 | #include "a1cffa.h" |
| r31373 | r31374 | |
| 153 | 153 | |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 |
| r31373 | r31374 | |
|---|---|---|
| 17 | 17 | // MACROS/CONSTANTS |
| 18 | 18 | //************************************************************************** |
| 19 | 19 | |
| 20 | #define WD1772_TAG | |
| 20 | #define WD1772_TAG "wd1772" | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | |
| r31373 | r31374 | |
| 238 | 238 | { |
| 239 | 239 | m_fdc->write(space, offset & 0x03, data); |
| 240 | 240 | } |
| 241 | ||
| 241 | ||
| 242 | 242 | if (offset == 0x1e000) |
| 243 | 243 | { |
| 244 | 244 | /* |
| 245 | 245 | |
| 246 | | |
| 246 | bit description | |
| 247 | 247 | |
| 248 | 0 DRIVE1 | |
| 249 | 1 DRIVE0 | |
| 250 | 2 MOTOR | |
| 251 | 3 SIDE | |
| 252 | 4 | |
| 253 | 5 | |
| 254 | 6 | |
| 255 | 7 | |
| 248 | 0 DRIVE1 | |
| 249 | 1 DRIVE0 | |
| 250 | 2 MOTOR | |
| 251 | 3 SIDE | |
| 252 | 4 | |
| 253 | 5 | |
| 254 | 6 | |
| 255 | 7 | |
| 256 | 256 | |
| 257 | 257 | */ |
| 258 | 258 | |
| 259 | 259 | floppy_image_device *floppy = NULL; |
| 260 | 260 | |
| 261 | if (BIT(data, 1)) | |
| 261 | if (BIT(data, 1)) | |
| 262 | 262 | { |
| 263 | 263 | floppy = m_floppy0->get_device(); |
| 264 | 264 | } |
| r31373 | r31374 | |
|---|---|---|
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | 5 | CST QL Disc Interface emulation |
| 6 | ||
| 6 | ||
| 7 | 7 | Copyright MESS Team. |
| 8 | 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| 9 | 9 |
| r31373 | r31374 | |
|---|---|---|
| 17 | 17 | // MACROS/CONSTANTS |
| 18 | 18 | //************************************************************************** |
| 19 | 19 | |
| 20 | #define WD1772_TAG "ic3" | |
| 21 | #define TTL74273_TAG "ic10" | |
| 22 | #define CENTRONICS_TAG "j2" | |
| 20 | #define WD1772_TAG "ic3" | |
| 21 | #define TTL74273_TAG "ic10" | |
| 22 | #define CENTRONICS_TAG "j2" | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| r31373 | r31374 | |
| 289 | 289 | |
| 290 | 290 | m_latch->write(0); |
| 291 | 291 | m_centronics->write_strobe(1); |
| 292 | ||
| 292 | ||
| 293 | 293 | m_fd6 = 0; |
| 294 | 294 | m_fd7 = 0; |
| 295 | 295 | m_status = 0; |
| r31373 | r31374 | |
| 313 | 313 | case 0: |
| 314 | 314 | data = m_fdc->read(space, offset & 0x03); |
| 315 | 315 | break; |
| 316 | ||
| 316 | ||
| 317 | 317 | case 3: |
| 318 | 318 | /* |
| 319 | 319 | |
| 320 | | |
| 320 | bit description | |
| 321 | 321 | |
| 322 | 0 BUSY | |
| 323 | 1 mouse pin 8 (middle button) | |
| 324 | 2 mouse pin 1 (right button) | |
| 325 | 3 mouse pin 2 (left button) | |
| 326 | 4 mouse pin 4 flip-flop Q (Y direction) | |
| 327 | 5 mouse pin 3 flip-flop Q (X direction) | |
| 328 | 6 INT3 (Y interrupt) | |
| 329 | 7 INT2 (X interrupt) | |
| 322 | 0 BUSY | |
| 323 | 1 mouse pin 8 (middle button) | |
| 324 | 2 mouse pin 1 (right button) | |
| 325 | 3 mouse pin 2 (left button) | |
| 326 | 4 mouse pin 4 flip-flop Q (Y direction) | |
| 327 | 5 mouse pin 3 flip-flop Q (X direction) | |
| 328 | 6 INT3 (Y interrupt) | |
| 329 | 7 INT2 (X interrupt) | |
| 330 | 330 | |
| 331 | 331 | */ |
| 332 | 332 | |
| r31373 | r31374 | |
| 378 | 378 | { |
| 379 | 379 | /* |
| 380 | 380 | |
| 381 | | |
| 381 | bit description | |
| 382 | 382 | |
| 383 | 0 SIDE ONE | |
| 384 | 1 DSEL0 | |
| 385 | 2 DSEL1 | |
| 386 | 3 M ON0 | |
| 387 | 4 /DDEN | |
| 388 | 5 STROBE inverted | |
| 389 | 6 enable printer interrupt (GAL pin 11) | |
| 390 | 7 enable mouse interrupt (GAL pin 9) | |
| 383 | 0 SIDE ONE | |
| 384 | 1 DSEL0 | |
| 385 | 2 DSEL1 | |
| 386 | 3 M ON0 | |
| 387 | 4 /DDEN | |
| 388 | 5 STROBE inverted | |
| 389 | 6 enable printer interrupt (GAL pin 11) | |
| 390 | 7 enable mouse interrupt (GAL pin 9) | |
| 391 | 391 | |
| 392 | 392 | */ |
| 393 | 393 | |
| 394 | 394 | floppy_image_device *floppy = NULL; |
| 395 | 395 | |
| 396 | if (BIT(data, 1)) | |
| 396 | if (BIT(data, 1)) | |
| 397 | 397 | { |
| 398 | 398 | floppy = m_floppy0->get_device(); |
| 399 | 399 | } |
| r31373 | r31374 | |
|---|---|---|
| 133 | 133 | |
| 134 | 134 | SLOT_INTERFACE_START( ql_rom_cartridge_cards ) |
| 135 | 135 | SLOT_INTERFACE("mhd", MIRACLE_HARD_DISK) |
| 136 | ||
| 136 | ||
| 137 | 137 | // the following need ROMs from the software list |
| 138 | 138 | SLOT_INTERFACE_INTERNAL("standard", QL_STANDARD_ROM_CARTRIDGE) |
| 139 | 139 | SLOT_INTERFACE_END |
| r31373 | r31374 | |
|---|---|---|
| 17 | 17 | // MACROS/CONSTANTS |
| 18 | 18 | //************************************************************************** |
| 19 | 19 | |
| 20 | #define WD1772_TAG "wd1772" | |
| 21 | #define TTL74273_TAG "ttl74273" | |
| 22 | #define CENTRONICS_TAG "centronics" | |
| 20 | #define WD1772_TAG "wd1772" | |
| 21 | #define TTL74273_TAG "ttl74273" | |
| 22 | #define CENTRONICS_TAG "centronics" | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| r31373 | r31374 | |
| 170 | 170 | case 0: |
| 171 | 171 | data = m_fdc->read(space, offset & 0x03); |
| 172 | 172 | break; |
| 173 | ||
| 173 | ||
| 174 | 174 | case 3: |
| 175 | 175 | /* |
| 176 | 176 | |
| 177 | | |
| 177 | bit description | |
| 178 | 178 | |
| 179 | 0 BUSY | |
| 180 | 1 | |
| 181 | 2 | |
| 182 | 3 | |
| 183 | 4 | |
| 184 | 5 | |
| 185 | 6 | |
| 186 | 7 | |
| 179 | 0 BUSY | |
| 180 | 1 | |
| 181 | 2 | |
| 182 | 3 | |
| 183 | 4 | |
| 184 | 5 | |
| 185 | 6 | |
| 186 | 7 | |
| 187 | 187 | |
| 188 | 188 | */ |
| 189 | 189 | |
| r31373 | r31374 | |
| 221 | 221 | { |
| 222 | 222 | /* |
| 223 | 223 | |
| 224 | | |
| 224 | bit description | |
| 225 | 225 | |
| 226 | 0 SIDE ONE | |
| 227 | 1 DSEL0 | |
| 228 | 2 DSEL1 | |
| 229 | 3 M ON0 | |
| 230 | 4 /DDEN | |
| 231 | 5 STROBE inverted | |
| 232 | 6 enable printer interrupt | |
| 233 | 7 | |
| 226 | 0 SIDE ONE | |
| 227 | 1 DSEL0 | |
| 228 | 2 DSEL1 | |
| 229 | 3 M ON0 | |
| 230 | 4 /DDEN | |
| 231 | 5 STROBE inverted | |
| 232 | 6 enable printer interrupt | |
| 233 | 7 | |
| 234 | 234 | |
| 235 | 235 | */ |
| 236 | 236 | |
| 237 | 237 | floppy_image_device *floppy = NULL; |
| 238 | 238 | |
| 239 | if (BIT(data, 1)) | |
| 239 | if (BIT(data, 1)) | |
| 240 | 240 | { |
| 241 | 241 | floppy = m_floppy0->get_device(); |
| 242 | 242 | } |
| r31373 | r31374 | |
|---|---|---|
| 269 | 269 | case 0: case 0x0e: case 0x0f: |
| 270 | 270 | m_ata->write_cs1(space, 0x05, data, 0xff); |
| 271 | 271 | break; |
| 272 | ||
| 272 | ||
| 273 | 273 | case 0x08: case 0x0a: case 0x0c: |
| 274 | 274 | m_ata_data = (data << 8) | (m_ata_data & 0xff); |
| 275 | 275 | break; |
| r31373 | r31374 | |
|---|---|---|
| 2 | 2 | // copyright-holders:Curt Coder |
| 3 | 3 | /********************************************************************** |
| 4 | 4 | |
| 5 | ||
| 5 | Cumana Floppy Disk Interface emulation | |
| 6 | 6 | |
| 7 | 7 | Copyright MESS Team. |
| 8 | 8 | Visit http://mamedev.org for licensing and usage restrictions. |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Buddha | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | Zorro-II IDE controller | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Commodore A2052 | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | Zorro-II RAM Expansion (0.5, 1 or 2 MB) | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Commodore A2232 | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | Zorro-II Serial Card | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Datel Action Replay | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | Freezer cartridge for Amiga 500 and Amiga 2000 | |
| 9 | 9 | |
| 10 | Skeleton device, just loads the ROMs and generates the NMI | |
| 11 | for now. | |
| 10 | Skeleton device, just loads the ROMs and generates the NMI | |
| 11 | for now. | |
| 12 | 12 | |
| 13 | Hardware notes: | |
| 14 | - http://www.mways.co.uk/amiga/howtocode/text/actionreplay.php | |
| 13 | Hardware notes: | |
| 14 | - http://www.mways.co.uk/amiga/howtocode/text/actionreplay.php | |
| 15 | 15 | |
| 16 | 16 | ***************************************************************************/ |
| 17 | 17 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Amiga Zorro Slots | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | 86-pin Expansion Slot (Zorro-I), Zorro-II, Zorro-III | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Amiga Zorro Cards | |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Commodore A590 / A2091 | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | DMAC based HD controller for the Amiga 500 and Zorro-II | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 84 | 84 | MC6845_UPDATE_ROW( c64_xl80_device::crtc_update_row ) |
| 85 | 85 | { |
| 86 | 86 | const pen_t *pen = m_palette->pens(); |
| 87 | ||
| 87 | ||
| 88 | 88 | for (int column = 0; column < x_count; column++) |
| 89 | 89 | { |
| 90 | 90 | UINT8 code = m_ram[((ma + column) & 0x7ff)]; |
| 91 | 91 | UINT16 addr = (code << 3) | (ra & 0x07); |
| 92 | 92 | UINT8 data = m_char_rom->base()[addr & 0x7ff]; |
| 93 | ||
| 93 | ||
| 94 | 94 | if (column == cursor_x) |
| 95 | 95 | { |
| 96 | 96 | data = 0xff; |
| 97 | 97 | } |
| 98 | ||
| 98 | ||
| 99 | 99 | for (int bit = 0; bit < 8; bit++) |
| 100 | 100 | { |
| 101 | 101 | int x = (column * 8) + bit; |
| 102 | 102 | int color = BIT(data, 7) && de; |
| 103 | ||
| 103 | ||
| 104 | 104 | bitmap.pix32(vbp + y, hbp + x) = pen[color]; |
| 105 | ||
| 105 | ||
| 106 | 106 | data <<= 1; |
| 107 | 107 | } |
| 108 | 108 | } |
| r31373 | r31374 | |
|---|---|---|
| 150 | 150 | MCFG_TPI6525_OUT_PB_CB(DEVWRITE8(IEEE488_TAG, ieee488_device, dio_w)) |
| 151 | 151 | MCFG_TPI6525_IN_PC_CB(READ8(c64_ieee488_device, tpi_pc_r)) |
| 152 | 152 | MCFG_TPI6525_OUT_PC_CB(WRITE8(c64_ieee488_device, tpi_pc_w)) |
| 153 | ||
| 153 | ||
| 154 | 154 | MCFG_CBM_IEEE488_ADD(NULL) |
| 155 | 155 | MCFG_C64_PASSTHRU_EXPANSION_SLOT_ADD() |
| 156 | 156 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 74 | 74 | |
| 75 | 75 | void SCSI_PORT_DEVICE::device_start() |
| 76 | 76 | { |
| 77 | const char *deviceName[] = | |
| 77 | const char *deviceName[] = | |
| 78 | 78 | { |
| 79 | 79 | SCSI_PORT_DEVICE1, |
| 80 | 80 | SCSI_PORT_DEVICE2, |
| r31373 | r31374 | |
|---|---|---|
| 124 | 124 | |
| 125 | 125 | void scsihle_device::data_out(UINT8 data) |
| 126 | 126 | { |
| 127 | // | |
| 127 | // printf( "%s data out %02x\n", tag(), data ); | |
| 128 | 128 | output_data0(BIT(data, 0)); |
| 129 | 129 | output_data1(BIT(data, 1)); |
| 130 | 130 | output_data2(BIT(data, 2)); |
| r31373 | r31374 | |
| 396 | 396 | |
| 397 | 397 | WRITE_LINE_MEMBER( scsihle_device::input_sel ) |
| 398 | 398 | { |
| 399 | // | |
| 399 | // printf( "sel %d %d %02x\n", state, m_phase, m_input_data ); | |
| 400 | 400 | switch (m_phase) |
| 401 | 401 | { |
| 402 | 402 | case SCSI_PHASE_BUS_FREE: |
| r31373 | r31374 | |
|---|---|---|
| 365 | 365 | MCFG_TPI6525_IN_PB_CB(READ8(c1551_device, tpi1_pb_r)) |
| 366 | 366 | MCFG_TPI6525_IN_PC_CB(READ8(c1551_device, tpi1_pc_r)) |
| 367 | 367 | MCFG_TPI6525_OUT_PC_CB(WRITE8(c1551_device, tpi1_pc_w)) |
| 368 | ||
| 368 | ||
| 369 | 369 | MCFG_DEVICE_ADD(C64H156_TAG, C64H156, XTAL_16MHz) |
| 370 | 370 | MCFG_64H156_BYTE_CALLBACK(DEVWRITELINE(C64H156_TAG, c64h156_device, atni_w)) |
| 371 | 371 | MCFG_FLOPPY_DRIVE_ADD(C64H156_TAG":0", c1551_floppies, "525ssqd", c1551_device::floppy_formats) |
| r31373 | r31374 | |
|---|---|---|
| 4976 | 4976 | } |
| 4977 | 4977 | } |
| 4978 | 4978 | } |
| 4979 |
| r31373 | r31374 | |
|---|---|---|
| 310 | 310 | image_battery_load_by_name - retrieves the battery |
| 311 | 311 | backed RAM for an image. A filename may be supplied |
| 312 | 312 | to the function. |
| 313 | ||
| 313 | ||
| 314 | 314 | The function comes in two flavors, depending on |
| 315 | ||
| 315 | what should happen when no battery is available: | |
| 316 | 316 | we could fill the memory with a given value, or |
| 317 | pass a default battery (for a pre-initialized | |
| 317 | pass a default battery (for a pre-initialized | |
| 318 | 318 | battery from factory) |
| 319 | 319 | -------------------------------------------------*/ |
| 320 | 320 | |
| r31373 | r31374 | |
| 339 | 339 | { |
| 340 | 340 | file_error filerr; |
| 341 | 341 | int bytes_read = 0; |
| 342 | ||
| 342 | ||
| 343 | 343 | assert_always(buffer && (length > 0), "Must specify sensical buffer/length"); |
| 344 | ||
| 344 | ||
| 345 | 345 | /* try to open the battery file and read it in, if possible */ |
| 346 | 346 | emu_file file(options.nvram_directory(), OPEN_FLAG_READ); |
| 347 | 347 | filerr = file.open(filename); |
| r31373 | r31374 | |
|---|---|---|
| 83 | 83 | device_memory_interface(mconfig, *this), |
| 84 | 84 | m_space_config("videoram", ENDIANNESS_LITTLE, 8, 17, 0, NULL, *ADDRESS_MAP_NAME(tms3556)), |
| 85 | 85 | m_reg_access_phase(0), |
| 86 | m_row_col_written(0), | |
| 87 | m_bamp_written(0), | |
| 88 | m_colrow(0), | |
| 89 | m_vdp_acmpxy_mode(dma_write), | |
| 90 | m_vdp_acmpxy(0), | |
| 91 | m_vdp_acmp(0), | |
| 92 | m_init_read(0), | |
| 86 | m_row_col_written(0), | |
| 87 | m_bamp_written(0), | |
| 88 | m_colrow(0), | |
| 89 | m_vdp_acmpxy_mode(dma_write), | |
| 90 | m_vdp_acmpxy(0), | |
| 91 | m_vdp_acmp(0), | |
| 92 | m_init_read(0), | |
| 93 | 93 | m_scanline(0), |
| 94 | 94 | m_blink(0), |
| 95 | 95 | m_blink_count(0), |
| r31373 | r31374 | |
| 113 | 113 | save_item(NAME(m_control_regs)); |
| 114 | 114 | save_item(NAME(m_address_regs)); |
| 115 | 115 | save_item(NAME(m_reg_access_phase)); |
| 116 | save_item(NAME(m_row_col_written)); | |
| 117 | save_item(NAME(m_bamp_written)); | |
| 118 | save_item(NAME(m_colrow)); | |
| 116 | save_item(NAME(m_row_col_written)); | |
| 117 | save_item(NAME(m_bamp_written)); | |
| 118 | save_item(NAME(m_colrow)); | |
| 119 | 119 | // save_item(NAME(m_vdp_acmpxy_mode)); // FIXME : mame cannot save enum |
| 120 | save_item(NAME(m_vdp_acmpxy)); | |
| 121 | save_item(NAME(m_vdp_acmp)); | |
| 120 | save_item(NAME(m_vdp_acmpxy)); | |
| 121 | save_item(NAME(m_vdp_acmp)); | |
| 122 | 122 | save_item(NAME(m_scanline)); |
| 123 | 123 | save_item(NAME(m_blink)); |
| 124 | 124 | save_item(NAME(m_blink_count)); |
| r31373 | r31374 | |
| 148 | 148 | |
| 149 | 149 | READ8_MEMBER( tms3556_device::vram_r ) |
| 150 | 150 | { |
| 151 | UINT8 ret; | |
| 152 | if (m_bamp_written) { | |
| 153 | m_bamp_written=false; | |
| 154 | m_vdp_acmpxy_mode=dma_write; | |
| 155 | if (m_init_read) | |
| 156 | m_vdp_acmp=VDP_BAMP; | |
| 157 | else | |
| 158 | m_vdp_acmp=(VDP_BAMP-1)&0xFFFF; | |
| 159 | } | |
| 151 | UINT8 ret; | |
| 152 | if (m_bamp_written) { | |
| 153 | m_bamp_written=false; | |
| 154 | m_vdp_acmpxy_mode=dma_write; | |
| 155 | if (m_init_read) | |
| 156 | m_vdp_acmp=VDP_BAMP; | |
| 157 | else | |
| 158 | m_vdp_acmp=(VDP_BAMP-1)&0xFFFF; | |
| 159 | } | |
| 160 | 160 | |
| 161 | if (m_row_col_written) { | |
| 162 | m_row_col_written=0; | |
| 163 | m_vdp_acmpxy_mode=dma_read; | |
| 164 | if (m_init_read) | |
| 165 | m_vdp_acmpxy=m_colrow; | |
| 166 | else | |
| 167 | m_vdp_acmpxy=(m_colrow-1)&0xFFFF; | |
| 168 | } | |
| 161 | if (m_row_col_written) { | |
| 162 | m_row_col_written=0; | |
| 163 | m_vdp_acmpxy_mode=dma_read; | |
| 164 | if (m_init_read) | |
| 165 | m_vdp_acmpxy=m_colrow; | |
| 166 | else | |
| 167 | m_vdp_acmpxy=(m_colrow-1)&0xFFFF; | |
| 168 | } | |
| 169 | 169 | |
| 170 | m_init_read=false; | |
| 171 | if (m_vdp_acmpxy_mode==dma_read) { | |
| 172 | ret=readbyte(m_vdp_acmpxy); | |
| 173 | m_vdp_acmpxy++; | |
| 174 | if (m_vdp_acmpxy==VDP_BAMTF) m_vdp_acmpxy=VDP_BAMP; | |
| 175 | } else { | |
| 176 | ret=readbyte(m_vdp_acmp); | |
| 177 | m_vdp_acmp++; | |
| 178 | if (m_vdp_acmp==VDP_BAMTF) m_vdp_acmp=VDP_BAMP; | |
| 179 | } | |
| 180 | return ret; | |
| 170 | m_init_read=false; | |
| 171 | if (m_vdp_acmpxy_mode==dma_read) { | |
| 172 | ret=readbyte(m_vdp_acmpxy); | |
| 173 | m_vdp_acmpxy++; | |
| 174 | if (m_vdp_acmpxy==VDP_BAMTF) m_vdp_acmpxy=VDP_BAMP; | |
| 175 | } else { | |
| 176 | ret=readbyte(m_vdp_acmp); | |
| 177 | m_vdp_acmp++; | |
| 178 | if (m_vdp_acmp==VDP_BAMTF) m_vdp_acmp=VDP_BAMP; | |
| 179 | } | |
| 180 | return ret; | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | //------------------------------------------------- |
| r31373 | r31374 | |
| 186 | 186 | |
| 187 | 187 | WRITE8_MEMBER( tms3556_device::vram_w ) |
| 188 | 188 | { |
| 189 | if (m_bamp_written) { | |
| 190 | m_bamp_written=false; | |
| 191 | m_vdp_acmpxy_mode=dma_read; | |
| 192 | m_vdp_acmp=VDP_BAMP; | |
| 193 | } | |
| 189 | if (m_bamp_written) { | |
| 190 | m_bamp_written=false; | |
| 191 | m_vdp_acmpxy_mode=dma_read; | |
| 192 | m_vdp_acmp=VDP_BAMP; | |
| 193 | } | |
| 194 | 194 | |
| 195 | if (m_row_col_written) { | |
| 196 | m_row_col_written=0; | |
| 197 | m_vdp_acmpxy_mode=dma_write; | |
| 198 | m_vdp_acmpxy=m_colrow; | |
| 199 | } | |
| 195 | if (m_row_col_written) { | |
| 196 | m_row_col_written=0; | |
| 197 | m_vdp_acmpxy_mode=dma_write; | |
| 198 | m_vdp_acmpxy=m_colrow; | |
| 199 | } | |
| 200 | 200 | |
| 201 | if (m_vdp_acmpxy_mode==dma_write) { | |
| 202 | writebyte(m_vdp_acmpxy,data); | |
| 203 | m_vdp_acmpxy++; | |
| 204 | if (m_vdp_acmpxy==VDP_BAMTF) m_vdp_acmpxy=VDP_BAMP; | |
| 205 | } else { | |
| 206 | writebyte(m_vdp_acmp,data); | |
| 207 | m_vdp_acmp++; | |
| 208 | if (m_vdp_acmp==VDP_BAMTF) m_vdp_acmp=VDP_BAMP; | |
| 209 | } | |
| 201 | if (m_vdp_acmpxy_mode==dma_write) { | |
| 202 | writebyte(m_vdp_acmpxy,data); | |
| 203 | m_vdp_acmpxy++; | |
| 204 | if (m_vdp_acmpxy==VDP_BAMTF) m_vdp_acmpxy=VDP_BAMP; | |
| 205 | } else { | |
| 206 | writebyte(m_vdp_acmp,data); | |
| 207 | m_vdp_acmp++; | |
| 208 | if (m_vdp_acmp==VDP_BAMTF) m_vdp_acmp=VDP_BAMP; | |
| 209 | } | |
| 210 | 210 | |
| 211 | 211 | } |
| 212 | 212 | |
| r31373 | r31374 | |
| 220 | 220 | if (LOG) logerror("TMS3556 Reg Read: %06x\n", offset); |
| 221 | 221 | |
| 222 | 222 | int reply = 0; // FIXME : will send internal status (VBL, HBL...) |
| 223 | ||
| 223 | m_reg_access_phase=0; | |
| 224 | 224 | return reply; |
| 225 | 225 | } |
| 226 | 226 | |
| r31373 | r31374 | |
| 230 | 230 | |
| 231 | 231 | WRITE8_MEMBER( tms3556_device::reg_w ) |
| 232 | 232 | { |
| 233 | static int reg2=0; // FIXME : this static makes that only one TMS3556 will be present in one system... | |
| 234 | static int reg=0; | |
| 233 | static int reg2=0; // FIXME : this static makes that only one TMS3556 will be present in one system... | |
| 234 | static int reg=0; | |
| 235 | 235 | |
| 236 | 236 | if (LOG) logerror("TMS3556 Reg Write: %06x = %02x\n", offset, data); |
| 237 | 237 | |
| 238 | switch (m_reg_access_phase) { | |
| 239 | case 0: | |
| 240 | reg=data&0x0F; | |
| 241 | reg2=(data&0xF0)>>4; | |
| 242 | if (reg!=0) | |
| 243 | m_reg_access_phase=1; | |
| 244 | return; | |
| 238 | switch (m_reg_access_phase) { | |
| 239 | case 0: | |
| 240 | reg=data&0x0F; | |
| 241 | reg2=(data&0xF0)>>4; | |
| 242 | if (reg!=0) | |
| 243 | m_reg_access_phase=1; | |
| 244 | return; | |
| 245 | 245 | |
| 246 | case 1: | |
| 247 | if (reg<8) { | |
| 248 | m_control_regs[reg]=data; | |
| 249 | // leve un flag si le dernier registre ecrit est row ou col | |
| 250 | if ((reg==2) || (reg==1)) { | |
| 251 | m_colrow=(m_control_regs[2]<<8)|m_control_regs[1]; | |
| 252 | m_row_col_written=true; | |
| 253 | } | |
| 246 | case 1: | |
| 247 | if (reg<8) { | |
| 248 | m_control_regs[reg]=data; | |
| 249 | // leve un flag si le dernier registre ecrit est row ou col | |
| 250 | if ((reg==2) || (reg==1)) { | |
| 251 | m_colrow=(m_control_regs[2]<<8)|m_control_regs[1]; | |
| 252 | m_row_col_written=true; | |
| 253 | } | |
| 254 | 254 | |
| 255 | if (reg2==0) { | |
| 256 | m_reg_access_phase=0; | |
| 257 | return; | |
| 258 | } | |
| 259 | else { | |
| 260 | m_reg_access_phase=1; | |
| 261 | reg=reg2; | |
| 262 | reg2=0; | |
| 263 | return; | |
| 264 | } | |
| 265 | } else { | |
| 266 | m_address_regs[reg-8]=(m_control_regs[2]<<8)|m_control_regs[1]; | |
| 267 | // cas speciaux de decalage pour les generateurs | |
| 268 | if ((reg>=0xB) && (reg<=0xE)) { | |
| 269 | m_address_regs[reg-8]+=2; | |
| 270 | m_address_regs[reg-8]&=0xFFFF; | |
| 271 | } else { | |
| 272 | m_address_regs[reg-8]+=1; | |
| 273 | m_address_regs[reg-8]&=0xFFFF; | |
| 274 | } | |
| 275 | if (reg==9) { | |
| 276 | m_row_col_written=false; | |
| 277 | m_bamp_written=true; | |
| 278 | m_reg_access_phase=0; | |
| 279 | return; | |
| 280 | } else { | |
| 281 | m_row_col_written=0; | |
| 282 | m_bamp_written=false; | |
| 283 | m_reg_access_phase=2;//??? | |
| 284 | return; | |
| 285 | } | |
| 286 | logerror("VDP16[%d] = x%x",reg,m_address_regs[reg-8]); | |
| 287 | if (reg2==0) { | |
| 288 | m_reg_access_phase=0; | |
| 289 | return; | |
| 290 | } | |
| 291 | else { | |
| 292 | m_reg_access_phase=1; | |
| 293 | reg=reg2; | |
| 294 | reg2=0; | |
| 295 | return; | |
| 296 | } | |
| 297 | } | |
| 298 | case 2: | |
| 299 | m_reg_access_phase=0; | |
| 300 | return; | |
| 301 | } | |
| 255 | if (reg2==0) { | |
| 256 | m_reg_access_phase=0; | |
| 257 | return; | |
| 258 | } | |
| 259 | else { | |
| 260 | m_reg_access_phase=1; | |
| 261 | reg=reg2; | |
| 262 | reg2=0; | |
| 263 | return; | |
| 264 | } | |
| 265 | } else { | |
| 266 | m_address_regs[reg-8]=(m_control_regs[2]<<8)|m_control_regs[1]; | |
| 267 | // cas speciaux de decalage pour les generateurs | |
| 268 | if ((reg>=0xB) && (reg<=0xE)) { | |
| 269 | m_address_regs[reg-8]+=2; | |
| 270 | m_address_regs[reg-8]&=0xFFFF; | |
| 271 | } else { | |
| 272 | m_address_regs[reg-8]+=1; | |
| 273 | m_address_regs[reg-8]&=0xFFFF; | |
| 274 | } | |
| 275 | if (reg==9) { | |
| 276 | m_row_col_written=false; | |
| 277 | m_bamp_written=true; | |
| 278 | m_reg_access_phase=0; | |
| 279 | return; | |
| 280 | } else { | |
| 281 | m_row_col_written=0; | |
| 282 | m_bamp_written=false; | |
| 283 | m_reg_access_phase=2;//??? | |
| 284 | return; | |
| 285 | } | |
| 286 | logerror("VDP16[%d] = x%x",reg,m_address_regs[reg-8]); | |
| 287 | if (reg2==0) { | |
| 288 | m_reg_access_phase=0; | |
| 289 | return; | |
| 290 | } | |
| 291 | else { | |
| 292 | m_reg_access_phase=1; | |
| 293 | reg=reg2; | |
| 294 | reg2=0; | |
| 295 | return; | |
| 296 | } | |
| 297 | } | |
| 298 | case 2: | |
| 299 | m_reg_access_phase=0; | |
| 300 | return; | |
| 301 | } | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | //-------------------------------------------------------------------------- |
| r31373 | r31374 | |
| 307 | 307 | |
| 308 | 308 | READ8_MEMBER( tms3556_device::initptr_r ) |
| 309 | 309 | { |
| 310 | m_init_read=true; | |
| 311 | return 0xff; | |
| 310 | m_init_read=true; | |
| 311 | return 0xff; | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 |
| r31373 | r31374 | |
|---|---|---|
| 1517 | 1517 | MC6845_UPDATE_ROW( mos8563_device::vdc_update_row ) |
| 1518 | 1518 | { |
| 1519 | 1519 | const pen_t *pen = m_palette->pens(); |
| 1520 | ||
| 1520 | ||
| 1521 | 1521 | ra += (m_vert_scroll & 0x0f); |
| 1522 | 1522 | ra &= 0x0f; |
| 1523 | ||
| 1523 | ||
| 1524 | 1524 | UINT8 cth = (m_horiz_char >> 4) + (HSS_DBL ? 0 : 1); |
| 1525 | 1525 | UINT8 cdh = (m_horiz_char & 0x0f) + (HSS_DBL ? 0 : 1); |
| 1526 | 1526 | UINT8 cdv = m_vert_char_disp; |
| 1527 | ||
| 1527 | ||
| 1528 | 1528 | for (int column = 0; column < x_count; column++) |
| 1529 | 1529 | { |
| 1530 | 1530 | UINT8 code = read_videoram(ma + column); |
| 1531 | 1531 | UINT8 attr = 0; |
| 1532 | ||
| 1532 | ||
| 1533 | 1533 | int fg = m_color >> 4; |
| 1534 | 1534 | int bg = m_color & 0x0f; |
| 1535 | ||
| 1535 | ||
| 1536 | 1536 | if (HSS_ATTR) |
| 1537 | 1537 | { |
| 1538 | 1538 | offs_t attr_addr = m_attribute_addr + ma + column; |
| 1539 | 1539 | attr = read_videoram(attr_addr); |
| 1540 | 1540 | } |
| 1541 | ||
| 1541 | ||
| 1542 | 1542 | if (HSS_TEXT) |
| 1543 | 1543 | { |
| 1544 | 1544 | if (HSS_ATTR) |
| r31373 | r31374 | |
| 1546 | 1546 | fg = ATTR_FOREGROUND; |
| 1547 | 1547 | bg = ATTR_BACKGROUND; |
| 1548 | 1548 | } |
| 1549 | ||
| 1549 | ||
| 1550 | 1550 | if (VSS_RVS) code ^= 0xff; |
| 1551 | ||
| 1551 | ||
| 1552 | 1552 | for (int bit = 0; bit < cdh; bit++) |
| 1553 | 1553 | { |
| 1554 | 1554 | int x = (m_horiz_scroll & 0x0f) - cth + (column * cth) + bit; |
| 1555 | 1555 | if (x < 0) x = 0; |
| 1556 | 1556 | int color = BIT(code, 7) ? fg : bg; |
| 1557 | ||
| 1557 | ||
| 1558 | 1558 | bitmap.pix32(vbp + y, hbp + x) = pen[de ? color : 0]; |
| 1559 | 1559 | } |
| 1560 | 1560 | } |
| r31373 | r31374 | |
| 1564 | 1564 | { |
| 1565 | 1565 | fg = ATTR_COLOR; |
| 1566 | 1566 | } |
| 1567 | ||
| 1567 | ||
| 1568 | 1568 | offs_t font_addr; |
| 1569 | ||
| 1569 | ||
| 1570 | 1570 | if (m_max_ras_addr < 16) |
| 1571 | 1571 | { |
| 1572 | 1572 | font_addr = ((m_char_base_addr & 0xe0) << 8) | (ATTR_ALTERNATE_CHARSET << 12) | (code << 4) | (ra & 0x0f); |
| r31373 | r31374 | |
| 1575 | 1575 | { |
| 1576 | 1576 | font_addr = ((m_char_base_addr & 0xc0) << 8) | (ATTR_ALTERNATE_CHARSET << 13) | (code << 5) | (ra & 0x1f); |
| 1577 | 1577 | } |
| 1578 | ||
| 1578 | ||
| 1579 | 1579 | UINT8 data = read_videoram(font_addr); |
| 1580 | ||
| 1580 | ||
| 1581 | 1581 | if (ra >= cdv) data = 0; |
| 1582 | 1582 | if (ATTR_UNDERLINE && (ra == m_underline_ras)) data = 0xff; |
| 1583 | 1583 | if (ATTR_BLINK && !m_char_blink_state) data = 0; |
| 1584 | 1584 | if (ATTR_REVERSE) data ^= 0xff; |
| 1585 | 1585 | if (column == cursor_x) data ^= 0xff; |
| 1586 | 1586 | if (VSS_RVS) data ^= 0xff; |
| 1587 | ||
| 1587 | ||
| 1588 | 1588 | for (int bit = 0; bit < cdh; bit++) |
| 1589 | 1589 | { |
| 1590 | 1590 | int x = (m_horiz_scroll & 0x0f) - cth + (column * cth) + bit; |
| 1591 | 1591 | if (x < 0) x = 0; |
| 1592 | 1592 | int color = BIT(data, 7) ? fg : bg; |
| 1593 | ||
| 1593 | ||
| 1594 | 1594 | bitmap.pix32(vbp + y, hbp + x) = pen[de ? color : 0]; |
| 1595 | ||
| 1595 | ||
| 1596 | 1596 | if ((bit < 8) || !HSS_SEMI) data <<= 1; |
| 1597 | 1597 | } |
| 1598 | 1598 | } |
| r31373 | r31374 | |
|---|---|---|
| 612 | 612 | int level = ((inputs >> i) & 1); |
| 613 | 613 | if (di.rgb[channel].R[i] != 0.0 && !level) |
| 614 | 614 | { |
| 615 | // There is no difference in the calculation of the "low" input | |
| 616 | // (transistor conducting to ground) between TTL output and | |
| 617 | // open collector output. This is documented explicitly in the | |
| 618 | // code below (no difference if / else. | |
| 615 | // There is no difference in the calculation of the "low" input | |
| 616 | // (transistor conducting to ground) between TTL output and | |
| 617 | // open collector output. This is documented explicitly in the | |
| 618 | // code below (no difference if / else. | |
| 619 | 619 | if (OpenCol) |
| 620 | 620 | { |
| 621 | 621 | rTotal += 1.0 / di.rgb[channel].R[i]; |
| r31373 | r31374 | |
|---|---|---|
| 5666 | 5666 | |
| 5667 | 5667 | voodoo_device::voodoo_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) |
| 5668 | 5668 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 5669 | m_fbmem(0), | |
| 5670 | m_tmumem0(0), | |
| 5671 | m_tmumem1(0), | |
| 5672 | m_screen(NULL), | |
| 5673 | m_cputag(NULL), | |
| 5674 | m_vblank(*this), | |
| 5675 | m_stall(*this) | |
| 5669 | m_fbmem(0), | |
| 5670 | m_tmumem0(0), | |
| 5671 | m_tmumem1(0), | |
| 5672 | m_screen(NULL), | |
| 5673 | m_cputag(NULL), | |
| 5674 | m_vblank(*this), | |
| 5675 | m_stall(*this) | |
| 5676 | 5676 | { |
| 5677 | 5677 | m_token = global_alloc_clear(voodoo_state); |
| 5678 | 5678 | } |
| r31373 | r31374 | |
|---|---|---|
| 224 | 224 | //if (LOG) logerror("I8275 '%s' y %u x %u VRTC 0\n", tag(), y, x); |
| 225 | 225 | m_write_vrtc(0); |
| 226 | 226 | } |
| 227 | ||
| 227 | ||
| 228 | 228 | if (m_scanline <= (m_vrtc_scanline - SCANLINES_PER_ROW)) |
| 229 | 229 | { |
| 230 | 230 | if (lc == 0) |
| r31373 | r31374 | |
| 233 | 233 | { |
| 234 | 234 | m_status |= ST_DU; |
| 235 | 235 | m_du = true; |
| 236 | ||
| 236 | ||
| 237 | 237 | //if (LOG) logerror("I8275 '%s' y %u x %u DMA Underrun\n", tag(), y, x); |
| 238 | ||
| 238 | ||
| 239 | 239 | m_write_drq(0); |
| 240 | 240 | } |
| 241 | 241 | |
| r31373 | r31374 | |
| 254 | 254 | } |
| 255 | 255 | } |
| 256 | 256 | } |
| 257 | ||
| 257 | ||
| 258 | 258 | if (m_scanline == m_irq_scanline) |
| 259 | 259 | { |
| 260 | 260 | if (m_status & ST_IE) |
| r31373 | r31374 | |
| 264 | 264 | m_write_irq(ASSERT_LINE); |
| 265 | 265 | } |
| 266 | 266 | } |
| 267 | ||
| 267 | ||
| 268 | 268 | if (m_scanline == m_vrtc_scanline) |
| 269 | 269 | { |
| 270 | 270 | //if (LOG) logerror("I8275 '%s' y %u x %u VRTC 1\n", tag(), y, x); |
| r31373 | r31374 | |
| 288 | 288 | m_char_blink &= 0x3f; |
| 289 | 289 | m_stored_attr = 0; |
| 290 | 290 | } |
| 291 | ||
| 291 | ||
| 292 | 292 | if (m_scanline == m_vrtc_drq_scanline) |
| 293 | 293 | { |
| 294 | 294 | // swap line buffers |
| r31373 | r31374 | |
| 614 | 614 | } |
| 615 | 615 | else |
| 616 | 616 | { |
| 617 | m_drq_on_timer->adjust(attotime::zero); | |
| 617 | m_drq_on_timer->adjust(attotime::zero); | |
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 |
| r31373 | r31374 | |
|---|---|---|
| 217 | 217 | #if SNES_LAYER_DEBUG |
| 218 | 218 | memset(&m_debug_options, 0, sizeof(m_debug_options)); |
| 219 | 219 | #endif |
| 220 | ||
| 220 | ||
| 221 | 221 | m_vram = auto_alloc_array(machine(), UINT8, SNES_VRAM_SIZE); |
| 222 | 222 | m_cgram = auto_alloc_array(machine(), UINT16, SNES_CGRAM_SIZE/2); |
| 223 | 223 | m_oam_ram = auto_alloc_array(machine(), UINT16, SNES_OAM_SIZE/2); |
| 224 | ||
| 224 | ||
| 225 | 225 | /* Inititialize registers/variables */ |
| 226 | 226 | m_update_windows = 1; |
| 227 | 227 | m_beam.latch_vert = 0; |
| r31373 | r31374 | |
| 232 | 232 | m_mode = 0; |
| 233 | 233 | m_ppu1_version = 1; // 5C77 chip version number, read by STAT77, only '1' is known |
| 234 | 234 | m_ppu2_version = 3; // 5C78 chip version number, read by STAT78, only '2' & '3' encountered so far. |
| 235 | ||
| 235 | ||
| 236 | 236 | m_cgram_address = 0; |
| 237 | 237 | m_read_ophct = 0; |
| 238 | 238 | m_read_opvct = 0; |
| 239 | ||
| 239 | ||
| 240 | 240 | PPU_REG(VMAIN) = 0x80; |
| 241 | 241 | // what about other regs? |
| 242 | ||
| 242 | ||
| 243 | 243 | /* Inititialize mosaic table */ |
| 244 | 244 | for (int j = 0; j < 16; j++) |
| 245 | 245 | { |
| 246 | 246 | for (int i = 0; i < 4096; i++) |
| 247 | 247 | m_mosaic_table[j][i] = (i / (j + 1)) * (j + 1); |
| 248 | 248 | } |
| 249 | ||
| 249 | ||
| 250 | 250 | /* Init VRAM */ |
| 251 | 251 | memset(m_vram, 0, SNES_VRAM_SIZE); |
| 252 | ||
| 252 | ||
| 253 | 253 | /* Init Palette RAM */ |
| 254 | 254 | memset((UINT8 *)m_cgram, 0, SNES_CGRAM_SIZE); |
| 255 | ||
| 255 | ||
| 256 | 256 | /* Init oam RAM */ |
| 257 | 257 | memset((UINT8 *)m_oam_ram, 0xff, SNES_OAM_SIZE); |
| 258 | 258 | |
| r31373 | r31374 | |
| 268 | 268 | save_item(NAME(m_scanlines[i].layer), i); |
| 269 | 269 | save_item(NAME(m_scanlines[i].blend_exception), i); |
| 270 | 270 | } |
| 271 | ||
| 271 | ||
| 272 | 272 | for (int i = 0; i < 6; i++) |
| 273 | 273 | { |
| 274 | 274 | save_item(NAME(m_layer[i].window1_enabled), i); |
| r31373 | r31374 | |
| 288 | 288 | save_item(NAME(m_layer[i].sub_bg_enabled), i); |
| 289 | 289 | save_item(NAME(m_layer[i].hoffs), i); |
| 290 | 290 | save_item(NAME(m_layer[i].voffs), i); |
| 291 | ||
| 291 | ||
| 292 | 292 | save_item(NAME(m_clipmasks[i]), i); |
| 293 | 293 | } |
| 294 | ||
| 294 | ||
| 295 | 295 | save_item(NAME(m_oam.address_low)); |
| 296 | 296 | save_item(NAME(m_oam.address_high)); |
| 297 | 297 | save_item(NAME(m_oam.saved_address_low)); |
| r31373 | r31374 | |
| 306 | 306 | save_item(NAME(m_oam.first_sprite)); |
| 307 | 307 | save_item(NAME(m_oam.flip)); |
| 308 | 308 | save_item(NAME(m_oam.write_latch)); |
| 309 | ||
| 309 | ||
| 310 | 310 | save_item(NAME(m_beam.latch_horz)); |
| 311 | 311 | save_item(NAME(m_beam.latch_vert)); |
| 312 | 312 | save_item(NAME(m_beam.current_horz)); |
| 313 | 313 | save_item(NAME(m_beam.current_vert)); |
| 314 | 314 | save_item(NAME(m_beam.last_visible_line)); |
| 315 | 315 | save_item(NAME(m_beam.interlace_count)); |
| 316 | ||
| 316 | ||
| 317 | 317 | save_item(NAME(m_mode7.repeat)); |
| 318 | 318 | save_item(NAME(m_mode7.hflip)); |
| 319 | 319 | save_item(NAME(m_mode7.vflip)); |
| r31373 | r31374 | |
| 326 | 326 | save_item(NAME(m_mode7.hor_offset)); |
| 327 | 327 | save_item(NAME(m_mode7.ver_offset)); |
| 328 | 328 | save_item(NAME(m_mode7.extbg)); |
| 329 | ||
| 329 | ||
| 330 | 330 | save_item(NAME(m_mosaic_size)); |
| 331 | 331 | save_item(NAME(m_clip_to_black)); |
| 332 | 332 | save_item(NAME(m_prevent_color_math)); |
| r31373 | r31374 | |
| 335 | 335 | save_item(NAME(m_direct_color)); |
| 336 | 336 | save_item(NAME(m_ppu_last_scroll)); |
| 337 | 337 | save_item(NAME(m_mode7_last_scroll)); |
| 338 | ||
| 338 | ||
| 339 | 339 | save_item(NAME(m_ppu1_open_bus)); |
| 340 | 340 | save_item(NAME(m_ppu2_open_bus)); |
| 341 | 341 | save_item(NAME(m_ppu1_version)); |
| r31373 | r31374 | |
| 344 | 344 | save_item(NAME(m_window1_right)); |
| 345 | 345 | save_item(NAME(m_window2_left)); |
| 346 | 346 | save_item(NAME(m_window2_right)); |
| 347 | ||
| 347 | ||
| 348 | 348 | save_item(NAME(m_update_windows)); |
| 349 | 349 | save_item(NAME(m_update_offsets)); |
| 350 | 350 | save_item(NAME(m_update_oam_list)); |
| r31373 | r31374 | |
| 357 | 357 | save_item(NAME(m_color_modes)); |
| 358 | 358 | save_item(NAME(m_stat77)); |
| 359 | 359 | save_item(NAME(m_stat78)); |
| 360 | ||
| 360 | ||
| 361 | 361 | save_item(NAME(m_htmult)); |
| 362 | 362 | save_item(NAME(m_cgram_address)); |
| 363 | 363 | save_item(NAME(m_read_ophct)); |
| r31373 | r31374 | |
| 369 | 369 | save_item(NAME(m_vram_fgr_shift)); |
| 370 | 370 | save_item(NAME(m_vram_read_buffer)); |
| 371 | 371 | save_item(NAME(m_vmadd)); |
| 372 | ||
| 372 | ||
| 373 | 373 | save_item(NAME(m_regs)); |
| 374 | ||
| 374 | ||
| 375 | 375 | save_pointer(NAME(m_vram), SNES_VRAM_SIZE); |
| 376 | 376 | save_pointer(NAME(m_cgram), SNES_CGRAM_SIZE/2); |
| 377 | 377 | save_pointer(NAME(m_oam_ram), SNES_OAM_SIZE/2); |
| r31373 | r31374 | |
|---|---|---|
| 431 | 431 | |
| 432 | 432 | //if (LOG) |
| 433 | 433 | //{ |
| 434 | // logerror("CRT9007 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh)); | |
| 435 | // logerror("CRT9007 '%s' Visible Area: (%u, %u) - (%u, %u)\n", tag(), visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); | |
| 434 | // logerror("CRT9007 '%s' Screen: %u x %u @ %f Hz\n", tag(), horiz_pix_total, vert_pix_total, 1 / ATTOSECONDS_TO_DOUBLE(refresh)); | |
| 435 | // logerror("CRT9007 '%s' Visible Area: (%u, %u) - (%u, %u)\n", tag(), visarea.min_x, visarea.min_y, visarea.max_x, visarea.max_y); | |
| 436 | 436 | //} |
| 437 | 437 | |
| 438 | 438 | //m_screen->configure(horiz_pix_total, vert_pix_total, visarea, refresh); |
| r31373 | r31374 | |
|---|---|---|
| 189 | 189 | if (m_active_ram == DDRAM) |
| 190 | 190 | { |
| 191 | 191 | int max_ac = (m_num_line == 1) ? 0x4f : 0x67; |
| 192 | ||
| 192 | ||
| 193 | 193 | if (m_ac > max_ac) |
| 194 | 194 | m_ac -= max_ac + 1; |
| 195 | 195 | else if (m_ac < 0) |
| r31373 | r31374 | |
| 214 | 214 | void hd44780_device::shift_display(int direction) |
| 215 | 215 | { |
| 216 | 216 | m_disp_shift += direction; |
| 217 | ||
| 217 | ||
| 218 | 218 | if (m_disp_shift == 0x50) |
| 219 | 219 | m_disp_shift = 0; |
| 220 | 220 | else if (m_disp_shift == -1) |
| r31373 | r31374 | |
|---|---|---|
| 103 | 103 | array.append(data); |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | // add all sliders | |
| 106 | // add all sliders | |
| 107 | 107 | for (curslider = (slider_state*)machine().osd().get_slider_list(); curslider != NULL; curslider = curslider->next) |
| 108 | 108 | { |
| 109 | 109 | INT32 curval = (*curslider->update)(machine(), curslider->arg, &tempstring, SLIDER_NOCHANGE); |
| r31373 | r31374 | |
| 258 | 258 | file.close(); |
| 259 | 259 | mg_send_header(conn, "Cache-Control", "no-cache, no-store, must-revalidate"); |
| 260 | 260 | mg_send_header(conn, "Pragma", "no-cache"); |
| 261 | mg_send_header(conn, "Expires", "0"); | |
| 261 | mg_send_header(conn, "Expires", "0"); | |
| 262 | 262 | mg_send_file(conn, fullpath.cstr()); |
| 263 | 263 | return MG_MORE; // It is important to return MG_MORE after mg_send_file! |
| 264 | 264 | } |
| r31373 | r31374 | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | static int ev_handler(struct mg_connection *conn, enum mg_event ev) { |
| 269 | ||
| 269 | if (ev == MG_REQUEST) { | |
| 270 | 270 | if (conn->is_websocket) { |
| 271 | 271 | // This handler is called for each incoming websocket frame, one or more |
| 272 | 272 | // times for connection lifetime. |
| 273 | 273 | // Echo websocket data back to the client. |
| 274 | 274 | return conn->content_len == 4 && !memcmp(conn->content, "exit", 4) ? MG_FALSE : MG_TRUE; |
| 275 | } else { | |
| 276 | web_engine *engine = static_cast<web_engine *>(conn->server_param); | |
| 275 | } else { | |
| 276 | web_engine *engine = static_cast<web_engine *>(conn->server_param); | |
| 277 | 277 | return engine->begin_request_handler(conn); |
| 278 | 278 | } |
| 279 | ||
| 279 | } else if (ev== MG_WS_CONNECT) { | |
| 280 | 280 | // New websocket connection. Send connection ID back to the client. |
| 281 | 281 | mg_websocket_printf(conn, WEBSOCKET_OPCODE_TEXT, "update_machine"); |
| 282 | 282 | return MG_FALSE; |
| 283 | } else if (ev == MG_AUTH) { | |
| 284 | return MG_TRUE; | |
| 285 | } else { | |
| 286 | return MG_FALSE; | |
| 287 | } | |
| 283 | } else if (ev == MG_AUTH) { | |
| 284 | return MG_TRUE; | |
| 285 | } else { | |
| 286 | return MG_FALSE; | |
| 287 | } | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | static int iterate_callback(struct mg_connection *c, enum mg_event ev) { |
| 291 | if (ev == MG_POLL && c->is_websocket) { | |
| 292 | char buf[20]; | |
| 293 | int len = snprintf(buf, sizeof(buf), "%lu", | |
| 294 | (unsigned long) * (time_t *) c->callback_param); | |
| 295 | mg_websocket_write(c, 1, buf, len); | |
| 296 | } | |
| 297 | return MG_TRUE; | |
| 291 | if (ev == MG_POLL && c->is_websocket) { | |
| 292 | char buf[20]; | |
| 293 | int len = snprintf(buf, sizeof(buf), "%lu", | |
| 294 | (unsigned long) * (time_t *) c->callback_param); | |
| 295 | mg_websocket_write(c, 1, buf, len); | |
| 296 | } | |
| 297 | return MG_TRUE; | |
| 298 | 298 | } |
| 299 | 299 | |
| 300 | 300 | static void *serve(void *server) { |
| r31373 | r31374 | |
| 304 | 304 | if (current_timer - last_timer > 0) { |
| 305 | 305 | last_timer = current_timer; |
| 306 | 306 | mg_iterate_over_connections((struct mg_server *)server, iterate_callback, ¤t_timer); |
| 307 | } | |
| 307 | } | |
| 308 | 308 | return NULL; |
| 309 | 309 | } |
| 310 | 310 | |
| r31373 | r31374 | |
| 322 | 322 | { |
| 323 | 323 | if (m_options.http()) { |
| 324 | 324 | m_server = mg_create_server(this, ev_handler); |
| 325 | ||
| 325 | ||
| 326 | 326 | mg_set_option(m_server, "listening_port", options.http_port()); |
| 327 | 327 | mg_set_option(m_server, "document_root", options.http_path()); |
| 328 | ||
| 328 | ||
| 329 | 329 | mg_start_thread(serve, m_server); |
| 330 | 330 | } |
| 331 | 331 | |
| r31373 | r31374 | |
| 349 | 349 | { |
| 350 | 350 | m_exiting_core = 1; |
| 351 | 351 | // Cleanup, and free server instance |
| 352 | mg_destroy_server(&m_server); | |
| 352 | mg_destroy_server(&m_server); | |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | 355 | static int websocket_callback(struct mg_connection *c, enum mg_event ev) { |
| 356 | if (c->is_websocket) { | |
| 357 | const char *message = (const char *)c->callback_param; | |
| 358 | mg_websocket_write(c, 1, message, strlen(message)); | |
| 359 | } | |
| 360 | return MG_TRUE; | |
| 356 | if (c->is_websocket) { | |
| 357 | const char *message = (const char *)c->callback_param; | |
| 358 | mg_websocket_write(c, 1, message, strlen(message)); | |
| 359 | } | |
| 360 | return MG_TRUE; | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | void web_engine::push_message(const char *message) |
| r31373 | r31374 | |
|---|---|---|
| 197 | 197 | throw emu_fatalerror(MAMERR_FATALERROR, NULL); |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | ||
| 200 | ||
| 201 | 201 | m_options.parse_standard_inis(option_errors); |
| 202 | 202 | // parse the command line, adding any system-specific options |
| 203 | 203 | if (!m_options.parse_command_line(argc, argv, option_errors)) |
| r31373 | r31374 | |
| 232 | 232 | } |
| 233 | 233 | if (option_errors) |
| 234 | 234 | osd_printf_error("Error in command line:\n%s\n", option_errors.trimspace().cstr()); |
| 235 | ||
| 235 | ||
| 236 | 236 | // if we can't find it, give an appropriate error |
| 237 | 237 | const game_driver *system = m_options.system(); |
| 238 | 238 | if (system == NULL && *(m_options.system_name()) != 0) |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Amiga Autoconfig | |
| 4 | 4 | |
| 5 | 5 | ***************************************************************************/ |
| 6 | 6 |
| r31373 | r31374 | |
|---|---|---|
| 8 | 8 | Example of usage in a driver. |
| 9 | 9 | |
| 10 | 10 | In MACHINE_CONFIG |
| 11 | ||
| 12 | MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) | |
| 13 | MCFG_GENERIC_KEYBOARD_CB(WRITE8(xxx_state, kbd_put)) | |
| 14 | 11 | |
| 12 | MCFG_DEVICE_ADD(KEYBOARD_TAG, GENERIC_KEYBOARD, 0) | |
| 13 | MCFG_GENERIC_KEYBOARD_CB(WRITE8(xxx_state, kbd_put)) | |
| 14 | ||
| 15 | 15 | In the code: |
| 16 | 16 | |
| 17 | 17 | WRITE8_MEMBER( xxx_state::kbd_put ) |
| r31373 | r31374 | |
|---|---|---|
| 91 | 91 | |
| 92 | 92 | void aakart_device::device_timer(emu_timer &timer, device_timer_id id, int param, void *ptr) |
| 93 | 93 | { |
| 94 | if(id == TX_TIMER && m_new_command & 1) | |
| 95 | { | |
| 96 | switch(m_tx_latch) | |
| 97 | { | |
| 98 | case 0x00: | |
| 99 | case 0x02: | |
| 100 | case 0x03: | |
| 101 | case 0x07: | |
| 102 | // ---- -x-- scroll lock | |
| 103 | // ---- --x- num lock | |
| 104 | // ---- ---x caps lock | |
| 105 | break; | |
| 106 | case 0x20: | |
| 107 | m_rx = 0x81; | |
| 108 | m_out_tx_cb(ASSERT_LINE); | |
| 109 | break; | |
| 110 | case 0x30: | |
| 111 | case 0x31: | |
| 112 | case 0x32: | |
| 113 | case 0x33: | |
| 114 | m_keyb_enable = m_tx_latch & 1; | |
| 115 | m_mouse_enable = (m_tx_latch & 2) >> 1; | |
| 116 | if(m_keyb_enable & 1 && m_keyb_state & 1) | |
| 117 | { | |
| 118 | //printf("Got row\n"); | |
| 119 | m_rx = m_keyb_row; | |
| 120 | m_out_tx_cb(ASSERT_LINE); | |
| 121 | } | |
| 94 | if(id == TX_TIMER && m_new_command & 1) | |
| 95 | { | |
| 96 | switch(m_tx_latch) | |
| 97 | { | |
| 98 | case 0x00: | |
| 99 | case 0x02: | |
| 100 | case 0x03: | |
| 101 | case 0x07: | |
| 102 | // ---- -x-- scroll lock | |
| 103 | // ---- --x- num lock | |
| 104 | // ---- ---x caps lock | |
| 105 | break; | |
| 106 | case 0x20: | |
| 107 | m_rx = 0x81; | |
| 108 | m_out_tx_cb(ASSERT_LINE); | |
| 109 | break; | |
| 110 | case 0x30: | |
| 111 | case 0x31: | |
| 112 | case 0x32: | |
| 113 | case 0x33: | |
| 114 | m_keyb_enable = m_tx_latch & 1; | |
| 115 | m_mouse_enable = (m_tx_latch & 2) >> 1; | |
| 116 | if(m_keyb_enable & 1 && m_keyb_state & 1) | |
| 117 | { | |
| 118 | //printf("Got row\n"); | |
| 119 | m_rx = m_keyb_row; | |
| 120 | m_out_tx_cb(ASSERT_LINE); | |
| 121 | } | |
| 122 | 122 | |
| 123 | break; | |
| 124 | case 0x3f: | |
| 125 | if(m_keyb_enable & 1 && m_keyb_state & 1) | |
| 126 | { | |
| 127 | //printf("Got col\n"); | |
| 128 | m_rx = m_keyb_col; | |
| 129 | m_out_tx_cb(ASSERT_LINE); | |
| 130 | m_keyb_state = 0; | |
| 131 | } | |
| 123 | break; | |
| 124 | case 0x3f: | |
| 125 | if(m_keyb_enable & 1 && m_keyb_state & 1) | |
| 126 | { | |
| 127 | //printf("Got col\n"); | |
| 128 | m_rx = m_keyb_col; | |
| 129 | m_out_tx_cb(ASSERT_LINE); | |
| 130 | m_keyb_state = 0; | |
| 131 | } | |
| 132 | 132 | |
| 133 | break; | |
| 134 | case 0xfd: | |
| 135 | m_rx = 0xfd; | |
| 136 | m_out_tx_cb(ASSERT_LINE); | |
| 137 | break; | |
| 138 | case 0xfe: | |
| 139 | m_rx = 0xfe; | |
| 140 | m_out_tx_cb(ASSERT_LINE); | |
| 141 | break; | |
| 142 | case 0xff: | |
| 143 | m_rx = 0xff; | |
| 144 | m_out_tx_cb(ASSERT_LINE); | |
| 145 | break; | |
| 146 | default: | |
| 147 | //printf("%02x %02x %02x\n",m_tx_latch,m_rx_latch,m_keyb_enable); | |
| 148 | break; | |
| 149 | } | |
| 133 | break; | |
| 134 | case 0xfd: | |
| 135 | m_rx = 0xfd; | |
| 136 | m_out_tx_cb(ASSERT_LINE); | |
| 137 | break; | |
| 138 | case 0xfe: | |
| 139 | m_rx = 0xfe; | |
| 140 | m_out_tx_cb(ASSERT_LINE); | |
| 141 | break; | |
| 142 | case 0xff: | |
| 143 | m_rx = 0xff; | |
| 144 | m_out_tx_cb(ASSERT_LINE); | |
| 145 | break; | |
| 146 | default: | |
| 147 | //printf("%02x %02x %02x\n",m_tx_latch,m_rx_latch,m_keyb_enable); | |
| 148 | break; | |
| 149 | } | |
| 150 | 150 | |
| 151 | //m_new_command &= ~1; | |
| 152 | m_out_rx_cb(ASSERT_LINE); | |
| 153 | } | |
| 151 | //m_new_command &= ~1; | |
| 152 | m_out_rx_cb(ASSERT_LINE); | |
| 153 | } | |
| 154 | 154 | |
| 155 | 155 | } |
| 156 | 156 | |
| r31373 | r31374 | |
| 162 | 162 | |
| 163 | 163 | READ8_MEMBER( aakart_device::read ) |
| 164 | 164 | { |
| 165 | m_out_tx_cb(CLEAR_LINE); | |
| 166 | //debugger_break(machine()); | |
| 165 | m_out_tx_cb(CLEAR_LINE); | |
| 166 | //debugger_break(machine()); | |
| 167 | 167 | return m_rx; |
| 168 | 168 | } |
| 169 | 169 | |
| r31373 | r31374 | |
| 172 | 172 | // if(m_new_command) printf("skip cmd %02x\n",data); |
| 173 | 173 | |
| 174 | 174 | m_tx_latch = data; |
| 175 | m_out_rx_cb(CLEAR_LINE); | |
| 176 | m_new_command |= 1; | |
| 175 | m_out_rx_cb(CLEAR_LINE); | |
| 176 | m_new_command |= 1; | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | void aakart_device::send_keycode_down(UINT8 row, UINT8 col) |
| 180 | 180 | { |
| 181 | //printf("keycode down\n"); | |
| 182 | m_keyb_row = row | 0xc0; | |
| 183 | m_keyb_col = col | 0xc0; | |
| 184 | m_keyb_state = 1; | |
| 181 | //printf("keycode down\n"); | |
| 182 | m_keyb_row = row | 0xc0; | |
| 183 | m_keyb_col = col | 0xc0; | |
| 184 | m_keyb_state = 1; | |
| 185 | 185 | } |
| 186 | 186 | |
| 187 | 187 | void aakart_device::send_keycode_up(UINT8 row, UINT8 col) |
| 188 | 188 | { |
| 189 | //printf("keycode up\n"); | |
| 190 | m_keyb_row = row | 0xd0; | |
| 191 | m_keyb_col = col | 0xd0; | |
| 192 | m_keyb_state = 1; | |
| 189 | //printf("keycode up\n"); | |
| 190 | m_keyb_row = row | 0xd0; | |
| 191 | m_keyb_col = col | 0xd0; | |
| 192 | m_keyb_state = 1; | |
| 193 | 193 | } |
| r31373 | r31374 | |
|---|---|---|
| 57 | 57 | "Command", // 3 |
| 58 | 58 | "Status", // 4 |
| 59 | 59 | "Interrupt Status", // 5 |
| 60 | "Internal State", // 6 | |
| 61 | "Current FIFO/Internal State", // 7 | |
| 62 | "Control Register 1", // 8 | |
| 60 | "Internal State", // 6 | |
| 61 | "Current FIFO/Internal State", // 7 | |
| 62 | "Control Register 1", // 8 | |
| 63 | 63 | "0x9", |
| 64 | 64 | "0xA", |
| 65 | 65 | "Control Register 2", |
| r31373 | r31374 | |
| 434 | 434 | WRITE8_MEMBER( ncr539x_device::write ) |
| 435 | 435 | { |
| 436 | 436 | #if VERBOSE |
| 437 | //if (offset != 2) | |
| 437 | //if (offset != 2) | |
| 438 | 438 | printf("539x: Write %02x @ %s (%02x) (PC=%x)\n", data, wrregs[offset], offset, space.device().safe_pc()); |
| 439 | 439 | #endif |
| 440 | 440 |
| r31373 | r31374 | |
|---|---|---|
| 439 | 439 | switch (s->m_dt) |
| 440 | 440 | { |
| 441 | 441 | case DT_DOUBLE: |
| 442 | { | |
| 443 | double *td = s->resolved<double>(); | |
| 444 | if (td != NULL) save_pointer(td, s->m_name, s->m_count); | |
| 445 | } | |
| 442 | { | |
| 443 | double *td = s->resolved<double>(); | |
| 444 | if (td != NULL) save_pointer(td, s->m_name, s->m_count); | |
| 445 | } | |
| 446 | 446 | break; |
| 447 | 447 | case DT_INT64: |
| 448 | 448 | save_pointer((INT64 *) s->m_ptr, s->m_name, s->m_count); |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | Akiko | |
| 4 | 4 | |
| 5 | ||
| 5 | ASIC used in the Amiga CD32. Commodore Part number 391563-01. | |
| 6 | 6 | |
| 7 | - CD-ROM controller | |
| 8 | - Builtin 1KB NVRAM | |
| 9 | - Chunky to planar converter | |
| 10 | - 2x CIA chips | |
| 7 | - CD-ROM controller | |
| 8 | - Builtin 1KB NVRAM | |
| 9 | - Chunky to planar converter | |
| 10 | - 2x CIA chips | |
| 11 | 11 | |
| 12 | 12 | ***************************************************************************/ |
| 13 | 13 |
| r31373 | r31374 | |
|---|---|---|
| 42 | 42 | // LIVE DEVICE |
| 43 | 43 | //************************************************************************** |
| 44 | 44 | |
| 45 | wozfdc_device::wozfdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : | |
| 45 | wozfdc_device::wozfdc_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : | |
| 46 | 46 | device_t(mconfig, type, name, tag, owner, clock, shortname, source) |
| 47 | 47 | { |
| 48 | 48 | } |
| r31373 | r31374 | |
| 99 | 99 | } |
| 100 | 100 | else |
| 101 | 101 | { |
| 102 | switch (drvsel & 3) | |
| 102 | switch (drvsel & 3) | |
| 103 | 103 | { |
| 104 | 104 | case 0: |
| 105 | 105 | newflop = floppy0->get_device(); |
| r31373 | r31374 | |
| 213 | 213 | floppy->stp_w(false); |
| 214 | 214 | floppy->stp_w(true); |
| 215 | 215 | } |
| 216 | } | |
| 216 | } | |
| 217 | 217 | } |
| 218 | 218 | } |
| 219 | 219 | |
| r31373 | r31374 | |
| 396 | 396 | cur_lss.write_start_time = cur_lss.tm; |
| 397 | 397 | cur_lss.write_position = 0; |
| 398 | 398 | } |
| 399 | ||
| 399 | ||
| 400 | 400 | predicted_lss.tm = attotime::never; |
| 401 | 401 | } |
| 402 | 402 | |
| r31373 | r31374 | |
| 409 | 409 | while(cur_lss.tm < tm) { |
| 410 | 410 | lss_predict(tm); |
| 411 | 411 | commit_predicted(); |
| 412 | } | |
| 412 | } | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | void wozfdc_device::lss_predict(attotime limit) |
| r31373 | r31374 | |
| 450 | 450 | |
| 451 | 451 | if(mode_write) { |
| 452 | 452 | if((write_line_active && !(address & 0x80)) || |
| 453 | | |
| 453 | (!write_line_active && (address & 0x80))) { | |
| 454 | 454 | write_line_active = !write_line_active; |
| 455 | 455 | assert(predicted_lss.write_position != 32); |
| 456 | 456 | predicted_lss.write_buffer[predicted_lss.write_position++] = cycles_to_time(cycles); |
| r31373 | r31374 | |
| 538 | 538 | { |
| 539 | 539 | switch (offset) |
| 540 | 540 | { |
| 541 | case 0: | |
| 541 | case 0: // clear drive select bit 0 | |
| 542 | 542 | drvsel &= ~1; |
| 543 | 543 | break; |
| 544 | 544 | |
| 545 | case 1: | |
| 545 | case 1: // set drive select bit 0 | |
| 546 | 546 | drvsel |= 1; |
| 547 | 547 | break; |
| 548 | 548 | |
| 549 | case 2: | |
| 549 | case 2: // clear drive select bit 1 | |
| 550 | 550 | drvsel &= ~2; |
| 551 | 551 | break; |
| 552 | 552 | |
| 553 | case 3: | |
| 553 | case 3: // set drive select bit 1 | |
| 554 | 554 | drvsel |= 2; |
| 555 | 555 | break; |
| 556 | 556 | |
| 557 | case 4: | |
| 557 | case 4: // clear enable 1 | |
| 558 | 558 | enable1 = 0; |
| 559 | 559 | break; |
| 560 | 560 | |
| 561 | case 5: | |
| 561 | case 5: // set enable 1 | |
| 562 | 562 | enable1 = 1; |
| 563 | 563 | break; |
| 564 | 564 | |
| 565 | case 6: | |
| 565 | case 6: // clear side 2 | |
| 566 | 566 | case 7: // set side 2 |
| 567 | 567 | break; |
| 568 | 568 | |
| 569 | default: | |
| 569 | default: // cod8-c0df are not FDC related | |
| 570 | 570 | break; |
| 571 | 571 | } |
| 572 | 572 | } |
| 573 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | GAYLE | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | ||
| 8 | Gate array used in the Amiga 600 and Amiga 1200 computers. | |
| 9 | 9 | |
| 10 | 10 | ***************************************************************************/ |
| 11 | 11 |
| r31373 | r31374 | |
|---|---|---|
| 89 | 89 | /* sample input */ |
| 90 | 90 | double vref_pos = m_in_vref_pos_cb(); |
| 91 | 91 | double vref_neg = m_in_vref_neg_cb(); |
| 92 | ||
| 92 | ||
| 93 | 93 | double input = 0; |
| 94 | ||
| 94 | ||
| 95 | 95 | switch (m_address) |
| 96 | 96 | { |
| 97 | 97 | case 0: |
| r31373 | r31374 | |
| 117 | 117 | break; |
| 118 | 118 | case 7: |
| 119 | 119 | input = m_in_in_7_cb(); |
| 120 | break; | |
| 120 | break; | |
| 121 | 121 | break; |
| 122 | 122 | } |
| 123 | 123 | m_sar = (255 * (input - vref_neg)) / (vref_pos - vref_neg); |
| r31373 | r31374 | |
|---|---|---|
| 89 | 89 | m_out1_cb.resolve_safe(); |
| 90 | 90 | m_out2_cb.resolve_safe(); |
| 91 | 91 | m_irq_cb.resolve_safe(); |
| 92 | ||
| 92 | ||
| 93 | 93 | for (int i = 0; i < 3; i++) |
| 94 | 94 | { |
| 95 | 95 | if ( m_external_clock[i] == 0 ) |
| 96 | 96 | m_external_clock[i] = 1; |
| 97 | 97 | } |
| 98 | ||
| 98 | ||
| 99 | 99 | m_timer[0] = timer_alloc(0); |
| 100 | 100 | m_timer[1] = timer_alloc(1); |
| 101 | 101 | m_timer[2] = timer_alloc(2); |
| r31373 | r31374 | |
|---|---|---|
| 199 | 199 | } |
| 200 | 200 | } |
| 201 | 201 | |
| 202 | WRITE_LINE_MEMBER( rocvfd_t::sclk ) | |
| 203 | { | |
| 204 | shift_clock(state); | |
| 202 | WRITE_LINE_MEMBER( rocvfd_t::sclk ) | |
| 203 | { | |
| 204 | shift_clock(state); | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | WRITE_LINE_MEMBER( rocvfd_t::data ) | |
| 208 | { | |
| 207 | WRITE_LINE_MEMBER( rocvfd_t::data ) | |
| 208 | { | |
| 209 | 209 | m_data = state; |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | WRITE_LINE_MEMBER( rocvfd_t::por ) | |
| 212 | WRITE_LINE_MEMBER( rocvfd_t::por ) | |
| 213 | 213 | { |
| 214 | 214 | //If line goes low, reset mode is engaged, until such a time as it goes high again. |
| 215 | 215 | if (!state) |
| r31373 | r31374 | |
|---|---|---|
| 2523 | 2523 | tc_w((m_cr1 & 0x01) ? true : false); |
| 2524 | 2524 | } |
| 2525 | 2525 | } |
| 2526 | ||
| 2527 |
| r31373 | r31374 | |
|---|---|---|
| 238 | 238 | if(adkcon & 0x0400) { |
| 239 | 239 | if(dma_state == DMA_WAIT_START) { |
| 240 | 240 | cur_live.bit_counter = 0; |
| 241 | ||
| 241 | ||
| 242 | 242 | if(!(dsklen & 0x3fff)) |
| 243 | 243 | dma_done(); |
| 244 | 244 | else if(dsklen & 0x4000) { |
| r31373 | r31374 | |
| 286 | 286 | if(cur_live.bit_counter != 8) |
| 287 | 287 | fatalerror("amiga_fdc::live_run - cur_live.bit_counter != 8\n"); |
| 288 | 288 | cur_live.bit_counter = 0; |
| 289 | ||
| 289 | ||
| 290 | 290 | switch(dma_state) { |
| 291 | 291 | case DMA_IDLE: |
| 292 | 292 | case DMA_WAIT_START: |
| 293 | 293 | break; |
| 294 | ||
| 294 | ||
| 295 | 295 | case DMA_RUNNING_BYTE_0: |
| 296 | 296 | dma_state = DMA_RUNNING_BYTE_1; |
| 297 | 297 | break; |
| 298 | ||
| 298 | ||
| 299 | 299 | case DMA_RUNNING_BYTE_1: { |
| 300 | 300 | dma_value = dma_read(); |
| 301 | 301 | break; |
| 302 | 302 | } |
| 303 | 303 | } |
| 304 | 304 | } |
| 305 | ||
| 305 | ||
| 306 | 306 | cur_live.state = RUNNING; |
| 307 | 307 | checkpoint(); |
| 308 | 308 | break; |
| r31373 | r31374 | |
| 331 | 331 | cur_live.bit_counter = 0; |
| 332 | 332 | dma_value = dma_read(); |
| 333 | 333 | } |
| 334 | } | |
| 334 | } | |
| 335 | 335 | } else { |
| 336 | 336 | dskbyt |= 0x4000; |
| 337 | 337 | if(dsklen & 0x4000) |
| r31373 | r31374 | |
|---|---|---|
| 246 | 246 | { |
| 247 | 247 | UINT8 csr = m_chanA->get_chan_CSR(); |
| 248 | 248 | |
| 249 | if ((csr & 0xf0) == 0xd0) | |
| 249 | if ((csr & 0xf0) == 0xd0) // tx is timer driven | |
| 250 | 250 | { |
| 251 | 251 | m_chanA->tx_clock_w(half_period); |
| 252 | 252 | } |
| 253 | if ((csr & 0x0f) == 0x0d) | |
| 253 | if ((csr & 0x0f) == 0x0d) // rx is timer driven | |
| 254 | 254 | { |
| 255 | 255 | m_chanA->rx_clock_w(half_period); |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | csr = m_chanB->get_chan_CSR(); | |
| 259 | if ((csr & 0xf0) == 0xd0) // tx is timer driven | |
| 258 | csr = m_chanB->get_chan_CSR(); | |
| 259 | if ((csr & 0xf0) == 0xd0) // tx is timer driven | |
| 260 | 260 | { |
| 261 | 261 | m_chanB->tx_clock_w(half_period); |
| 262 | 262 | } |
| 263 | if ((csr & 0x0f) == 0x0d) | |
| 263 | if ((csr & 0x0f) == 0x0d) // rx is timer driven | |
| 264 | 264 | { |
| 265 | 265 | m_chanB->rx_clock_w(half_period); |
| 266 | 266 | } |
| r31373 | r31374 | |
| 721 | 721 | |
| 722 | 722 | void mc68681_channel::tra_complete() |
| 723 | 723 | { |
| 724 | // | |
| 724 | // printf("%s ch %d Tx complete\n", tag(), m_ch); | |
| 725 | 725 | tx_ready = 1; |
| 726 | 726 | SR |= STATUS_TRANSMITTER_READY; |
| 727 | 727 | |
| r31373 | r31374 | |
| 1147 | 1147 | { |
| 1148 | 1148 | return CSR; |
| 1149 | 1149 | } |
| 1150 |
| r31373 | r31374 | |
|---|---|---|
| 1046 | 1046 | |
| 1047 | 1047 | /* these two do not appear to be set at all! ?? */ |
| 1048 | 1048 | |
| 1049 | if (m_floppy[0]) | |
| 1049 | if (m_floppy[0]) | |
| 1050 | 1050 | { |
| 1051 | 1051 | if (m_floppy[0]->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY)) |
| 1052 | 1052 | { |
| r31373 | r31374 | |
| 1054 | 1054 | } |
| 1055 | 1055 | } |
| 1056 | 1056 | |
| 1057 | if (m_floppy[1]) | |
| 1057 | if (m_floppy[1]) | |
| 1058 | 1058 | { |
| 1059 | 1059 | if (m_floppy[1]->floppy_drive_get_flag_state(FLOPPY_DRIVE_READY)) |
| 1060 | 1060 | { |
| r31373 | r31374 | |
|---|---|---|
| 284 | 284 | // Keyboard |
| 285 | 285 | WRITE8_MEMBER( wd7600_device::keyb_data_w ) |
| 286 | 286 | { |
| 287 | // | |
| 287 | // if(LOG) logerror("WD7600 '%s': keyboard data write %02x\n", tag(), data); | |
| 288 | 288 | m_keybc->data_w(space,0,data); |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | READ8_MEMBER( wd7600_device::keyb_data_r ) |
| 292 | 292 | { |
| 293 | 293 | UINT8 ret = m_keybc->data_r(space,0); |
| 294 | // | |
| 294 | // if(LOG) logerror("WD7600 '%s': keyboard data read %02x\n", tag(), ret); | |
| 295 | 295 | return ret; |
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | WRITE8_MEMBER( wd7600_device::keyb_cmd_w ) |
| 299 | 299 | { |
| 300 | // | |
| 300 | // if(LOG) logerror("WD7600 '%s': keyboard command %02x\n", tag(), data); | |
| 301 | 301 | m_keybc->command_w(space,0,data); |
| 302 | 302 | } |
| 303 | 303 |
| r31373 | r31374 | |
|---|---|---|
| 224 | 224 | // |
| 225 | 225 | // Prep Commands |
| 226 | 226 | // |
| 227 | case PREP_MODE_SELECT: | |
| 227 | case PREP_MODE_SELECT: | |
| 228 | 228 | case PREP_RESET_DRIVE: |
| 229 | 229 | case PREP_FORMAT_DRIVE: |
| 230 | 230 | case PREP_FILL_DRIVE_OMNI: |
| r31373 | r31374 | |
| 692 | 692 | |
| 693 | 693 | // This firmware string and revision were taken from the Corvus firmware |
| 694 | 694 | // file CORVB184.CLR found on the SSE SoftBox distribution disk. |
| 695 | strcpy((char *) m_buffer.drive_param_response.firmware_desc, "V18.4 -- CONST II - 11/82 "); | |
| 695 | strcpy((char *) m_buffer.drive_param_response.firmware_desc, "V18.4 -- CONST II - 11/82 "); | |
| 696 | 696 | m_buffer.drive_param_response.firmware_rev = 37; |
| 697 | 697 | |
| 698 | 698 | // Controller ROM version |
| 699 | 699 | m_buffer.drive_param_response.rom_version = ROM_VERSION; |
| 700 | 700 | |
| 701 | 701 | // |
| 702 | ||
| 702 | // Track information | |
| 703 | 703 | // |
| 704 | 704 | m_buffer.drive_param_response.track_info.sectors_per_track = m_sectors_per_track; |
| 705 | 705 | m_buffer.drive_param_response.track_info.tracks_per_cylinder = m_tracks_per_cylinder; |
| r31373 | r31374 | |
| 766 | 766 | // |
| 767 | 767 | // Enter prep mode. In prep mode, only prep mode commands may be executed. |
| 768 | 768 | // |
| 769 | // A "prep block" is 512 bytes of machine code that the host sends to the | |
| 769 | // A "prep block" is 512 bytes of machine code that the host sends to the | |
| 770 | 770 | // controller. The controller will jump to this code after receiving it, |
| 771 | 771 | // and it is what actually implements prep mode commands. This HLE ignores |
| 772 | // the prep block from the host. | |
| 772 | // the prep block from the host. | |
| 773 | 773 | // |
| 774 | 774 | // On the Rev B/H drives (which we emulate), a prep block is Z80 machine |
| 775 | 775 | // code and only one prep block can be sent. Sending the "put drive into |
| r31373 | r31374 | |
| 778 | 778 | // distribution disk returns error 0x8f (unrecognized command) for this case. |
| 779 | 779 | // |
| 780 | 780 | // On the OmniDrive and Bank, a prep block is 6801 machine code. These |
| 781 | // controllers allow multiple prep blocks to be sent. The first time the | |
| 781 | // controllers allow multiple prep blocks to be sent. The first time the | |
| 782 | 782 | // "put drive into prep mode" command is sent puts the drive into prep mode. |
| 783 | // The command can then be sent again up to 3 times with more prep blocks. | |
| 783 | // The command can then be sent again up to 3 times with more prep blocks. | |
| 784 | 784 | // (Mass Storage GTI, pages 50-51) |
| 785 | 785 | // |
| 786 | 786 | // Pass: |
| r31373 | r31374 | |
| 791 | 791 | // Status of command |
| 792 | 792 | // |
| 793 | 793 | UINT8 corvus_hdc_t::corvus_enter_prep_mode(UINT8 drv, UINT8 *prep_block) { |
| 794 | // on rev b/h drives, sending the "put drive into prep mode" | |
| 794 | // on rev b/h drives, sending the "put drive into prep mode" | |
| 795 | 795 | // command when already in prep mode is an error. |
| 796 | 796 | if (m_prep_mode) { |
| 797 | 797 | logerror("corvus_enter_prep_mode: Attempt to enter prep mode while in prep mode\n"); |
| r31373 | r31374 | |
| 809 | 809 | |
| 810 | 810 | m_prep_mode = true; |
| 811 | 811 | m_prep_drv = drv; |
| 812 | return STAT_SUCCESS; | |
| 812 | return STAT_SUCCESS; | |
| 813 | 813 | } |
| 814 | 814 | |
| 815 | 815 | |
| r31373 | r31374 | |
| 826 | 826 | LOG(("corvus_exit_prep_mode: Prep mode exited\n")); |
| 827 | 827 | m_prep_mode = false; |
| 828 | 828 | m_prep_drv = 0; |
| 829 | return STAT_SUCCESS; | |
| 829 | return STAT_SUCCESS; | |
| 830 | 830 | } |
| 831 | 831 | |
| 832 | 832 | |
| r31373 | r31374 | |
| 852 | 852 | LOG(("corvus_read_firmware_block: Reading firmware head: 0x%2.2x, sector: 0x%2.2x, relative_sector: 0x%2.2x\n", |
| 853 | 853 | head, sector, relative_sector)); |
| 854 | 854 | |
| 855 | status = corvus_read_sector(m_prep_drv, relative_sector, m_buffer.read_512_response.data, 512); | |
| 855 | status = corvus_read_sector(m_prep_drv, relative_sector, m_buffer.read_512_response.data, 512); | |
| 856 | 856 | return status; |
| 857 | 857 | } |
| 858 | 858 | |
| r31373 | r31374 | |
| 880 | 880 | LOG(("corvus_write_firmware_block: Writing firmware head: 0x%2.2x, sector: 0x%2.2x, relative_sector: 0x%2.2x\n", |
| 881 | 881 | head, sector, relative_sector)); |
| 882 | 882 | |
| 883 | status = corvus_write_sector(m_prep_drv, relative_sector, buffer, 512); | |
| 883 | status = corvus_write_sector(m_prep_drv, relative_sector, buffer, 512); | |
| 884 | 884 | return status; |
| 885 | 885 | } |
| 886 | 886 | |
| r31373 | r31374 | |
| 1067 | 1067 | break; |
| 1068 | 1068 | case PREP_MODE_SELECT: |
| 1069 | 1069 | m_buffer.single_byte_response.status = |
| 1070 | corvus_enter_prep_mode(m_buffer.prep_mode_command.drive, | |
| 1070 | corvus_enter_prep_mode(m_buffer.prep_mode_command.drive, | |
| 1071 | 1071 | m_buffer.prep_mode_command.prep_block); |
| 1072 | 1072 | break; |
| 1073 | 1073 | default: |
| r31373 | r31374 | |
| 1082 | 1082 | // when already in prep mode, some drives allow this command to |
| 1083 | 1083 | // be sent again. see corvus_enter_prep_mode() for details. |
| 1084 | 1084 | m_buffer.single_byte_response.status = |
| 1085 | corvus_enter_prep_mode(m_buffer.prep_mode_command.drive, | |
| 1085 | corvus_enter_prep_mode(m_buffer.prep_mode_command.drive, | |
| 1086 | 1086 | m_buffer.prep_mode_command.prep_block); |
| 1087 | 1087 | break; |
| 1088 | 1088 | case PREP_RESET_DRIVE: |
| 1089 | m_buffer.single_byte_response.status = | |
| 1089 | m_buffer.single_byte_response.status = | |
| 1090 | 1090 | corvus_exit_prep_mode(); |
| 1091 | 1091 | break; |
| 1092 | 1092 | case PREP_READ_FIRMWARE: |
| r31373 | r31374 | |
| 1105 | 1105 | break; |
| 1106 | 1106 | case PREP_VERIFY: |
| 1107 | 1107 | m_buffer.verify_drive_response.status = STAT_SUCCESS; |
| 1108 | m_buffer.verify_drive_response.bad_sectors = 0; | |
| 1108 | m_buffer.verify_drive_response.bad_sectors = 0; | |
| 1109 | 1109 | break; |
| 1110 | 1110 | default: |
| 1111 | 1111 | m_xmit_bytes = 1; |
| r31373 | r31374 | |
|---|---|---|
| 462 | 462 | |
| 463 | 463 | if (m_dma_active) |
| 464 | 464 | { |
| 465 | ||
| 466 | 465 | } |
| 467 | 466 | } |
| r31373 | r31374 | |
|---|---|---|
| 608 | 608 | |
| 609 | 609 | void lsi53c810_device::add_opcode(UINT8 op, UINT8 mask, opcode_handler_delegate handler) |
| 610 | 610 | { |
| 611 | for (int i = 0; i < 256; i++) | |
| 611 | for (int i = 0; i < 256; i++) | |
| 612 | 612 | { |
| 613 | if ((i & mask) == op) | |
| 613 | if ((i & mask) == op) | |
| 614 | 614 | { |
| 615 | 615 | dma_opcode[i] = handler; |
| 616 | 616 | } |
| r31373 | r31374 | |
| 629 | 629 | m_irq_cb.bind_relative_to(*owner()); |
| 630 | 630 | m_dma_cb.bind_relative_to(*owner()); |
| 631 | 631 | m_fetch_cb.bind_relative_to(*owner()); |
| 632 | ||
| 632 | ||
| 633 | 633 | for (int i = 0; i < 256; i++) |
| 634 | 634 | { |
| 635 | 635 | dma_opcode[i] = opcode_handler_delegate(FUNC(lsi53c810_device::dmaop_invalid), this); |
| r31373 | r31374 | |
|---|---|---|
| 307 | 307 | if (!(*port->m_in_cb).isnull()) |
| 308 | 308 | { |
| 309 | 309 | port->m_in = (*port->m_in_cb)(0); |
| 310 | ||
| 310 | ||
| 311 | 311 | /* changes to port A need to update the PA7 state */ |
| 312 | 312 | if (port == &m_port[0]) |
| 313 | 313 | { |
| r31373 | r31374 | |
|---|---|---|
| 489 | 489 | { |
| 490 | 490 | bool ostate = m_drq_state[0]; |
| 491 | 491 | m_drq_state[0] = state; |
| 492 | ||
| 492 | ||
| 493 | 493 | if((m_reg[0].ocr & 2) && (state && !ostate)) |
| 494 | 494 | { |
| 495 | 495 | // in cycle steal mode drq is supposed to be edge triggered |
| r31373 | r31374 | |
| 518 | 518 | { |
| 519 | 519 | bool ostate = m_drq_state[2]; |
| 520 | 520 | m_drq_state[2] = state; |
| 521 | ||
| 521 | ||
| 522 | 522 | if((m_reg[2].ocr & 2) && (state && !ostate)) |
| 523 | 523 | { |
| 524 | 524 | single_transfer(2); |
| r31373 | r31374 | |
| 532 | 532 | { |
| 533 | 533 | bool ostate = m_drq_state[3]; |
| 534 | 534 | m_drq_state[3] = state; |
| 535 | ||
| 535 | ||
| 536 | 536 | if((m_reg[3].ocr & 2) && (state && !ostate)) |
| 537 | 537 | { |
| 538 | 538 | single_transfer(3); |
| r31373 | r31374 | |
|---|---|---|
| 286 | 286 | m_out_pa_cb.resolve_safe(); |
| 287 | 287 | m_out_pb_cb.resolve_safe(); |
| 288 | 288 | m_out_pc_cb.resolve_safe(); |
| 289 | ||
| 289 | ||
| 290 | 290 | // register for state saving |
| 291 | 291 | save_item(NAME(m_control)); |
| 292 | 292 | save_item(NAME(m_output)); |
| r31373 | r31374 | |
| 522 | 522 | m_out_pb_cb((offs_t)0, m_output[port]); |
| 523 | 523 | else |
| 524 | 524 | m_out_pc_cb((offs_t)0, m_output[port]); |
| 525 | ||
| 525 | ||
| 526 | 526 | // set output buffer full flag |
| 527 | 527 | set_obf(port, 0); |
| 528 | 528 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | CR-511-B CD-ROM drive | |
| 4 | 4 | |
| 5 | 5 | license: MAME, GPL-2.0+ |
| 6 | 6 | copyright-holders: Dirk Best |
| 7 | 7 | |
| 8 | CD-ROM drive with a custom MKE/Panasonic interface as used in the | |
| 9 | Commodore CDTV and early SoundBlaster cards. | |
| 8 | CD-ROM drive with a custom MKE/Panasonic interface as used in the | |
| 9 | Commodore CDTV and early SoundBlaster cards. | |
| 10 | 10 | |
| 11 | 11 | ***************************************************************************/ |
| 12 | 12 | |
| r31373 | r31374 | |
| 109 | 109 | |
| 110 | 110 | WRITE8_MEMBER ( cr511b_device::write ) |
| 111 | 111 | { |
| 112 | ||
| 113 | 112 | } |
| 114 | 113 | |
| 115 | 114 | WRITE_LINE_MEMBER( cr511b_device::enable_w ) |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | 2 | |
| 3 | ||
| 3 | !!! DEPRECATED, USE src/emu/wd_fdc.h FOR NEW DRIVERS !!! | |
| 4 | 4 | |
| 5 | 5 | wd17xx.c |
| 6 | 6 | |
| r31373 | r31374 | |
| 2024 | 2024 | |
| 2025 | 2025 | for (int i = 0; i < 4; i++) |
| 2026 | 2026 | { |
| 2027 | if (m_floppy_drive_tags[i]) | |
| 2027 | if (m_floppy_drive_tags[i]) | |
| 2028 | 2028 | { |
| 2029 | 2029 | legacy_floppy_image_device *img = siblingdevice<legacy_floppy_image_device>(m_floppy_drive_tags[i]); |
| 2030 | 2030 | |
| 2031 | if (img) | |
| 2031 | if (img) | |
| 2032 | 2032 | { |
| 2033 | 2033 | img->floppy_drive_set_controller(this); |
| 2034 | 2034 | img->floppy_drive_set_index_pulse_callback(wd17xx_index_pulse_callback); |
| r31373 | r31374 | |
|---|---|---|
| 124 | 124 | } |
| 125 | 125 | if ((m_status & STATUS_TRANSMIT_READY) && (m_control & CONTROL_TRANSMIT_IRQ_ENABLE)) |
| 126 | 126 | { |
| 127 | // | |
| 127 | // m_irq_state = ASSERT_LINE; | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | m_irq_handler(m_irq_state); |
| r31373 | r31374 | |
| 205 | 205 | { |
| 206 | 206 | m_rxd = state; |
| 207 | 207 | } |
| 208 |
| r31373 | r31374 | |
|---|---|---|
| 137 | 137 | m_zc1_cb.resolve_safe(); |
| 138 | 138 | m_zc2_cb.resolve_safe(); |
| 139 | 139 | m_zc3_cb.resolve_safe(); |
| 140 | ||
| 140 | ||
| 141 | 141 | // start each channel |
| 142 | 142 | m_channel[0].start(this, 0); |
| 143 | 143 | m_channel[1].start(this, 1); |
| r31373 | r31374 | |
| 520 | 520 | m_device->m_zc3_cb(0); |
| 521 | 521 | break; |
| 522 | 522 | } |
| 523 | ||
| 523 | ||
| 524 | 524 | // reset the down counter |
| 525 | 525 | m_down = m_tconst; |
| 526 | 526 | } |
| r31373 | r31374 | |
|---|---|---|
| 1 | /* | |
| 1 | /* | |
| 2 | 2 | (this acts as a trampoline to 2x i8255 chips) |
| 3 | 3 | |
| 4 | 4 | |
| r31373 | r31374 | |
| 12 | 12 | Note: MB89363B is compatible with 8255 |
| 13 | 13 | |
| 14 | 14 | Pin Assignment: |
| 15 | +5v | |
| 16 | P P P P P P P P P V P P P P P P P P P | |
| 17 | N N 5 4 4 4 4 4 4 4 4 C N 1 1 1 1 1 1 1 1 2 N N | |
| 18 | C C 3 0 1 2 3 4 5 6 7 C C 7 6 5 4 3 2 1 0 3 C C | |
| 19 | ||
| 20 | | | ^ ^ ^ ^ ^ ^ ^ ^ ^ | | ^ ^ ^ ^ ^ ^ ^ ^ ^ | | | |
| 21 | | | | | | | | | | | | | | | | | | | | | | | | | | |
| 22 | | | v v v v v v v v v | | v v v v v v v v v | | | |
| 23 | .-------------------------------------------------------. | |
| 24 | | 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 | | |
| 25 | | 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 | | |
| 26 | P52 <-> | 65 40 | <-> P22 | |
| 27 | P51 <-> | 66 39 | <-> P21 | |
| 28 | P50 <-> | 67 38 | <-> P20 | |
| 29 | P54 <-> | 68 37 | <-> P24 | |
| 30 | P55 <-> | 69 36 | <-> P25 | |
| 31 | P56 <-> | 70 35 | <-> P26 | |
| 32 | P57 <-> | 71 34 | <-> P27 | |
| 33 | NC --- | 72 MB89363B 33 | --- NC | |
| 15 | +5v | |
| 16 | P P P P P P P P P V P P P P P P P P P | |
| 17 | N N 5 4 4 4 4 4 4 4 4 C N 1 1 1 1 1 1 1 1 2 N N | |
| 18 | C C 3 0 1 2 3 4 5 6 7 C C 7 6 5 4 3 2 1 0 3 C C | |
| 19 | ||
| 20 | | | ^ ^ ^ ^ ^ ^ ^ ^ ^ | | ^ ^ ^ ^ ^ ^ ^ ^ ^ | | | |
| 21 | | | | | | | | | | | | | | | | | | | | | | | | | | |
| 22 | | | v v v v v v v v v | | v v v v v v v v v | | | |
| 23 | .-------------------------------------------------------. | |
| 24 | | 6 6 6 6 6 5 5 5 5 5 5 5 5 5 5 4 4 4 4 4 4 4 4 4 | | |
| 25 | | 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 | | |
| 26 | P52 <-> | 65 40 | <-> P22 | |
| 27 | P51 <-> | 66 39 | <-> P21 | |
| 28 | P50 <-> | 67 38 | <-> P20 | |
| 29 | P54 <-> | 68 37 | <-> P24 | |
| 30 | P55 <-> | 69 36 | <-> P25 | |
| 31 | P56 <-> | 70 35 | <-> P26 | |
| 32 | P57 <-> | 71 34 | <-> P27 | |
| 33 | NC --- | 72 MB89363B 33 | --- NC | |
| 34 | 34 | NC --- | 73 32 | <-- RSLCT1 |
| 35 | 35 | GND --> | 74 31 | <-- RSLCT0 |
| 36 | CS2 --> | 75 30 | <-- GND | |
| 37 | R --> | 76 29 | <-- CS1 | |
| 38 | P30 <-> | 77 28 | <-> P00 | |
| 39 | P31 <-> | 78 27 | <-> P01 | |
| 40 | P32 <-> | 79 26 | <-> P02 | |
| 41 | P33 <-> | 80 25 | <-> P03 | |
| 42 | \ 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 | | |
| 43 | \ 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 | | |
| 44 | -----------------------------------------------------' | |
| 45 | ^ ^ ^ ^ ^ ^ | | ^ | ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ | | |
| 46 | | | | | | | | | | | | | | | | | | | | | | | | | | |
| 47 | v v v v | | | | | | | v v v v v v v v v v v v | | |
| 48 | ||
| 49 | P P P P W R N N R N O D D D D D D D D P P P P N | |
| 50 | 3 3 3 3 S C C H C U B B B B B B B B 0 0 0 0 C | |
| 51 | 4 5 6 7 T / S 0 1 2 3 4 5 6 7 7 6 5 4 | |
| 52 | R / | |
| 53 | L I | |
| 54 | N | |
| 55 | S | |
| 36 | CS2 --> | 75 30 | <-- GND | |
| 37 | R --> | 76 29 | <-- CS1 | |
| 38 | P30 <-> | 77 28 | <-> P00 | |
| 39 | P31 <-> | 78 27 | <-> P01 | |
| 40 | P32 <-> | 79 26 | <-> P02 | |
| 41 | P33 <-> | 80 25 | <-> P03 | |
| 42 | \ 1 1 1 1 1 1 1 1 1 1 2 2 2 2 2 | | |
| 43 | \ 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 | | |
| 44 | -----------------------------------------------------' | |
| 45 | ^ ^ ^ ^ ^ ^ | | ^ | ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ ^ | | |
| 46 | | | | | | | | | | | | | | | | | | | | | | | | | | |
| 47 | v v v v | | | | | | | v v v v v v v v v v v v | | |
| 56 | 48 | |
| 49 | P P P P W R N N R N O D D D D D D D D P P P P N | |
| 50 | 3 3 3 3 S C C H C U B B B B B B B B 0 0 0 0 C | |
| 51 | 4 5 6 7 T / S 0 1 2 3 4 5 6 7 7 6 5 4 | |
| 52 | R / | |
| 53 | L I | |
| 54 | N | |
| 55 | S | |
| 56 | ||
| 57 | 57 | Block Diagram / Pin Descriptions: |
| 58 | 58 | http://www.mess.org/_media/datasheets/fujitsu/mb89363b_partial.pdf |
| 59 | 59 |
| r31373 | r31374 | |
|---|---|---|
| 708 | 708 | case IDE_CS1_ACTIVE_STATUS: |
| 709 | 709 | /* |
| 710 | 710 | |
| 711 | | |
| 711 | bit description | |
| 712 | 712 | |
| 713 | 0 master active | |
| 714 | 1 slave active | |
| 715 | 2 complement of active disk head bit 0 | |
| 716 | 3 complement of active disk head bit 1 | |
| 717 | 4 complement of active disk head bit 2 | |
| 718 | 5 complement of active disk head bit 3 | |
| 719 | 6 write in progress | |
| 720 | 7 floppy present (unused) | |
| 713 | 0 master active | |
| 714 | 1 slave active | |
| 715 | 2 complement of active disk head bit 0 | |
| 716 | 3 complement of active disk head bit 1 | |
| 717 | 4 complement of active disk head bit 2 | |
| 718 | 5 complement of active disk head bit 3 | |
| 719 | 6 write in progress | |
| 720 | 7 floppy present (unused) | |
| 721 | 721 | |
| 722 | 722 | */ |
| 723 | 723 | if (device_selected()) |
| r31373 | r31374 | |
|---|---|---|
| 763 | 763 | eeprom_serial_x24c44_device::eeprom_serial_x24c44_device(const machine_config &mconfig, device_type devtype, const char *name, const char *tag, device_t *owner, const char *shortname, const char *file) |
| 764 | 764 | : eeprom_serial_base_device(mconfig, devtype, name, tag, owner, shortname, file) |
| 765 | 765 | { |
| 766 | ||
| 767 | 766 | } |
| 768 | 767 | |
| 769 | 768 | |
| r31373 | r31374 | |
| 785 | 784 | m_ram_length=0xf; |
| 786 | 785 | |
| 787 | 786 | for (i=0;i<16;i++){ |
| 788 | m_ram_data[i]=read(i); | |
| 787 | m_ram_data[i]=read(i); //autoreload at power up | |
| 789 | 788 | } |
| 790 | 789 | m_reading=0; |
| 791 | 790 | m_store_latch=0; |
| r31373 | r31374 | |
| 828 | 827 | }else{ |
| 829 | 828 | LOG0(("Store command with store latch not set!\n")); |
| 830 | 829 | } |
| 831 | ||
| 830 | ||
| 832 | 831 | } |
| 833 | 832 | |
| 834 | 833 | //------------------------------------------------- |
| r31373 | r31374 | |
| 902 | 901 | copy_ram_to_eeprom(); |
| 903 | 902 | set_state(STATE_IN_RESET); |
| 904 | 903 | break; |
| 905 | ||
| 904 | ||
| 906 | 905 | default: |
| 907 | 906 | throw emu_fatalerror("execute_command called with invalid command %d\n", m_command); |
| 908 | 907 | } |
| r31373 | r31374 | |
| 959 | 958 | { |
| 960 | 959 | // if we have enough bits for a command + address, check it out |
| 961 | 960 | m_command_address_accum = (m_command_address_accum << 1) | m_di_state; |
| 962 | ||
| 961 | ||
| 963 | 962 | m_bits_accum=m_bits_accum+1; |
| 964 | ||
| 963 | ||
| 965 | 964 | if (m_bits_accum == 2 + m_command_address_bits){ |
| 966 | 965 | //read command is only 2 bits all other are 3 bits!!! |
| 967 | 966 | |
| 968 | 967 | parse_command_and_address_2_bit(); |
| 969 | 968 | |
| 970 | 969 | } |
| 971 | ||
| 970 | ||
| 972 | 971 | if (!m_reading){ |
| 973 | 972 | if (m_bits_accum == 3 + m_command_address_bits){ |
| 974 | 973 | execute_command(); |
| r31373 | r31374 | |
| 983 | 982 | case STATE_READING_DATA: |
| 984 | 983 | if (event == EVENT_CLK_RISING_EDGE) |
| 985 | 984 | { |
| 986 | ||
| 987 | 985 | int bit_index = m_bits_accum++; |
| 988 | 986 | |
| 989 | 987 | if (bit_index % m_data_bits == 0 && (bit_index == 0 || m_streaming_enabled)){ |
| 990 | ||
| 991 | 988 | m_shift_register=m_ram_data[m_address]; |
| 992 | ||
| 989 | ||
| 993 | 990 | //m_shift_register=BITSWAP16(m_shift_register,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15); |
| 994 | 991 | //m_shift_register=BITSWAP16(m_shift_register,7,6,5,4,3,2,1,0,15,14,13,12,11,10,9,8); |
| 995 | 992 | m_shift_register= BITSWAP16(m_shift_register,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7); |
| 996 | 993 | |
| 997 | 994 | m_shift_register=m_shift_register<<16; |
| 998 | ||
| 995 | ||
| 999 | 996 | LOG1(("read from RAM addr %02X data(from ram) %04X ,m_shift_register vale %04X \n",m_address,m_ram_data[m_address],m_shift_register)); |
| 1000 | 997 | } |
| 1001 | 998 | else{ |
| 1002 | ||
| 1003 | 999 | m_shift_register = (m_shift_register << 1) | 1; |
| 1004 | 1000 | |
| 1005 | 1001 | } |
| r31373 | r31374 | |
| 1023 | 1019 | case STATE_WAIT_FOR_DATA: |
| 1024 | 1020 | if (event == EVENT_CLK_RISING_EDGE) |
| 1025 | 1021 | { |
| 1026 | ||
| 1027 | 1022 | m_shift_register = (m_shift_register << 1) | m_di_state; |
| 1028 | 1023 | if (++m_bits_accum == m_data_bits){ |
| 1029 | ||
| 1030 | 1024 | //m_shift_register=BITSWAP16(m_shift_register, 0, 1, 2, 3, 4, 5,6,7, 8, 9,10,11,12,13,14,15); |
| 1031 | 1025 | //m_shift_register=BITSWAP16(m_shift_register, 7, 6, 5, 4, 3, 2,1,0,15,14,13,12,11,10, 9, 8); |
| 1032 | 1026 | m_shift_register=BITSWAP16(m_shift_register,8,9,10,11,12,13,14,15,0,1,2,3,4,5,6,7); |
| r31373 | r31374 | |
| 1042 | 1036 | } |
| 1043 | 1037 | break; |
| 1044 | 1038 | |
| 1045 | ||
| 1039 | ||
| 1046 | 1040 | // CS is asserted; waiting for completion; watch for CS falling |
| 1047 | 1041 | case STATE_WAIT_FOR_COMPLETION: |
| 1048 | 1042 | if (event == EVENT_CS_FALLING_EDGE) |
| r31373 | r31374 | |
| 1059 | 1053 | |
| 1060 | 1054 | void eeprom_serial_x24c44_device::parse_command_and_address() |
| 1061 | 1055 | { |
| 1062 | ||
| 1063 | 1056 | //command is start_bit - 4bit_address - 3bit_command |
| 1064 | 1057 | |
| 1065 | 1058 | // set the defaults |
| r31373 | r31374 | |
| 1068 | 1061 | m_address = (m_command_address_accum >> 3) & 0x0f; |
| 1069 | 1062 | |
| 1070 | 1063 | LOG1(("EEPROM: command= %04X, address %02X\n", m_command_address_accum& 0x07, m_address)); |
| 1071 | ||
| 1064 | ||
| 1072 | 1065 | switch (m_command_address_accum & 0x07) |
| 1073 | 1066 | { |
| 1074 | case 0: | |
| 1067 | case 0: //reset write enable latch | |
| 1075 | 1068 | LOG0(("Lock eeprom\n")); |
| 1076 | m_command = COMMAND_LOCK; | |
| 1069 | m_command = COMMAND_LOCK; break; | |
| 1077 | 1070 | case 3: //write data into ram |
| 1078 | 1071 | LOG0(("Write to ram\n")); |
| 1079 | m_command = COMMAND_WRITE; | |
| 1072 | m_command = COMMAND_WRITE; break; | |
| 1080 | 1073 | case 4: //set write enable latch |
| 1081 | 1074 | LOG0(("Unlock eeprom\n")); |
| 1082 | m_command = COMMAND_UNLOCK; | |
| 1075 | m_command = COMMAND_UNLOCK; break; | |
| 1083 | 1076 | case 1: //store ram data in eeprom |
| 1084 | 1077 | LOG0(("copy ram to eeprom\n")); |
| 1085 | 1078 | m_command = COMMAND_COPY_RAM_TO_EEPROM; break; |
| 1086 | 1079 | case 5: //reload eeprom data into ram |
| 1087 | 1080 | LOG0(("copy eeprom to ram\n")); |
| 1088 | m_command = COMMAND_COPY_EEPROM_TO_RAM; | |
| 1081 | m_command = COMMAND_COPY_EEPROM_TO_RAM; break; | |
| 1089 | 1082 | case 2: //reserved (Sleep on x2444) |
| 1090 | 1083 | m_command = COMMAND_INVALID; |
| 1091 | break; | |
| 1084 | break; | |
| 1092 | 1085 | |
| 1093 | 1086 | } |
| 1094 | 1087 | |
| r31373 | r31374 | |
| 1096 | 1089 | |
| 1097 | 1090 | void eeprom_serial_x24c44_device::parse_command_and_address_2_bit() |
| 1098 | 1091 | { |
| 1099 | ||
| 1100 | ||
| 1101 | 1092 | if ((m_command_address_accum & 0x03) == 0x03){ |
| 1102 | ||
| 1103 | 1093 | m_command = COMMAND_READ; |
| 1104 | 1094 | m_address = ((m_command_address_accum >> 2) & 0x0f); |
| 1105 | 1095 | m_shift_register = 0; |
| r31373 | r31374 | |
| 1108 | 1098 | m_reading=1; |
| 1109 | 1099 | m_bits_accum=0; |
| 1110 | 1100 | } |
| 1111 | ||
| 1101 | ||
| 1112 | 1102 | // warn about out-of-range addresses |
| 1113 | 1103 | if (m_address >= (1 << m_address_bits)) |
| 1114 | 1104 | LOG1(("EEPROM: out-of-range address 0x%X provided (maximum should be 0x%X)\n", m_address, (1 << m_address_bits) - 1)); |
| r31373 | r31374 | |
|---|---|---|
| 15 | 15 | READ8_MEMBER( m68307cpu_device::m68307_internal_serial_r ) |
| 16 | 16 | { |
| 17 | 17 | m68307cpu_device *m68k = this; |
| 18 | ||
| 18 | ||
| 19 | 19 | if (offset&1) return m_duart->read(*m68k->program, offset>>1); |
| 20 | 20 | return 0x0000; |
| 21 | 21 | } |
| r31373 | r31374 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | NETLIB_UPDATE(nicRSFF) |
| 24 | 24 | { |
| 25 | if (!INPLOGIC(m_S)) | |
| 26 | { | |
| 27 | OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(20)); | |
| 28 | OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(20)); | |
| 29 | } | |
| 30 | else if (!INPLOGIC(m_R)) | |
| 25 | if (!INPLOGIC(m_S)) | |
| 31 | 26 | { |
| 27 | OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(20)); | |
| 28 | OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(20)); | |
| 29 | } | |
| 30 | else if (!INPLOGIC(m_R)) | |
| 31 | { | |
| 32 | 32 | OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(20)); |
| 33 | 33 | OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(20)); |
| 34 | 34 | } |
| r31373 | r31374 | |
|---|---|---|
| 89 | 89 | ENTRY(D, DIODE, "model") |
| 90 | 90 | ENTRY(VCVS, VCVS, "-") // FIXME: STD parameters ? |
| 91 | 91 | ENTRY(VCCS, VCCS, "-") |
| 92 | ENTRY(CCCS, CCCS, "-") | |
| 93 | ENTRY(dummy_input, DUMMY_INPUT, "-") | |
| 92 | ENTRY(CCCS, CCCS, "-") | |
| 93 | ENTRY(dummy_input, DUMMY_INPUT, "-") | |
| 94 | 94 | ENTRY(QBJT_EB, QBJT_EB, "model") |
| 95 | 95 | ENTRY(QBJT_switch, QBJT_SW, "model") |
| 96 | 96 | ENTRY(ttl_input, TTL_INPUT, "IN") |
| r31373 | r31374 | |
| 103 | 103 | ENTRY(gnd, GND, "-") |
| 104 | 104 | ENTRY(switch2, SWITCH2, "-") |
| 105 | 105 | ENTRY(nicRSFF, NETDEV_RSFF, "+S,R") |
| 106 | ENTRY(4020, CD_4020, "+IP,RESET,VDD,VSS") | |
| 107 | //ENTRY(4066, CD_4066, "+A,B") | |
| 106 | ENTRY(4020, CD_4020, "+IP,RESET,VDD,VSS") | |
| 107 | //ENTRY(4066, CD_4066, "+A,B") | |
| 108 | 108 | ENTRY(7400, TTL_7400_NAND, "+A,B") |
| 109 | 109 | ENTRY(7402, TTL_7402_NOR, "+A,B") |
| 110 | 110 | ENTRY(7404, TTL_7404_INVERT, "+A") |
| 111 | ||
| 111 | ENTRY(7408, TTL_7408_AND, "+A,B") | |
| 112 | 112 | ENTRY(7410, TTL_7410_NAND, "+A,B,C") |
| 113 | ||
| 113 | ENTRY(7411, TTL_7411_AND, "+A,B,C") | |
| 114 | 114 | ENTRY(7420, TTL_7420_NAND, "+A,B,C,D") |
| 115 | 115 | ENTRY(7425, TTL_7425_NOR, "+A,B,C,D") |
| 116 | 116 | ENTRY(7427, TTL_7427_NOR, "+A,B,C") |
| 117 | 117 | ENTRY(7430, TTL_7430_NAND, "+A,B,C,D,E,F,G,H") |
| 118 | ENTRY(7432, TTL_7432_OR, "+A,B") | |
| 119 | ENTRY(7437, TTL_7437_NAND, "+A,B") | |
| 118 | ENTRY(7432, TTL_7432_OR, "+A,B") | |
| 119 | ENTRY(7437, TTL_7437_NAND, "+A,B") | |
| 120 | 120 | ENTRY(7450, TTL_7450_ANDORINVERT, "+A,B,C,D") |
| 121 | 121 | ENTRY(7486, TTL_7486_XOR, "+A,B") |
| 122 | 122 | ENTRY(7448, TTL_7448, "+A,B,C,D,LTQ,BIQ,RBIQ") |
| r31373 | r31374 | |
| 126 | 126 | ENTRY(7493, TTL_7493, "+CLKA,CLKB,R1,R2") |
| 127 | 127 | ENTRY(74107, TTL_74107, "+CLK,J,K,CLRQ") |
| 128 | 128 | ENTRY(74107A, TTL_74107A, "+CLK,J,K,CLRQ") |
| 129 | ||
| 129 | ENTRY(74123, TTL_74123, "-") | |
| 130 | 130 | ENTRY(74153, TTL_74153, "+C0,C1,C2,C3,A,B,G") |
| 131 | 131 | ENTRY(SN74LS629, SN74LS629, "CAP") |
| 132 | 132 | ENTRY(9316, TTL_9316, "+CLK,ENP,ENT,CLRQ,LOADQ,A,B,C,D") |
| 133 | 133 | ENTRY(NE555, NE555, "-") |
| 134 | ||
| 134 | ENTRY(r2r_dac, R2R_DAC, "+VIN,R,N") | |
| 135 | 135 | ENTRY(4020_dip, CD_4020_DIP, "-") |
| 136 | ||
| 136 | ENTRY(4066_dip, CD_4066_DIP, "-") | |
| 137 | 137 | ENTRY(7400_dip, TTL_7400_DIP, "-") |
| 138 | 138 | ENTRY(7402_dip, TTL_7402_DIP, "-") |
| 139 | 139 | ENTRY(7404_dip, TTL_7404_DIP, "-") |
| 140 | ||
| 140 | ENTRY(7408_dip, TTL_7408_DIP, "-") | |
| 141 | 141 | ENTRY(7410_dip, TTL_7410_DIP, "-") |
| 142 | ||
| 142 | ENTRY(7411_dip, TTL_7411_DIP, "-") | |
| 143 | 143 | ENTRY(7420_dip, TTL_7420_DIP, "-") |
| 144 | 144 | ENTRY(7425_dip, TTL_7425_DIP, "-") |
| 145 | 145 | ENTRY(7427_dip, TTL_7427_DIP, "-") |
| 146 | 146 | ENTRY(7430_dip, TTL_7430_DIP, "-") |
| 147 | ENTRY(7432_dip, TTL_7432_DIP, "-") | |
| 148 | ENTRY(7437_dip, TTL_7437_DIP, "-") | |
| 147 | ENTRY(7432_dip, TTL_7432_DIP, "-") | |
| 148 | ENTRY(7437_dip, TTL_7437_DIP, "-") | |
| 149 | 149 | ENTRY(7448_dip, TTL_7448_DIP, "-") |
| 150 | 150 | ENTRY(7450_dip, TTL_7450_DIP, "-") |
| 151 | 151 | ENTRY(7474_dip, TTL_7474_DIP, "-") |
| r31373 | r31374 | |
| 154 | 154 | ENTRY(7490_dip, TTL_7490_DIP, "-") |
| 155 | 155 | ENTRY(7493_dip, TTL_7493_DIP, "-") |
| 156 | 156 | ENTRY(74107_dip, TTL_74107_DIP, "-") |
| 157 | ||
| 157 | ENTRY(74123_dip, TTL_74123_DIP, "-") | |
| 158 | 158 | ENTRY(74153_dip, TTL_74153_DIP, "-") |
| 159 | 159 | ENTRY(9316_dip, TTL_9316_DIP, "-") |
| 160 | 160 | ENTRY(SN74LS629_dip, SN74LS629_DIP, "1.CAP1,2.CAP2") |
| r31373 | r31374 | |
|---|---|---|
| 89 | 89 | |
| 90 | 90 | ATTR_COLD void nld_d_to_a_proxy::start() |
| 91 | 91 | { |
| 92 | ||
| 92 | nld_base_d_to_a_proxy::start(); | |
| 93 | 93 | |
| 94 | register_sub(m_RV, "RV"); | |
| 95 | register_terminal("1", m_RV.m_P); | |
| 96 | register_terminal("2", m_RV.m_N); | |
| 94 | register_sub(m_RV, "RV"); | |
| 95 | register_terminal("1", m_RV.m_P); | |
| 96 | register_terminal("2", m_RV.m_N); | |
| 97 | 97 | |
| 98 | register_output("_Q", m_Q); | |
| 99 | register_subalias("Q", m_RV.m_P); | |
| 98 | register_output("_Q", m_Q); | |
| 99 | register_subalias("Q", m_RV.m_P); | |
| 100 | 100 | |
| 101 | connect(m_RV.m_N, m_Q); | |
| 102 | m_Q.initial(0.0); | |
| 101 | connect(m_RV.m_N, m_Q); | |
| 102 | m_Q.initial(0.0); | |
| 103 | 103 | } |
| 104 | 104 | |
| 105 | 105 | ATTR_COLD void nld_d_to_a_proxy::reset() |
| 106 | 106 | { |
| 107 | ||
| 107 | m_RV.do_reset(); | |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | ATTR_COLD netlist_core_terminal_t &nld_d_to_a_proxy::out() |
| 111 | 111 | { |
| 112 | ||
| 112 | return m_RV.m_P; | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | ATTR_HOT ATTR_ALIGN void nld_d_to_a_proxy::update() |
| 116 | 116 | { |
| 117 | const int state = INPLOGIC(m_I); | |
| 118 | if (state != m_last_state) | |
| 119 | { | |
| 120 | m_last_state = state; | |
| 121 | const double R = state ? m_logic_family->m_R_high : m_logic_family->m_R_low; | |
| 122 | const double V = state ? m_logic_family->m_high_V : m_logic_family->m_low_V; | |
| 117 | const int state = INPLOGIC(m_I); | |
| 118 | if (state != m_last_state) | |
| 119 | { | |
| 120 | m_last_state = state; | |
| 121 | const double R = state ? m_logic_family->m_R_high : m_logic_family->m_R_low; | |
| 122 | const double V = state ? m_logic_family->m_high_V : m_logic_family->m_low_V; | |
| 123 | 123 | |
| 124 | // We only need to update the net first if this is a time stepping net | |
| 125 | if (m_RV.m_P.net().as_analog().solver()->is_timestep()) | |
| 126 | { | |
| 127 | m_RV.update_dev(); | |
| 128 | m_RV.set(1.0 / R, V, 0.0); | |
| 129 | m_RV.m_P.schedule_after(NLTIME_FROM_NS(1)); | |
| 130 | } | |
| 131 | else | |
| 132 | { | |
| 133 | m_RV.set(1.0 / R, V, 0.0); | |
| 134 | m_RV.update_dev(); | |
| 135 | } | |
| 136 | } | |
| 124 | // We only need to update the net first if this is a time stepping net | |
| 125 | if (m_RV.m_P.net().as_analog().solver()->is_timestep()) | |
| 126 | { | |
| 127 | m_RV.update_dev(); | |
| 128 | m_RV.set(1.0 / R, V, 0.0); | |
| 129 | m_RV.m_P.schedule_after(NLTIME_FROM_NS(1)); | |
| 130 | } | |
| 131 | else | |
| 132 | { | |
| 133 | m_RV.set(1.0 / R, V, 0.0); | |
| 134 | m_RV.update_dev(); | |
| 135 | } | |
| 136 | } | |
| 137 | 137 | } |
| r31373 | r31374 | |
|---|---|---|
| 10 | 10 | register_sub(sub, "sub"); |
| 11 | 11 | |
| 12 | 12 | register_input("RESET", m_RESET); |
| 13 | register_subalias("IP", sub.m_IP); | |
| 14 | register_subalias("Q1", sub.m_Q[0]); | |
| 15 | register_subalias("Q4", sub.m_Q[3]); | |
| 16 | register_subalias("Q5", sub.m_Q[4]); | |
| 17 | register_subalias("Q6", sub.m_Q[5]); | |
| 18 | register_subalias("Q7", sub.m_Q[6]); | |
| 19 | register_subalias("Q8", sub.m_Q[7]); | |
| 20 | register_subalias("Q9", sub.m_Q[8]); | |
| 21 | register_subalias("Q10", sub.m_Q[9]); | |
| 22 | register_subalias("Q11", sub.m_Q[10]); | |
| 23 | register_subalias("Q12", sub.m_Q[11]); | |
| 24 | register_subalias("Q13", sub.m_Q[12]); | |
| 25 | register_subalias("Q14", sub.m_Q[13]); | |
| 26 | register_subalias("VDD", m_supply.m_vdd); | |
| 27 | register_subalias("VSS", m_supply.m_vss); | |
| 13 | register_subalias("IP", sub.m_IP); | |
| 14 | register_subalias("Q1", sub.m_Q[0]); | |
| 15 | register_subalias("Q4", sub.m_Q[3]); | |
| 16 | register_subalias("Q5", sub.m_Q[4]); | |
| 17 | register_subalias("Q6", sub.m_Q[5]); | |
| 18 | register_subalias("Q7", sub.m_Q[6]); | |
| 19 | register_subalias("Q8", sub.m_Q[7]); | |
| 20 | register_subalias("Q9", sub.m_Q[8]); | |
| 21 | register_subalias("Q10", sub.m_Q[9]); | |
| 22 | register_subalias("Q11", sub.m_Q[10]); | |
| 23 | register_subalias("Q12", sub.m_Q[11]); | |
| 24 | register_subalias("Q13", sub.m_Q[12]); | |
| 25 | register_subalias("Q14", sub.m_Q[13]); | |
| 26 | register_subalias("VDD", m_supply.m_vdd); | |
| 27 | register_subalias("VSS", m_supply.m_vss); | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | NETLIB_RESET(4020) |
| r31373 | r31374 | |
| 38 | 38 | register_input("IP", m_IP); |
| 39 | 39 | |
| 40 | 40 | register_output("Q1", m_Q[0]); |
| 41 | register_output("Q4", m_Q[3]); | |
| 42 | register_output("Q5", m_Q[4]); | |
| 43 | register_output("Q6", m_Q[5]); | |
| 44 | register_output("Q7", m_Q[6]); | |
| 45 | register_output("Q8", m_Q[8]); | |
| 46 | register_output("Q9", m_Q[8]); | |
| 47 | register_output("Q10", m_Q[9]); | |
| 48 | register_output("Q11", m_Q[10]); | |
| 49 | register_output("Q12", m_Q[11]); | |
| 50 | register_output("Q13", m_Q[12]); | |
| 41 | register_output("Q4", m_Q[3]); | |
| 42 | register_output("Q5", m_Q[4]); | |
| 43 | register_output("Q6", m_Q[5]); | |
| 44 | register_output("Q7", m_Q[6]); | |
| 45 | register_output("Q8", m_Q[8]); | |
| 46 | register_output("Q9", m_Q[8]); | |
| 47 | register_output("Q10", m_Q[9]); | |
| 48 | register_output("Q11", m_Q[10]); | |
| 49 | register_output("Q12", m_Q[11]); | |
| 50 | register_output("Q13", m_Q[12]); | |
| 51 | 51 | register_output("Q14", m_Q[13]); |
| 52 | 52 | |
| 53 | 53 | save(NAME(m_cnt)); |
| r31373 | r31374 | |
| 62 | 62 | NETLIB_UPDATE(4020_sub) |
| 63 | 63 | { |
| 64 | 64 | UINT8 cnt = m_cnt; |
| 65 | cnt = ( cnt + 1) & 0x3fff; | |
| 66 | update_outputs(cnt); | |
| 65 | cnt = ( cnt + 1) & 0x3fff; | |
| 66 | update_outputs(cnt); | |
| 67 | 67 | m_cnt = cnt; |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | NETLIB_UPDATE(4020) |
| 71 | 71 | { |
| 72 | ||
| 73 | if (INPLOGIC(m_RESET)) | |
| 74 | { | |
| 75 | sub.m_cnt = 0; | |
| 76 | sub.m_IP.inactivate(); | |
| 77 | static const netlist_time reset_time = netlist_time::from_nsec(140); | |
| 78 | OUTLOGIC(sub.m_Q[0], 0, reset_time); | |
| 79 | for (int i=3; i<14; i++) | |
| 80 | OUTLOGIC(sub.m_Q[i], 0, reset_time); | |
| 81 | } | |
| 82 | else | |
| 83 | sub.m_IP.activate_hl(); | |
| 72 | if (INPLOGIC(m_RESET)) | |
| 73 | { | |
| 74 | sub.m_cnt = 0; | |
| 75 | sub.m_IP.inactivate(); | |
| 76 | static const netlist_time reset_time = netlist_time::from_nsec(140); | |
| 77 | OUTLOGIC(sub.m_Q[0], 0, reset_time); | |
| 78 | for (int i=3; i<14; i++) | |
| 79 | OUTLOGIC(sub.m_Q[i], 0, reset_time); | |
| 80 | } | |
| 81 | else | |
| 82 | sub.m_IP.activate_hl(); | |
| 84 | 83 | } |
| 85 | 84 | |
| 86 | 85 | inline NETLIB_FUNC_VOID(4020_sub, update_outputs, (const UINT16 cnt)) |
| 87 | 86 | { |
| 88 | static const netlist_time out_delayQn[14] = { | |
| 89 | NLTIME_FROM_NS(180), NLTIME_FROM_NS(280), | |
| 90 | NLTIME_FROM_NS(380), NLTIME_FROM_NS(480), | |
| 91 | NLTIME_FROM_NS(580), NLTIME_FROM_NS(680), | |
| 92 | NLTIME_FROM_NS(780), NLTIME_FROM_NS(880), | |
| 93 | NLTIME_FROM_NS(980), NLTIME_FROM_NS(1080), | |
| 94 | NLTIME_FROM_NS(1180), NLTIME_FROM_NS(1280), | |
| 95 | NLTIME_FROM_NS(1380), NLTIME_FROM_NS(1480), | |
| 96 | }; | |
| 87 | static const netlist_time out_delayQn[14] = { | |
| 88 | NLTIME_FROM_NS(180), NLTIME_FROM_NS(280), | |
| 89 | NLTIME_FROM_NS(380), NLTIME_FROM_NS(480), | |
| 90 | NLTIME_FROM_NS(580), NLTIME_FROM_NS(680), | |
| 91 | NLTIME_FROM_NS(780), NLTIME_FROM_NS(880), | |
| 92 | NLTIME_FROM_NS(980), NLTIME_FROM_NS(1080), | |
| 93 | NLTIME_FROM_NS(1180), NLTIME_FROM_NS(1280), | |
| 94 | NLTIME_FROM_NS(1380), NLTIME_FROM_NS(1480), | |
| 95 | }; | |
| 97 | 96 | |
| 98 | OUTLOGIC(m_Q[0], 0, out_delayQn[0]); | |
| 99 | for (int i=3; i<14; i++) | |
| 100 | OUTLOGIC(m_Q[i], (cnt >> i) & 1, out_delayQn[i]); | |
| 97 | OUTLOGIC(m_Q[0], 0, out_delayQn[0]); | |
| 98 | for (int i=3; i<14; i++) | |
| 99 | OUTLOGIC(m_Q[i], (cnt >> i) & 1, out_delayQn[i]); | |
| 101 | 100 | } |
| 102 | 101 | |
| 103 | 102 | NETLIB_START(4020_dip) |
| 104 | 103 | { |
| 105 | 104 | NETLIB_NAME(4020)::start(); |
| 106 | 105 | |
| 107 | /* +--------------+ | |
| 108 | * Q12 |1 ++ 16| VDD | |
| 109 | * Q13 |2 15| Q11 | |
| 110 | * Q14 |3 14| Q10 | |
| 111 | * Q6 |4 4020 13| Q8 | |
| 112 | * Q5 |5 12| Q9 | |
| 113 | * Q7 |6 11| RESET | |
| 114 | * Q4 |7 10| IP (Input pulses) | |
| 115 | * VSS |8 9| Q1 | |
| 116 | * +--------------+ | |
| 117 | */ | |
| 106 | /* +--------------+ | |
| 107 | * Q12 |1 ++ 16| VDD | |
| 108 | * Q13 |2 15| Q11 | |
| 109 | * Q14 |3 14| Q10 | |
| 110 | * Q6 |4 4020 13| Q8 | |
| 111 | * Q5 |5 12| Q9 | |
| 112 | * Q7 |6 11| RESET | |
| 113 | * Q4 |7 10| IP (Input pulses) | |
| 114 | * VSS |8 9| Q1 | |
| 115 | * +--------------+ | |
| 116 | */ | |
| 118 | 117 | |
| 119 | 118 | register_subalias("1", sub.m_Q[11]); |
| 120 | 119 | register_subalias("2", sub.m_Q[12]); |
| r31373 | r31374 | |
| 123 | 122 | register_subalias("5", sub.m_Q[4]); |
| 124 | 123 | register_subalias("6", sub.m_Q[6]); |
| 125 | 124 | register_subalias("7", sub.m_Q[3]); |
| 126 | ||
| 125 | register_subalias("8", m_supply.m_vss); | |
| 127 | 126 | |
| 128 | 127 | register_subalias("9", sub.m_Q[1]); |
| 129 | 128 | register_subalias("10", sub.m_IP); |
| r31373 | r31374 | |
| 132 | 131 | register_subalias("13", sub.m_Q[7]); |
| 133 | 132 | register_subalias("14", sub.m_Q[9]); |
| 134 | 133 | register_subalias("15", sub.m_Q[10]); |
| 135 | ||
| 134 | register_subalias("16", m_supply.m_vdd); | |
| 136 | 135 | } |
| 137 | 136 | |
| 138 | 137 | NETLIB_UPDATE(4020_dip) |
| r31373 | r31374 | |
|---|---|---|
| 20 | 20 | register_output("QD", m_Q[3]); |
| 21 | 21 | |
| 22 | 22 | save(NAME(m_cnt)); |
| 23 | save(NAME(m_last_A)); | |
| 24 | save(NAME(m_last_B)); | |
| 23 | save(NAME(m_last_A)); | |
| 24 | save(NAME(m_last_B)); | |
| 25 | 25 | |
| 26 | 26 | } |
| 27 | 27 | |
| r31373 | r31374 | |
| 61 | 61 | m_cnt = 0; |
| 62 | 62 | update_outputs(); |
| 63 | 63 | } |
| 64 | m_last_A = INPLOGIC(m_A); | |
| 65 | m_last_B = INPLOGIC(m_B); | |
| 64 | m_last_A = INPLOGIC(m_A); | |
| 65 | m_last_B = INPLOGIC(m_B); | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | NETLIB_FUNC_VOID(7490, update_outputs, (void)) |
| r31373 | r31374 | |
|---|---|---|
| 9 | 9 | nld_7400::truthtable_t nld_7400::m_ttbl; |
| 10 | 10 | |
| 11 | 11 | const char *nld_7400::m_desc[] = { |
| 12 | "A,B,PQ,PA,PB|Q", | |
| 13 | "0,X,X,X,X|1|22", | |
| 14 | "X,0,X,X,X|1|22", | |
| 15 | "1,1,X,X,X|0|15", | |
| 16 | "" | |
| 12 | "A,B,PQ,PA,PB|Q", | |
| 13 | "0,X,X,X,X|1|22", | |
| 14 | "X,0,X,X,X|1|22", | |
| 15 | "1,1,X,X,X|0|15", | |
| 16 | "" | |
| 17 | 17 | }; |
| 18 | 18 | |
| 19 | 19 | #endif |
| r31373 | r31374 | |
|---|---|---|
| 80 | 80 | |
| 81 | 81 | if (!m_last_out && out) |
| 82 | 82 | { |
| 83 | m_RDIS.update_dev(); | |
| 84 | // FIXME: Should be delayed by 100ns | |
| 83 | m_RDIS.update_dev(); | |
| 84 | // FIXME: Should be delayed by 100ns | |
| 85 | 85 | OUTANALOG(m_OUT, TERMANALOG(m_R1.m_P)); |
| 86 | 86 | m_RDIS.set_R(R_OFF); |
| 87 | 87 | } |
| 88 | 88 | else if (m_last_out && !out) |
| 89 | 89 | { |
| 90 | ||
| 90 | m_RDIS.update_dev(); | |
| 91 | 91 | OUTANALOG(m_OUT, TERMANALOG(m_R3.m_N)); |
| 92 | 92 | m_RDIS.set_R(R_ON); |
| 93 | 93 | } |
| r31373 | r31374 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | NETLIB_START(74123) |
| 12 | 12 | { |
| 13 | register_sub(m_RP, "RP"); | |
| 14 | register_sub(m_RN, "RN"); | |
| 13 | 15 | |
| 14 | register_sub(m_RP, "RP"); | |
| 15 | register_sub(m_RN, "RN"); | |
| 16 | register_input("A", m_A); | |
| 17 | register_input("B", m_B); | |
| 18 | register_input("CLRQ", m_CLRQ); | |
| 19 | register_output("Q", m_Q); | |
| 20 | register_output("QQ", m_QQ); | |
| 16 | 21 | |
| 17 | register_input("A", m_A); | |
| 18 | register_input("B", m_B); | |
| 19 | register_input("CLRQ", m_CLRQ); | |
| 20 | register_output("Q", m_Q); | |
| 21 | register_output("QQ", m_QQ); | |
| 22 | register_input("_CV", m_CV); // internal | |
| 22 | 23 | |
| 23 | register_input("_CV", m_CV); // internal | |
| 24 | register_subalias("GND", m_RN.m_N); | |
| 25 | register_subalias("VCC", m_RP.m_P); | |
| 26 | register_subalias("C", m_RN.m_N); | |
| 27 | register_subalias("RC", m_RN.m_P); | |
| 24 | 28 | |
| 25 | register_subalias("GND", m_RN.m_N); | |
| 26 | register_subalias("VCC", m_RP.m_P); | |
| 27 | register_subalias("C", m_RN.m_N); | |
| 28 | register_subalias("RC", m_RN.m_P); | |
| 29 | register_param("K", m_K, 0.4); | |
| 30 | register_param("RI", m_RI, 400.0); // around 250 for HC series, 400 on LS/TTL, estimated from datasheets | |
| 29 | 31 | |
| 30 | register_param("K", m_K, 0.4); | |
| 31 | register_param("RI", m_RI, 400.0); // around 250 for HC series, 400 on LS/TTL, estimated from datasheets | |
| 32 | connect(m_RN.m_P, m_RP.m_N); | |
| 33 | connect(m_CV, m_RN.m_P); | |
| 32 | 34 | |
| 33 | connect(m_RN.m_P, m_RP.m_N); | |
| 34 | connect(m_CV, m_RN.m_P); | |
| 35 | save(NAME(m_last_trig)); | |
| 36 | save(NAME(m_state)); | |
| 37 | save(NAME(m_KP)); | |
| 35 | 38 | |
| 36 | save(NAME(m_last_trig)); | |
| 37 | save(NAME(m_state)); | |
| 38 | save(NAME(m_KP)); | |
| 39 | ||
| 40 | m_KP = 1.0 / (1.0 + exp(m_K.Value())); | |
| 39 | m_KP = 1.0 / (1.0 + exp(m_K.Value())); | |
| 41 | 40 | } |
| 42 | 41 | |
| 43 | 42 | NETLIB_UPDATE(74123) |
| 44 | 43 | { |
| 45 | ||
| 44 | const netlist_sig_t m_trig = (INPLOGIC(m_A) ^ 1) & INPLOGIC(m_B) & INPLOGIC(m_CLRQ); | |
| 46 | 45 | |
| 47 | if (!INPLOGIC(m_CLRQ)) | |
| 48 | { | |
| 49 | OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(10)); | |
| 50 | OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10)); | |
| 51 | /* quick charge until trigger */ | |
| 52 | /* FIXME: SGS datasheet shows quick charge to 5V, | |
| 53 | * though schematics indicate quick charge to Vhigh only. | |
| 54 | */ | |
| 55 | m_RP.set_R(R_ON); | |
| 56 | m_RN.set_R(R_OFF); | |
| 57 | m_state = 2; //charging (quick) | |
| 58 | } | |
| 59 | else if (!m_last_trig && m_trig) | |
| 60 | { | |
| 61 | // FIXME: Timing! | |
| 62 | OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(10)); | |
| 63 | OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(10)); | |
| 64 | m_RN.set_R(R_ON); | |
| 65 | m_RP.set_R(R_OFF); | |
| 66 | m_state = 1; // discharging | |
| 67 | } | |
| 46 | if (!INPLOGIC(m_CLRQ)) | |
| 47 | { | |
| 48 | OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(10)); | |
| 49 | OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10)); | |
| 50 | /* quick charge until trigger */ | |
| 51 | /* FIXME: SGS datasheet shows quick charge to 5V, | |
| 52 | * though schematics indicate quick charge to Vhigh only. | |
| 53 | */ | |
| 54 | m_RP.set_R(R_ON); | |
| 55 | m_RN.set_R(R_OFF); | |
| 56 | m_state = 2; //charging (quick) | |
| 57 | } | |
| 58 | else if (!m_last_trig && m_trig) | |
| 59 | { | |
| 60 | // FIXME: Timing! | |
| 61 | OUTLOGIC(m_Q, 1, NLTIME_FROM_NS(10)); | |
| 62 | OUTLOGIC(m_QQ, 0, NLTIME_FROM_NS(10)); | |
| 63 | m_RN.set_R(R_ON); | |
| 64 | m_RP.set_R(R_OFF); | |
| 65 | m_state = 1; // discharging | |
| 66 | } | |
| 68 | 67 | |
| 69 | ||
| 68 | m_last_trig = m_trig; | |
| 70 | 69 | |
| 71 | if (m_state == 1) | |
| 72 | { | |
| 73 | const double vLow = m_KP * TERMANALOG(m_RP.m_P); | |
| 74 | if (INPANALOG(m_CV) < vLow) | |
| 75 | { | |
| 76 | m_RN.set_R(R_OFF); | |
| 77 | m_state = 2; // charging | |
| 78 | } | |
| 79 | } | |
| 80 | else if (m_state == 2) | |
| 81 | { | |
| 82 | const double vHigh = TERMANALOG(m_RP.m_P) * (1.0 - m_KP); | |
| 83 | if (INPANALOG(m_CV) > vHigh) | |
| 84 | { | |
| 85 | m_RP.set_R(R_OFF); | |
| 86 | OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(10)); | |
| 87 | OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10)); | |
| 88 | m_state = 0; // waiting | |
| 89 | } | |
| 90 | } | |
| 70 | if (m_state == 1) | |
| 71 | { | |
| 72 | const double vLow = m_KP * TERMANALOG(m_RP.m_P); | |
| 73 | if (INPANALOG(m_CV) < vLow) | |
| 74 | { | |
| 75 | m_RN.set_R(R_OFF); | |
| 76 | m_state = 2; // charging | |
| 77 | } | |
| 78 | } | |
| 79 | else if (m_state == 2) | |
| 80 | { | |
| 81 | const double vHigh = TERMANALOG(m_RP.m_P) * (1.0 - m_KP); | |
| 82 | if (INPANALOG(m_CV) > vHigh) | |
| 83 | { | |
| 84 | m_RP.set_R(R_OFF); | |
| 85 | OUTLOGIC(m_Q, 0, NLTIME_FROM_NS(10)); | |
| 86 | OUTLOGIC(m_QQ, 1, NLTIME_FROM_NS(10)); | |
| 87 | m_state = 0; // waiting | |
| 88 | } | |
| 89 | } | |
| 91 | 90 | } |
| 92 | 91 | |
| 93 | 92 | NETLIB_RESET(74123) |
| 94 | 93 | { |
| 95 | m_RP.do_reset(); | |
| 96 | m_RN.do_reset(); | |
| 94 | m_RP.do_reset(); | |
| 95 | m_RN.do_reset(); | |
| 97 | 96 | |
| 98 | m_RP.set_R(R_OFF); | |
| 99 | m_RN.set_R(R_OFF); | |
| 97 | m_RP.set_R(R_OFF); | |
| 98 | m_RN.set_R(R_OFF); | |
| 100 | 99 | |
| 101 | m_last_trig = 0; | |
| 102 | m_state = 0; | |
| 103 | m_QQ.initial(1); | |
| 100 | m_last_trig = 0; | |
| 101 | m_state = 0; | |
| 102 | m_QQ.initial(1); | |
| 104 | 103 | } |
| 105 | 104 | |
| 106 | 105 | NETLIB_START(74123_dip) |
| r31373 | r31374 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | save(NAME(m_enableq)); |
| 53 | 53 | save(NAME(m_inc)); |
| 54 | ||
| 54 | save(NAME(m_out)); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | NETLIB_RESET(SN74LS629clk) |
| r31373 | r31374 | |
| 65 | 65 | { |
| 66 | 66 | if (!m_enableq) |
| 67 | 67 | { |
| 68 | | |
| 68 | m_out = m_out ^ 1; | |
| 69 | 69 | OUTLOGIC(m_Y, m_out, m_inc); |
| 70 | 70 | } |
| 71 | 71 | else |
| r31373 | r31374 | |
| 103 | 103 | NETLIB_UPDATE(SN74LS629) |
| 104 | 104 | { |
| 105 | 105 | { |
| 106 | | |
| 106 | // recompute | |
| 107 | 107 | double freq; |
| 108 | 108 | double v_freq_2, v_freq_3, v_freq_4; |
| 109 | 109 | double v_freq = INPANALOG(m_FC); |
| r31373 | r31374 | |
|---|---|---|
| 48 | 48 | |
| 49 | 49 | NETLIB_RESET(9316_subABCD) |
| 50 | 50 | { |
| 51 | m_A.inactivate(); | |
| 52 | m_B.inactivate(); | |
| 53 | m_C.inactivate(); | |
| 54 | m_D.inactivate(); | |
| 51 | m_A.inactivate(); | |
| 52 | m_B.inactivate(); | |
| 53 | m_C.inactivate(); | |
| 54 | m_D.inactivate(); | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | ATTR_HOT inline UINT8 NETLIB_NAME(9316_subABCD::read_ABCD)() |
| 58 | 58 | { |
| 59 | ||
| 59 | return (INPLOGIC_PASSIVE(m_D) << 3) | (INPLOGIC_PASSIVE(m_C) << 2) | (INPLOGIC_PASSIVE(m_B) << 1) | (INPLOGIC_PASSIVE(m_A) << 0); | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | NETLIB_UPDATE(9316_subABCD) |
| r31373 | r31374 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | ATTR_HOT inline void NETLIB_NAME(7474sub)::newstate(const UINT8 stateQ, const UINT8 stateQQ) |
| 9 | 9 | { |
| 10 | ||
| 10 | // 0: High-to-low 40 ns, 1: Low-to-high 25 ns | |
| 11 | 11 | static const netlist_time delay[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; |
| 12 | 12 | OUTLOGIC(m_Q, stateQ, delay[stateQ]); |
| 13 | 13 | OUTLOGIC(m_QQ, stateQQ, delay[stateQQ]); |
| r31373 | r31374 | |
| 25 | 25 | NETLIB_UPDATE(7474) |
| 26 | 26 | { |
| 27 | 27 | if (INPLOGIC(m_PREQ) && INPLOGIC(m_CLRQ)) |
| 28 | { | |
| 29 | m_D.activate(); | |
| 30 | sub.m_nextD = INPLOGIC(m_D); | |
| 31 | sub.m_CLK.activate_lh(); | |
| 32 | } | |
| 28 | { | |
| 29 | m_D.activate(); | |
| 30 | sub.m_nextD = INPLOGIC(m_D); | |
| 31 | sub.m_CLK.activate_lh(); | |
| 32 | } | |
| 33 | 33 | else if (!INPLOGIC(m_PREQ)) |
| 34 | 34 | { |
| 35 | 35 | sub.newstate(1, 0); |
| r31373 | r31374 | |
| 43 | 43 | m_D.inactivate(); |
| 44 | 44 | } |
| 45 | 45 | else |
| 46 | { | |
| 47 | sub.newstate(1, 1); | |
| 48 | sub.m_CLK.inactivate(); | |
| 49 | m_D.inactivate(); | |
| 50 | } | |
| 46 | { | |
| 47 | sub.newstate(1, 1); | |
| 48 | sub.m_CLK.inactivate(); | |
| 49 | m_D.inactivate(); | |
| 50 | } | |
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | NETLIB_START(7474) |
| r31373 | r31374 | |
|---|---|---|
| 7 | 7 | |
| 8 | 8 | NETLIB_START(r2r_dac) |
| 9 | 9 | { |
| 10 | NETLIB_NAME(twoterm)::start(); | |
| 11 | register_terminal("VOUT", m_P); | |
| 12 | register_terminal("VGND", m_N); | |
| 13 | register_param("R", m_R, 1.0); | |
| 14 | register_param("VIN", m_VIN, 1.0); | |
| 15 | register_param("N", m_num, 1); | |
| 16 | register_param("VAL", m_val, 1); | |
| 10 | NETLIB_NAME(twoterm)::start(); | |
| 11 | register_terminal("VOUT", m_P); | |
| 12 | register_terminal("VGND", m_N); | |
| 13 | register_param("R", m_R, 1.0); | |
| 14 | register_param("VIN", m_VIN, 1.0); | |
| 15 | register_param("N", m_num, 1); | |
| 16 | register_param("VAL", m_val, 1); | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | NETLIB_RESET(r2r_dac) |
| 20 | 20 | { |
| 21 | ||
| 21 | NETLIB_NAME(twoterm)::reset(); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | NETLIB_UPDATE(r2r_dac) |
| 25 | 25 | { |
| 26 | ||
| 26 | NETLIB_NAME(twoterm)::update(); | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | NETLIB_UPDATE_PARAM(r2r_dac) |
| 30 | 30 | { |
| 31 | ||
| 31 | //printf("updating %s to %f\n", name().cstr(), m_R.Value()); | |
| 32 | 32 | |
| 33 | ||
| 33 | update_dev(); | |
| 34 | 34 | |
| 35 | ||
| 35 | double V = m_VIN.Value() / (double) (1 << m_num.Value()) * (double) m_val.Value(); | |
| 36 | 36 | |
| 37 | ||
| 37 | this->set(1.0 / m_R.Value(), V, 0.0); | |
| 38 | 38 | } |
| 39 |
| r31373 | r31374 | |
|---|---|---|
| 24 | 24 | //FIXME: set to proper values |
| 25 | 25 | netlist_logic_family_desc_t netlist_family_CD4000 = |
| 26 | 26 | { |
| 27 | 0.8, // m_low_thresh_V | |
| 28 | 2.0, // m_high_thresh_V | |
| 29 | 0.3, // m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications. | |
| 30 | 3.7, // m_high_V | |
| 31 | 1.0, // m_R_low; | |
| 32 | 130.0, // m_R_high; | |
| 27 | 0.8, // m_low_thresh_V | |
| 28 | 2.0, // m_high_thresh_V | |
| 29 | 0.3, // m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications. | |
| 30 | 3.7, // m_high_V | |
| 31 | 1.0, // m_R_low; | |
| 32 | 130.0, // m_R_high; | |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | 35 | // ---------------------------------------------------------------------------------------- |
| r31373 | r31374 | |
| 42 | 42 | , pstate_callback_t() |
| 43 | 43 | , m_qsize(0) |
| 44 | 44 | { |
| 45 | ||
| 45 | this->init_object(nl, "QUEUE"); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | void netlist_queue_t::register_state(pstate_manager_t &manager, const pstring &module) |
| r31373 | r31374 | |
| 187 | 187 | m_solver->start_dev(); |
| 188 | 188 | |
| 189 | 189 | NL_VERBOSE_OUT(("Initializing devices ...\n")); |
| 190 | for (netlist_device_t * const * entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry)) | |
| 191 | { | |
| 190 | for (netlist_device_t * const * entry = m_devices.first(); entry != NULL; entry = m_devices.next(entry)) | |
| 191 | { | |
| 192 | 192 | netlist_device_t *dev = *entry; |
| 193 | 193 | if (dev != m_solver) |
| 194 | 194 | dev->start_dev(); |
| r31373 | r31374 | |
| 229 | 229 | // Reset all devices once ! |
| 230 | 230 | for (int i = 0; i < m_devices.count(); i++) |
| 231 | 231 | { |
| 232 | | |
| 232 | m_devices[i]->do_reset(); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | // Step all devices once ! |
| 236 | for (int i = 0; i < m_devices.count(); i++) | |
| 237 | { | |
| 238 | m_devices[i]->update_dev(); | |
| 236 | for (int i = 0; i < m_devices.count(); i++) | |
| 237 | { | |
| 238 | m_devices[i]->update_dev(); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | // FIXME: some const devices rely on this |
| 242 | 242 | /* make sure params are set now .. */ |
| 243 | for (int i = 0; i < m_devices.count(); i++) | |
| 244 | { | |
| 245 | m_devices[i]->update_param(); | |
| 243 | for (int i = 0; i < m_devices.count(); i++) | |
| 244 | { | |
| 245 | m_devices[i]->update_param(); | |
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
| r31373 | r31374 | |
| 463 | 463 | |
| 464 | 464 | ATTR_COLD netlist_net_t::netlist_net_t(const family_t afamily) |
| 465 | 465 | : netlist_object_t(NET, afamily) |
| 466 | , m_new_Q(0) | |
| 467 | , m_cur_Q (0) | |
| 468 | , m_railterminal(NULL) | |
| 466 | , m_new_Q(0) | |
| 467 | , m_cur_Q (0) | |
| 468 | , m_railterminal(NULL) | |
| 469 | 469 | , m_time(netlist_time::zero) |
| 470 | 470 | , m_active(0) |
| 471 | 471 | , m_in_queue(2) |
| 472 | ||
| 472 | , m_cur_Analog(0.0) | |
| 473 | 473 | { |
| 474 | 474 | }; |
| 475 | 475 | |
| 476 | 476 | ATTR_COLD netlist_net_t::~netlist_net_t() |
| 477 | 477 | { |
| 478 | if (isInitialized()) | |
| 479 | netlist().remove_save_items(this); | |
| 478 | if (isInitialized()) | |
| 479 | netlist().remove_save_items(this); | |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | ATTR_COLD void netlist_net_t::init_object(netlist_base_t &nl, const pstring &aname) |
| r31373 | r31374 | |
| 548 | 548 | save(NAME(m_time)); |
| 549 | 549 | save(NAME(m_active)); |
| 550 | 550 | save(NAME(m_in_queue)); |
| 551 | save(NAME(m_cur_Analog)); | |
| 552 | save(NAME(m_cur_Q)); | |
| 553 | save(NAME(m_new_Q)); | |
| 551 | save(NAME(m_cur_Analog)); | |
| 552 | save(NAME(m_cur_Q)); | |
| 553 | save(NAME(m_new_Q)); | |
| 554 | 554 | netlist_object_t::save_register(); |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | ATTR_HOT ATTR_ALIGN static inline void update_dev(const netlist_core_terminal_t *inp, const UINT32 mask) |
| 558 | 558 | { |
| 559 | if ((inp->state() & mask) != 0) | |
| 560 | { | |
| 561 | netlist_core_device_t &netdev = inp->netdev(); | |
| 562 | begin_timing(netdev.total_time); | |
| 563 | inc_stat(netdev.stat_count); | |
| 564 | netdev.update_dev(); | |
| 565 | end_timing(netdev().total_time); | |
| 566 | } | |
| 559 | if ((inp->state() & mask) != 0) | |
| 560 | { | |
| 561 | netlist_core_device_t &netdev = inp->netdev(); | |
| 562 | begin_timing(netdev.total_time); | |
| 563 | inc_stat(netdev.stat_count); | |
| 564 | netdev.update_dev(); | |
| 565 | end_timing(netdev().total_time); | |
| 566 | } | |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | ATTR_HOT ATTR_ALIGN inline void netlist_net_t::update_devs() |
| r31373 | r31374 | |
| 572 | 572 | assert(this->isRailNet()); |
| 573 | 573 | |
| 574 | 574 | const UINT32 masks[4] = { 1, 5, 3, 1 }; |
| 575 | ||
| 575 | const UINT32 mask = masks[ (m_cur_Q << 1) | m_new_Q ]; | |
| 576 | 576 | netlist_core_terminal_t *p = m_list_active.first(); |
| 577 | 577 | |
| 578 | 578 | m_in_queue = 2; /* mark as taken ... */ |
| 579 | 579 | m_cur_Q = m_new_Q; |
| 580 | 580 | |
| 581 | 581 | switch (m_active) |
| 582 | { | |
| 583 | case 2: | |
| 584 | update_dev(p, mask); | |
| 585 | p = m_list_active.next(p); | |
| 586 | if (p == NULL) break; | |
| 587 | case 1: | |
| 588 | update_dev(p, mask); | |
| 589 | break; | |
| 590 | default: | |
| 591 | while (p != NULL) | |
| 592 | { | |
| 593 | update_dev(p, mask); | |
| 594 | p = m_list_active.next(p); | |
| 595 | } | |
| 596 | break; | |
| 597 | } | |
| 582 | { | |
| 583 | case 2: | |
| 584 | update_dev(p, mask); | |
| 585 | p = m_list_active.next(p); | |
| 586 | if (p == NULL) break; | |
| 587 | case 1: | |
| 588 | update_dev(p, mask); | |
| 589 | break; | |
| 590 | default: | |
| 591 | while (p != NULL) | |
| 592 | { | |
| 593 | update_dev(p, mask); | |
| 594 | p = m_list_active.next(p); | |
| 595 | } | |
| 596 | break; | |
| 597 | } | |
| 598 | 598 | |
| 599 | 599 | } |
| 600 | 600 | |
| r31373 | r31374 | |
| 604 | 604 | m_active = 0; |
| 605 | 605 | m_in_queue = 2; |
| 606 | 606 | |
| 607 | m_new_Q = 0; | |
| 608 | m_cur_Q = 0; | |
| 609 | m_cur_Analog = 0.0; | |
| 607 | m_new_Q = 0; | |
| 608 | m_cur_Q = 0; | |
| 609 | m_cur_Analog = 0.0; | |
| 610 | 610 | |
| 611 | 611 | /* rebuild m_list */ |
| 612 | 612 | |
| r31373 | r31374 | |
| 614 | 614 | for (int i=0; i < m_core_terms.count(); i++) |
| 615 | 615 | m_list_active.add(*m_core_terms[i]); |
| 616 | 616 | |
| 617 | for (int i=0; i < m_core_terms.count(); i++) | |
| 618 | m_core_terms[i]->do_reset(); | |
| 617 | for (int i=0; i < m_core_terms.count(); i++) | |
| 618 | m_core_terms[i]->do_reset(); | |
| 619 | 619 | |
| 620 | for (int i=0; i < m_core_terms.count(); i++) | |
| 621 | if (m_core_terms[i]->state() != netlist_input_t::STATE_INP_PASSIVE) | |
| 622 | m_active++; | |
| 620 | for (int i=0; i < m_core_terms.count(); i++) | |
| 621 | if (m_core_terms[i]->state() != netlist_input_t::STATE_INP_PASSIVE) | |
| 622 | m_active++; | |
| 623 | 623 | } |
| 624 | 624 | |
| 625 | 625 | ATTR_COLD void netlist_net_t::register_con(netlist_core_terminal_t &terminal) |
| r31373 | r31374 | |
| 634 | 634 | |
| 635 | 635 | ATTR_COLD void netlist_net_t::move_connections(netlist_net_t *dest_net) |
| 636 | 636 | { |
| 637 | for (int i = 0; i < m_core_terms.count(); i++) | |
| 638 | { | |
| 639 | netlist_core_terminal_t *p = m_core_terms[i]; | |
| 640 | dest_net->register_con(*p); | |
| 641 | } | |
| 642 | m_core_terms.clear(); // FIXME: othernet needs to be free'd from memory | |
| 637 | for (int i = 0; i < m_core_terms.count(); i++) | |
| 638 | { | |
| 639 | netlist_core_terminal_t *p = m_core_terms[i]; | |
| 640 | dest_net->register_con(*p); | |
| 641 | } | |
| 642 | m_core_terms.clear(); // FIXME: othernet needs to be free'd from memory | |
| 643 | 643 | } |
| 644 | 644 | |
| 645 | 645 | ATTR_COLD void netlist_net_t::merge_net(netlist_net_t *othernet) |
| r31373 | r31374 | |
| 648 | 648 | if (othernet == NULL) |
| 649 | 649 | return; // Nothing to do |
| 650 | 650 | |
| 651 | if (othernet == this) | |
| 652 | { | |
| 653 | netlist().warning("Connecting %s to itself. This may be right, though\n", this->name().cstr()); | |
| 654 | return; // Nothing to do | |
| 655 | } | |
| 651 | if (othernet == this) | |
| 652 | { | |
| 653 | netlist().warning("Connecting %s to itself. This may be right, though\n", this->name().cstr()); | |
| 654 | return; // Nothing to do | |
| 655 | } | |
| 656 | 656 | |
| 657 | 657 | if (this->isRailNet() && othernet->isRailNet()) |
| 658 | 658 | netlist().error("Trying to merge two rail nets: %s and %s\n", this->name().cstr(), othernet->name().cstr()); |
| r31373 | r31374 | |
| 664 | 664 | } |
| 665 | 665 | else |
| 666 | 666 | { |
| 667 | | |
| 667 | othernet->move_connections(this); | |
| 668 | 668 | } |
| 669 | 669 | } |
| 670 | 670 | |
| r31373 | r31374 | |
| 673 | 673 | // ---------------------------------------------------------------------------------------- |
| 674 | 674 | |
| 675 | 675 | ATTR_COLD netlist_logic_net_t::netlist_logic_net_t() |
| 676 | ||
| 676 | : netlist_net_t(LOGIC) | |
| 677 | 677 | { |
| 678 | 678 | }; |
| 679 | 679 | |
| 680 | 680 | |
| 681 | 681 | ATTR_COLD void netlist_logic_net_t::reset() |
| 682 | 682 | { |
| 683 | ||
| 683 | netlist_net_t::reset(); | |
| 684 | 684 | } |
| 685 | 685 | |
| 686 | 686 | ATTR_COLD void netlist_logic_net_t::save_register() |
| 687 | 687 | { |
| 688 | ||
| 688 | netlist_net_t::save_register(); | |
| 689 | 689 | } |
| 690 | 690 | |
| 691 | 691 | // ---------------------------------------------------------------------------------------- |
| r31373 | r31374 | |
| 693 | 693 | // ---------------------------------------------------------------------------------------- |
| 694 | 694 | |
| 695 | 695 | ATTR_COLD netlist_analog_net_t::netlist_analog_net_t() |
| 696 | : netlist_net_t(ANALOG) | |
| 697 | , m_DD_n_m_1(0.0) | |
| 698 | , m_h_n_m_1(1e-6) | |
| 699 | , m_solver(NULL) | |
| 696 | : netlist_net_t(ANALOG) | |
| 697 | , m_DD_n_m_1(0.0) | |
| 698 | , m_h_n_m_1(1e-6) | |
| 699 | , m_solver(NULL) | |
| 700 | 700 | { |
| 701 | 701 | }; |
| 702 | 702 | |
| 703 | 703 | ATTR_COLD void netlist_analog_net_t::reset() |
| 704 | 704 | { |
| 705 | ||
| 705 | netlist_net_t::reset(); | |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | ATTR_COLD void netlist_analog_net_t::save_register() |
| 709 | 709 | { |
| 710 | save(NAME(m_DD_n_m_1)); | |
| 711 | save(NAME(m_h_n_m_1)); | |
| 712 | netlist_net_t::save_register(); | |
| 710 | save(NAME(m_DD_n_m_1)); | |
| 711 | save(NAME(m_h_n_m_1)); | |
| 712 | netlist_net_t::save_register(); | |
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | ATTR_COLD bool netlist_analog_net_t::already_processed(list_t *groups, int cur_group) |
| 716 | 716 | { |
| 717 | if (isRailNet()) | |
| 718 | return true; | |
| 719 | for (int i = 0; i <= cur_group; i++) | |
| 720 | { | |
| 721 | if (groups[i].contains(this)) | |
| 722 | return true; | |
| 723 | } | |
| 724 | return false; | |
| 717 | if (isRailNet()) | |
| 718 | return true; | |
| 719 | for (int i = 0; i <= cur_group; i++) | |
| 720 | { | |
| 721 | if (groups[i].contains(this)) | |
| 722 | return true; | |
| 723 | } | |
| 724 | return false; | |
| 725 | 725 | } |
| 726 | 726 | |
| 727 | 727 | ATTR_COLD void netlist_analog_net_t::process_net(list_t *groups, int &cur_group) |
| 728 | 728 | { |
| 729 | if (num_cons() == 0) | |
| 730 | return; | |
| 731 | /* add the net */ | |
| 732 | //SOLVER_VERBOSE_OUT(("add %d - %s\n", cur_group, name().cstr())); | |
| 733 | groups[cur_group].add(this); | |
| 734 | for (int i = 0; i < m_core_terms.count(); i++) | |
| 735 | { | |
| 736 | netlist_core_terminal_t *p = m_core_terms[i]; | |
| 737 | //SOLVER_VERBOSE_OUT(("terminal %s\n", p->name().cstr())); | |
| 738 | if (p->isType(netlist_terminal_t::TERMINAL)) | |
| 739 | { | |
| 740 | //SOLVER_VERBOSE_OUT(("isterminal\n")); | |
| 741 | netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p); | |
| 742 | netlist_analog_net_t *other_net = &pt->m_otherterm->net().as_analog(); | |
| 743 | if (!other_net->already_processed(groups, cur_group)) | |
| 744 | other_net->process_net(groups, cur_group); | |
| 745 | } | |
| 746 | } | |
| 729 | if (num_cons() == 0) | |
| 730 | return; | |
| 731 | /* add the net */ | |
| 732 | //SOLVER_VERBOSE_OUT(("add %d - %s\n", cur_group, name().cstr())); | |
| 733 | groups[cur_group].add(this); | |
| 734 | for (int i = 0; i < m_core_terms.count(); i++) | |
| 735 | { | |
| 736 | netlist_core_terminal_t *p = m_core_terms[i]; | |
| 737 | //SOLVER_VERBOSE_OUT(("terminal %s\n", p->name().cstr())); | |
| 738 | if (p->isType(netlist_terminal_t::TERMINAL)) | |
| 739 | { | |
| 740 | //SOLVER_VERBOSE_OUT(("isterminal\n")); | |
| 741 | netlist_terminal_t *pt = static_cast<netlist_terminal_t *>(p); | |
| 742 | netlist_analog_net_t *other_net = &pt->m_otherterm->net().as_analog(); | |
| 743 | if (!other_net->already_processed(groups, cur_group)) | |
| 744 | other_net->process_net(groups, cur_group); | |
| 745 | } | |
| 746 | } | |
| 747 | 747 | } |
| 748 | 748 | |
| 749 | 749 | |
| r31373 | r31374 | |
| 780 | 780 | |
| 781 | 781 | ATTR_HOT void netlist_terminal_t::schedule_solve() |
| 782 | 782 | { |
| 783 | // FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only. | |
| 784 | if (net().as_analog().solver() != NULL) | |
| 785 | net().as_analog().solver()->update_forced(); | |
| 783 | // FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only. | |
| 784 | if (net().as_analog().solver() != NULL) | |
| 785 | net().as_analog().solver()->update_forced(); | |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | ATTR_HOT void netlist_terminal_t::schedule_after(const netlist_time &after) |
| 789 | 789 | { |
| 790 | // FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only. | |
| 791 | if (net().as_analog().solver() != NULL) | |
| 792 | net().as_analog().solver()->update_after(after); | |
| 790 | // FIXME: Remove this after we found a way to remove *ALL* twoterms connected to railnets only. | |
| 791 | if (net().as_analog().solver() != NULL) | |
| 792 | net().as_analog().solver()->update_after(after); | |
| 793 | 793 | } |
| 794 | 794 | |
| 795 | 795 | ATTR_COLD void netlist_terminal_t::reset() |
| r31373 | r31374 | |
| 843 | 843 | ATTR_COLD netlist_logic_output_t::netlist_logic_output_t() |
| 844 | 844 | : netlist_output_t(OUTPUT, LOGIC), m_proxy(NULL) |
| 845 | 845 | { |
| 846 | ||
| 846 | this->set_net(m_my_net); | |
| 847 | 847 | } |
| 848 | 848 | |
| 849 | 849 | ATTR_COLD void netlist_logic_output_t::initial(const netlist_sig_t val) |
| r31373 | r31374 | |
| 867 | 867 | ATTR_COLD netlist_analog_output_t::netlist_analog_output_t() |
| 868 | 868 | : netlist_output_t(OUTPUT, ANALOG), m_proxied_net(NULL) |
| 869 | 869 | { |
| 870 | ||
| 870 | this->set_net(m_my_net); | |
| 871 | 871 | |
| 872 | 872 | net().as_analog().m_cur_Analog = 0.98; |
| 873 | 873 | } |
| r31373 | r31374 | |
| 995 | 995 | { |
| 996 | 996 | netlist_logic_net_t &net = m_Q.net().as_logic(); |
| 997 | 997 | // this is only called during setup ... |
| 998 | ||
| 998 | net.toggle_new_Q(); | |
| 999 | 999 | net.set_time(netlist().time() + m_inc); |
| 1000 | 1000 | } |
| 1001 | 1001 |
| r31373 | r31374 | |
|---|---|---|
| 8 | 8 | |
| 9 | 9 | NETLIST_START(opamp_lm3900) |
| 10 | 10 | |
| 11 | /* | |
| 12 | * Fast norton opamp model without bandwidth | |
| 13 | */ | |
| 11 | /* | |
| 12 | * Fast norton opamp model without bandwidth | |
| 13 | */ | |
| 14 | 14 | |
| 15 | ||
| 15 | /* Terminal definitions for calling netlists */ | |
| 16 | 16 | |
| 17 | ALIAS(PLUS, R1.1) // Positive input | |
| 18 | ALIAS(MINUS, R2.1) // Negative input | |
| 19 | ALIAS(OUT, G1.OP) // Opamp output ... | |
| 20 | ALIAS(VM, G1.ON) // V- terminal | |
| 21 | ALIAS(VP, DUMMY.I) // V+ terminal | |
| 17 | ALIAS(PLUS, R1.1) // Positive input | |
| 18 | ALIAS(MINUS, R2.1) // Negative input | |
| 19 | ALIAS(OUT, G1.OP) // Opamp output ... | |
| 20 | ALIAS(VM, G1.ON) // V- terminal | |
| 21 | ALIAS(VP, DUMMY.I) // V+ terminal | |
| 22 | 22 | |
| 23 | ||
| 23 | DUMMY_INPUT(DUMMY) | |
| 24 | 24 | |
| 25 | ||
| 25 | /* The opamp model */ | |
| 26 | 26 | |
| 27 | RES(R1, 1) | |
| 28 | RES(R2, 1) | |
| 29 | NET_C(R1.1, G1.IP) | |
| 30 | NET_C(R2.1, G1.IN) | |
| 31 | NET_C(R1.2, R2.2, G1.ON) | |
| 32 | VCVS(G1) | |
| 33 | PARAM(G1.G, 10000000) | |
| 34 | //PARAM(G1.RI, 100) | |
| 35 | PARAM(G1.RO, RES_K(8)) | |
| 27 | RES(R1, 1) | |
| 28 | RES(R2, 1) | |
| 29 | NET_C(R1.1, G1.IP) | |
| 30 | NET_C(R2.1, G1.IN) | |
| 31 | NET_C(R1.2, R2.2, G1.ON) | |
| 32 | VCVS(G1) | |
| 33 | PARAM(G1.G, 10000000) | |
| 34 | //PARAM(G1.RI, 100) | |
| 35 | PARAM(G1.RO, RES_K(8)) | |
| 36 | 36 | |
| 37 | 37 | NETLIST_END() |
| 38 |
| r31373 | r31374 | |
|---|---|---|
| 40 | 40 | // ---------------------------------------------------------------------------------------- |
| 41 | 41 | |
| 42 | 42 | ATTR_COLD NETLIB_NAME(twoterm)::NETLIB_NAME(twoterm)(const family_t afamily) |
| 43 | ||
| 43 | : netlist_device_t(afamily) | |
| 44 | 44 | { |
| 45 | 45 | m_P.m_otherterm = &m_N; |
| 46 | 46 | m_N.m_otherterm = &m_P; |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | ATTR_COLD NETLIB_NAME(twoterm)::NETLIB_NAME(twoterm)() |
| 50 | ||
| 50 | : netlist_device_t(TWOTERM) | |
| 51 | 51 | { |
| 52 | m_P.m_otherterm = &m_N; | |
| 53 | m_N.m_otherterm = &m_P; | |
| 52 | m_P.m_otherterm = &m_N; | |
| 53 | m_N.m_otherterm = &m_P; | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | NETLIB_START(twoterm) |
| r31373 | r31374 | |
| 113 | 113 | { |
| 114 | 114 | //printf("updating %s to %f\n", name().cstr(), m_R.Value()); |
| 115 | 115 | |
| 116 | // FIXME: Only attached nets should be brought up to current time | |
| 117 | //netlist().solver()->update_to_current_time(); // bring up current time | |
| 118 | update_dev(); | |
| 116 | // FIXME: Only attached nets should be brought up to current time | |
| 117 | //netlist().solver()->update_to_current_time(); // bring up current time | |
| 118 | update_dev(); | |
| 119 | 119 | if (m_R.Value() > 1e-9) |
| 120 | 120 | set_R(m_R.Value()); |
| 121 | 121 | else |
| r31373 | r31374 | |
| 162 | 162 | v = (exp(v) - 1.0) / (exp(1.0) - 1.0); |
| 163 | 163 | |
| 164 | 164 | // FIXME: Only attached nets should be brought up to current time |
| 165 | ||
| 165 | //netlist().solver()->update_to_current_time(); // bring up current time | |
| 166 | 166 | |
| 167 | m_R1.update_dev(); | |
| 168 | m_R2.update_dev(); | |
| 167 | m_R1.update_dev(); | |
| 168 | m_R2.update_dev(); | |
| 169 | 169 | |
| 170 | ||
| 170 | m_R1.set_R(MAX(m_R.Value() * v, netlist().gmin())); | |
| 171 | 171 | m_R2.set_R(MAX(m_R.Value() * (1.0 - v), netlist().gmin())); |
| 172 | 172 | |
| 173 | 173 | } |
| r31373 | r31374 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | NETLIB_START(VCCS) |
| 15 | 15 | { |
| 16 | ||
| 16 | start_internal(1.0 / netlist().gmin()); | |
| 17 | 17 | m_gfac = 1.0; |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | void NETLIB_NAME(VCCS)::start_internal(const double def_RI) |
| 21 | 21 | { |
| 22 | register_param("G", m_G, 1.0); | |
| 23 | register_param("RI", m_RI, def_RI); | |
| 22 | register_param("G", m_G, 1.0); | |
| 23 | register_param("RI", m_RI, def_RI); | |
| 24 | 24 | |
| 25 | register_terminal("IP", m_IP); | |
| 26 | register_terminal("IN", m_IN); | |
| 27 | register_terminal("OP", m_OP); | |
| 28 | register_terminal("ON", m_ON); | |
| 25 | register_terminal("IP", m_IP); | |
| 26 | register_terminal("IN", m_IN); | |
| 27 | register_terminal("OP", m_OP); | |
| 28 | register_terminal("ON", m_ON); | |
| 29 | 29 | |
| 30 | register_terminal("_OP1", m_OP1); | |
| 31 | register_terminal("_ON1", m_ON1); | |
| 30 | register_terminal("_OP1", m_OP1); | |
| 31 | register_terminal("_ON1", m_ON1); | |
| 32 | 32 | |
| 33 | m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving... | |
| 34 | m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving... | |
| 33 | m_IP.m_otherterm = &m_IN; // <= this should be NULL and terminal be filtered out prior to solving... | |
| 34 | m_IN.m_otherterm = &m_IP; // <= this should be NULL and terminal be filtered out prior to solving... | |
| 35 | 35 | |
| 36 | m_OP.m_otherterm = &m_IP; | |
| 37 | m_OP1.m_otherterm = &m_IN; | |
| 36 | m_OP.m_otherterm = &m_IP; | |
| 37 | m_OP1.m_otherterm = &m_IN; | |
| 38 | 38 | |
| 39 | m_ON.m_otherterm = &m_IP; | |
| 40 | m_ON1.m_otherterm = &m_IN; | |
| 39 | m_ON.m_otherterm = &m_IP; | |
| 40 | m_ON1.m_otherterm = &m_IN; | |
| 41 | 41 | |
| 42 | connect(m_OP, m_OP1); | |
| 43 | connect(m_ON, m_ON1); | |
| 42 | connect(m_OP, m_OP1); | |
| 43 | connect(m_ON, m_ON1); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | NETLIB_RESET(VCCS) |
| r31373 | r31374 | |
| 82 | 82 | |
| 83 | 83 | NETLIB_START(CCCS) |
| 84 | 84 | { |
| 85 | start_internal(1.0); | |
| 86 | m_gfac = 1.0 / m_RI.Value(); | |
| 85 | start_internal(1.0); | |
| 86 | m_gfac = 1.0 / m_RI.Value(); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | NETLIB_RESET(CCCS) |
| 90 | 90 | { |
| 91 | ||
| 91 | NETLIB_NAME(VCCS)::reset(); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | NETLIB_UPDATE_PARAM(CCCS) |
| 95 | 95 | { |
| 96 | ||
| 96 | NETLIB_NAME(VCCS)::update_param(); | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | NETLIB_UPDATE(CCCS) |
| 100 | 100 | { |
| 101 | ||
| 101 | NETLIB_NAME(VCCS)::update(); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | // ---------------------------------------------------------------------------------------- |
| r31373 | r31374 | |
|---|---|---|
| 41 | 41 | |
| 42 | 42 | vector_ops_t *vector_ops_t::create_ops(const int size) |
| 43 | 43 | { |
| 44 | switch (size) | |
| 45 | { | |
| 46 | case 1: | |
| 47 | return new vector_ops_impl_t<1>(); | |
| 48 | case 2: | |
| 49 | return new vector_ops_impl_t<2>(); | |
| 50 | case 3: | |
| 51 | return new vector_ops_impl_t<3>(); | |
| 52 | case 4: | |
| 53 | return new vector_ops_impl_t<4>(); | |
| 54 | case 5: | |
| 55 | return new vector_ops_impl_t<5>(); | |
| 56 | case 6: | |
| 57 | return new vector_ops_impl_t<6>(); | |
| 58 | case 7: | |
| 59 | return new vector_ops_impl_t<7>(); | |
| 60 | case 8: | |
| 61 | return new vector_ops_impl_t<8>(); | |
| 62 | case 9: | |
| 63 | return new vector_ops_impl_t<9>(); | |
| 64 | case 10: | |
| 65 | return new vector_ops_impl_t<10>(); | |
| 66 | case 11: | |
| 67 | return new vector_ops_impl_t<11>(); | |
| 68 | case 12: | |
| 69 | return new vector_ops_impl_t<12>(); | |
| 70 | default: | |
| 71 | return new vector_ops_impl_t<0>(size); | |
| 72 | } | |
| 44 | switch (size) | |
| 45 | { | |
| 46 | case 1: | |
| 47 | return new vector_ops_impl_t<1>(); | |
| 48 | case 2: | |
| 49 | return new vector_ops_impl_t<2>(); | |
| 50 | case 3: | |
| 51 | return new vector_ops_impl_t<3>(); | |
| 52 | case 4: | |
| 53 | return new vector_ops_impl_t<4>(); | |
| 54 | case 5: | |
| 55 | return new vector_ops_impl_t<5>(); | |
| 56 | case 6: | |
| 57 | return new vector_ops_impl_t<6>(); | |
| 58 | case 7: | |
| 59 | return new vector_ops_impl_t<7>(); | |
| 60 | case 8: | |
| 61 | return new vector_ops_impl_t<8>(); | |
| 62 | case 9: | |
| 63 | return new vector_ops_impl_t<9>(); | |
| 64 | case 10: | |
| 65 | return new vector_ops_impl_t<10>(); | |
| 66 | case 11: | |
| 67 | return new vector_ops_impl_t<11>(); | |
| 68 | case 12: | |
| 69 | return new vector_ops_impl_t<12>(); | |
| 70 | default: | |
| 71 | return new vector_ops_impl_t<0>(size); | |
| 72 | } | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | ATTR_COLD void terms_t::add(netlist_terminal_t *term, int net_other) |
| 76 | 76 | { |
| 77 | m_term.add(term); | |
| 78 | m_net_other.add(net_other); | |
| 79 | m_gt.add(0.0); | |
| 80 | m_go.add(0.0); | |
| 81 | m_Idr.add(0.0); | |
| 82 | m_other_curanalog.add(NULL); | |
| 77 | m_term.add(term); | |
| 78 | m_net_other.add(net_other); | |
| 79 | m_gt.add(0.0); | |
| 80 | m_go.add(0.0); | |
| 81 | m_Idr.add(0.0); | |
| 82 | m_other_curanalog.add(NULL); | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | ATTR_COLD void terms_t::set_pointers() |
| 86 | 86 | { |
| 87 | for (int i = 0; i < count(); i++) | |
| 88 | { | |
| 89 | m_term[i]->m_gt1 = &m_gt[i]; | |
| 90 | m_term[i]->m_go1 = &m_go[i]; | |
| 91 | m_term[i]->m_Idr1 = &m_Idr[i]; | |
| 92 | m_other_curanalog[i] = &m_term[i]->m_otherterm->net().as_analog().m_cur_Analog; | |
| 93 | } | |
| 87 | for (int i = 0; i < count(); i++) | |
| 88 | { | |
| 89 | m_term[i]->m_gt1 = &m_gt[i]; | |
| 90 | m_term[i]->m_go1 = &m_go[i]; | |
| 91 | m_term[i]->m_Idr1 = &m_Idr[i]; | |
| 92 | m_other_curanalog[i] = &m_term[i]->m_otherterm->net().as_analog().m_cur_Analog; | |
| 93 | } | |
| 94 | 94 | |
| 95 | ||
| 95 | m_ops = vector_ops_t::create_ops(m_gt.count()); | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | // ---------------------------------------------------------------------------------------- |
| r31373 | r31374 | |
| 106 | 106 | |
| 107 | 107 | ATTR_COLD netlist_matrix_solver_t::~netlist_matrix_solver_t() |
| 108 | 108 | { |
| 109 | for (int i = 0; i < m_inps.count(); i++) | |
| 110 | delete m_inps[i]; | |
| 109 | for (int i = 0; i < m_inps.count(); i++) | |
| 110 | delete m_inps[i]; | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | ATTR_COLD void netlist_matrix_solver_t::setup(netlist_analog_net_t::list_t &nets) |
| r31373 | r31374 | |
| 118 | 118 | |
| 119 | 119 | for (int k = 0; k < nets.count(); k++) |
| 120 | 120 | { |
| 121 | m_nets.add(nets[k]); | |
| 122 | } | |
| 121 | m_nets.add(nets[k]); | |
| 122 | } | |
| 123 | 123 | |
| 124 | 124 | for (int k = 0; k < nets.count(); k++) |
| 125 | 125 | { |
| r31373 | r31374 | |
| 129 | 129 | |
| 130 | 130 | net->m_solver = this; |
| 131 | 131 | |
| 132 | ||
| 132 | for (int i = 0; i < net->m_core_terms.count(); i++) | |
| 133 | 133 | { |
| 134 | | |
| 134 | netlist_core_terminal_t *p = net->m_core_terms[i]; | |
| 135 | 135 | NL_VERBOSE_OUT(("%s %s %d\n", p->name().cstr(), net->name().cstr(), (int) net->isRailNet())); |
| 136 | 136 | switch (p->type()) |
| 137 | 137 | { |
| r31373 | r31374 | |
| 160 | 160 | NL_VERBOSE_OUT(("Added terminal\n")); |
| 161 | 161 | break; |
| 162 | 162 | case netlist_terminal_t::INPUT: |
| 163 | { | |
| 164 | netlist_analog_output_t *net_proxy_output = NULL; | |
| 165 | for (int i = 0; i < m_inps.count(); i++) | |
| 166 | if (m_inps[i]->m_proxied_net == &p->net().as_analog()) | |
| 167 | { | |
| 168 | net_proxy_output = m_inps[i]; | |
| 169 | break; | |
| 170 | } | |
| 163 | { | |
| 164 | netlist_analog_output_t *net_proxy_output = NULL; | |
| 165 | for (int i = 0; i < m_inps.count(); i++) | |
| 166 | if (m_inps[i]->m_proxied_net == &p->net().as_analog()) | |
| 167 | { | |
| 168 | net_proxy_output = m_inps[i]; | |
| 169 | break; | |
| 170 | } | |
| 171 | 171 | |
| 172 | if (net_proxy_output == NULL) | |
| 173 | { | |
| 174 | net_proxy_output = new netlist_analog_output_t(); | |
| 175 | net_proxy_output->init_object(*this, this->name() + "." + pstring::sprintf("m%d", m_inps.count())); | |
| 176 | m_inps.add(net_proxy_output); | |
| 177 | net_proxy_output->m_proxied_net = &p->net().as_analog(); | |
| 178 | } | |
| 179 | net_proxy_output->net().register_con(*p); | |
| 180 | // FIXME: repeated | |
| 181 | net_proxy_output->net().rebuild_list(); | |
| 182 | NL_VERBOSE_OUT(("Added input\n")); | |
| 183 | } | |
| 184 | break; | |
| 172 | if (net_proxy_output == NULL) | |
| 173 | { | |
| 174 | net_proxy_output = new netlist_analog_output_t(); | |
| 175 | net_proxy_output->init_object(*this, this->name() + "." + pstring::sprintf("m%d", m_inps.count())); | |
| 176 | m_inps.add(net_proxy_output); | |
| 177 | net_proxy_output->m_proxied_net = &p->net().as_analog(); | |
| 178 | } | |
| 179 | net_proxy_output->net().register_con(*p); | |
| 180 | // FIXME: repeated | |
| 181 | net_proxy_output->net().rebuild_list(); | |
| 182 | NL_VERBOSE_OUT(("Added input\n")); | |
| 183 | } | |
| 184 | break; | |
| 185 | 185 | default: |
| 186 | 186 | netlist().error("unhandled element found\n"); |
| 187 | 187 | break; |
| r31373 | r31374 | |
| 194 | 194 | |
| 195 | 195 | ATTR_HOT void netlist_matrix_solver_t::update_inputs() |
| 196 | 196 | { |
| 197 | // avoid recursive calls. Inputs are updated outside this call | |
| 198 | for (netlist_analog_output_t * const *p = m_inps.first(); p != NULL; p = m_inps.next(p)) | |
| 199 | (*p)->set_Q((*p)->m_proxied_net->m_cur_Analog); | |
| 197 | // avoid recursive calls. Inputs are updated outside this call | |
| 198 | for (netlist_analog_output_t * const *p = m_inps.first(); p != NULL; p = m_inps.next(p)) | |
| 199 | (*p)->set_Q((*p)->m_proxied_net->m_cur_Analog); | |
| 200 | 200 | |
| 201 | 201 | } |
| 202 | 202 | |
| r31373 | r31374 | |
| 218 | 218 | |
| 219 | 219 | ATTR_COLD void netlist_matrix_solver_t::start() |
| 220 | 220 | { |
| 221 | register_output("Q_sync", m_Q_sync); | |
| 222 | register_input("FB_sync", m_fb_sync); | |
| 223 | connect(m_fb_sync, m_Q_sync); | |
| 221 | register_output("Q_sync", m_Q_sync); | |
| 222 | register_input("FB_sync", m_fb_sync); | |
| 223 | connect(m_fb_sync, m_Q_sync); | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | ATTR_COLD void netlist_matrix_solver_t::reset() |
| r31373 | r31374 | |
| 230 | 230 | |
| 231 | 231 | ATTR_COLD void netlist_matrix_solver_t::update() |
| 232 | 232 | { |
| 233 | ||
| 233 | const double new_timestep = solve(); | |
| 234 | 234 | |
| 235 | if (m_params.m_dynamic && is_timestep() && new_timestep > 0) | |
| 236 | m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(new_timestep)); | |
| 235 | if (m_params.m_dynamic && is_timestep() && new_timestep > 0) | |
| 236 | m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(new_timestep)); | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | ATTR_COLD void netlist_matrix_solver_t::update_forced() |
| 240 | 240 | { |
| 241 | ||
| 241 | ATTR_UNUSED const double new_timestep = solve(); | |
| 242 | 242 | |
| 243 | if (m_params.m_dynamic && is_timestep()) | |
| 244 | m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(m_params.m_min_timestep)); | |
| 243 | if (m_params.m_dynamic && is_timestep()) | |
| 244 | m_Q_sync.net().reschedule_in_queue(netlist_time::from_double(m_params.m_min_timestep)); | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | ATTR_HOT void netlist_matrix_solver_t::step(const netlist_time delta) |
| r31373 | r31374 | |
| 254 | 254 | template<class C > |
| 255 | 255 | void netlist_matrix_solver_t::solve_base(C *p) |
| 256 | 256 | { |
| 257 | if (is_dynamic()) | |
| 258 | { | |
| 259 | int this_resched; | |
| 260 | int newton_loops = 0; | |
| 261 | do | |
| 262 | { | |
| 263 | update_dynamic(); | |
| 264 | // Gauss-Seidel will revert to Gaussian elemination if steps exceeded. | |
| 265 | this_resched = p->vsolve_non_dynamic(); | |
| 266 | newton_loops++; | |
| 267 | } while (this_resched > 1 && newton_loops < m_params.m_nr_loops); | |
| 257 | if (is_dynamic()) | |
| 258 | { | |
| 259 | int this_resched; | |
| 260 | int newton_loops = 0; | |
| 261 | do | |
| 262 | { | |
| 263 | update_dynamic(); | |
| 264 | // Gauss-Seidel will revert to Gaussian elemination if steps exceeded. | |
| 265 | this_resched = p->vsolve_non_dynamic(); | |
| 266 | newton_loops++; | |
| 267 | } while (this_resched > 1 && newton_loops < m_params.m_nr_loops); | |
| 268 | 268 | |
| 269 | // reschedule .... | |
| 270 | if (this_resched > 1 && !m_Q_sync.net().is_queued()) | |
| 271 | { | |
| 272 | netlist().warning("NEWTON_LOOPS exceeded ... reschedule"); | |
| 273 | m_Q_sync.net().reschedule_in_queue(m_params.m_nt_sync_delay); | |
| 274 | } | |
| 275 | } | |
| 276 | else | |
| 277 | { | |
| 278 | p->vsolve_non_dynamic(); | |
| 279 | } | |
| 269 | // reschedule .... | |
| 270 | if (this_resched > 1 && !m_Q_sync.net().is_queued()) | |
| 271 | { | |
| 272 | netlist().warning("NEWTON_LOOPS exceeded ... reschedule"); | |
| 273 | m_Q_sync.net().reschedule_in_queue(m_params.m_nt_sync_delay); | |
| 274 | } | |
| 275 | } | |
| 276 | else | |
| 277 | { | |
| 278 | p->vsolve_non_dynamic(); | |
| 279 | } | |
| 280 | 280 | } |
| 281 | 281 | |
| 282 | 282 | ATTR_HOT double netlist_matrix_solver_t::solve() |
| 283 | 283 | { |
| 284 | ||
| 285 | 284 | netlist_time now = netlist().time(); |
| 286 | 285 | netlist_time delta = now - m_last_step; |
| 287 | 286 | |
| 288 | 287 | // We are already up to date. Avoid oscillations. |
| 289 | 288 | if (delta < netlist_time::from_nsec(1)) |
| 290 | | |
| 289 | return -1.0; | |
| 291 | 290 | |
| 292 | 291 | /* update all terminals for new time step */ |
| 293 | 292 | m_last_step = now; |
| r31373 | r31374 | |
| 297 | 296 | |
| 298 | 297 | const double next_time_step = vsolve(); |
| 299 | 298 | |
| 300 | ||
| 299 | update_inputs(); | |
| 301 | 300 | return next_time_step; |
| 302 | 301 | } |
| 303 | 302 | |
| r31373 | r31374 | |
| 330 | 329 | { |
| 331 | 330 | register_output("Q_step", m_Q_step); |
| 332 | 331 | |
| 333 | ||
| 332 | register_param("SYNC_DELAY", m_sync_delay, NLTIME_FROM_NS(10).as_double()); | |
| 334 | 333 | |
| 335 | 334 | register_param("FREQ", m_freq, 48000.0); |
| 336 | 335 | |
| 337 | 336 | register_param("ACCURACY", m_accuracy, 1e-7); |
| 338 | register_param("GS_LOOPS", m_gs_loops, 9); // Gauss-Seidel loops | |
| 339 | register_param("GS_THRESHOLD", m_gs_threshold, 5); // below this value, gaussian elimination is used | |
| 340 | register_param("NR_LOOPS", m_nr_loops, 25); // Newton-Raphson loops | |
| 337 | register_param("GS_LOOPS", m_gs_loops, 9); // Gauss-Seidel loops | |
| 338 | register_param("GS_THRESHOLD", m_gs_threshold, 5); // below this value, gaussian elimination is used | |
| 339 | register_param("NR_LOOPS", m_nr_loops, 25); // Newton-Raphson loops | |
| 341 | 340 | register_param("PARALLEL", m_parallel, 0); |
| 342 | register_param("SOR_FACTOR", m_sor, 1.059); | |
| 343 | register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT); | |
| 344 | register_param("DYNAMIC_TS", m_dynamic, 0); | |
| 345 | register_param("LTE", m_lte, 5e-5); // diff/timestep | |
| 341 | register_param("SOR_FACTOR", m_sor, 1.059); | |
| 342 | register_param("GMIN", m_gmin, NETLIST_GMIN_DEFAULT); | |
| 343 | register_param("DYNAMIC_TS", m_dynamic, 0); | |
| 344 | register_param("LTE", m_lte, 5e-5); // diff/timestep | |
| 346 | 345 | register_param("MIN_TIMESTEP", m_min_timestep, 1e-6); // double timestep resolution |
| 347 | 346 | |
| 348 | 347 | // internal staff |
| r31373 | r31374 | |
| 366 | 365 | |
| 367 | 366 | NETLIB_NAME(solver)::~NETLIB_NAME(solver)() |
| 368 | 367 | { |
| 369 | for (int i = 0; i < m_mat_solvers.count(); i++) | |
| 370 | m_mat_solvers[i]->log_stats(); | |
| 368 | for (int i = 0; i < m_mat_solvers.count(); i++) | |
| 369 | m_mat_solvers[i]->log_stats(); | |
| 371 | 370 | |
| 372 | 371 | netlist_matrix_solver_t * const *e = m_mat_solvers.first(); |
| 373 | 372 | while (e != NULL) |
| r31373 | r31374 | |
| 382 | 381 | NETLIB_UPDATE(solver) |
| 383 | 382 | { |
| 384 | 383 | if (m_params.m_dynamic) |
| 385 | | |
| 384 | return; | |
| 386 | 385 | |
| 387 | ||
| 386 | const int t_cnt = m_mat_solvers.count(); | |
| 388 | 387 | |
| 389 | 388 | #if HAS_OPENMP && USE_OPENMP |
| 390 | 389 | if (m_parallel.Value()) |
| r31373 | r31374 | |
| 407 | 406 | this_resched[i] = m_mat_solvers[i]->solve(); |
| 408 | 407 | } |
| 409 | 408 | #else |
| 410 | for (int i = 0; i < t_cnt; i++) | |
| 411 | { | |
| 412 | if (m_mat_solvers[i]->is_timestep()) | |
| 413 | { | |
| 414 | // Ignore return value | |
| 415 | ATTR_UNUSED const double ts = m_mat_solvers[i]->solve(); | |
| 416 | } | |
| 417 | } | |
| 409 | for (int i = 0; i < t_cnt; i++) | |
| 410 | { | |
| 411 | if (m_mat_solvers[i]->is_timestep()) | |
| 412 | { | |
| 413 | // Ignore return value | |
| 414 | ATTR_UNUSED const double ts = m_mat_solvers[i]->solve(); | |
| 415 | } | |
| 416 | } | |
| 418 | 417 | #endif |
| 419 | 418 | |
| 420 | /* step circuit */ | |
| 421 | if (!m_Q_step.net().is_queued()) | |
| 422 | { | |
| 423 | m_Q_step.net().push_to_queue(netlist_time::from_double(m_params.m_max_timestep)); | |
| 424 | } | |
| 419 | /* step circuit */ | |
| 420 | if (!m_Q_step.net().is_queued()) | |
| 421 | { | |
| 422 | m_Q_step.net().push_to_queue(netlist_time::from_double(m_params.m_max_timestep)); | |
| 423 | } | |
| 425 | 424 | } |
| 426 | 425 | |
| 427 | 426 | template <int m_N, int _storage_N> |
| 428 | 427 | netlist_matrix_solver_t * NETLIB_NAME(solver)::create_solver(int size, const int gs_threshold, const bool use_specific) |
| 429 | 428 | { |
| 430 | if (use_specific && m_N == 1) | |
| 431 | return new netlist_matrix_solver_direct1_t(m_params); | |
| 432 | else if (use_specific && m_N == 2) | |
| 433 | return new netlist_matrix_solver_direct2_t(m_params); | |
| 434 | else | |
| 435 | { | |
| 436 | if (size >= gs_threshold) | |
| 437 | return new netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N>(m_params, size); | |
| 438 | else | |
| 439 | return new netlist_matrix_solver_direct_t<m_N, _storage_N>(m_params, size); | |
| 440 | } | |
| 429 | if (use_specific && m_N == 1) | |
| 430 | return new netlist_matrix_solver_direct1_t(m_params); | |
| 431 | else if (use_specific && m_N == 2) | |
| 432 | return new netlist_matrix_solver_direct2_t(m_params); | |
| 433 | else | |
| 434 | { | |
| 435 | if (size >= gs_threshold) | |
| 436 | return new netlist_matrix_solver_gauss_seidel_t<m_N,_storage_N>(m_params, size); | |
| 437 | else | |
| 438 | return new netlist_matrix_solver_direct_t<m_N, _storage_N>(m_params, size); | |
| 439 | } | |
| 441 | 440 | } |
| 442 | 441 | |
| 443 | 442 | ATTR_COLD void NETLIB_NAME(solver)::post_start() |
| r31373 | r31374 | |
| 447 | 446 | const int gs_threshold = m_gs_threshold.Value(); |
| 448 | 447 | const bool use_specific = true; |
| 449 | 448 | |
| 450 | m_params.m_accuracy = m_accuracy.Value(); | |
| 451 | m_params.m_gs_loops = m_gs_loops.Value(); | |
| 452 | m_params.m_nr_loops = m_nr_loops.Value(); | |
| 453 | m_params.m_nt_sync_delay = m_sync_delay.Value(); | |
| 454 | m_params.m_lte = m_lte.Value(); | |
| 455 | m_params.m_sor = m_sor.Value(); | |
| 449 | m_params.m_accuracy = m_accuracy.Value(); | |
| 450 | m_params.m_gs_loops = m_gs_loops.Value(); | |
| 451 | m_params.m_nr_loops = m_nr_loops.Value(); | |
| 452 | m_params.m_nt_sync_delay = m_sync_delay.Value(); | |
| 453 | m_params.m_lte = m_lte.Value(); | |
| 454 | m_params.m_sor = m_sor.Value(); | |
| 456 | 455 | |
| 457 | m_params.m_min_timestep = m_min_timestep.Value(); | |
| 458 | m_params.m_dynamic = (m_dynamic.Value() == 1 ? true : false); | |
| 459 | m_params.m_max_timestep = netlist_time::from_hz(m_freq.Value()).as_double(); | |
| 456 | m_params.m_min_timestep = m_min_timestep.Value(); | |
| 457 | m_params.m_dynamic = (m_dynamic.Value() == 1 ? true : false); | |
| 458 | m_params.m_max_timestep = netlist_time::from_hz(m_freq.Value()).as_double(); | |
| 460 | 459 | |
| 461 | if (m_params.m_dynamic) | |
| 462 | { | |
| 463 | m_params.m_max_timestep *= 1000.0; | |
| 464 | } | |
| 465 | else | |
| 466 | { | |
| 467 | m_params.m_min_timestep = m_params.m_max_timestep; | |
| 468 | } | |
| 460 | if (m_params.m_dynamic) | |
| 461 | { | |
| 462 | m_params.m_max_timestep *= 1000.0; | |
| 463 | } | |
| 464 | else | |
| 465 | { | |
| 466 | m_params.m_min_timestep = m_params.m_max_timestep; | |
| 467 | } | |
| 469 | 468 | |
| 470 | 469 | netlist().log("Scanning net groups ..."); |
| 471 | 470 | // determine net groups |
| 472 | 471 | for (netlist_net_t * const *pn = netlist().m_nets.first(); pn != NULL; pn = netlist().m_nets.next(pn)) |
| 473 | 472 | { |
| 474 | SOLVER_VERBOSE_OUT(("processing %s\n", (*pn)->name().cstr())); | |
| 475 | if (!(*pn)->isRailNet()) | |
| 476 | { | |
| 477 | SOLVER_VERBOSE_OUT((" ==> not a rail net\n")); | |
| 478 | netlist_analog_net_t *n = &(*pn)->as_analog(); | |
| 479 | if (!n->already_processed(groups, cur_group)) | |
| 480 | { | |
| 481 | cur_group++; | |
| 482 | n->process_net(groups, cur_group); | |
| 483 | } | |
| 484 | } | |
| 473 | SOLVER_VERBOSE_OUT(("processing %s\n", (*pn)->name().cstr())); | |
| 474 | if (!(*pn)->isRailNet()) | |
| 475 | { | |
| 476 | SOLVER_VERBOSE_OUT((" ==> not a rail net\n")); | |
| 477 | netlist_analog_net_t *n = &(*pn)->as_analog(); | |
| 478 | if (!n->already_processed(groups, cur_group)) | |
| 479 | { | |
| 480 | cur_group++; | |
| 481 | n->process_net(groups, cur_group); | |
| 482 | } | |
| 483 | } | |
| 485 | 484 | } |
| 486 | 485 | |
| 487 | 486 | // setup the solvers |
| r31373 | r31374 | |
| 497 | 496 | ms = create_solver<1,1>(1, gs_threshold, use_specific); |
| 498 | 497 | break; |
| 499 | 498 | case 2: |
| 500 | ||
| 499 | ms = create_solver<2,2>(2, gs_threshold, use_specific); | |
| 501 | 500 | break; |
| 502 | 501 | case 3: |
| 503 | ||
| 502 | ms = create_solver<3,3>(3, gs_threshold, use_specific); | |
| 504 | 503 | break; |
| 505 | 504 | case 4: |
| 506 | ||
| 505 | ms = create_solver<4,4>(4, gs_threshold, use_specific); | |
| 507 | 506 | break; |
| 508 | 507 | case 5: |
| 509 | ||
| 508 | ms = create_solver<5,5>(5, gs_threshold, use_specific); | |
| 510 | 509 | break; |
| 511 | 510 | case 6: |
| 512 | ||
| 511 | ms = create_solver<6,6>(6, gs_threshold, use_specific); | |
| 513 | 512 | break; |
| 514 | case 7: | |
| 515 | ms = create_solver<7,7>(7, gs_threshold, use_specific); | |
| 516 | break; | |
| 517 | case 8: | |
| 518 | ms = create_solver<8,8>(8, gs_threshold, use_specific); | |
| 519 | break; | |
| 520 | case 12: | |
| 521 | ms = create_solver<12,12>(12, gs_threshold, use_specific); | |
| 522 | break; | |
| 523 | default: | |
| 513 | case 7: | |
| 514 | ms = create_solver<7,7>(7, gs_threshold, use_specific); | |
| 515 | break; | |
| 516 | case 8: | |
| 517 | ms = create_solver<8,8>(8, gs_threshold, use_specific); | |
| 518 | break; | |
| 519 | case 12: | |
| 520 | ms = create_solver<12,12>(12, gs_threshold, use_specific); | |
| 521 | break; | |
| 522 | default: | |
| 524 | 523 | if (net_count <= 16) |
| 525 | 524 | { |
| 526 | | |
| 525 | ms = create_solver<0,16>(net_count, gs_threshold, use_specific); | |
| 527 | 526 | } |
| 528 | 527 | else if (net_count <= 32) |
| 529 | 528 | { |
| 530 | | |
| 529 | ms = create_solver<0,32>(net_count, gs_threshold, use_specific); | |
| 531 | 530 | } |
| 532 | 531 | else if (net_count <= 64) |
| 533 | 532 | { |
| 534 | | |
| 533 | ms = create_solver<0,64>(net_count, gs_threshold, use_specific); | |
| 535 | 534 | } |
| 536 | 535 | else |
| 537 | 536 | { |
| r31373 | r31374 | |
| 544 | 543 | |
| 545 | 544 | register_sub(*ms, pstring::sprintf("Solver %d",m_mat_solvers.count())); |
| 546 | 545 | |
| 547 | ||
| 546 | ms->vsetup(groups[i]); | |
| 548 | 547 | |
| 549 | ||
| 548 | m_mat_solvers.add(ms); | |
| 550 | 549 | |
| 551 | netlist().log("Solver %s", ms->name().cstr()); | |
| 552 | netlist().log(" # %d ==> %d nets", i, groups[i].count()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); | |
| 550 | netlist().log("Solver %s", ms->name().cstr()); | |
| 551 | netlist().log(" # %d ==> %d nets", i, groups[i].count()); //, (*(*groups[i].first())->m_core_terms.first())->name().cstr()); | |
| 553 | 552 | netlist().log(" has %s elements", ms->is_dynamic() ? "dynamic" : "no dynamic"); |
| 554 | 553 | netlist().log(" has %s elements", ms->is_timestep() ? "timestep" : "no timestep"); |
| 555 | 554 | for (int j=0; j<groups[i].count(); j++) |
| 556 | 555 | { |
| 557 | | |
| 556 | netlist().log("Net %d: %s", j, groups[i][j]->name().cstr()); | |
| 558 | 557 | netlist_net_t *n = groups[i][j]; |
| 559 | 558 | for (int k = 0; k < n->m_core_terms.count(); k++) |
| 560 | 559 | { |
| 561 | const netlist_core_terminal_t *p = n->m_core_terms[k]; | |
| 562 | netlist().log(" %s", p->name().cstr()); | |
| 560 | const netlist_core_terminal_t *p = n->m_core_terms[k]; | |
| 561 | netlist().log(" %s", p->name().cstr()); | |
| 563 | 562 | } |
| 564 | 563 | } |
| 565 | 564 | } |
| 566 | 565 | } |
| 567 |
| r31373 | r31374 | |
|---|---|---|
| 115 | 115 | |
| 116 | 116 | NETLIB_UPDATE(QBJT_switch) |
| 117 | 117 | { |
| 118 | if (!m_RB.m_P.net().isRailNet()) | |
| 119 | m_RB.m_P.schedule_solve(); // Basis | |
| 120 | else if (!m_RB.m_N.net().isRailNet()) | |
| 121 | m_RB.m_N.schedule_solve(); // Emitter | |
| 122 | else if (!m_RC.m_P.net().isRailNet()) | |
| 123 | m_RC.m_P.schedule_solve(); // Collector | |
| 118 | if (!m_RB.m_P.net().isRailNet()) | |
| 119 | m_RB.m_P.schedule_solve(); // Basis | |
| 120 | else if (!m_RB.m_N.net().isRailNet()) | |
| 121 | m_RB.m_N.schedule_solve(); // Emitter | |
| 122 | else if (!m_RC.m_P.net().isRailNet()) | |
| 123 | m_RC.m_P.schedule_solve(); // Collector | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 |
| r31373 | r31374 | |
|---|---|---|
| 385 | 385 | { |
| 386 | 386 | pstring t1 = get_identifier(); |
| 387 | 387 | m_setup.register_link(last , t1); |
| 388 | | |
| 388 | NL_VERBOSE_OUT(("Parser: Connect: %s %s\n", last.cstr(), t1.cstr())); | |
| 389 | 389 | token_t n = get_token(); |
| 390 | 390 | if (n.is(m_tok_param_right)) |
| 391 | 391 | break; |
| r31373 | r31374 | |
|---|---|---|
| 92 | 92 | template <class T> |
| 93 | 93 | static void remove_start_with(T &hm, pstring &sw) |
| 94 | 94 | { |
| 95 | for (int i = hm.count() - 1; i >= 0; i++) | |
| 96 | { | |
| 97 | pstring x = hm[i]->name(); | |
| 95 | for (int i = hm.count() - 1; i >= 0; i++) | |
| 96 | { | |
| 97 | pstring x = hm[i]->name(); | |
| 98 | 98 | if (sw.equals(x.substr(0, sw.len()))) |
| 99 | 99 | { |
| 100 | 100 | NL_VERBOSE_OUT(("removing %s\n", hm[i]->name().cstr())); |
| r31373 | r31374 | |
| 167 | 167 | case netlist_terminal_t::NETLIST: |
| 168 | 168 | return "NETLIST"; |
| 169 | 169 | break; |
| 170 | case netlist_terminal_t::QUEUE: | |
| 171 | return "QUEUE"; | |
| 170 | case netlist_terminal_t::QUEUE: | |
| 171 | return "QUEUE"; | |
| 172 | 172 | break; |
| 173 | 173 | } |
| 174 | 174 | // FIXME: noreturn |
| r31373 | r31374 | |
| 264 | 264 | case netlist_terminal_t::NETLIST: |
| 265 | 265 | netlist().error("Netlist registration not yet supported - %s\n", name.cstr()); |
| 266 | 266 | break; |
| 267 | case netlist_terminal_t::QUEUE: | |
| 268 | netlist().error("QUEUE registration not yet supported - %s\n", name.cstr()); | |
| 269 | break; | |
| 267 | case netlist_terminal_t::QUEUE: | |
| 268 | netlist().error("QUEUE registration not yet supported - %s\n", name.cstr()); | |
| 269 | break; | |
| 270 | 270 | } |
| 271 | 271 | } |
| 272 | 272 | |
| r31373 | r31374 | |
| 407 | 407 | |
| 408 | 408 | for (int i = 0; i < out.net().m_core_terms.count(); i++) |
| 409 | 409 | { |
| 410 | | |
| 410 | netlist_core_terminal_t *p = out.net().m_core_terms[i]; | |
| 411 | 411 | p->clear_net(); // de-link from all nets ... |
| 412 | 412 | connect(proxy->out(), *p); |
| 413 | 413 | } |
| r31373 | r31374 | |
| 444 | 444 | } |
| 445 | 445 | else |
| 446 | 446 | { |
| 447 | if (in.has_net()) | |
| 448 | out.net().merge_net(&in.net()); | |
| 449 | else | |
| 450 | out.net().register_con(in); | |
| 447 | if (in.has_net()) | |
| 448 | out.net().merge_net(&in.net()); | |
| 449 | else | |
| 450 | out.net().register_con(in); | |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
| r31373 | r31374 | |
| 485 | 485 | { |
| 486 | 486 | if (out.isFamily(netlist_terminal_t::ANALOG)) |
| 487 | 487 | { |
| 488 | | |
| 488 | NL_VERBOSE_OUT(("connect_terminal_output: %s %s\n", in.name().cstr(), out.name().cstr())); | |
| 489 | 489 | /* no proxy needed, just merge existing terminal net */ |
| 490 | 490 | if (in.has_net()) |
| 491 | 491 | out.net().merge_net(&in.net()); |
| r31373 | r31374 | |
| 650 | 650 | pstring errstr(""); |
| 651 | 651 | |
| 652 | 652 | netlist().log("looking for terminals not connected ..."); |
| 653 | for (int i = 0; i < m_terminals.count(); i++) | |
| 654 | { | |
| 653 | for (int i = 0; i < m_terminals.count(); i++) | |
| 654 | { | |
| 655 | 655 | if (!m_terminals[i]->has_net()) |
| 656 | 656 | errstr += pstring::sprintf("Found terminal %s without a net\n", |
| 657 | | |
| 657 | m_terminals[i]->name().cstr()); | |
| 658 | 658 | else if (m_terminals[i]->net().num_cons() == 0) |
| 659 | 659 | netlist().warning("Found terminal %s without connections", |
| 660 | | |
| 660 | m_terminals[i]->name().cstr()); | |
| 661 | 661 | } |
| 662 | 662 | if (errstr != "") |
| 663 | 663 | netlist().error("%s", errstr.cstr()); |
| r31373 | r31374 | |
|---|---|---|
| 292 | 292 | |
| 293 | 293 | // allocate autoboot timer |
| 294 | 294 | m_autoboot_timer = scheduler().timer_alloc(timer_expired_delegate(FUNC(running_machine::autoboot_callback), this)); |
| 295 | ||
| 295 | ||
| 296 | 296 | manager().update_machine(); |
| 297 | 297 | } |
| 298 | 298 |
| r31373 | r31374 | |
|---|---|---|
| 1145 | 1145 | else |
| 1146 | 1146 | parse_error("Invalid dataarea endianness"); |
| 1147 | 1147 | } |
| 1148 | ||
| 1148 | ||
| 1149 | 1149 | add_rom_entry(attrvalues[0], NULL, 0, strtol(attrvalues[1], NULL, 0), regionflags); |
| 1150 | 1150 | } |
| 1151 | 1151 | else |
| r31373 | r31374 | |
|---|---|---|
| 92 | 92 | |
| 93 | 93 | void k053260_device::device_reset() |
| 94 | 94 | { |
| 95 | ||
| 96 | for (int i = 0; i < 4; i++) | |
| 95 | for (int i = 0; i < 4; i++) | |
| 97 | 96 | { |
| 98 | 97 | m_channels[i].rate = 0; |
| 99 | 98 | m_channels[i].size = 0; |
| r31373 | r31374 | |
|---|---|---|
| 274 | 274 | { |
| 275 | 275 | m_POTx[i] = 0; |
| 276 | 276 | } |
| 277 | ||
| 277 | ||
| 278 | 278 | m_pot0_r_cb.resolve(); |
| 279 | 279 | m_pot1_r_cb.resolve(); |
| 280 | 280 | m_pot2_r_cb.resolve(); |
| r31373 | r31374 | |
|---|---|---|
| 155 | 155 | m_region3(NULL), |
| 156 | 156 | m_channels(0), |
| 157 | 157 | m_irq_cb(*this), |
| 158 | m_read_port_cb(*this) | |
| 158 | m_read_port_cb(*this) | |
| 159 | 159 | { |
| 160 | 160 | for (int i = 0; i < 4; i++) |
| 161 | 161 | { |
| r31373 | r31374 | |
|---|---|---|
| 128 | 128 | void ym2608_device::device_start() |
| 129 | 129 | { |
| 130 | 130 | ay8910_device::device_start(); |
| 131 | ||
| 131 | ||
| 132 | 132 | int rate = clock()/72; |
| 133 | 133 | void *pcmbufa; |
| 134 | 134 | int pcmsizea; |
| r31373 | r31374 | |
|---|---|---|
| 118 | 118 | void ym2203_device::device_start() |
| 119 | 119 | { |
| 120 | 120 | ay8910_device::device_start(); |
| 121 | ||
| 121 | ||
| 122 | 122 | int rate = clock()/72; /* ??? */ |
| 123 | 123 | |
| 124 | 124 | m_irq_handler.resolve(); |
| r31373 | r31374 | |
|---|---|---|
| 491 | 491 | void k054539_device::device_start() |
| 492 | 492 | { |
| 493 | 493 | m_timer = timer_alloc(0); |
| 494 | ||
| 494 | ||
| 495 | 495 | // resolve / bind callbacks |
| 496 | 496 | m_timer_handler.resolve_safe(); |
| 497 | 497 | m_apan_cb.bind_relative_to(*owner()); |
| 498 | ||
| 498 | ||
| 499 | 499 | for (int i = 0; i < 8; i++) |
| 500 | 500 | gain[i] = 1.0; |
| 501 | 501 |
| r31373 | r31374 | |
|---|---|---|
| 139 | 139 | void ym2610_device::device_start() |
| 140 | 140 | { |
| 141 | 141 | ay8910_device::device_start(); |
| 142 | ||
| 142 | ||
| 143 | 143 | int rate = clock()/72; |
| 144 | 144 | void *pcmbufa,*pcmbufb; |
| 145 | 145 | int pcmsizea,pcmsizeb; |
| r31373 | r31374 | |
|---|---|---|
| 37 | 37 | void rf5c68_device::device_start() |
| 38 | 38 | { |
| 39 | 39 | m_sample_end_cb.bind_relative_to(*owner()); |
| 40 | ||
| 40 | ||
| 41 | 41 | /* allocate memory for the chip */ |
| 42 | 42 | memset(m_data, 0xff, sizeof(m_data)); |
| 43 | 43 |
| r31373 | r31374 | |
|---|---|---|
| 389 | 389 | |
| 390 | 390 | static const ay8910_device::ay_ym_param ay8910_param = |
| 391 | 391 | { |
| 392 | 800000, 8000000, | |
| 393 | 16, | |
| 394 | { 15950, 15350, 15090, 14760, 14275, 13620, 12890, 11370, | |
| 395 | 10600, 8590, 7190, 5985, 4820, 3945, 3017, 2345 } | |
| 392 | 800000, 8000000, | |
| 393 | 16, | |
| 394 | { 15950, 15350, 15090, 14760, 14275, 13620, 12890, 11370, | |
| 395 | 10600, 8590, 7190, 5985, 4820, 3945, 3017, 2345 } | |
| 396 | 396 | }; |
| 397 | 397 | |
| 398 | 398 | static const ay8910_device::mosfet_param ay8910_mosfet_param = |
| 399 | 399 | { |
| 400 | 1.465385778, | |
| 401 | 4.9, | |
| 402 | 16, | |
| 403 | { | |
| 404 | 0.00076, | |
| 405 | 0.80536, | |
| 406 | 1.13106, | |
| 407 | 1.65952, | |
| 408 | 2.42261, | |
| 409 | 3.60536, | |
| 410 | 5.34893, | |
| 411 | 8.96871, | |
| 412 | 10.97202, | |
| 413 | 19.32370, | |
| 414 | 29.01935, | |
| 415 | 38.82026, | |
| 416 | 55.50539, | |
| 417 | 78.44395, | |
| 418 | 109.49257, | |
| 419 | 153.72985, | |
| 420 | } | |
| 400 | 1.465385778, | |
| 401 | 4.9, | |
| 402 | 16, | |
| 403 | { | |
| 404 | 0.00076, | |
| 405 | 0.80536, | |
| 406 | 1.13106, | |
| 407 | 1.65952, | |
| 408 | 2.42261, | |
| 409 | 3.60536, | |
| 410 | 5.34893, | |
| 411 | 8.96871, | |
| 412 | 10.97202, | |
| 413 | 19.32370, | |
| 414 | 29.01935, | |
| 415 | 38.82026, | |
| 416 | 55.50539, | |
| 417 | 78.44395, | |
| 418 | 109.49257, | |
| 419 | 153.72985, | |
| 420 | } | |
| 421 | 421 | }; |
| 422 | 422 | |
| 423 | 423 | |
| r31373 | r31374 | |
| 523 | 523 | |
| 524 | 524 | INLINE void build_mosfet_resistor_table(const ay8910_device::mosfet_param &par, const double rd, INT32 *tab) |
| 525 | 525 | { |
| 526 | ||
| 526 | int j; | |
| 527 | 527 | |
| 528 | for (j=0; j < par.m_count; j++) | |
| 529 | { | |
| 530 | const double Vd = 5.0; | |
| 531 | const double Vg = par.m_Vg - par.m_Vth; | |
| 532 | const double kn = par.m_Kn[j] / 1.0e6; | |
| 533 | const double p2 = 1.0 / (2.0 * kn * rd) + Vg; | |
| 534 | const double Vs = p2 - sqrt(p2 * p2 - Vg * Vg); | |
| 528 | for (j=0; j < par.m_count; j++) | |
| 529 | { | |
| 530 | const double Vd = 5.0; | |
| 531 | const double Vg = par.m_Vg - par.m_Vth; | |
| 532 | const double kn = par.m_Kn[j] / 1.0e6; | |
| 533 | const double p2 = 1.0 / (2.0 * kn * rd) + Vg; | |
| 534 | const double Vs = p2 - sqrt(p2 * p2 - Vg * Vg); | |
| 535 | 535 | |
| 536 | const double res = rd * ( Vd / Vs - 1.0); | |
| 537 | /* That's the biggest value we can stream on to netlist. */ | |
| 536 | const double res = rd * ( Vd / Vs - 1.0); | |
| 537 | /* That's the biggest value we can stream on to netlist. */ | |
| 538 | 538 | |
| 539 | if (res > (1 << 28)) | |
| 540 | tab[j] = (1 << 28); | |
| 541 | else | |
| 542 | tab[j] = res; | |
| 543 | //printf("%d %f %10d\n", j, rd / (res + rd) * 5.0, tab[j]); | |
| 544 | } | |
| 539 | if (res > (1 << 28)) | |
| 540 | tab[j] = (1 << 28); | |
| 541 | else | |
| 542 | tab[j] = res; | |
| 543 | //printf("%d %f %10d\n", j, rd / (res + rd) * 5.0, tab[j]); | |
| 544 | } | |
| 545 | 545 | } |
| 546 | 546 | |
| 547 | 547 | |
| r31373 | r31374 | |
| 814 | 814 | |
| 815 | 815 | if ((m_flags & AY8910_RESISTOR_OUTPUT) != 0) |
| 816 | 816 | { |
| 817 | if (m_type != PSG_TYPE_AY) | |
| 818 | fatalerror("AY8910_RESISTOR_OUTPUT currently only supported for AY8910 devices."); | |
| 817 | if (m_type != PSG_TYPE_AY) | |
| 818 | fatalerror("AY8910_RESISTOR_OUTPUT currently only supported for AY8910 devices."); | |
| 819 | 819 | |
| 820 | | |
| 820 | for (chan=0; chan < AY8910_NUM_CHANNELS; chan++) | |
| 821 | 821 | { |
| 822 | 822 | build_mosfet_resistor_table(ay8910_mosfet_param, m_res_load[chan], m_vol_table[chan]); |
| 823 | 823 | build_mosfet_resistor_table(ay8910_mosfet_param, m_res_load[chan], m_env_table[chan]); |
| r31373 | r31374 | |
| 1110 | 1110 | ay8910_device::ay8910_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 1111 | 1111 | : device_t(mconfig, AY8910, "AY-3-8910A", tag, owner, clock, "ay8910", __FILE__), |
| 1112 | 1112 | device_sound_interface(mconfig, *this), |
| 1113 | ||
| 1113 | m_type(PSG_TYPE_AY), | |
| 1114 | 1114 | m_streams(3), |
| 1115 | 1115 | m_ioports(2), |
| 1116 | 1116 | m_ready(0), |
| r31373 | r31374 | |
| 1149 | 1149 | } |
| 1150 | 1150 | |
| 1151 | 1151 | ay8910_device::ay8910_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, |
| 1152 | | |
| 1152 | psg_type_t psg_type, int streams, int ioports, const char *shortname, const char *source) | |
| 1153 | 1153 | : device_t(mconfig, type, name, tag, owner, clock, shortname, source), |
| 1154 | 1154 | device_sound_interface(mconfig, *this), |
| 1155 | ||
| 1155 | m_type(psg_type), | |
| 1156 | 1156 | m_streams(streams), |
| 1157 | 1157 | m_ioports(ioports), |
| 1158 | 1158 | m_ready(0), |
| r31373 | r31374 | |
|---|---|---|
| 31 | 31 | */ |
| 32 | 32 | |
| 33 | 33 | |
| 34 | #define LEVELS1 12 /* size of the first part of the stack */ | |
| 35 | #define LEVELS2 10 /* size of the second part of the stack */ | |
| 34 | #define LEVELS1 12 /* size of the first part of the stack */ | |
| 35 | #define LEVELS2 10 /* size of the second part of the stack */ | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | |
| r31373 | r31374 | |
| 41 | 41 | ** return 1 + string at top if find a good name. |
| 42 | 42 | */ |
| 43 | 43 | static int findfield (lua_State *L, int objidx, int level) { |
| 44 | if (level == 0 || !lua_istable(L, -1)) | |
| 45 | return 0; /* not found */ | |
| 46 | lua_pushnil(L); /* start 'next' loop */ | |
| 47 | while (lua_next(L, -2)) { /* for each pair in table */ | |
| 48 | if (lua_type(L, -2) == LUA_TSTRING) { /* ignore non-string keys */ | |
| 49 | if (lua_rawequal(L, objidx, -1)) { /* found object? */ | |
| 50 | lua_pop(L, 1); /* remove value (but keep name) */ | |
| 51 | return 1; | |
| 52 | } | |
| 53 | else if (findfield(L, objidx, level - 1)) { /* try recursively */ | |
| 54 | lua_remove(L, -2); /* remove table (but keep name) */ | |
| 55 | lua_pushliteral(L, "."); | |
| 56 | lua_insert(L, -2); /* place '.' between the two names */ | |
| 57 | lua_concat(L, 3); | |
| 58 | return 1; | |
| 59 | } | |
| 60 | } | |
| 61 | lua_pop(L, 1); /* remove value */ | |
| 62 | } | |
| 63 | return 0; /* not found */ | |
| 44 | if (level == 0 || !lua_istable(L, -1)) | |
| 45 | return 0; /* not found */ | |
| 46 | lua_pushnil(L); /* start 'next' loop */ | |
| 47 | while (lua_next(L, -2)) { /* for each pair in table */ | |
| 48 | if (lua_type(L, -2) == LUA_TSTRING) { /* ignore non-string keys */ | |
| 49 | if (lua_rawequal(L, objidx, -1)) { /* found object? */ | |
| 50 | lua_pop(L, 1); /* remove value (but keep name) */ | |
| 51 | return 1; | |
| 52 | } | |
| 53 | else if (findfield(L, objidx, level - 1)) { /* try recursively */ | |
| 54 | lua_remove(L, -2); /* remove table (but keep name) */ | |
| 55 | lua_pushliteral(L, "."); | |
| 56 | lua_insert(L, -2); /* place '.' between the two names */ | |
| 57 | lua_concat(L, 3); | |
| 58 | return 1; | |
| 59 | } | |
| 60 | } | |
| 61 | lua_pop(L, 1); /* remove value */ | |
| 62 | } | |
| 63 | return 0; /* not found */ | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | static int pushglobalfuncname (lua_State *L, lua_Debug *ar) { |
| 68 | int top = lua_gettop(L); | |
| 69 | lua_getinfo(L, "f", ar); /* push function */ | |
| 70 | lua_pushglobaltable(L); | |
| 71 | if (findfield(L, top + 1, 2)) { | |
| 72 | lua_copy(L, -1, top + 1); /* move name to proper place */ | |
| 73 | lua_pop(L, 2); /* remove pushed values */ | |
| 74 | return 1; | |
| 75 | } | |
| 76 | else { | |
| 77 | lua_settop(L, top); /* remove function and global table */ | |
| 78 | return 0; | |
| 79 | } | |
| 68 | int top = lua_gettop(L); | |
| 69 | lua_getinfo(L, "f", ar); /* push function */ | |
| 70 | lua_pushglobaltable(L); | |
| 71 | if (findfield(L, top + 1, 2)) { | |
| 72 | lua_copy(L, -1, top + 1); /* move name to proper place */ | |
| 73 | lua_pop(L, 2); /* remove pushed values */ | |
| 74 | return 1; | |
| 75 | } | |
| 76 | else { | |
| 77 | lua_settop(L, top); /* remove function and global table */ | |
| 78 | return 0; | |
| 79 | } | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | static void pushfuncname (lua_State *L, lua_Debug *ar) { |
| 84 | if (*ar->namewhat != '\0') /* is there a name? */ | |
| 85 | lua_pushfstring(L, "function " LUA_QS, ar->name); | |
| 86 | else if (*ar->what == 'm') /* main? */ | |
| 87 | lua_pushliteral(L, "main chunk"); | |
| 88 | else if (*ar->what == 'C') { | |
| 89 | if (pushglobalfuncname(L, ar)) { | |
| 90 | lua_pushfstring(L, "function " LUA_QS, lua_tostring(L, -1)); | |
| 91 | lua_remove(L, -2); /* remove name */ | |
| 92 | } | |
| 93 | else | |
| 94 | lua_pushliteral(L, "?"); | |
| 95 | } | |
| 96 | else | |
| 97 | lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined); | |
| 84 | if (*ar->namewhat != '\0') /* is there a name? */ | |
| 85 | lua_pushfstring(L, "function " LUA_QS, ar->name); | |
| 86 | else if (*ar->what == 'm') /* main? */ | |
| 87 | lua_pushliteral(L, "main chunk"); | |
| 88 | else if (*ar->what == 'C') { | |
| 89 | if (pushglobalfuncname(L, ar)) { | |
| 90 | lua_pushfstring(L, "function " LUA_QS, lua_tostring(L, -1)); | |
| 91 | lua_remove(L, -2); /* remove name */ | |
| 92 | } | |
| 93 | else | |
| 94 | lua_pushliteral(L, "?"); | |
| 95 | } | |
| 96 | else | |
| 97 | lua_pushfstring(L, "function <%s:%d>", ar->short_src, ar->linedefined); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | static int countlevels (lua_State *L) { |
| 102 | lua_Debug ar; | |
| 103 | int li = 1, le = 1; | |
| 104 | /* find an upper bound */ | |
| 105 | while (lua_getstack(L, le, &ar)) { li = le; le *= 2; } | |
| 106 | /* do a binary search */ | |
| 107 | while (li < le) { | |
| 108 | int m = (li + le)/2; | |
| 109 | if (lua_getstack(L, m, &ar)) li = m + 1; | |
| 110 | else le = m; | |
| 111 | } | |
| 112 | return le - 1; | |
| 102 | lua_Debug ar; | |
| 103 | int li = 1, le = 1; | |
| 104 | /* find an upper bound */ | |
| 105 | while (lua_getstack(L, le, &ar)) { li = le; le *= 2; } | |
| 106 | /* do a binary search */ | |
| 107 | while (li < le) { | |
| 108 | int m = (li + le)/2; | |
| 109 | if (lua_getstack(L, m, &ar)) li = m + 1; | |
| 110 | else le = m; | |
| 111 | } | |
| 112 | return le - 1; | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | LUALIB_API void luaL_traceback (lua_State *L, lua_State *L1, |
| 117 | const char *msg, int level) { | |
| 118 | lua_Debug ar; | |
| 119 | int top = lua_gettop(L); | |
| 120 | int numlevels = countlevels(L1); | |
| 121 | int mark = (numlevels > LEVELS1 + LEVELS2) ? LEVELS1 : 0; | |
| 122 | if (msg) lua_pushfstring(L, "%s\n", msg); | |
| 123 | lua_pushliteral(L, "stack traceback:"); | |
| 124 | while (lua_getstack(L1, level++, &ar)) { | |
| 125 | if (level == mark) { /* too many levels? */ | |
| 126 | lua_pushliteral(L, "\n\t..."); /* add a '...' */ | |
| 127 | level = numlevels - LEVELS2; /* and skip to last ones */ | |
| 128 | } | |
| 129 | else { | |
| 130 | lua_getinfo(L1, "Slnt", &ar); | |
| 131 | lua_pushfstring(L, "\n\t%s:", ar.short_src); | |
| 132 | if (ar.currentline > 0) | |
| 133 | lua_pushfstring(L, "%d:", ar.currentline); | |
| 134 | lua_pushliteral(L, " in "); | |
| 135 | pushfuncname(L, &ar); | |
| 136 | if (ar.istailcall) | |
| 137 | lua_pushliteral(L, "\n\t(...tail calls...)"); | |
| 138 | lua_concat(L, lua_gettop(L) - top); | |
| 139 | } | |
| 140 | } | |
| 141 | lua_concat(L, lua_gettop(L) - top); | |
| 117 | const char *msg, int level) { | |
| 118 | lua_Debug ar; | |
| 119 | int top = lua_gettop(L); | |
| 120 | int numlevels = countlevels(L1); | |
| 121 | int mark = (numlevels > LEVELS1 + LEVELS2) ? LEVELS1 : 0; | |
| 122 | if (msg) lua_pushfstring(L, "%s\n", msg); | |
| 123 | lua_pushliteral(L, "stack traceback:"); | |
| 124 | while (lua_getstack(L1, level++, &ar)) { | |
| 125 | if (level == mark) { /* too many levels? */ | |
| 126 | lua_pushliteral(L, "\n\t..."); /* add a '...' */ | |
| 127 | level = numlevels - LEVELS2; /* and skip to last ones */ | |
| 128 | } | |
| 129 | else { | |
| 130 | lua_getinfo(L1, "Slnt", &ar); | |
| 131 | lua_pushfstring(L, "\n\t%s:", ar.short_src); | |
| 132 | if (ar.currentline > 0) | |
| 133 | lua_pushfstring(L, "%d:", ar.currentline); | |
| 134 | lua_pushliteral(L, " in "); | |
| 135 | pushfuncname(L, &ar); | |
| 136 | if (ar.istailcall) | |
| 137 | lua_pushliteral(L, "\n\t(...tail calls...)"); | |
| 138 | lua_concat(L, lua_gettop(L) - top); | |
| 139 | } | |
| 140 | } | |
| 141 | lua_concat(L, lua_gettop(L) - top); | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | /* }====================================================== */ |
| r31373 | r31374 | |
| 151 | 151 | */ |
| 152 | 152 | |
| 153 | 153 | LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { |
| 154 | lua_Debug ar; | |
| 155 | if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ | |
| 156 | return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); | |
| 157 | lua_getinfo(L, "n", &ar); | |
| 158 | if (strcmp(ar.namewhat, "method") == 0) { | |
| 159 | narg--; /* do not count `self' */ | |
| 160 | if (narg == 0) /* error is in the self argument itself? */ | |
| 161 | return luaL_error(L, "calling " LUA_QS " on bad self (%s)", | |
| 162 | ar.name, extramsg); | |
| 163 | } | |
| 164 | if (ar.name == NULL) | |
| 165 | ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?"; | |
| 166 | return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", | |
| 167 | narg, ar.name, extramsg); | |
| 154 | lua_Debug ar; | |
| 155 | if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ | |
| 156 | return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); | |
| 157 | lua_getinfo(L, "n", &ar); | |
| 158 | if (strcmp(ar.namewhat, "method") == 0) { | |
| 159 | narg--; /* do not count `self' */ | |
| 160 | if (narg == 0) /* error is in the self argument itself? */ | |
| 161 | return luaL_error(L, "calling " LUA_QS " on bad self (%s)", | |
| 162 | ar.name, extramsg); | |
| 163 | } | |
| 164 | if (ar.name == NULL) | |
| 165 | ar.name = (pushglobalfuncname(L, &ar)) ? lua_tostring(L, -1) : "?"; | |
| 166 | return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", | |
| 167 | narg, ar.name, extramsg); | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | static int typeerror (lua_State *L, int narg, const char *tname) { |
| 172 | const char *msg = lua_pushfstring(L, "%s expected, got %s", | |
| 173 | tname, luaL_typename(L, narg)); | |
| 174 | return luaL_argerror(L, narg, msg); | |
| 172 | const char *msg = lua_pushfstring(L, "%s expected, got %s", | |
| 173 | tname, luaL_typename(L, narg)); | |
| 174 | return luaL_argerror(L, narg, msg); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | static void tag_error (lua_State *L, int narg, int tag) { |
| 179 | ||
| 179 | typeerror(L, narg, lua_typename(L, tag)); | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
| 183 | 183 | LUALIB_API void luaL_where (lua_State *L, int level) { |
| 184 | lua_Debug ar; | |
| 185 | if (lua_getstack(L, level, &ar)) { /* check function at level */ | |
| 186 | lua_getinfo(L, "Sl", &ar); /* get info about it */ | |
| 187 | if (ar.currentline > 0) { /* is there info? */ | |
| 188 | lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); | |
| 189 | return; | |
| 190 | } | |
| 191 | } | |
| 192 | lua_pushliteral(L, ""); /* else, no information available... */ | |
| 184 | lua_Debug ar; | |
| 185 | if (lua_getstack(L, level, &ar)) { /* check function at level */ | |
| 186 | lua_getinfo(L, "Sl", &ar); /* get info about it */ | |
| 187 | if (ar.currentline > 0) { /* is there info? */ | |
| 188 | lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); | |
| 189 | return; | |
| 190 | } | |
| 191 | } | |
| 192 | lua_pushliteral(L, ""); /* else, no information available... */ | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
| 196 | 196 | LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { |
| 197 | va_list argp; | |
| 198 | va_start(argp, fmt); | |
| 199 | luaL_where(L, 1); | |
| 200 | lua_pushvfstring(L, fmt, argp); | |
| 201 | va_end(argp); | |
| 202 | lua_concat(L, 2); | |
| 203 | return lua_error(L); | |
| 197 | va_list argp; | |
| 198 | va_start(argp, fmt); | |
| 199 | luaL_where(L, 1); | |
| 200 | lua_pushvfstring(L, fmt, argp); | |
| 201 | va_end(argp); | |
| 202 | lua_concat(L, 2); | |
| 203 | return lua_error(L); | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | |
| 207 | 207 | LUALIB_API int luaL_fileresult (lua_State *L, int stat, const char *fname) { |
| 208 | int en = errno; /* calls to Lua API may change this value */ | |
| 209 | if (stat) { | |
| 210 | lua_pushboolean(L, 1); | |
| 211 | return 1; | |
| 212 | } | |
| 213 | else { | |
| 214 | lua_pushnil(L); | |
| 215 | if (fname) | |
| 216 | lua_pushfstring(L, "%s: %s", fname, strerror(en)); | |
| 217 | else | |
| 218 | lua_pushstring(L, strerror(en)); | |
| 219 | lua_pushinteger(L, en); | |
| 220 | return 3; | |
| 221 | } | |
| 208 | int en = errno; /* calls to Lua API may change this value */ | |
| 209 | if (stat) { | |
| 210 | lua_pushboolean(L, 1); | |
| 211 | return 1; | |
| 212 | } | |
| 213 | else { | |
| 214 | lua_pushnil(L); | |
| 215 | if (fname) | |
| 216 | lua_pushfstring(L, "%s: %s", fname, strerror(en)); | |
| 217 | else | |
| 218 | lua_pushstring(L, strerror(en)); | |
| 219 | lua_pushinteger(L, en); | |
| 220 | return 3; | |
| 221 | } | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | |
| 225 | #if !defined(inspectstat) | |
| 225 | #if !defined(inspectstat) /* { */ | |
| 226 | 226 | |
| 227 | 227 | #if defined(LUA_USE_POSIX) |
| 228 | 228 | |
| r31373 | r31374 | |
| 232 | 232 | ** use appropriate macros to interpret 'pclose' return status |
| 233 | 233 | */ |
| 234 | 234 | #define inspectstat(stat,what) \ |
| 235 | if (WIFEXITED(stat)) { stat = WEXITSTATUS(stat); } \ | |
| 236 | else if (WIFSIGNALED(stat)) { stat = WTERMSIG(stat); what = "signal"; } | |
| 235 | if (WIFEXITED(stat)) { stat = WEXITSTATUS(stat); } \ | |
| 236 | else if (WIFSIGNALED(stat)) { stat = WTERMSIG(stat); what = "signal"; } | |
| 237 | 237 | |
| 238 | 238 | #else |
| 239 | 239 | |
| r31373 | r31374 | |
| 241 | 241 | |
| 242 | 242 | #endif |
| 243 | 243 | |
| 244 | #endif | |
| 244 | #endif /* } */ | |
| 245 | 245 | |
| 246 | 246 | |
| 247 | 247 | LUALIB_API int luaL_execresult (lua_State *L, int stat) { |
| 248 | const char *what = "exit"; /* type of termination */ | |
| 249 | if (stat == -1) /* error? */ | |
| 250 | return luaL_fileresult(L, 0, NULL); | |
| 251 | else { | |
| 252 | inspectstat(stat, what); /* interpret result */ | |
| 253 | if (*what == 'e' && stat == 0) /* successful termination? */ | |
| 254 | lua_pushboolean(L, 1); | |
| 255 | else | |
| 256 | lua_pushnil(L); | |
| 257 | lua_pushstring(L, what); | |
| 258 | lua_pushinteger(L, stat); | |
| 259 | return 3; /* return true/nil,what,code */ | |
| 260 | } | |
| 248 | const char *what = "exit"; /* type of termination */ | |
| 249 | if (stat == -1) /* error? */ | |
| 250 | return luaL_fileresult(L, 0, NULL); | |
| 251 | else { | |
| 252 | inspectstat(stat, what); /* interpret result */ | |
| 253 | if (*what == 'e' && stat == 0) /* successful termination? */ | |
| 254 | lua_pushboolean(L, 1); | |
| 255 | else | |
| 256 | lua_pushnil(L); | |
| 257 | lua_pushstring(L, what); | |
| 258 | lua_pushinteger(L, stat); | |
| 259 | return 3; /* return true/nil,what,code */ | |
| 260 | } | |
| 261 | 261 | } |
| 262 | 262 | |
| 263 | 263 | /* }====================================================== */ |
| r31373 | r31374 | |
| 270 | 270 | */ |
| 271 | 271 | |
| 272 | 272 | LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { |
| 273 | luaL_getmetatable(L, tname); /* try to get metatable */ | |
| 274 | if (!lua_isnil(L, -1)) /* name already in use? */ | |
| 275 | return 0; /* leave previous value on top, but return 0 */ | |
| 276 | lua_pop(L, 1); | |
| 277 | lua_newtable(L); /* create metatable */ | |
| 278 | lua_pushvalue(L, -1); | |
| 279 | lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ | |
| 280 | return 1; | |
| 273 | luaL_getmetatable(L, tname); /* try to get metatable */ | |
| 274 | if (!lua_isnil(L, -1)) /* name already in use? */ | |
| 275 | return 0; /* leave previous value on top, but return 0 */ | |
| 276 | lua_pop(L, 1); | |
| 277 | lua_newtable(L); /* create metatable */ | |
| 278 | lua_pushvalue(L, -1); | |
| 279 | lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ | |
| 280 | return 1; | |
| 281 | 281 | } |
| 282 | 282 | |
| 283 | 283 | |
| 284 | 284 | LUALIB_API void luaL_setmetatable (lua_State *L, const char *tname) { |
| 285 | luaL_getmetatable(L, tname); | |
| 286 | lua_setmetatable(L, -2); | |
| 285 | luaL_getmetatable(L, tname); | |
| 286 | lua_setmetatable(L, -2); | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | |
| 290 | 290 | LUALIB_API void *luaL_testudata (lua_State *L, int ud, const char *tname) { |
| 291 | void *p = lua_touserdata(L, ud); | |
| 292 | if (p != NULL) { /* value is a userdata? */ | |
| 293 | if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ | |
| 294 | luaL_getmetatable(L, tname); /* get correct metatable */ | |
| 295 | if (!lua_rawequal(L, -1, -2)) /* not the same? */ | |
| 296 | p = NULL; /* value is a userdata with wrong metatable */ | |
| 297 | lua_pop(L, 2); /* remove both metatables */ | |
| 298 | return p; | |
| 299 | } | |
| 300 | } | |
| 301 | return NULL; /* value is not a userdata with a metatable */ | |
| 291 | void *p = lua_touserdata(L, ud); | |
| 292 | if (p != NULL) { /* value is a userdata? */ | |
| 293 | if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ | |
| 294 | luaL_getmetatable(L, tname); /* get correct metatable */ | |
| 295 | if (!lua_rawequal(L, -1, -2)) /* not the same? */ | |
| 296 | p = NULL; /* value is a userdata with wrong metatable */ | |
| 297 | lua_pop(L, 2); /* remove both metatables */ | |
| 298 | return p; | |
| 299 | } | |
| 300 | } | |
| 301 | return NULL; /* value is not a userdata with a metatable */ | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
| 305 | 305 | LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { |
| 306 | void *p = luaL_testudata(L, ud, tname); | |
| 307 | if (p == NULL) typeerror(L, ud, tname); | |
| 308 | return p; | |
| 306 | void *p = luaL_testudata(L, ud, tname); | |
| 307 | if (p == NULL) typeerror(L, ud, tname); | |
| 308 | return p; | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | /* }====================================================== */ |
| r31373 | r31374 | |
| 318 | 318 | */ |
| 319 | 319 | |
| 320 | 320 | LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, |
| 321 | const char *const lst[]) { | |
| 322 | const char *name = (def) ? luaL_optstring(L, narg, def) : | |
| 323 | luaL_checkstring(L, narg); | |
| 324 | int i; | |
| 325 | for (i=0; lst[i]; i++) | |
| 326 | if (strcmp(lst[i], name) == 0) | |
| 327 | return i; | |
| 328 | return luaL_argerror(L, narg, | |
| 329 | lua_pushfstring(L, "invalid option " LUA_QS, name)); | |
| 321 | const char *const lst[]) { | |
| 322 | const char *name = (def) ? luaL_optstring(L, narg, def) : | |
| 323 | luaL_checkstring(L, narg); | |
| 324 | int i; | |
| 325 | for (i=0; lst[i]; i++) | |
| 326 | if (strcmp(lst[i], name) == 0) | |
| 327 | return i; | |
| 328 | return luaL_argerror(L, narg, | |
| 329 | lua_pushfstring(L, "invalid option " LUA_QS, name)); | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
| 333 | 333 | LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *msg) { |
| 334 | /* keep some extra space to run error routines, if needed */ | |
| 335 | const int extra = LUA_MINSTACK; | |
| 336 | if (!lua_checkstack(L, space + extra)) { | |
| 337 | if (msg) | |
| 338 | luaL_error(L, "stack overflow (%s)", msg); | |
| 339 | else | |
| 340 | luaL_error(L, "stack overflow"); | |
| 341 | } | |
| 334 | /* keep some extra space to run error routines, if needed */ | |
| 335 | const int extra = LUA_MINSTACK; | |
| 336 | if (!lua_checkstack(L, space + extra)) { | |
| 337 | if (msg) | |
| 338 | luaL_error(L, "stack overflow (%s)", msg); | |
| 339 | else | |
| 340 | luaL_error(L, "stack overflow"); | |
| 341 | } | |
| 342 | 342 | } |
| 343 | 343 | |
| 344 | 344 | |
| 345 | 345 | LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) { |
| 346 | if (lua_type(L, narg) != t) | |
| 347 | tag_error(L, narg, t); | |
| 346 | if (lua_type(L, narg) != t) | |
| 347 | tag_error(L, narg, t); | |
| 348 | 348 | } |
| 349 | 349 | |
| 350 | 350 | |
| 351 | 351 | LUALIB_API void luaL_checkany (lua_State *L, int narg) { |
| 352 | if (lua_type(L, narg) == LUA_TNONE) | |
| 353 | luaL_argerror(L, narg, "value expected"); | |
| 352 | if (lua_type(L, narg) == LUA_TNONE) | |
| 353 | luaL_argerror(L, narg, "value expected"); | |
| 354 | 354 | } |
| 355 | 355 | |
| 356 | 356 | |
| 357 | 357 | LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) { |
| 358 | const char *s = lua_tolstring(L, narg, len); | |
| 359 | if (!s) tag_error(L, narg, LUA_TSTRING); | |
| 360 | return s; | |
| 358 | const char *s = lua_tolstring(L, narg, len); | |
| 359 | if (!s) tag_error(L, narg, LUA_TSTRING); | |
| 360 | return s; | |
| 361 | 361 | } |
| 362 | 362 | |
| 363 | 363 | |
| 364 | 364 | LUALIB_API const char *luaL_optlstring (lua_State *L, int narg, |
| 365 | const char *def, size_t *len) { | |
| 366 | if (lua_isnoneornil(L, narg)) { | |
| 367 | if (len) | |
| 368 | *len = (def ? strlen(def) : 0); | |
| 369 | return def; | |
| 370 | } | |
| 371 | else return luaL_checklstring(L, narg, len); | |
| 365 | const char *def, size_t *len) { | |
| 366 | if (lua_isnoneornil(L, narg)) { | |
| 367 | if (len) | |
| 368 | *len = (def ? strlen(def) : 0); | |
| 369 | return def; | |
| 370 | } | |
| 371 | else return luaL_checklstring(L, narg, len); | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | |
| 375 | 375 | LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) { |
| 376 | int isnum; | |
| 377 | lua_Number d = lua_tonumberx(L, narg, &isnum); | |
| 378 | if (!isnum) | |
| 379 | tag_error(L, narg, LUA_TNUMBER); | |
| 380 | return d; | |
| 376 | int isnum; | |
| 377 | lua_Number d = lua_tonumberx(L, narg, &isnum); | |
| 378 | if (!isnum) | |
| 379 | tag_error(L, narg, LUA_TNUMBER); | |
| 380 | return d; | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
| 384 | 384 | LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { |
| 385 | ||
| 385 | return luaL_opt(L, luaL_checknumber, narg, def); | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | |
| 389 | 389 | LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) { |
| 390 | int isnum; | |
| 391 | lua_Integer d = lua_tointegerx(L, narg, &isnum); | |
| 392 | if (!isnum) | |
| 393 | tag_error(L, narg, LUA_TNUMBER); | |
| 394 | return d; | |
| 390 | int isnum; | |
| 391 | lua_Integer d = lua_tointegerx(L, narg, &isnum); | |
| 392 | if (!isnum) | |
| 393 | tag_error(L, narg, LUA_TNUMBER); | |
| 394 | return d; | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
| 398 | 398 | LUALIB_API lua_Unsigned luaL_checkunsigned (lua_State *L, int narg) { |
| 399 | int isnum; | |
| 400 | lua_Unsigned d = lua_tounsignedx(L, narg, &isnum); | |
| 401 | if (!isnum) | |
| 402 | tag_error(L, narg, LUA_TNUMBER); | |
| 403 | return d; | |
| 399 | int isnum; | |
| 400 | lua_Unsigned d = lua_tounsignedx(L, narg, &isnum); | |
| 401 | if (!isnum) | |
| 402 | tag_error(L, narg, LUA_TNUMBER); | |
| 403 | return d; | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | |
| 407 | 407 | LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, |
| 408 | lua_Integer def) { | |
| 409 | return luaL_opt(L, luaL_checkinteger, narg, def); | |
| 408 | lua_Integer def) { | |
| 409 | return luaL_opt(L, luaL_checkinteger, narg, def); | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | |
| 413 | 413 | LUALIB_API lua_Unsigned luaL_optunsigned (lua_State *L, int narg, |
| 414 | lua_Unsigned def) { | |
| 415 | return luaL_opt(L, luaL_checkunsigned, narg, def); | |
| 414 | lua_Unsigned def) { | |
| 415 | return luaL_opt(L, luaL_checkunsigned, narg, def); | |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | /* }====================================================== */ |
| r31373 | r31374 | |
| 428 | 428 | ** check whether buffer is using a userdata on the stack as a temporary |
| 429 | 429 | ** buffer |
| 430 | 430 | */ |
| 431 | #define buffonstack(B) | |
| 431 | #define buffonstack(B) ((B)->b != (B)->initb) | |
| 432 | 432 | |
| 433 | 433 | |
| 434 | 434 | /* |
| 435 | 435 | ** returns a pointer to a free area with at least 'sz' bytes |
| 436 | 436 | */ |
| 437 | 437 | LUALIB_API char *luaL_prepbuffsize (luaL_Buffer *B, size_t sz) { |
| 438 | lua_State *L = B->L; | |
| 439 | if (B->size - B->n < sz) { /* not enough space? */ | |
| 440 | char *newbuff; | |
| 441 | size_t newsize = B->size * 2; /* double buffer size */ | |
| 442 | if (newsize - B->n < sz) /* not big enough? */ | |
| 443 | newsize = B->n + sz; | |
| 444 | if (newsize < B->n || newsize - B->n < sz) | |
| 445 | luaL_error(L, "buffer too large"); | |
| 446 | /* create larger buffer */ | |
| 447 | newbuff = (char *)lua_newuserdata(L, newsize * sizeof(char)); | |
| 448 | /* move content to new buffer */ | |
| 449 | memcpy(newbuff, B->b, B->n * sizeof(char)); | |
| 450 | if (buffonstack(B)) | |
| 451 | lua_remove(L, -2); /* remove old buffer */ | |
| 452 | B->b = newbuff; | |
| 453 | B->size = newsize; | |
| 454 | } | |
| 455 | return &B->b[B->n]; | |
| 438 | lua_State *L = B->L; | |
| 439 | if (B->size - B->n < sz) { /* not enough space? */ | |
| 440 | char *newbuff; | |
| 441 | size_t newsize = B->size * 2; /* double buffer size */ | |
| 442 | if (newsize - B->n < sz) /* not big enough? */ | |
| 443 | newsize = B->n + sz; | |
| 444 | if (newsize < B->n || newsize - B->n < sz) | |
| 445 | luaL_error(L, "buffer too large"); | |
| 446 | /* create larger buffer */ | |
| 447 | newbuff = (char *)lua_newuserdata(L, newsize * sizeof(char)); | |
| 448 | /* move content to new buffer */ | |
| 449 | memcpy(newbuff, B->b, B->n * sizeof(char)); | |
| 450 | if (buffonstack(B)) | |
| 451 | lua_remove(L, -2); /* remove old buffer */ | |
| 452 | B->b = newbuff; | |
| 453 | B->size = newsize; | |
| 454 | } | |
| 455 | return &B->b[B->n]; | |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | |
| 459 | 459 | LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { |
| 460 | char *b = luaL_prepbuffsize(B, l); | |
| 461 | memcpy(b, s, l * sizeof(char)); | |
| 462 | luaL_addsize(B, l); | |
| 460 | char *b = luaL_prepbuffsize(B, l); | |
| 461 | memcpy(b, s, l * sizeof(char)); | |
| 462 | luaL_addsize(B, l); | |
| 463 | 463 | } |
| 464 | 464 | |
| 465 | 465 | |
| 466 | 466 | LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) { |
| 467 | ||
| 467 | luaL_addlstring(B, s, strlen(s)); | |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | |
| 471 | 471 | LUALIB_API void luaL_pushresult (luaL_Buffer *B) { |
| 472 | lua_State *L = B->L; | |
| 473 | lua_pushlstring(L, B->b, B->n); | |
| 474 | if (buffonstack(B)) | |
| 475 | lua_remove(L, -2); /* remove old buffer */ | |
| 472 | lua_State *L = B->L; | |
| 473 | lua_pushlstring(L, B->b, B->n); | |
| 474 | if (buffonstack(B)) | |
| 475 | lua_remove(L, -2); /* remove old buffer */ | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | |
| 479 | 479 | LUALIB_API void luaL_pushresultsize (luaL_Buffer *B, size_t sz) { |
| 480 | luaL_addsize(B, sz); | |
| 481 | luaL_pushresult(B); | |
| 480 | luaL_addsize(B, sz); | |
| 481 | luaL_pushresult(B); | |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | 484 | |
| 485 | 485 | LUALIB_API void luaL_addvalue (luaL_Buffer *B) { |
| 486 | lua_State *L = B->L; | |
| 487 | size_t l; | |
| 488 | const char *s = lua_tolstring(L, -1, &l); | |
| 489 | if (buffonstack(B)) | |
| 490 | lua_insert(L, -2); /* put value below buffer */ | |
| 491 | luaL_addlstring(B, s, l); | |
| 492 | lua_remove(L, (buffonstack(B)) ? -2 : -1); /* remove value */ | |
| 486 | lua_State *L = B->L; | |
| 487 | size_t l; | |
| 488 | const char *s = lua_tolstring(L, -1, &l); | |
| 489 | if (buffonstack(B)) | |
| 490 | lua_insert(L, -2); /* put value below buffer */ | |
| 491 | luaL_addlstring(B, s, l); | |
| 492 | lua_remove(L, (buffonstack(B)) ? -2 : -1); /* remove value */ | |
| 493 | 493 | } |
| 494 | 494 | |
| 495 | 495 | |
| 496 | 496 | LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) { |
| 497 | B->L = L; | |
| 498 | B->b = B->initb; | |
| 499 | B->n = 0; | |
| 500 | B->size = LUAL_BUFFERSIZE; | |
| 497 | B->L = L; | |
| 498 | B->b = B->initb; | |
| 499 | B->n = 0; | |
| 500 | B->size = LUAL_BUFFERSIZE; | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | |
| 504 | 504 | LUALIB_API char *luaL_buffinitsize (lua_State *L, luaL_Buffer *B, size_t sz) { |
| 505 | luaL_buffinit(L, B); | |
| 506 | return luaL_prepbuffsize(B, sz); | |
| 505 | luaL_buffinit(L, B); | |
| 506 | return luaL_prepbuffsize(B, sz); | |
| 507 | 507 | } |
| 508 | 508 | |
| 509 | 509 | /* }====================================================== */ |
| r31373 | r31374 | |
| 516 | 516 | */ |
| 517 | 517 | |
| 518 | 518 | /* index of free-list header */ |
| 519 | #define freelist | |
| 519 | #define freelist 0 | |
| 520 | 520 | |
| 521 | 521 | |
| 522 | 522 | LUALIB_API int luaL_ref (lua_State *L, int t) { |
| 523 | int ref; | |
| 524 | if (lua_isnil(L, -1)) { | |
| 525 | lua_pop(L, 1); /* remove from stack */ | |
| 526 | return LUA_REFNIL; /* `nil' has a unique fixed reference */ | |
| 527 | } | |
| 528 | t = lua_absindex(L, t); | |
| 529 | lua_rawgeti(L, t, freelist); /* get first free element */ | |
| 530 | ref = (int)lua_tointeger(L, -1); /* ref = t[freelist] */ | |
| 531 | lua_pop(L, 1); /* remove it from stack */ | |
| 532 | if (ref != 0) { /* any free element? */ | |
| 533 | lua_rawgeti(L, t, ref); /* remove it from list */ | |
| 534 | lua_rawseti(L, t, freelist); /* (t[freelist] = t[ref]) */ | |
| 535 | } | |
| 536 | else /* no free elements */ | |
| 537 | ref = (int)lua_rawlen(L, t) + 1; /* get a new reference */ | |
| 538 | lua_rawseti(L, t, ref); | |
| 539 | return ref; | |
| 523 | int ref; | |
| 524 | if (lua_isnil(L, -1)) { | |
| 525 | lua_pop(L, 1); /* remove from stack */ | |
| 526 | return LUA_REFNIL; /* `nil' has a unique fixed reference */ | |
| 527 | } | |
| 528 | t = lua_absindex(L, t); | |
| 529 | lua_rawgeti(L, t, freelist); /* get first free element */ | |
| 530 | ref = (int)lua_tointeger(L, -1); /* ref = t[freelist] */ | |
| 531 | lua_pop(L, 1); /* remove it from stack */ | |
| 532 | if (ref != 0) { /* any free element? */ | |
| 533 | lua_rawgeti(L, t, ref); /* remove it from list */ | |
| 534 | lua_rawseti(L, t, freelist); /* (t[freelist] = t[ref]) */ | |
| 535 | } | |
| 536 | else /* no free elements */ | |
| 537 | ref = (int)lua_rawlen(L, t) + 1; /* get a new reference */ | |
| 538 | lua_rawseti(L, t, ref); | |
| 539 | return ref; | |
| 540 | 540 | } |
| 541 | 541 | |
| 542 | 542 | |
| 543 | 543 | LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { |
| 544 | if (ref >= 0) { | |
| 545 | t = lua_absindex(L, t); | |
| 546 | lua_rawgeti(L, t, freelist); | |
| 547 | lua_rawseti(L, t, ref); /* t[ref] = t[freelist] */ | |
| 548 | lua_pushinteger(L, ref); | |
| 549 | lua_rawseti(L, t, freelist); /* t[freelist] = ref */ | |
| 550 | } | |
| 544 | if (ref >= 0) { | |
| 545 | t = lua_absindex(L, t); | |
| 546 | lua_rawgeti(L, t, freelist); | |
| 547 | lua_rawseti(L, t, ref); /* t[ref] = t[freelist] */ | |
| 548 | lua_pushinteger(L, ref); | |
| 549 | lua_rawseti(L, t, freelist); /* t[freelist] = ref */ | |
| 550 | } | |
| 551 | 551 | } |
| 552 | 552 | |
| 553 | 553 | /* }====================================================== */ |
| r31373 | r31374 | |
| 560 | 560 | */ |
| 561 | 561 | |
| 562 | 562 | typedef struct LoadF { |
| 563 | int n; /* number of pre-read characters */ | |
| 564 | FILE *f; /* file being read */ | |
| 565 | char buff[LUAL_BUFFERSIZE]; /* area for reading file */ | |
| 563 | int n; /* number of pre-read characters */ | |
| 564 | FILE *f; /* file being read */ | |
| 565 | char buff[LUAL_BUFFERSIZE]; /* area for reading file */ | |
| 566 | 566 | } LoadF; |
| 567 | 567 | |
| 568 | 568 | |
| 569 | 569 | static const char *getF (lua_State *L, void *ud, size_t *size) { |
| 570 | LoadF *lf = (LoadF *)ud; | |
| 571 | (void)L; /* not used */ | |
| 572 | if (lf->n > 0) { /* are there pre-read characters to be read? */ | |
| 573 | *size = lf->n; /* return them (chars already in buffer) */ | |
| 574 | lf->n = 0; /* no more pre-read characters */ | |
| 575 | } | |
| 576 | else { /* read a block from file */ | |
| 577 | /* 'fread' can return > 0 *and* set the EOF flag. If next call to | |
| 578 | 'getF' called 'fread', it might still wait for user input. | |
| 579 | The next check avoids this problem. */ | |
| 580 | if (feof(lf->f)) return NULL; | |
| 581 | *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); /* read block */ | |
| 582 | } | |
| 583 | return lf->buff; | |
| 570 | LoadF *lf = (LoadF *)ud; | |
| 571 | (void)L; /* not used */ | |
| 572 | if (lf->n > 0) { /* are there pre-read characters to be read? */ | |
| 573 | *size = lf->n; /* return them (chars already in buffer) */ | |
| 574 | lf->n = 0; /* no more pre-read characters */ | |
| 575 | } | |
| 576 | else { /* read a block from file */ | |
| 577 | /* 'fread' can return > 0 *and* set the EOF flag. If next call to | |
| 578 | 'getF' called 'fread', it might still wait for user input. | |
| 579 | The next check avoids this problem. */ | |
| 580 | if (feof(lf->f)) return NULL; | |
| 581 | *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); /* read block */ | |
| 582 | } | |
| 583 | return lf->buff; | |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | |
| 587 | 587 | static int errfile (lua_State *L, const char *what, int fnameindex) { |
| 588 | const char *serr = strerror(errno); | |
| 589 | const char *filename = lua_tostring(L, fnameindex) + 1; | |
| 590 | lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); | |
| 591 | lua_remove(L, fnameindex); | |
| 592 | return LUA_ERRFILE; | |
| 588 | const char *serr = strerror(errno); | |
| 589 | const char *filename = lua_tostring(L, fnameindex) + 1; | |
| 590 | lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); | |
| 591 | lua_remove(L, fnameindex); | |
| 592 | return LUA_ERRFILE; | |
| 593 | 593 | } |
| 594 | 594 | |
| 595 | 595 | |
| 596 | 596 | static int skipBOM (LoadF *lf) { |
| 597 | const char *p = "\xEF\xBB\xBF"; /* Utf8 BOM mark */ | |
| 598 | int c; | |
| 599 | lf->n = 0; | |
| 600 | do { | |
| 601 | c = getc(lf->f); | |
| 602 | if (c == EOF || c != *(const unsigned char *)p++) return c; | |
| 603 | lf->buff[lf->n++] = c; /* to be read by the parser */ | |
| 604 | } while (*p != '\0'); | |
| 605 | lf->n = 0; /* prefix matched; discard it */ | |
| 606 | return getc(lf->f); /* return next character */ | |
| 597 | const char *p = "\xEF\xBB\xBF"; /* Utf8 BOM mark */ | |
| 598 | int c; | |
| 599 | lf->n = 0; | |
| 600 | do { | |
| 601 | c = getc(lf->f); | |
| 602 | if (c == EOF || c != *(const unsigned char *)p++) return c; | |
| 603 | lf->buff[lf->n++] = c; /* to be read by the parser */ | |
| 604 | } while (*p != '\0'); | |
| 605 | lf->n = 0; /* prefix matched; discard it */ | |
| 606 | return getc(lf->f); /* return next character */ | |
| 607 | 607 | } |
| 608 | 608 | |
| 609 | 609 | |
| r31373 | r31374 | |
| 615 | 615 | ** a first-line comment). |
| 616 | 616 | */ |
| 617 | 617 | static int skipcomment (LoadF *lf, int *cp) { |
| 618 | int c = *cp = skipBOM(lf); | |
| 619 | if (c == '#') { /* first line is a comment (Unix exec. file)? */ | |
| 620 | do { /* skip first line */ | |
| 621 | c = getc(lf->f); | |
| 622 | } while (c != EOF && c != '\n') ; | |
| 623 | *cp = getc(lf->f); /* skip end-of-line, if present */ | |
| 624 | return 1; /* there was a comment */ | |
| 625 | } | |
| 626 | else return 0; /* no comment */ | |
| 618 | int c = *cp = skipBOM(lf); | |
| 619 | if (c == '#') { /* first line is a comment (Unix exec. file)? */ | |
| 620 | do { /* skip first line */ | |
| 621 | c = getc(lf->f); | |
| 622 | } while (c != EOF && c != '\n') ; | |
| 623 | *cp = getc(lf->f); /* skip end-of-line, if present */ | |
| 624 | return 1; /* there was a comment */ | |
| 625 | } | |
| 626 | else return 0; /* no comment */ | |
| 627 | 627 | } |
| 628 | 628 | |
| 629 | 629 | |
| 630 | 630 | LUALIB_API int luaL_loadfilex (lua_State *L, const char *filename, |
| 631 | const char *mode) { | |
| 632 | LoadF lf; | |
| 633 | int status, readstatus; | |
| 634 | int c; | |
| 635 | int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ | |
| 636 | if (filename == NULL) { | |
| 637 | lua_pushliteral(L, "=stdin"); | |
| 638 | lf.f = stdin; | |
| 639 | } | |
| 640 | else { | |
| 641 | lua_pushfstring(L, "@%s", filename); | |
| 642 | lf.f = fopen(filename, "r"); | |
| 643 | if (lf.f == NULL) return errfile(L, "open", fnameindex); | |
| 644 | } | |
| 645 | if (skipcomment(&lf, &c)) /* read initial portion */ | |
| 646 | lf.buff[lf.n++] = '\n'; /* add line to correct line numbers */ | |
| 647 | if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ | |
| 648 | lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ | |
| 649 | if (lf.f == NULL) return errfile(L, "reopen", fnameindex); | |
| 650 | skipcomment(&lf, &c); /* re-read initial portion */ | |
| 651 | } | |
| 652 | if (c != EOF) | |
| 653 | lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */ | |
| 654 | status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode); | |
| 655 | readstatus = ferror(lf.f); | |
| 656 | if (filename) fclose(lf.f); /* close file (even in case of errors) */ | |
| 657 | if (readstatus) { | |
| 658 | lua_settop(L, fnameindex); /* ignore results from `lua_load' */ | |
| 659 | return errfile(L, "read", fnameindex); | |
| 660 | } | |
| 661 | lua_remove(L, fnameindex); | |
| 662 | return status; | |
| 631 | const char *mode) { | |
| 632 | LoadF lf; | |
| 633 | int status, readstatus; | |
| 634 | int c; | |
| 635 | int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ | |
| 636 | if (filename == NULL) { | |
| 637 | lua_pushliteral(L, "=stdin"); | |
| 638 | lf.f = stdin; | |
| 639 | } | |
| 640 | else { | |
| 641 | lua_pushfstring(L, "@%s", filename); | |
| 642 | lf.f = fopen(filename, "r"); | |
| 643 | if (lf.f == NULL) return errfile(L, "open", fnameindex); | |
| 644 | } | |
| 645 | if (skipcomment(&lf, &c)) /* read initial portion */ | |
| 646 | lf.buff[lf.n++] = '\n'; /* add line to correct line numbers */ | |
| 647 | if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ | |
| 648 | lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ | |
| 649 | if (lf.f == NULL) return errfile(L, "reopen", fnameindex); | |
| 650 | skipcomment(&lf, &c); /* re-read initial portion */ | |
| 651 | } | |
| 652 | if (c != EOF) | |
| 653 | lf.buff[lf.n++] = c; /* 'c' is the first character of the stream */ | |
| 654 | status = lua_load(L, getF, &lf, lua_tostring(L, -1), mode); | |
| 655 | readstatus = ferror(lf.f); | |
| 656 | if (filename) fclose(lf.f); /* close file (even in case of errors) */ | |
| 657 | if (readstatus) { | |
| 658 | lua_settop(L, fnameindex); /* ignore results from `lua_load' */ | |
| 659 | return errfile(L, "read", fnameindex); | |
| 660 | } | |
| 661 | lua_remove(L, fnameindex); | |
| 662 | return status; | |
| 663 | 663 | } |
| 664 | 664 | |
| 665 | 665 | |
| 666 | 666 | typedef struct LoadS { |
| 667 | const char *s; | |
| 668 | size_t size; | |
| 667 | const char *s; | |
| 668 | size_t size; | |
| 669 | 669 | } LoadS; |
| 670 | 670 | |
| 671 | 671 | |
| 672 | 672 | static const char *getS (lua_State *L, void *ud, size_t *size) { |
| 673 | LoadS *ls = (LoadS *)ud; | |
| 674 | (void)L; /* not used */ | |
| 675 | if (ls->size == 0) return NULL; | |
| 676 | *size = ls->size; | |
| 677 | ls->size = 0; | |
| 678 | return ls->s; | |
| 673 | LoadS *ls = (LoadS *)ud; | |
| 674 | (void)L; /* not used */ | |
| 675 | if (ls->size == 0) return NULL; | |
| 676 | *size = ls->size; | |
| 677 | ls->size = 0; | |
| 678 | return ls->s; | |
| 679 | 679 | } |
| 680 | 680 | |
| 681 | 681 | |
| 682 | 682 | LUALIB_API int luaL_loadbufferx (lua_State *L, const char *buff, size_t size, |
| 683 | const char *name, const char *mode) { | |
| 684 | LoadS ls; | |
| 685 | ls.s = buff; | |
| 686 | ls.size = size; | |
| 687 | return lua_load(L, getS, &ls, name, mode); | |
| 683 | const char *name, const char *mode) { | |
| 684 | LoadS ls; | |
| 685 | ls.s = buff; | |
| 686 | ls.size = size; | |
| 687 | return lua_load(L, getS, &ls, name, mode); | |
| 688 | 688 | } |
| 689 | 689 | |
| 690 | 690 | |
| 691 | 691 | LUALIB_API int luaL_loadstring (lua_State *L, const char *s) { |
| 692 | ||
| 692 | return luaL_loadbuffer(L, s, strlen(s), s); | |
| 693 | 693 | } |
| 694 | 694 | |
| 695 | 695 | /* }====================================================== */ |
| r31373 | r31374 | |
| 697 | 697 | |
| 698 | 698 | |
| 699 | 699 | LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { |
| 700 | if (!lua_getmetatable(L, obj)) /* no metatable? */ | |
| 701 | return 0; | |
| 702 | lua_pushstring(L, event); | |
| 703 | lua_rawget(L, -2); | |
| 704 | if (lua_isnil(L, -1)) { | |
| 705 | lua_pop(L, 2); /* remove metatable and metafield */ | |
| 706 | return 0; | |
| 707 | } | |
| 708 | else { | |
| 709 | lua_remove(L, -2); /* remove only metatable */ | |
| 710 | return 1; | |
| 711 | } | |
| 700 | if (!lua_getmetatable(L, obj)) /* no metatable? */ | |
| 701 | return 0; | |
| 702 | lua_pushstring(L, event); | |
| 703 | lua_rawget(L, -2); | |
| 704 | if (lua_isnil(L, -1)) { | |
| 705 | lua_pop(L, 2); /* remove metatable and metafield */ | |
| 706 | return 0; | |
| 707 | } | |
| 708 | else { | |
| 709 | lua_remove(L, -2); /* remove only metatable */ | |
| 710 | return 1; | |
| 711 | } | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | |
| 715 | 715 | LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { |
| 716 | obj = lua_absindex(L, obj); | |
| 717 | if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ | |
| 718 | return 0; | |
| 719 | lua_pushvalue(L, obj); | |
| 720 | lua_call(L, 1, 1); | |
| 721 | return 1; | |
| 716 | obj = lua_absindex(L, obj); | |
| 717 | if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ | |
| 718 | return 0; | |
| 719 | lua_pushvalue(L, obj); | |
| 720 | lua_call(L, 1, 1); | |
| 721 | return 1; | |
| 722 | 722 | } |
| 723 | 723 | |
| 724 | 724 | |
| 725 | 725 | LUALIB_API int luaL_len (lua_State *L, int idx) { |
| 726 | int l; | |
| 727 | int isnum; | |
| 728 | lua_len(L, idx); | |
| 729 | l = (int)lua_tointegerx(L, -1, &isnum); | |
| 730 | if (!isnum) | |
| 731 | luaL_error(L, "object length is not a number"); | |
| 732 | lua_pop(L, 1); /* remove object */ | |
| 733 | return l; | |
| 726 | int l; | |
| 727 | int isnum; | |
| 728 | lua_len(L, idx); | |
| 729 | l = (int)lua_tointegerx(L, -1, &isnum); | |
| 730 | if (!isnum) | |
| 731 | luaL_error(L, "object length is not a number"); | |
| 732 | lua_pop(L, 1); /* remove object */ | |
| 733 | return l; | |
| 734 | 734 | } |
| 735 | 735 | |
| 736 | 736 | |
| 737 | 737 | LUALIB_API const char *luaL_tolstring (lua_State *L, int idx, size_t *len) { |
| 738 | if (!luaL_callmeta(L, idx, "__tostring")) { /* no metafield? */ | |
| 739 | switch (lua_type(L, idx)) { | |
| 740 | case LUA_TNUMBER: | |
| 741 | case LUA_TSTRING: | |
| 742 | lua_pushvalue(L, idx); | |
| 743 | break; | |
| 744 | case LUA_TBOOLEAN: | |
| 745 | lua_pushstring(L, (lua_toboolean(L, idx) ? "true" : "false")); | |
| 746 | break; | |
| 747 | case LUA_TNIL: | |
| 748 | lua_pushliteral(L, "nil"); | |
| 749 | break; | |
| 750 | default: | |
| 751 | lua_pushfstring(L, "%s: %p", luaL_typename(L, idx), | |
| 752 | lua_topointer(L, idx)); | |
| 753 | break; | |
| 754 | } | |
| 755 | } | |
| 756 | return lua_tolstring(L, -1, len); | |
| 738 | if (!luaL_callmeta(L, idx, "__tostring")) { /* no metafield? */ | |
| 739 | switch (lua_type(L, idx)) { | |
| 740 | case LUA_TNUMBER: | |
| 741 | case LUA_TSTRING: | |
| 742 | lua_pushvalue(L, idx); | |
| 743 | break; | |
| 744 | case LUA_TBOOLEAN: | |
| 745 | lua_pushstring(L, (lua_toboolean(L, idx) ? "true" : "false")); | |
| 746 | break; | |
| 747 | case LUA_TNIL: | |
| 748 | lua_pushliteral(L, "nil"); | |
| 749 | break; | |
| 750 | default: | |
| 751 | lua_pushfstring(L, "%s: %p", luaL_typename(L, idx), | |
| 752 | lua_topointer(L, idx)); | |
| 753 | break; | |
| 754 | } | |
| 755 | } | |
| 756 | return lua_tolstring(L, -1, len); | |
| 757 | 757 | } |
| 758 | 758 | |
| 759 | 759 | |
| r31373 | r31374 | |
| 765 | 765 | #if defined(LUA_COMPAT_MODULE) |
| 766 | 766 | |
| 767 | 767 | static const char *luaL_findtable (lua_State *L, int idx, |
| 768 | const char *fname, int szhint) { | |
| 769 | const char *e; | |
| 770 | if (idx) lua_pushvalue(L, idx); | |
| 771 | do { | |
| 772 | e = strchr(fname, '.'); | |
| 773 | if (e == NULL) e = fname + strlen(fname); | |
| 774 | lua_pushlstring(L, fname, e - fname); | |
| 775 | lua_rawget(L, -2); | |
| 776 | if (lua_isnil(L, -1)) { /* no such field? */ | |
| 777 | lua_pop(L, 1); /* remove this nil */ | |
| 778 | lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ | |
| 779 | lua_pushlstring(L, fname, e - fname); | |
| 780 | lua_pushvalue(L, -2); | |
| 781 | lua_settable(L, -4); /* set new table into field */ | |
| 782 | } | |
| 783 | else if (!lua_istable(L, -1)) { /* field has a non-table value? */ | |
| 784 | lua_pop(L, 2); /* remove table and value */ | |
| 785 | return fname; /* return problematic part of the name */ | |
| 786 | } | |
| 787 | lua_remove(L, -2); /* remove previous table */ | |
| 788 | fname = e + 1; | |
| 789 | } while (*e == '.'); | |
| 790 | return NULL; | |
| 768 | const char *fname, int szhint) { | |
| 769 | const char *e; | |
| 770 | if (idx) lua_pushvalue(L, idx); | |
| 771 | do { | |
| 772 | e = strchr(fname, '.'); | |
| 773 | if (e == NULL) e = fname + strlen(fname); | |
| 774 | lua_pushlstring(L, fname, e - fname); | |
| 775 | lua_rawget(L, -2); | |
| 776 | if (lua_isnil(L, -1)) { /* no such field? */ | |
| 777 | lua_pop(L, 1); /* remove this nil */ | |
| 778 | lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ | |
| 779 | lua_pushlstring(L, fname, e - fname); | |
| 780 | lua_pushvalue(L, -2); | |
| 781 | lua_settable(L, -4); /* set new table into field */ | |
| 782 | } | |
| 783 | else if (!lua_istable(L, -1)) { /* field has a non-table value? */ | |
| 784 | lua_pop(L, 2); /* remove table and value */ | |
| 785 | return fname; /* return problematic part of the name */ | |
| 786 | } | |
| 787 | lua_remove(L, -2); /* remove previous table */ | |
| 788 | fname = e + 1; | |
| 789 | } while (*e == '.'); | |
| 790 | return NULL; | |
| 791 | 791 | } |
| 792 | 792 | |
| 793 | 793 | |
| r31373 | r31374 | |
| 795 | 795 | ** Count number of elements in a luaL_Reg list. |
| 796 | 796 | */ |
| 797 | 797 | static int libsize (const luaL_Reg *l) { |
| 798 | int size = 0; | |
| 799 | for (; l && l->name; l++) size++; | |
| 800 | return size; | |
| 798 | int size = 0; | |
| 799 | for (; l && l->name; l++) size++; | |
| 800 | return size; | |
| 801 | 801 | } |
| 802 | 802 | |
| 803 | 803 | |
| r31373 | r31374 | |
| 808 | 808 | ** the module table. |
| 809 | 809 | */ |
| 810 | 810 | LUALIB_API void luaL_pushmodule (lua_State *L, const char *modname, |
| 811 | int sizehint) { | |
| 812 | luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); /* get _LOADED table */ | |
| 813 | lua_getfield(L, -1, modname); /* get _LOADED[modname] */ | |
| 814 | if (!lua_istable(L, -1)) { /* not found? */ | |
| 815 | lua_pop(L, 1); /* remove previous result */ | |
| 816 | /* try global variable (and create one if it does not exist) */ | |
| 817 | lua_pushglobaltable(L); | |
| 818 | if (luaL_findtable(L, 0, modname, sizehint) != NULL) | |
| 819 | luaL_error(L, "name conflict for module " LUA_QS, modname); | |
| 820 | lua_pushvalue(L, -1); | |
| 821 | lua_setfield(L, -3, modname); /* _LOADED[modname] = new table */ | |
| 822 | } | |
| 823 | lua_remove(L, -2); /* remove _LOADED table */ | |
| 811 | int sizehint) { | |
| 812 | luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); /* get _LOADED table */ | |
| 813 | lua_getfield(L, -1, modname); /* get _LOADED[modname] */ | |
| 814 | if (!lua_istable(L, -1)) { /* not found? */ | |
| 815 | lua_pop(L, 1); /* remove previous result */ | |
| 816 | /* try global variable (and create one if it does not exist) */ | |
| 817 | lua_pushglobaltable(L); | |
| 818 | if (luaL_findtable(L, 0, modname, sizehint) != NULL) | |
| 819 | luaL_error(L, "name conflict for module " LUA_QS, modname); | |
| 820 | lua_pushvalue(L, -1); | |
| 821 | lua_setfield(L, -3, modname); /* _LOADED[modname] = new table */ | |
| 822 | } | |
| 823 | lua_remove(L, -2); /* remove _LOADED table */ | |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | |
| 827 | 827 | LUALIB_API void luaL_openlib (lua_State *L, const char *libname, |
| 828 | const luaL_Reg *l, int nup) { | |
| 829 | luaL_checkversion(L); | |
| 830 | if (libname) { | |
| 831 | luaL_pushmodule(L, libname, libsize(l)); /* get/create library table */ | |
| 832 | lua_insert(L, -(nup + 1)); /* move library table to below upvalues */ | |
| 833 | } | |
| 834 | if (l) | |
| 835 | luaL_setfuncs(L, l, nup); | |
| 836 | else | |
| 837 | lua_pop(L, nup); /* remove upvalues */ | |
| 828 | const luaL_Reg *l, int nup) { | |
| 829 | luaL_checkversion(L); | |
| 830 | if (libname) { | |
| 831 | luaL_pushmodule(L, libname, libsize(l)); /* get/create library table */ | |
| 832 | lua_insert(L, -(nup + 1)); /* move library table to below upvalues */ | |
| 833 | } | |
| 834 | if (l) | |
| 835 | luaL_setfuncs(L, l, nup); | |
| 836 | else | |
| 837 | lua_pop(L, nup); /* remove upvalues */ | |
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | #endif |
| r31373 | r31374 | |
| 846 | 846 | ** Returns with only the table at the stack. |
| 847 | 847 | */ |
| 848 | 848 | LUALIB_API void luaL_setfuncs (lua_State *L, const luaL_Reg *l, int nup) { |
| 849 | luaL_checkversion(L); | |
| 850 | luaL_checkstack(L, nup, "too many upvalues"); | |
| 851 | for (; l->name != NULL; l++) { /* fill the table with given functions */ | |
| 852 | int i; | |
| 853 | for (i = 0; i < nup; i++) /* copy upvalues to the top */ | |
| 854 | lua_pushvalue(L, -nup); | |
| 855 | lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ | |
| 856 | lua_setfield(L, -(nup + 2), l->name); | |
| 857 | } | |
| 858 | lua_pop(L, nup); /* remove upvalues */ | |
| 849 | luaL_checkversion(L); | |
| 850 | luaL_checkstack(L, nup, "too many upvalues"); | |
| 851 | for (; l->name != NULL; l++) { /* fill the table with given functions */ | |
| 852 | int i; | |
| 853 | for (i = 0; i < nup; i++) /* copy upvalues to the top */ | |
| 854 | lua_pushvalue(L, -nup); | |
| 855 | lua_pushcclosure(L, l->func, nup); /* closure with those upvalues */ | |
| 856 | lua_setfield(L, -(nup + 2), l->name); | |
| 857 | } | |
| 858 | lua_pop(L, nup); /* remove upvalues */ | |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | |
| r31373 | r31374 | |
| 864 | 864 | ** into the stack |
| 865 | 865 | */ |
| 866 | 866 | LUALIB_API int luaL_getsubtable (lua_State *L, int idx, const char *fname) { |
| 867 | lua_getfield(L, idx, fname); | |
| 868 | if (lua_istable(L, -1)) return 1; /* table already there */ | |
| 869 | else { | |
| 870 | lua_pop(L, 1); /* remove previous result */ | |
| 871 | idx = lua_absindex(L, idx); | |
| 872 | lua_newtable(L); | |
| 873 | lua_pushvalue(L, -1); /* copy to be left at top */ | |
| 874 | lua_setfield(L, idx, fname); /* assign new table to field */ | |
| 875 | return 0; /* false, because did not find table there */ | |
| 876 | } | |
| 867 | lua_getfield(L, idx, fname); | |
| 868 | if (lua_istable(L, -1)) return 1; /* table already there */ | |
| 869 | else { | |
| 870 | lua_pop(L, 1); /* remove previous result */ | |
| 871 | idx = lua_absindex(L, idx); | |
| 872 | lua_newtable(L); | |
| 873 | lua_pushvalue(L, -1); /* copy to be left at top */ | |
| 874 | lua_setfield(L, idx, fname); /* assign new table to field */ | |
| 875 | return 0; /* false, because did not find table there */ | |
| 876 | } | |
| 877 | 877 | } |
| 878 | 878 | |
| 879 | 879 | |
| r31373 | r31374 | |
| 884 | 884 | ** Leaves resulting module on the top. |
| 885 | 885 | */ |
| 886 | 886 | LUALIB_API void luaL_requiref (lua_State *L, const char *modname, |
| 887 | lua_CFunction openf, int glb) { | |
| 888 | lua_pushcfunction(L, openf); | |
| 889 | lua_pushstring(L, modname); /* argument to open function */ | |
| 890 | lua_call(L, 1, 1); /* open module */ | |
| 891 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); | |
| 892 | lua_pushvalue(L, -2); /* make copy of module (call result) */ | |
| 893 | lua_setfield(L, -2, modname); /* _LOADED[modname] = module */ | |
| 894 | lua_pop(L, 1); /* remove _LOADED table */ | |
| 895 | if (glb) { | |
| 896 | lua_pushvalue(L, -1); /* copy of 'mod' */ | |
| 897 | lua_setglobal(L, modname); /* _G[modname] = module */ | |
| 898 | } | |
| 887 | lua_CFunction openf, int glb) { | |
| 888 | lua_pushcfunction(L, openf); | |
| 889 | lua_pushstring(L, modname); /* argument to open function */ | |
| 890 | lua_call(L, 1, 1); /* open module */ | |
| 891 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); | |
| 892 | lua_pushvalue(L, -2); /* make copy of module (call result) */ | |
| 893 | lua_setfield(L, -2, modname); /* _LOADED[modname] = module */ | |
| 894 | lua_pop(L, 1); /* remove _LOADED table */ | |
| 895 | if (glb) { | |
| 896 | lua_pushvalue(L, -1); /* copy of 'mod' */ | |
| 897 | lua_setglobal(L, modname); /* _G[modname] = module */ | |
| 898 | } | |
| 899 | 899 | } |
| 900 | 900 | |
| 901 | 901 | |
| 902 | 902 | LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, |
| 903 | const char *r) { | |
| 904 | const char *wild; | |
| 905 | size_t l = strlen(p); | |
| 906 | luaL_Buffer b; | |
| 907 | luaL_buffinit(L, &b); | |
| 908 | while ((wild = strstr(s, p)) != NULL) { | |
| 909 | luaL_addlstring(&b, s, wild - s); /* push prefix */ | |
| 910 | luaL_addstring(&b, r); /* push replacement in place of pattern */ | |
| 911 | s = wild + l; /* continue after `p' */ | |
| 912 | } | |
| 913 | luaL_addstring(&b, s); /* push last suffix */ | |
| 914 | luaL_pushresult(&b); | |
| 915 | return lua_tostring(L, -1); | |
| 903 | const char *r) { | |
| 904 | const char *wild; | |
| 905 | size_t l = strlen(p); | |
| 906 | luaL_Buffer b; | |
| 907 | luaL_buffinit(L, &b); | |
| 908 | while ((wild = strstr(s, p)) != NULL) { | |
| 909 | luaL_addlstring(&b, s, wild - s); /* push prefix */ | |
| 910 | luaL_addstring(&b, r); /* push replacement in place of pattern */ | |
| 911 | s = wild + l; /* continue after `p' */ | |
| 912 | } | |
| 913 | luaL_addstring(&b, s); /* push last suffix */ | |
| 914 | luaL_pushresult(&b); | |
| 915 | return lua_tostring(L, -1); | |
| 916 | 916 | } |
| 917 | 917 | |
| 918 | 918 | |
| 919 | 919 | static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { |
| 920 | (void)ud; (void)osize; /* not used */ | |
| 921 | if (nsize == 0) { | |
| 922 | free(ptr); | |
| 923 | return NULL; | |
| 924 | } | |
| 925 | else | |
| 926 | return realloc(ptr, nsize); | |
| 920 | (void)ud; (void)osize; /* not used */ | |
| 921 | if (nsize == 0) { | |
| 922 | free(ptr); | |
| 923 | return NULL; | |
| 924 | } | |
| 925 | else | |
| 926 | return realloc(ptr, nsize); | |
| 927 | 927 | } |
| 928 | 928 | |
| 929 | 929 | |
| 930 | 930 | static int panic (lua_State *L) { |
| 931 | luai_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", | |
| 932 | lua_tostring(L, -1)); | |
| 933 | return 0; /* return to Lua to abort */ | |
| 931 | luai_writestringerror("PANIC: unprotected error in call to Lua API (%s)\n", | |
| 932 | lua_tostring(L, -1)); | |
| 933 | return 0; /* return to Lua to abort */ | |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | |
| 937 | 937 | LUALIB_API lua_State *luaL_newstate (void) { |
| 938 | lua_State *L = lua_newstate(l_alloc, NULL); | |
| 939 | if (L) lua_atpanic(L, &panic); | |
| 940 | return L; | |
| 938 | lua_State *L = lua_newstate(l_alloc, NULL); | |
| 939 | if (L) lua_atpanic(L, &panic); | |
| 940 | return L; | |
| 941 | 941 | } |
| 942 | 942 | |
| 943 | 943 | |
| 944 | 944 | LUALIB_API void luaL_checkversion_ (lua_State *L, lua_Number ver) { |
| 945 | const lua_Number *v = lua_version(L); | |
| 946 | if (v != lua_version(NULL)) | |
| 947 | luaL_error(L, "multiple Lua VMs detected"); | |
| 948 | else if (*v != ver) | |
| 949 | luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", | |
| 950 | ver, *v); | |
| 951 | /* check conversions number -> integer types */ | |
| 952 | lua_pushnumber(L, -(lua_Number)0x1234); | |
| 953 | if (lua_tointeger(L, -1) != -0x1234 || | |
| 954 | lua_tounsigned(L, -1) != (lua_Unsigned)-0x1234) | |
| 955 | luaL_error(L, "bad conversion number->int;" | |
| 956 | " must recompile Lua with proper settings"); | |
| 957 | lua_pop(L, 1); | |
| 945 | const lua_Number *v = lua_version(L); | |
| 946 | if (v != lua_version(NULL)) | |
| 947 | luaL_error(L, "multiple Lua VMs detected"); | |
| 948 | else if (*v != ver) | |
| 949 | luaL_error(L, "version mismatch: app. needs %f, Lua core provides %f", | |
| 950 | ver, *v); | |
| 951 | /* check conversions number -> integer types */ | |
| 952 | lua_pushnumber(L, -(lua_Number)0x1234); | |
| 953 | if (lua_tointeger(L, -1) != -0x1234 || | |
| 954 | lua_tounsigned(L, -1) != (lua_Unsigned)-0x1234) | |
| 955 | luaL_error(L, "bad conversion number->int;" | |
| 956 | " must recompile Lua with proper settings"); | |
| 957 | lua_pop(L, 1); | |
| 958 | 958 | } |
| 959 |
| r31373 | r31374 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | |
| 33 | #define noLuaClosure(f) | |
| 33 | #define noLuaClosure(f) ((f) == NULL || (f)->c.tt == LUA_TCCL) | |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | static int currentpc (CallInfo *ci) { |
| 40 | lua_assert(isLua(ci)); | |
| 41 | return pcRel(ci->u.l.savedpc, ci_func(ci)->p); | |
| 40 | lua_assert(isLua(ci)); | |
| 41 | return pcRel(ci->u.l.savedpc, ci_func(ci)->p); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | static int currentline (CallInfo *ci) { |
| 46 | ||
| 46 | return getfuncline(ci_func(ci)->p, currentpc(ci)); | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| r31373 | r31374 | |
| 51 | 51 | ** this function can be called asynchronous (e.g. during a signal) |
| 52 | 52 | */ |
| 53 | 53 | LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { |
| 54 | if (func == NULL || mask == 0) { /* turn off hooks? */ | |
| 55 | mask = 0; | |
| 56 | func = NULL; | |
| 57 | } | |
| 58 | if (isLua(L->ci)) | |
| 59 | L->oldpc = L->ci->u.l.savedpc; | |
| 60 | L->hook = func; | |
| 61 | L->basehookcount = count; | |
| 62 | resethookcount(L); | |
| 63 | L->hookmask = cast_byte(mask); | |
| 64 | return 1; | |
| 54 | if (func == NULL || mask == 0) { /* turn off hooks? */ | |
| 55 | mask = 0; | |
| 56 | func = NULL; | |
| 57 | } | |
| 58 | if (isLua(L->ci)) | |
| 59 | L->oldpc = L->ci->u.l.savedpc; | |
| 60 | L->hook = func; | |
| 61 | L->basehookcount = count; | |
| 62 | resethookcount(L); | |
| 63 | L->hookmask = cast_byte(mask); | |
| 64 | return 1; | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | LUA_API lua_Hook lua_gethook (lua_State *L) { |
| 69 | ||
| 69 | return L->hook; | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | LUA_API int lua_gethookmask (lua_State *L) { |
| 74 | ||
| 74 | return L->hookmask; | |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | |
| 78 | 78 | LUA_API int lua_gethookcount (lua_State *L) { |
| 79 | ||
| 79 | return L->basehookcount; | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { |
| 84 | int status; | |
| 85 | CallInfo *ci; | |
| 86 | if (level < 0) return 0; /* invalid (negative) level */ | |
| 87 | lua_lock(L); | |
| 88 | for (ci = L->ci; level > 0 && ci != &L->base_ci; ci = ci->previous) | |
| 89 | level--; | |
| 90 | if (level == 0 && ci != &L->base_ci) { /* level found? */ | |
| 91 | status = 1; | |
| 92 | ar->i_ci = ci; | |
| 93 | } | |
| 94 | else status = 0; /* no such level */ | |
| 95 | lua_unlock(L); | |
| 96 | return status; | |
| 84 | int status; | |
| 85 | CallInfo *ci; | |
| 86 | if (level < 0) return 0; /* invalid (negative) level */ | |
| 87 | lua_lock(L); | |
| 88 | for (ci = L->ci; level > 0 && ci != &L->base_ci; ci = ci->previous) | |
| 89 | level--; | |
| 90 | if (level == 0 && ci != &L->base_ci) { /* level found? */ | |
| 91 | status = 1; | |
| 92 | ar->i_ci = ci; | |
| 93 | } | |
| 94 | else status = 0; /* no such level */ | |
| 95 | lua_unlock(L); | |
| 96 | return status; | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | static const char *upvalname (Proto *p, int uv) { |
| 101 | TString *s = check_exp(uv < p->sizeupvalues, p->upvalues[uv].name); | |
| 102 | if (s == NULL) return "?"; | |
| 103 | else return getstr(s); | |
| 101 | TString *s = check_exp(uv < p->sizeupvalues, p->upvalues[uv].name); | |
| 102 | if (s == NULL) return "?"; | |
| 103 | else return getstr(s); | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | |
| 107 | 107 | static const char *findvararg (CallInfo *ci, int n, StkId *pos) { |
| 108 | int nparams = clLvalue(ci->func)->p->numparams; | |
| 109 | if (n >= ci->u.l.base - ci->func - nparams) | |
| 110 | return NULL; /* no such vararg */ | |
| 111 | else { | |
| 112 | *pos = ci->func + nparams + n; | |
| 113 | return "(*vararg)"; /* generic name for any vararg */ | |
| 114 | } | |
| 108 | int nparams = clLvalue(ci->func)->p->numparams; | |
| 109 | if (n >= ci->u.l.base - ci->func - nparams) | |
| 110 | return NULL; /* no such vararg */ | |
| 111 | else { | |
| 112 | *pos = ci->func + nparams + n; | |
| 113 | return "(*vararg)"; /* generic name for any vararg */ | |
| 114 | } | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | static const char *findlocal (lua_State *L, CallInfo *ci, int n, |
| 119 | StkId *pos) { | |
| 120 | const char *name = NULL; | |
| 121 | StkId base; | |
| 122 | if (isLua(ci)) { | |
| 123 | if (n < 0) /* access to vararg values? */ | |
| 124 | return findvararg(ci, -n, pos); | |
| 125 | else { | |
| 126 | base = ci->u.l.base; | |
| 127 | name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci)); | |
| 128 | } | |
| 129 | } | |
| 130 | else | |
| 131 | base = ci->func + 1; | |
| 132 | if (name == NULL) { /* no 'standard' name? */ | |
| 133 | StkId limit = (ci == L->ci) ? L->top : ci->next->func; | |
| 134 | if (limit - base >= n && n > 0) /* is 'n' inside 'ci' stack? */ | |
| 135 | name = "(*temporary)"; /* generic name for any valid slot */ | |
| 136 | else | |
| 137 | return NULL; /* no name */ | |
| 138 | } | |
| 139 | *pos = base + (n - 1); | |
| 140 | return name; | |
| 119 | StkId *pos) { | |
| 120 | const char *name = NULL; | |
| 121 | StkId base; | |
| 122 | if (isLua(ci)) { | |
| 123 | if (n < 0) /* access to vararg values? */ | |
| 124 | return findvararg(ci, -n, pos); | |
| 125 | else { | |
| 126 | base = ci->u.l.base; | |
| 127 | name = luaF_getlocalname(ci_func(ci)->p, n, currentpc(ci)); | |
| 128 | } | |
| 129 | } | |
| 130 | else | |
| 131 | base = ci->func + 1; | |
| 132 | if (name == NULL) { /* no 'standard' name? */ | |
| 133 | StkId limit = (ci == L->ci) ? L->top : ci->next->func; | |
| 134 | if (limit - base >= n && n > 0) /* is 'n' inside 'ci' stack? */ | |
| 135 | name = "(*temporary)"; /* generic name for any valid slot */ | |
| 136 | else | |
| 137 | return NULL; /* no name */ | |
| 138 | } | |
| 139 | *pos = base + (n - 1); | |
| 140 | return name; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { |
| 145 | const char *name; | |
| 146 | lua_lock(L); | |
| 147 | if (ar == NULL) { /* information about non-active function? */ | |
| 148 | if (!isLfunction(L->top - 1)) /* not a Lua function? */ | |
| 149 | name = NULL; | |
| 150 | else /* consider live variables at function start (parameters) */ | |
| 151 | name = luaF_getlocalname(clLvalue(L->top - 1)->p, n, 0); | |
| 152 | } | |
| 153 | else { /* active function; get information through 'ar' */ | |
| 154 | StkId pos = 0; /* to avoid warnings */ | |
| 155 | name = findlocal(L, ar->i_ci, n, &pos); | |
| 156 | if (name) { | |
| 157 | setobj2s(L, L->top, pos); | |
| 158 | api_incr_top(L); | |
| 159 | } | |
| 160 | } | |
| 161 | lua_unlock(L); | |
| 162 | return name; | |
| 145 | const char *name; | |
| 146 | lua_lock(L); | |
| 147 | if (ar == NULL) { /* information about non-active function? */ | |
| 148 | if (!isLfunction(L->top - 1)) /* not a Lua function? */ | |
| 149 | name = NULL; | |
| 150 | else /* consider live variables at function start (parameters) */ | |
| 151 | name = luaF_getlocalname(clLvalue(L->top - 1)->p, n, 0); | |
| 152 | } | |
| 153 | else { /* active function; get information through 'ar' */ | |
| 154 | StkId pos = 0; /* to avoid warnings */ | |
| 155 | name = findlocal(L, ar->i_ci, n, &pos); | |
| 156 | if (name) { | |
| 157 | setobj2s(L, L->top, pos); | |
| 158 | api_incr_top(L); | |
| 159 | } | |
| 160 | } | |
| 161 | lua_unlock(L); | |
| 162 | return name; | |
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | |
| 166 | 166 | LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { |
| 167 | StkId pos = 0; /* to avoid warnings */ | |
| 168 | const char *name = findlocal(L, ar->i_ci, n, &pos); | |
| 169 | lua_lock(L); | |
| 170 | if (name) | |
| 171 | setobjs2s(L, pos, L->top - 1); | |
| 172 | L->top--; /* pop value */ | |
| 173 | lua_unlock(L); | |
| 174 | return name; | |
| 167 | StkId pos = 0; /* to avoid warnings */ | |
| 168 | const char *name = findlocal(L, ar->i_ci, n, &pos); | |
| 169 | lua_lock(L); | |
| 170 | if (name) | |
| 171 | setobjs2s(L, pos, L->top - 1); | |
| 172 | L->top--; /* pop value */ | |
| 173 | lua_unlock(L); | |
| 174 | return name; | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | static void funcinfo (lua_Debug *ar, Closure *cl) { |
| 179 | if (noLuaClosure(cl)) { | |
| 180 | ar->source = "=[C]"; | |
| 181 | ar->linedefined = -1; | |
| 182 | ar->lastlinedefined = -1; | |
| 183 | ar->what = "C"; | |
| 184 | } | |
| 185 | else { | |
| 186 | Proto *p = cl->l.p; | |
| 187 | ar->source = p->source ? getstr(p->source) : "=?"; | |
| 188 | ar->linedefined = p->linedefined; | |
| 189 | ar->lastlinedefined = p->lastlinedefined; | |
| 190 | ar->what = (ar->linedefined == 0) ? "main" : "Lua"; | |
| 191 | } | |
| 192 | luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); | |
| 179 | if (noLuaClosure(cl)) { | |
| 180 | ar->source = "=[C]"; | |
| 181 | ar->linedefined = -1; | |
| 182 | ar->lastlinedefined = -1; | |
| 183 | ar->what = "C"; | |
| 184 | } | |
| 185 | else { | |
| 186 | Proto *p = cl->l.p; | |
| 187 | ar->source = p->source ? getstr(p->source) : "=?"; | |
| 188 | ar->linedefined = p->linedefined; | |
| 189 | ar->lastlinedefined = p->lastlinedefined; | |
| 190 | ar->what = (ar->linedefined == 0) ? "main" : "Lua"; | |
| 191 | } | |
| 192 | luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
| 196 | 196 | static void collectvalidlines (lua_State *L, Closure *f) { |
| 197 | if (noLuaClosure(f)) { | |
| 198 | setnilvalue(L->top); | |
| 199 | api_incr_top(L); | |
| 200 | } | |
| 201 | else { | |
| 202 | int i; | |
| 203 | TValue v; | |
| 204 | int *lineinfo = f->l.p->lineinfo; | |
| 205 | Table *t = luaH_new(L); /* new table to store active lines */ | |
| 206 | sethvalue(L, L->top, t); /* push it on stack */ | |
| 207 | api_incr_top(L); | |
| 208 | setbvalue(&v, 1); /* boolean 'true' to be the value of all indices */ | |
| 209 | for (i = 0; i < f->l.p->sizelineinfo; i++) /* for all lines with code */ | |
| 210 | luaH_setint(L, t, lineinfo[i], &v); /* table[line] = true */ | |
| 211 | } | |
| 197 | if (noLuaClosure(f)) { | |
| 198 | setnilvalue(L->top); | |
| 199 | api_incr_top(L); | |
| 200 | } | |
| 201 | else { | |
| 202 | int i; | |
| 203 | TValue v; | |
| 204 | int *lineinfo = f->l.p->lineinfo; | |
| 205 | Table *t = luaH_new(L); /* new table to store active lines */ | |
| 206 | sethvalue(L, L->top, t); /* push it on stack */ | |
| 207 | api_incr_top(L); | |
| 208 | setbvalue(&v, 1); /* boolean 'true' to be the value of all indices */ | |
| 209 | for (i = 0; i < f->l.p->sizelineinfo; i++) /* for all lines with code */ | |
| 210 | luaH_setint(L, t, lineinfo[i], &v); /* table[line] = true */ | |
| 211 | } | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | |
| 215 | 215 | static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, |
| 216 | Closure *f, CallInfo *ci) { | |
| 217 | int status = 1; | |
| 218 | for (; *what; what++) { | |
| 219 | switch (*what) { | |
| 220 | case 'S': { | |
| 221 | funcinfo(ar, f); | |
| 222 | break; | |
| 223 | } | |
| 224 | case 'l': { | |
| 225 | ar->currentline = (ci && isLua(ci)) ? currentline(ci) : -1; | |
| 226 | break; | |
| 227 | } | |
| 228 | case 'u': { | |
| 229 | ar->nups = (f == NULL) ? 0 : f->c.nupvalues; | |
| 230 | if (noLuaClosure(f)) { | |
| 231 | ar->isvararg = 1; | |
| 232 | ar->nparams = 0; | |
| 233 | } | |
| 234 | else { | |
| 235 | ar->isvararg = f->l.p->is_vararg; | |
| 236 | ar->nparams = f->l.p->numparams; | |
| 237 | } | |
| 238 | break; | |
| 239 | } | |
| 240 | case 't': { | |
| 241 | ar->istailcall = (ci) ? ci->callstatus & CIST_TAIL : 0; | |
| 242 | break; | |
| 243 | } | |
| 244 | case 'n': { | |
| 245 | /* calling function is a known Lua function? */ | |
| 246 | if (ci && !(ci->callstatus & CIST_TAIL) && isLua(ci->previous)) | |
| 247 | ar->namewhat = getfuncname(L, ci->previous, &ar->name); | |
| 248 | else | |
| 249 | ar->namewhat = NULL; | |
| 250 | if (ar->namewhat == NULL) { | |
| 251 | ar->namewhat = ""; /* not found */ | |
| 252 | ar->name = NULL; | |
| 253 | } | |
| 254 | break; | |
| 255 | } | |
| 256 | case 'L': | |
| 257 | case 'f': /* handled by lua_getinfo */ | |
| 258 | break; | |
| 259 | default: status = 0; /* invalid option */ | |
| 260 | } | |
| 261 | } | |
| 262 | return status; | |
| 216 | Closure *f, CallInfo *ci) { | |
| 217 | int status = 1; | |
| 218 | for (; *what; what++) { | |
| 219 | switch (*what) { | |
| 220 | case 'S': { | |
| 221 | funcinfo(ar, f); | |
| 222 | break; | |
| 223 | } | |
| 224 | case 'l': { | |
| 225 | ar->currentline = (ci && isLua(ci)) ? currentline(ci) : -1; | |
| 226 | break; | |
| 227 | } | |
| 228 | case 'u': { | |
| 229 | ar->nups = (f == NULL) ? 0 : f->c.nupvalues; | |
| 230 | if (noLuaClosure(f)) { | |
| 231 | ar->isvararg = 1; | |
| 232 | ar->nparams = 0; | |
| 233 | } | |
| 234 | else { | |
| 235 | ar->isvararg = f->l.p->is_vararg; | |
| 236 | ar->nparams = f->l.p->numparams; | |
| 237 | } | |
| 238 | break; | |
| 239 | } | |
| 240 | case 't': { | |
| 241 | ar->istailcall = (ci) ? ci->callstatus & CIST_TAIL : 0; | |
| 242 | break; | |
| 243 | } | |
| 244 | case 'n': { | |
| 245 | /* calling function is a known Lua function? */ | |
| 246 | if (ci && !(ci->callstatus & CIST_TAIL) && isLua(ci->previous)) | |
| 247 | ar->namewhat = getfuncname(L, ci->previous, &ar->name); | |
| 248 | else | |
| 249 | ar->namewhat = NULL; | |
| 250 | if (ar->namewhat == NULL) { | |
| 251 | ar->namewhat = ""; /* not found */ | |
| 252 | ar->name = NULL; | |
| 253 | } | |
| 254 | break; | |
| 255 | } | |
| 256 | case 'L': | |
| 257 | case 'f': /* handled by lua_getinfo */ | |
| 258 | break; | |
| 259 | default: status = 0; /* invalid option */ | |
| 260 | } | |
| 261 | } | |
| 262 | return status; | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | |
| 266 | 266 | LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { |
| 267 | int status; | |
| 268 | Closure *cl; | |
| 269 | CallInfo *ci; | |
| 270 | StkId func; | |
| 271 | lua_lock(L); | |
| 272 | if (*what == '>') { | |
| 273 | ci = NULL; | |
| 274 | func = L->top - 1; | |
| 275 | api_check(L, ttisfunction(func), "function expected"); | |
| 276 | what++; /* skip the '>' */ | |
| 277 | L->top--; /* pop function */ | |
| 278 | } | |
| 279 | else { | |
| 280 | ci = ar->i_ci; | |
| 281 | func = ci->func; | |
| 282 | lua_assert(ttisfunction(ci->func)); | |
| 283 | } | |
| 284 | cl = ttisclosure(func) ? clvalue(func) : NULL; | |
| 285 | status = auxgetinfo(L, what, ar, cl, ci); | |
| 286 | if (strchr(what, 'f')) { | |
| 287 | setobjs2s(L, L->top, func); | |
| 288 | api_incr_top(L); | |
| 289 | } | |
| 290 | if (strchr(what, 'L')) | |
| 291 | collectvalidlines(L, cl); | |
| 292 | lua_unlock(L); | |
| 293 | return status; | |
| 267 | int status; | |
| 268 | Closure *cl; | |
| 269 | CallInfo *ci; | |
| 270 | StkId func; | |
| 271 | lua_lock(L); | |
| 272 | if (*what == '>') { | |
| 273 | ci = NULL; | |
| 274 | func = L->top - 1; | |
| 275 | api_check(L, ttisfunction(func), "function expected"); | |
| 276 | what++; /* skip the '>' */ | |
| 277 | L->top--; /* pop function */ | |
| 278 | } | |
| 279 | else { | |
| 280 | ci = ar->i_ci; | |
| 281 | func = ci->func; | |
| 282 | lua_assert(ttisfunction(ci->func)); | |
| 283 | } | |
| 284 | cl = ttisclosure(func) ? clvalue(func) : NULL; | |
| 285 | status = auxgetinfo(L, what, ar, cl, ci); | |
| 286 | if (strchr(what, 'f')) { | |
| 287 | setobjs2s(L, L->top, func); | |
| 288 | api_incr_top(L); | |
| 289 | } | |
| 290 | if (strchr(what, 'L')) | |
| 291 | collectvalidlines(L, cl); | |
| 292 | lua_unlock(L); | |
| 293 | return status; | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| r31373 | r31374 | |
| 301 | 301 | */ |
| 302 | 302 | |
| 303 | 303 | static const char *getobjname (Proto *p, int lastpc, int reg, |
| 304 | ||
| 304 | const char **name); | |
| 305 | 305 | |
| 306 | 306 | |
| 307 | 307 | /* |
| 308 | 308 | ** find a "name" for the RK value 'c' |
| 309 | 309 | */ |
| 310 | 310 | static void kname (Proto *p, int pc, int c, const char **name) { |
| 311 | if (ISK(c)) { /* is 'c' a constant? */ | |
| 312 | TValue *kvalue = &p->k[INDEXK(c)]; | |
| 313 | if (ttisstring(kvalue)) { /* literal constant? */ | |
| 314 | *name = svalue(kvalue); /* it is its own name */ | |
| 315 | return; | |
| 316 | } | |
| 317 | /* else no reasonable name found */ | |
| 318 | } | |
| 319 | else { /* 'c' is a register */ | |
| 320 | const char *what = getobjname(p, pc, c, name); /* search for 'c' */ | |
| 321 | if (what && *what == 'c') { /* found a constant name? */ | |
| 322 | return; /* 'name' already filled */ | |
| 323 | } | |
| 324 | /* else no reasonable name found */ | |
| 325 | } | |
| 326 | *name = "?"; /* no reasonable name found */ | |
| 311 | if (ISK(c)) { /* is 'c' a constant? */ | |
| 312 | TValue *kvalue = &p->k[INDEXK(c)]; | |
| 313 | if (ttisstring(kvalue)) { /* literal constant? */ | |
| 314 | *name = svalue(kvalue); /* it is its own name */ | |
| 315 | return; | |
| 316 | } | |
| 317 | /* else no reasonable name found */ | |
| 318 | } | |
| 319 | else { /* 'c' is a register */ | |
| 320 | const char *what = getobjname(p, pc, c, name); /* search for 'c' */ | |
| 321 | if (what && *what == 'c') { /* found a constant name? */ | |
| 322 | return; /* 'name' already filled */ | |
| 323 | } | |
| 324 | /* else no reasonable name found */ | |
| 325 | } | |
| 326 | *name = "?"; /* no reasonable name found */ | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
| 330 | 330 | static int filterpc (int pc, int jmptarget) { |
| 331 | if (pc < jmptarget) /* is code conditional (inside a jump)? */ | |
| 332 | return -1; /* cannot know who sets that register */ | |
| 333 | else return pc; /* current position sets that register */ | |
| 331 | if (pc < jmptarget) /* is code conditional (inside a jump)? */ | |
| 332 | return -1; /* cannot know who sets that register */ | |
| 333 | else return pc; /* current position sets that register */ | |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | |
| r31373 | r31374 | |
| 338 | 338 | ** try to find last instruction before 'lastpc' that modified register 'reg' |
| 339 | 339 | */ |
| 340 | 340 | static int findsetreg (Proto *p, int lastpc, int reg) { |
| 341 | int pc; | |
| 342 | int setreg = -1; /* keep last instruction that changed 'reg' */ | |
| 343 | int jmptarget = 0; /* any code before this address is conditional */ | |
| 344 | for (pc = 0; pc < lastpc; pc++) { | |
| 345 | Instruction i = p->code[pc]; | |
| 346 | OpCode op = GET_OPCODE(i); | |
| 347 | int a = GETARG_A(i); | |
| 348 | switch (op) { | |
| 349 | case OP_LOADNIL: { | |
| 350 | int b = GETARG_B(i); | |
| 351 | if (a <= reg && reg <= a + b) /* set registers from 'a' to 'a+b' */ | |
| 352 | setreg = filterpc(pc, jmptarget); | |
| 353 | break; | |
| 354 | } | |
| 355 | case OP_TFORCALL: { | |
| 356 | if (reg >= a + 2) /* affect all regs above its base */ | |
| 357 | setreg = filterpc(pc, jmptarget); | |
| 358 | break; | |
| 359 | } | |
| 360 | case OP_CALL: | |
| 361 | case OP_TAILCALL: { | |
| 362 | if (reg >= a) /* affect all registers above base */ | |
| 363 | setreg = filterpc(pc, jmptarget); | |
| 364 | break; | |
| 365 | } | |
| 366 | case OP_JMP: { | |
| 367 | int b = GETARG_sBx(i); | |
| 368 | int dest = pc + 1 + b; | |
| 369 | /* jump is forward and do not skip `lastpc'? */ | |
| 370 | if (pc < dest && dest <= lastpc) { | |
| 371 | if (dest > jmptarget) | |
| 372 | jmptarget = dest; /* update 'jmptarget' */ | |
| 373 | } | |
| 374 | break; | |
| 375 | } | |
| 376 | case OP_TEST: { | |
| 377 | if (reg == a) /* jumped code can change 'a' */ | |
| 378 | setreg = filterpc(pc, jmptarget); | |
| 379 | break; | |
| 380 | } | |
| 381 | default: | |
| 382 | if (testAMode(op) && reg == a) /* any instruction that set A */ | |
| 383 | setreg = filterpc(pc, jmptarget); | |
| 384 | break; | |
| 385 | } | |
| 386 | } | |
| 387 | return setreg; | |
| 341 | int pc; | |
| 342 | int setreg = -1; /* keep last instruction that changed 'reg' */ | |
| 343 | int jmptarget = 0; /* any code before this address is conditional */ | |
| 344 | for (pc = 0; pc < lastpc; pc++) { | |
| 345 | Instruction i = p->code[pc]; | |
| 346 | OpCode op = GET_OPCODE(i); | |
| 347 | int a = GETARG_A(i); | |
| 348 | switch (op) { | |
| 349 | case OP_LOADNIL: { | |
| 350 | int b = GETARG_B(i); | |
| 351 | if (a <= reg && reg <= a + b) /* set registers from 'a' to 'a+b' */ | |
| 352 | setreg = filterpc(pc, jmptarget); | |
| 353 | break; | |
| 354 | } | |
| 355 | case OP_TFORCALL: { | |
| 356 | if (reg >= a + 2) /* affect all regs above its base */ | |
| 357 | setreg = filterpc(pc, jmptarget); | |
| 358 | break; | |
| 359 | } | |
| 360 | case OP_CALL: | |
| 361 | case OP_TAILCALL: { | |
| 362 | if (reg >= a) /* affect all registers above base */ | |
| 363 | setreg = filterpc(pc, jmptarget); | |
| 364 | break; | |
| 365 | } | |
| 366 | case OP_JMP: { | |
| 367 | int b = GETARG_sBx(i); | |
| 368 | int dest = pc + 1 + b; | |
| 369 | /* jump is forward and do not skip `lastpc'? */ | |
| 370 | if (pc < dest && dest <= lastpc) { | |
| 371 | if (dest > jmptarget) | |
| 372 | jmptarget = dest; /* update 'jmptarget' */ | |
| 373 | } | |
| 374 | break; | |
| 375 | } | |
| 376 | case OP_TEST: { | |
| 377 | if (reg == a) /* jumped code can change 'a' */ | |
| 378 | setreg = filterpc(pc, jmptarget); | |
| 379 | break; | |
| 380 | } | |
| 381 | default: | |
| 382 | if (testAMode(op) && reg == a) /* any instruction that set A */ | |
| 383 | setreg = filterpc(pc, jmptarget); | |
| 384 | break; | |
| 385 | } | |
| 386 | } | |
| 387 | return setreg; | |
| 388 | 388 | } |
| 389 | 389 | |
| 390 | 390 | |
| 391 | 391 | static const char *getobjname (Proto *p, int lastpc, int reg, |
| 392 | const char **name) { | |
| 393 | int pc; | |
| 394 | *name = luaF_getlocalname(p, reg + 1, lastpc); | |
| 395 | if (*name) /* is a local? */ | |
| 396 | return "local"; | |
| 397 | /* else try symbolic execution */ | |
| 398 | pc = findsetreg(p, lastpc, reg); | |
| 399 | if (pc != -1) { /* could find instruction? */ | |
| 400 | Instruction i = p->code[pc]; | |
| 401 | OpCode op = GET_OPCODE(i); | |
| 402 | switch (op) { | |
| 403 | case OP_MOVE: { | |
| 404 | int b = GETARG_B(i); /* move from 'b' to 'a' */ | |
| 405 | if (b < GETARG_A(i)) | |
| 406 | return getobjname(p, pc, b, name); /* get name for 'b' */ | |
| 407 | break; | |
| 408 | } | |
| 409 | case OP_GETTABUP: | |
| 410 | case OP_GETTABLE: { | |
| 411 | int k = GETARG_C(i); /* key index */ | |
| 412 | int t = GETARG_B(i); /* table index */ | |
| 413 | const char *vn = (op == OP_GETTABLE) /* name of indexed variable */ | |
| 414 | ? luaF_getlocalname(p, t + 1, pc) | |
| 415 | : upvalname(p, t); | |
| 416 | kname(p, pc, k, name); | |
| 417 | return (vn && strcmp(vn, LUA_ENV) == 0) ? "global" : "field"; | |
| 418 | } | |
| 419 | case OP_GETUPVAL: { | |
| 420 | *name = upvalname(p, GETARG_B(i)); | |
| 421 | return "upvalue"; | |
| 422 | } | |
| 423 | case OP_LOADK: | |
| 424 | case OP_LOADKX: { | |
| 425 | int b = (op == OP_LOADK) ? GETARG_Bx(i) | |
| 426 | : GETARG_Ax(p->code[pc + 1]); | |
| 427 | if (ttisstring(&p->k[b])) { | |
| 428 | *name = svalue(&p->k[b]); | |
| 429 | return "constant"; | |
| 430 | } | |
| 431 | break; | |
| 432 | } | |
| 433 | case OP_SELF: { | |
| 434 | int k = GETARG_C(i); /* key index */ | |
| 435 | kname(p, pc, k, name); | |
| 436 | return "method"; | |
| 437 | } | |
| 438 | default: break; /* go through to return NULL */ | |
| 439 | } | |
| 440 | } | |
| 441 | return NULL; /* could not find reasonable name */ | |
| 392 | const char **name) { | |
| 393 | int pc; | |
| 394 | *name = luaF_getlocalname(p, reg + 1, lastpc); | |
| 395 | if (*name) /* is a local? */ | |
| 396 | return "local"; | |
| 397 | /* else try symbolic execution */ | |
| 398 | pc = findsetreg(p, lastpc, reg); | |
| 399 | if (pc != -1) { /* could find instruction? */ | |
| 400 | Instruction i = p->code[pc]; | |
| 401 | OpCode op = GET_OPCODE(i); | |
| 402 | switch (op) { | |
| 403 | case OP_MOVE: { | |
| 404 | int b = GETARG_B(i); /* move from 'b' to 'a' */ | |
| 405 | if (b < GETARG_A(i)) | |
| 406 | return getobjname(p, pc, b, name); /* get name for 'b' */ | |
| 407 | break; | |
| 408 | } | |
| 409 | case OP_GETTABUP: | |
| 410 | case OP_GETTABLE: { | |
| 411 | int k = GETARG_C(i); /* key index */ | |
| 412 | int t = GETARG_B(i); /* table index */ | |
| 413 | const char *vn = (op == OP_GETTABLE) /* name of indexed variable */ | |
| 414 | ? luaF_getlocalname(p, t + 1, pc) | |
| 415 | : upvalname(p, t); | |
| 416 | kname(p, pc, k, name); | |
| 417 | return (vn && strcmp(vn, LUA_ENV) == 0) ? "global" : "field"; | |
| 418 | } | |
| 419 | case OP_GETUPVAL: { | |
| 420 | *name = upvalname(p, GETARG_B(i)); | |
| 421 | return "upvalue"; | |
| 422 | } | |
| 423 | case OP_LOADK: | |
| 424 | case OP_LOADKX: { | |
| 425 | int b = (op == OP_LOADK) ? GETARG_Bx(i) | |
| 426 | : GETARG_Ax(p->code[pc + 1]); | |
| 427 | if (ttisstring(&p->k[b])) { | |
| 428 | *name = svalue(&p->k[b]); | |
| 429 | return "constant"; | |
| 430 | } | |
| 431 | break; | |
| 432 | } | |
| 433 | case OP_SELF: { | |
| 434 | int k = GETARG_C(i); /* key index */ | |
| 435 | kname(p, pc, k, name); | |
| 436 | return "method"; | |
| 437 | } | |
| 438 | default: break; /* go through to return NULL */ | |
| 439 | } | |
| 440 | } | |
| 441 | return NULL; /* could not find reasonable name */ | |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | |
| 445 | 445 | static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { |
| 446 | TMS tm; | |
| 447 | Proto *p = ci_func(ci)->p; /* calling function */ | |
| 448 | int pc = currentpc(ci); /* calling instruction index */ | |
| 449 | Instruction i = p->code[pc]; /* calling instruction */ | |
| 450 | switch (GET_OPCODE(i)) { | |
| 451 | case OP_CALL: | |
| 452 | case OP_TAILCALL: /* get function name */ | |
| 453 | return getobjname(p, pc, GETARG_A(i), name); | |
| 454 | case OP_TFORCALL: { /* for iterator */ | |
| 455 | *name = "for iterator"; | |
| 456 | return "for iterator"; | |
| 457 | } | |
| 458 | /* all other instructions can call only through metamethods */ | |
| 459 | case OP_SELF: | |
| 460 | case OP_GETTABUP: | |
| 461 | case OP_GETTABLE: tm = TM_INDEX; break; | |
| 462 | case OP_SETTABUP: | |
| 463 | case OP_SETTABLE: tm = TM_NEWINDEX; break; | |
| 464 | case OP_EQ: tm = TM_EQ; break; | |
| 465 | case OP_ADD: tm = TM_ADD; break; | |
| 466 | case OP_SUB: tm = TM_SUB; break; | |
| 467 | case OP_MUL: tm = TM_MUL; break; | |
| 468 | case OP_DIV: tm = TM_DIV; break; | |
| 469 | case OP_MOD: tm = TM_MOD; break; | |
| 470 | case OP_POW: tm = TM_POW; break; | |
| 471 | case OP_UNM: tm = TM_UNM; break; | |
| 472 | case OP_LEN: tm = TM_LEN; break; | |
| 473 | case OP_LT: tm = TM_LT; break; | |
| 474 | case OP_LE: tm = TM_LE; break; | |
| 475 | case OP_CONCAT: tm = TM_CONCAT; break; | |
| 476 | default: | |
| 477 | return NULL; /* else no useful name can be found */ | |
| 478 | } | |
| 479 | *name = getstr(G(L)->tmname[tm]); | |
| 480 | return "metamethod"; | |
| 446 | TMS tm; | |
| 447 | Proto *p = ci_func(ci)->p; /* calling function */ | |
| 448 | int pc = currentpc(ci); /* calling instruction index */ | |
| 449 | Instruction i = p->code[pc]; /* calling instruction */ | |
| 450 | switch (GET_OPCODE(i)) { | |
| 451 | case OP_CALL: | |
| 452 | case OP_TAILCALL: /* get function name */ | |
| 453 | return getobjname(p, pc, GETARG_A(i), name); | |
| 454 | case OP_TFORCALL: { /* for iterator */ | |
| 455 | *name = "for iterator"; | |
| 456 | return "for iterator"; | |
| 457 | } | |
| 458 | /* all other instructions can call only through metamethods */ | |
| 459 | case OP_SELF: | |
| 460 | case OP_GETTABUP: | |
| 461 | case OP_GETTABLE: tm = TM_INDEX; break; | |
| 462 | case OP_SETTABUP: | |
| 463 | case OP_SETTABLE: tm = TM_NEWINDEX; break; | |
| 464 | case OP_EQ: tm = TM_EQ; break; | |
| 465 | case OP_ADD: tm = TM_ADD; break; | |
| 466 | case OP_SUB: tm = TM_SUB; break; | |
| 467 | case OP_MUL: tm = TM_MUL; break; | |
| 468 | case OP_DIV: tm = TM_DIV; break; | |
| 469 | case OP_MOD: tm = TM_MOD; break; | |
| 470 | case OP_POW: tm = TM_POW; break; | |
| 471 | case OP_UNM: tm = TM_UNM; break; | |
| 472 | case OP_LEN: tm = TM_LEN; break; | |
| 473 | case OP_LT: tm = TM_LT; break; | |
| 474 | case OP_LE: tm = TM_LE; break; | |
| 475 | case OP_CONCAT: tm = TM_CONCAT; break; | |
| 476 | default: | |
| 477 | return NULL; /* else no useful name can be found */ | |
| 478 | } | |
| 479 | *name = getstr(G(L)->tmname[tm]); | |
| 480 | return "metamethod"; | |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | /* }====================================================== */ |
| r31373 | r31374 | |
| 489 | 489 | ** (used only for error messages, so efficiency is not a big concern) |
| 490 | 490 | */ |
| 491 | 491 | static int isinstack (CallInfo *ci, const TValue *o) { |
| 492 | StkId p; | |
| 493 | for (p = ci->u.l.base; p < ci->top; p++) | |
| 494 | if (o == p) return 1; | |
| 495 | return 0; | |
| 492 | StkId p; | |
| 493 | for (p = ci->u.l.base; p < ci->top; p++) | |
| 494 | if (o == p) return 1; | |
| 495 | return 0; | |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | |
| 499 | 499 | static const char *getupvalname (CallInfo *ci, const TValue *o, |
| 500 | const char **name) { | |
| 501 | LClosure *c = ci_func(ci); | |
| 502 | int i; | |
| 503 | for (i = 0; i < c->nupvalues; i++) { | |
| 504 | if (c->upvals[i]->v == o) { | |
| 505 | *name = upvalname(c->p, i); | |
| 506 | return "upvalue"; | |
| 507 | } | |
| 508 | } | |
| 509 | return NULL; | |
| 500 | const char **name) { | |
| 501 | LClosure *c = ci_func(ci); | |
| 502 | int i; | |
| 503 | for (i = 0; i < c->nupvalues; i++) { | |
| 504 | if (c->upvals[i]->v == o) { | |
| 505 | *name = upvalname(c->p, i); | |
| 506 | return "upvalue"; | |
| 507 | } | |
| 508 | } | |
| 509 | return NULL; | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | |
| 513 | 513 | l_noret luaG_typeerror (lua_State *L, const TValue *o, const char *op) { |
| 514 | CallInfo *ci = L->ci; | |
| 515 | const char *name = NULL; | |
| 516 | const char *t = objtypename(o); | |
| 517 | const char *kind = NULL; | |
| 518 | if (isLua(ci)) { | |
| 519 | kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */ | |
| 520 | if (!kind && isinstack(ci, o)) /* no? try a register */ | |
| 521 | kind = getobjname(ci_func(ci)->p, currentpc(ci), | |
| 522 | cast_int(o - ci->u.l.base), &name); | |
| 523 | } | |
| 524 | if (kind) | |
| 525 | luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)", | |
| 526 | op, kind, name, t); | |
| 527 | else | |
| 528 | luaG_runerror(L, "attempt to %s a %s value", op, t); | |
| 514 | CallInfo *ci = L->ci; | |
| 515 | const char *name = NULL; | |
| 516 | const char *t = objtypename(o); | |
| 517 | const char *kind = NULL; | |
| 518 | if (isLua(ci)) { | |
| 519 | kind = getupvalname(ci, o, &name); /* check whether 'o' is an upvalue */ | |
| 520 | if (!kind && isinstack(ci, o)) /* no? try a register */ | |
| 521 | kind = getobjname(ci_func(ci)->p, currentpc(ci), | |
| 522 | cast_int(o - ci->u.l.base), &name); | |
| 523 | } | |
| 524 | if (kind) | |
| 525 | luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)", | |
| 526 | op, kind, name, t); | |
| 527 | else | |
| 528 | luaG_runerror(L, "attempt to %s a %s value", op, t); | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
| 532 | 532 | l_noret luaG_concaterror (lua_State *L, StkId p1, StkId p2) { |
| 533 | if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; | |
| 534 | lua_assert(!ttisstring(p1) && !ttisnumber(p1)); | |
| 535 | luaG_typeerror(L, p1, "concatenate"); | |
| 533 | if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; | |
| 534 | lua_assert(!ttisstring(p1) && !ttisnumber(p1)); | |
| 535 | luaG_typeerror(L, p1, "concatenate"); | |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | |
| 539 | 539 | l_noret luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) { |
| 540 | TValue temp; | |
| 541 | if (luaV_tonumber(p1, &temp) == NULL) | |
| 542 | p2 = p1; /* first operand is wrong */ | |
| 543 | luaG_typeerror(L, p2, "perform arithmetic on"); | |
| 540 | TValue temp; | |
| 541 | if (luaV_tonumber(p1, &temp) == NULL) | |
| 542 | p2 = p1; /* first operand is wrong */ | |
| 543 | luaG_typeerror(L, p2, "perform arithmetic on"); | |
| 544 | 544 | } |
| 545 | 545 | |
| 546 | 546 | |
| 547 | 547 | l_noret luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { |
| 548 | const char *t1 = objtypename(p1); | |
| 549 | const char *t2 = objtypename(p2); | |
| 550 | if (t1 == t2) | |
| 551 | luaG_runerror(L, "attempt to compare two %s values", t1); | |
| 552 | else | |
| 553 | luaG_runerror(L, "attempt to compare %s with %s", t1, t2); | |
| 548 | const char *t1 = objtypename(p1); | |
| 549 | const char *t2 = objtypename(p2); | |
| 550 | if (t1 == t2) | |
| 551 | luaG_runerror(L, "attempt to compare two %s values", t1); | |
| 552 | else | |
| 553 | luaG_runerror(L, "attempt to compare %s with %s", t1, t2); | |
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | |
| 557 | 557 | static void addinfo (lua_State *L, const char *msg) { |
| 558 | CallInfo *ci = L->ci; | |
| 559 | if (isLua(ci)) { /* is Lua code? */ | |
| 560 | char buff[LUA_IDSIZE]; /* add file:line information */ | |
| 561 | int line = currentline(ci); | |
| 562 | TString *src = ci_func(ci)->p->source; | |
| 563 | if (src) | |
| 564 | luaO_chunkid(buff, getstr(src), LUA_IDSIZE); | |
| 565 | else { /* no source available; use "?" instead */ | |
| 566 | buff[0] = '?'; buff[1] = '\0'; | |
| 567 | } | |
| 568 | luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); | |
| 569 | } | |
| 558 | CallInfo *ci = L->ci; | |
| 559 | if (isLua(ci)) { /* is Lua code? */ | |
| 560 | char buff[LUA_IDSIZE]; /* add file:line information */ | |
| 561 | int line = currentline(ci); | |
| 562 | TString *src = ci_func(ci)->p->source; | |
| 563 | if (src) | |
| 564 | luaO_chunkid(buff, getstr(src), LUA_IDSIZE); | |
| 565 | else { /* no source available; use "?" instead */ | |
| 566 | buff[0] = '?'; buff[1] = '\0'; | |
| 567 | } | |
| 568 | luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); | |
| 569 | } | |
| 570 | 570 | } |
| 571 | 571 | |
| 572 | 572 | |
| 573 | 573 | l_noret luaG_errormsg (lua_State *L) { |
| 574 | if (L->errfunc != 0) { /* is there an error handling function? */ | |
| 575 | StkId errfunc = restorestack(L, L->errfunc); | |
| 576 | if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); | |
| 577 | setobjs2s(L, L->top, L->top - 1); /* move argument */ | |
| 578 | setobjs2s(L, L->top - 1, errfunc); /* push function */ | |
| 579 | L->top++; | |
| 580 | luaD_call(L, L->top - 2, 1, 0); /* call it */ | |
| 581 | } | |
| 582 | luaD_throw(L, LUA_ERRRUN); | |
| 574 | if (L->errfunc != 0) { /* is there an error handling function? */ | |
| 575 | StkId errfunc = restorestack(L, L->errfunc); | |
| 576 | if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); | |
| 577 | setobjs2s(L, L->top, L->top - 1); /* move argument */ | |
| 578 | setobjs2s(L, L->top - 1, errfunc); /* push function */ | |
| 579 | L->top++; | |
| 580 | luaD_call(L, L->top - 2, 1, 0); /* call it */ | |
| 581 | } | |
| 582 | luaD_throw(L, LUA_ERRRUN); | |
| 583 | 583 | } |
| 584 | 584 | |
| 585 | 585 | |
| 586 | 586 | l_noret luaG_runerror (lua_State *L, const char *fmt, ...) { |
| 587 | va_list argp; | |
| 588 | va_start(argp, fmt); | |
| 589 | addinfo(L, luaO_pushvfstring(L, fmt, argp)); | |
| 590 | va_end(argp); | |
| 591 | luaG_errormsg(L); | |
| 587 | va_list argp; | |
| 588 | va_start(argp, fmt); | |
| 589 | addinfo(L, luaO_pushvfstring(L, fmt, argp)); | |
| 590 | va_end(argp); | |
| 591 | luaG_errormsg(L); | |
| 592 | 592 | } |
| 593 |
| r31373 | r31374 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | static int auxresume (lua_State *L, lua_State *co, int narg) { |
| 21 | int status; | |
| 22 | if (!lua_checkstack(co, narg)) { | |
| 23 | lua_pushliteral(L, "too many arguments to resume"); | |
| 24 | return -1; /* error flag */ | |
| 25 | } | |
| 26 | if (lua_status(co) == LUA_OK && lua_gettop(co) == 0) { | |
| 27 | lua_pushliteral(L, "cannot resume dead coroutine"); | |
| 28 | return -1; /* error flag */ | |
| 29 | } | |
| 30 | lua_xmove(L, co, narg); | |
| 31 | status = lua_resume(co, L, narg); | |
| 32 | if (status == LUA_OK || status == LUA_YIELD) { | |
| 33 | int nres = lua_gettop(co); | |
| 34 | if (!lua_checkstack(L, nres + 1)) { | |
| 35 | lua_pop(co, nres); /* remove results anyway */ | |
| 36 | lua_pushliteral(L, "too many results to resume"); | |
| 37 | return -1; /* error flag */ | |
| 38 | } | |
| 39 | lua_xmove(co, L, nres); /* move yielded values */ | |
| 40 | return nres; | |
| 41 | } | |
| 42 | else { | |
| 43 | lua_xmove(co, L, 1); /* move error message */ | |
| 44 | return -1; /* error flag */ | |
| 45 | } | |
| 21 | int status; | |
| 22 | if (!lua_checkstack(co, narg)) { | |
| 23 | lua_pushliteral(L, "too many arguments to resume"); | |
| 24 | return -1; /* error flag */ | |
| 25 | } | |
| 26 | if (lua_status(co) == LUA_OK && lua_gettop(co) == 0) { | |
| 27 | lua_pushliteral(L, "cannot resume dead coroutine"); | |
| 28 | return -1; /* error flag */ | |
| 29 | } | |
| 30 | lua_xmove(L, co, narg); | |
| 31 | status = lua_resume(co, L, narg); | |
| 32 | if (status == LUA_OK || status == LUA_YIELD) { | |
| 33 | int nres = lua_gettop(co); | |
| 34 | if (!lua_checkstack(L, nres + 1)) { | |
| 35 | lua_pop(co, nres); /* remove results anyway */ | |
| 36 | lua_pushliteral(L, "too many results to resume"); | |
| 37 | return -1; /* error flag */ | |
| 38 | } | |
| 39 | lua_xmove(co, L, nres); /* move yielded values */ | |
| 40 | return nres; | |
| 41 | } | |
| 42 | else { | |
| 43 | lua_xmove(co, L, 1); /* move error message */ | |
| 44 | return -1; /* error flag */ | |
| 45 | } | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | |
| 49 | 49 | static int luaB_coresume (lua_State *L) { |
| 50 | lua_State *co = lua_tothread(L, 1); | |
| 51 | int r; | |
| 52 | luaL_argcheck(L, co, 1, "coroutine expected"); | |
| 53 | r = auxresume(L, co, lua_gettop(L) - 1); | |
| 54 | if (r < 0) { | |
| 55 | lua_pushboolean(L, 0); | |
| 56 | lua_insert(L, -2); | |
| 57 | return 2; /* return false + error message */ | |
| 58 | } | |
| 59 | else { | |
| 60 | lua_pushboolean(L, 1); | |
| 61 | lua_insert(L, -(r + 1)); | |
| 62 | return r + 1; /* return true + `resume' returns */ | |
| 63 | } | |
| 50 | lua_State *co = lua_tothread(L, 1); | |
| 51 | int r; | |
| 52 | luaL_argcheck(L, co, 1, "coroutine expected"); | |
| 53 | r = auxresume(L, co, lua_gettop(L) - 1); | |
| 54 | if (r < 0) { | |
| 55 | lua_pushboolean(L, 0); | |
| 56 | lua_insert(L, -2); | |
| 57 | return 2; /* return false + error message */ | |
| 58 | } | |
| 59 | else { | |
| 60 | lua_pushboolean(L, 1); | |
| 61 | lua_insert(L, -(r + 1)); | |
| 62 | return r + 1; /* return true + `resume' returns */ | |
| 63 | } | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | static int luaB_auxwrap (lua_State *L) { |
| 68 | lua_State *co = lua_tothread(L, lua_upvalueindex(1)); | |
| 69 | int r = auxresume(L, co, lua_gettop(L)); | |
| 70 | if (r < 0) { | |
| 71 | if (lua_isstring(L, -1)) { /* error object is a string? */ | |
| 72 | luaL_where(L, 1); /* add extra info */ | |
| 73 | lua_insert(L, -2); | |
| 74 | lua_concat(L, 2); | |
| 75 | } | |
| 76 | return lua_error(L); /* propagate error */ | |
| 77 | } | |
| 78 | return r; | |
| 68 | lua_State *co = lua_tothread(L, lua_upvalueindex(1)); | |
| 69 | int r = auxresume(L, co, lua_gettop(L)); | |
| 70 | if (r < 0) { | |
| 71 | if (lua_isstring(L, -1)) { /* error object is a string? */ | |
| 72 | luaL_where(L, 1); /* add extra info */ | |
| 73 | lua_insert(L, -2); | |
| 74 | lua_concat(L, 2); | |
| 75 | } | |
| 76 | return lua_error(L); /* propagate error */ | |
| 77 | } | |
| 78 | return r; | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | static int luaB_cocreate (lua_State *L) { |
| 83 | lua_State *NL; | |
| 84 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 85 | NL = lua_newthread(L); | |
| 86 | lua_pushvalue(L, 1); /* move function to top */ | |
| 87 | lua_xmove(L, NL, 1); /* move function from L to NL */ | |
| 88 | return 1; | |
| 83 | lua_State *NL; | |
| 84 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 85 | NL = lua_newthread(L); | |
| 86 | lua_pushvalue(L, 1); /* move function to top */ | |
| 87 | lua_xmove(L, NL, 1); /* move function from L to NL */ | |
| 88 | return 1; | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | static int luaB_cowrap (lua_State *L) { |
| 93 | luaB_cocreate(L); | |
| 94 | lua_pushcclosure(L, luaB_auxwrap, 1); | |
| 95 | return 1; | |
| 93 | luaB_cocreate(L); | |
| 94 | lua_pushcclosure(L, luaB_auxwrap, 1); | |
| 95 | return 1; | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | static int luaB_yield (lua_State *L) { |
| 100 | ||
| 100 | return lua_yield(L, lua_gettop(L)); | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | static int luaB_costatus (lua_State *L) { |
| 105 | lua_State *co = lua_tothread(L, 1); | |
| 106 | luaL_argcheck(L, co, 1, "coroutine expected"); | |
| 107 | if (L == co) lua_pushliteral(L, "running"); | |
| 108 | else { | |
| 109 | switch (lua_status(co)) { | |
| 110 | case LUA_YIELD: | |
| 111 | lua_pushliteral(L, "suspended"); | |
| 112 | break; | |
| 113 | case LUA_OK: { | |
| 114 | lua_Debug ar; | |
| 115 | if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ | |
| 116 | lua_pushliteral(L, "normal"); /* it is running */ | |
| 117 | else if (lua_gettop(co) == 0) | |
| 118 | lua_pushliteral(L, "dead"); | |
| 119 | else | |
| 120 | lua_pushliteral(L, "suspended"); /* initial state */ | |
| 121 | break; | |
| 122 | } | |
| 123 | default: /* some error occurred */ | |
| 124 | lua_pushliteral(L, "dead"); | |
| 125 | break; | |
| 126 | } | |
| 127 | } | |
| 128 | return 1; | |
| 105 | lua_State *co = lua_tothread(L, 1); | |
| 106 | luaL_argcheck(L, co, 1, "coroutine expected"); | |
| 107 | if (L == co) lua_pushliteral(L, "running"); | |
| 108 | else { | |
| 109 | switch (lua_status(co)) { | |
| 110 | case LUA_YIELD: | |
| 111 | lua_pushliteral(L, "suspended"); | |
| 112 | break; | |
| 113 | case LUA_OK: { | |
| 114 | lua_Debug ar; | |
| 115 | if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ | |
| 116 | lua_pushliteral(L, "normal"); /* it is running */ | |
| 117 | else if (lua_gettop(co) == 0) | |
| 118 | lua_pushliteral(L, "dead"); | |
| 119 | else | |
| 120 | lua_pushliteral(L, "suspended"); /* initial state */ | |
| 121 | break; | |
| 122 | } | |
| 123 | default: /* some error occurred */ | |
| 124 | lua_pushliteral(L, "dead"); | |
| 125 | break; | |
| 126 | } | |
| 127 | } | |
| 128 | return 1; | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | |
| 132 | 132 | static int luaB_corunning (lua_State *L) { |
| 133 | int ismain = lua_pushthread(L); | |
| 134 | lua_pushboolean(L, ismain); | |
| 135 | return 2; | |
| 133 | int ismain = lua_pushthread(L); | |
| 134 | lua_pushboolean(L, ismain); | |
| 135 | return 2; | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | static const luaL_Reg co_funcs[] = { |
| 140 | {"create", luaB_cocreate}, | |
| 141 | {"resume", luaB_coresume}, | |
| 142 | {"running", luaB_corunning}, | |
| 143 | {"status", luaB_costatus}, | |
| 144 | {"wrap", luaB_cowrap}, | |
| 145 | {"yield", luaB_yield}, | |
| 146 | {NULL, NULL} | |
| 140 | {"create", luaB_cocreate}, | |
| 141 | {"resume", luaB_coresume}, | |
| 142 | {"running", luaB_corunning}, | |
| 143 | {"status", luaB_costatus}, | |
| 144 | {"wrap", luaB_cowrap}, | |
| 145 | {"yield", luaB_yield}, | |
| 146 | {NULL, NULL} | |
| 147 | 147 | }; |
| 148 | 148 | |
| 149 | 149 | |
| 150 | 150 | |
| 151 | 151 | LUAMOD_API int luaopen_coroutine (lua_State *L) { |
| 152 | luaL_newlib(L, co_funcs); | |
| 153 | return 1; | |
| 152 | luaL_newlib(L, co_funcs); | |
| 153 | return 1; | |
| 154 | 154 | } |
| 155 |
| r31373 | r31374 | |
|---|---|---|
| 16 | 16 | #include "lualib.h" |
| 17 | 17 | |
| 18 | 18 | |
| 19 | #define aux_getn(L,n) | |
| 19 | #define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_len(L, n)) | |
| 20 | 20 | |
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | #if defined(LUA_COMPAT_MAXN) |
| 24 | 24 | static int maxn (lua_State *L) { |
| 25 | lua_Number max = 0; | |
| 26 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 27 | lua_pushnil(L); /* first key */ | |
| 28 | while (lua_next(L, 1)) { | |
| 29 | lua_pop(L, 1); /* remove value */ | |
| 30 | if (lua_type(L, -1) == LUA_TNUMBER) { | |
| 31 | lua_Number v = lua_tonumber(L, -1); | |
| 32 | if (v > max) max = v; | |
| 33 | } | |
| 34 | } | |
| 35 | lua_pushnumber(L, max); | |
| 36 | return 1; | |
| 25 | lua_Number max = 0; | |
| 26 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 27 | lua_pushnil(L); /* first key */ | |
| 28 | while (lua_next(L, 1)) { | |
| 29 | lua_pop(L, 1); /* remove value */ | |
| 30 | if (lua_type(L, -1) == LUA_TNUMBER) { | |
| 31 | lua_Number v = lua_tonumber(L, -1); | |
| 32 | if (v > max) max = v; | |
| 33 | } | |
| 34 | } | |
| 35 | lua_pushnumber(L, max); | |
| 36 | return 1; | |
| 37 | 37 | } |
| 38 | 38 | #endif |
| 39 | 39 | |
| 40 | 40 | |
| 41 | 41 | static int tinsert (lua_State *L) { |
| 42 | int e = aux_getn(L, 1) + 1; /* first empty element */ | |
| 43 | int pos; /* where to insert new element */ | |
| 44 | switch (lua_gettop(L)) { | |
| 45 | case 2: { /* called with only 2 arguments */ | |
| 46 | pos = e; /* insert new element at the end */ | |
| 47 | break; | |
| 48 | } | |
| 49 | case 3: { | |
| 50 | int i; | |
| 51 | pos = luaL_checkint(L, 2); /* 2nd argument is the position */ | |
| 52 | luaL_argcheck(L, 1 <= pos && pos <= e, 2, "position out of bounds"); | |
| 53 | for (i = e; i > pos; i--) { /* move up elements */ | |
| 54 | lua_rawgeti(L, 1, i-1); | |
| 55 | lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ | |
| 56 | } | |
| 57 | break; | |
| 58 | } | |
| 59 | default: { | |
| 60 | return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); | |
| 61 | } | |
| 62 | } | |
| 63 | lua_rawseti(L, 1, pos); /* t[pos] = v */ | |
| 64 | return 0; | |
| 42 | int e = aux_getn(L, 1) + 1; /* first empty element */ | |
| 43 | int pos; /* where to insert new element */ | |
| 44 | switch (lua_gettop(L)) { | |
| 45 | case 2: { /* called with only 2 arguments */ | |
| 46 | pos = e; /* insert new element at the end */ | |
| 47 | break; | |
| 48 | } | |
| 49 | case 3: { | |
| 50 | int i; | |
| 51 | pos = luaL_checkint(L, 2); /* 2nd argument is the position */ | |
| 52 | luaL_argcheck(L, 1 <= pos && pos <= e, 2, "position out of bounds"); | |
| 53 | for (i = e; i > pos; i--) { /* move up elements */ | |
| 54 | lua_rawgeti(L, 1, i-1); | |
| 55 | lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ | |
| 56 | } | |
| 57 | break; | |
| 58 | } | |
| 59 | default: { | |
| 60 | return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); | |
| 61 | } | |
| 62 | } | |
| 63 | lua_rawseti(L, 1, pos); /* t[pos] = v */ | |
| 64 | return 0; | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | |
| 68 | 68 | static int tremove (lua_State *L) { |
| 69 | int size = aux_getn(L, 1); | |
| 70 | int pos = luaL_optint(L, 2, size); | |
| 71 | if (pos != size) /* validate 'pos' if given */ | |
| 72 | luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds"); | |
| 73 | lua_rawgeti(L, 1, pos); /* result = t[pos] */ | |
| 74 | for ( ; pos < size; pos++) { | |
| 75 | lua_rawgeti(L, 1, pos+1); | |
| 76 | lua_rawseti(L, 1, pos); /* t[pos] = t[pos+1] */ | |
| 77 | } | |
| 78 | lua_pushnil(L); | |
| 79 | lua_rawseti(L, 1, pos); /* t[pos] = nil */ | |
| 80 | return 1; | |
| 69 | int size = aux_getn(L, 1); | |
| 70 | int pos = luaL_optint(L, 2, size); | |
| 71 | if (pos != size) /* validate 'pos' if given */ | |
| 72 | luaL_argcheck(L, 1 <= pos && pos <= size + 1, 1, "position out of bounds"); | |
| 73 | lua_rawgeti(L, 1, pos); /* result = t[pos] */ | |
| 74 | for ( ; pos < size; pos++) { | |
| 75 | lua_rawgeti(L, 1, pos+1); | |
| 76 | lua_rawseti(L, 1, pos); /* t[pos] = t[pos+1] */ | |
| 77 | } | |
| 78 | lua_pushnil(L); | |
| 79 | lua_rawseti(L, 1, pos); /* t[pos] = nil */ | |
| 80 | return 1; | |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | static void addfield (lua_State *L, luaL_Buffer *b, int i) { |
| 85 | lua_rawgeti(L, 1, i); | |
| 86 | if (!lua_isstring(L, -1)) | |
| 87 | luaL_error(L, "invalid value (%s) at index %d in table for " | |
| 88 | LUA_QL("concat"), luaL_typename(L, -1), i); | |
| 89 | luaL_addvalue(b); | |
| 85 | lua_rawgeti(L, 1, i); | |
| 86 | if (!lua_isstring(L, -1)) | |
| 87 | luaL_error(L, "invalid value (%s) at index %d in table for " | |
| 88 | LUA_QL("concat"), luaL_typename(L, -1), i); | |
| 89 | luaL_addvalue(b); | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | static int tconcat (lua_State *L) { |
| 94 | luaL_Buffer b; | |
| 95 | size_t lsep; | |
| 96 | int i, last; | |
| 97 | const char *sep = luaL_optlstring(L, 2, "", &lsep); | |
| 98 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 99 | i = luaL_optint(L, 3, 1); | |
| 100 | last = luaL_opt(L, luaL_checkint, 4, luaL_len(L, 1)); | |
| 101 | luaL_buffinit(L, &b); | |
| 102 | for (; i < last; i++) { | |
| 103 | addfield(L, &b, i); | |
| 104 | luaL_addlstring(&b, sep, lsep); | |
| 105 | } | |
| 106 | if (i == last) /* add last value (if interval was not empty) */ | |
| 107 | addfield(L, &b, i); | |
| 108 | luaL_pushresult(&b); | |
| 109 | return 1; | |
| 94 | luaL_Buffer b; | |
| 95 | size_t lsep; | |
| 96 | int i, last; | |
| 97 | const char *sep = luaL_optlstring(L, 2, "", &lsep); | |
| 98 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 99 | i = luaL_optint(L, 3, 1); | |
| 100 | last = luaL_opt(L, luaL_checkint, 4, luaL_len(L, 1)); | |
| 101 | luaL_buffinit(L, &b); | |
| 102 | for (; i < last; i++) { | |
| 103 | addfield(L, &b, i); | |
| 104 | luaL_addlstring(&b, sep, lsep); | |
| 105 | } | |
| 106 | if (i == last) /* add last value (if interval was not empty) */ | |
| 107 | addfield(L, &b, i); | |
| 108 | luaL_pushresult(&b); | |
| 109 | return 1; | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| r31373 | r31374 | |
| 117 | 117 | */ |
| 118 | 118 | |
| 119 | 119 | static int pack (lua_State *L) { |
| 120 | int n = lua_gettop(L); /* number of elements to pack */ | |
| 121 | lua_createtable(L, n, 1); /* create result table */ | |
| 122 | lua_pushinteger(L, n); | |
| 123 | lua_setfield(L, -2, "n"); /* t.n = number of elements */ | |
| 124 | if (n > 0) { /* at least one element? */ | |
| 125 | int i; | |
| 126 | lua_pushvalue(L, 1); | |
| 127 | lua_rawseti(L, -2, 1); /* insert first element */ | |
| 128 | lua_replace(L, 1); /* move table into index 1 */ | |
| 129 | for (i = n; i >= 2; i--) /* assign other elements */ | |
| 130 | lua_rawseti(L, 1, i); | |
| 131 | } | |
| 132 | return 1; /* return table */ | |
| 120 | int n = lua_gettop(L); /* number of elements to pack */ | |
| 121 | lua_createtable(L, n, 1); /* create result table */ | |
| 122 | lua_pushinteger(L, n); | |
| 123 | lua_setfield(L, -2, "n"); /* t.n = number of elements */ | |
| 124 | if (n > 0) { /* at least one element? */ | |
| 125 | int i; | |
| 126 | lua_pushvalue(L, 1); | |
| 127 | lua_rawseti(L, -2, 1); /* insert first element */ | |
| 128 | lua_replace(L, 1); /* move table into index 1 */ | |
| 129 | for (i = n; i >= 2; i--) /* assign other elements */ | |
| 130 | lua_rawseti(L, 1, i); | |
| 131 | } | |
| 132 | return 1; /* return table */ | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | static int unpack (lua_State *L) { |
| 137 | int i, e, n; | |
| 138 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 139 | i = luaL_optint(L, 2, 1); | |
| 140 | e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1)); | |
| 141 | if (i > e) return 0; /* empty range */ | |
| 142 | n = e - i + 1; /* number of elements */ | |
| 143 | if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ | |
| 144 | return luaL_error(L, "too many results to unpack"); | |
| 145 | lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ | |
| 146 | while (i++ < e) /* push arg[i + 1...e] */ | |
| 147 | lua_rawgeti(L, 1, i); | |
| 148 | return n; | |
| 137 | int i, e, n; | |
| 138 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 139 | i = luaL_optint(L, 2, 1); | |
| 140 | e = luaL_opt(L, luaL_checkint, 3, luaL_len(L, 1)); | |
| 141 | if (i > e) return 0; /* empty range */ | |
| 142 | n = e - i + 1; /* number of elements */ | |
| 143 | if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ | |
| 144 | return luaL_error(L, "too many results to unpack"); | |
| 145 | lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ | |
| 146 | while (i++ < e) /* push arg[i + 1...e] */ | |
| 147 | lua_rawgeti(L, 1, i); | |
| 148 | return n; | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | /* }====================================================== */ |
| r31373 | r31374 | |
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | static void set2 (lua_State *L, int i, int j) { |
| 165 | lua_rawseti(L, 1, i); | |
| 166 | lua_rawseti(L, 1, j); | |
| 165 | lua_rawseti(L, 1, i); | |
| 166 | lua_rawseti(L, 1, j); | |
| 167 | 167 | } |
| 168 | 168 | |
| 169 | 169 | static int sort_comp (lua_State *L, int a, int b) { |
| 170 | if (!lua_isnil(L, 2)) { /* function? */ | |
| 171 | int res; | |
| 172 | lua_pushvalue(L, 2); | |
| 173 | lua_pushvalue(L, a-1); /* -1 to compensate function */ | |
| 174 | lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */ | |
| 175 | lua_call(L, 2, 1); | |
| 176 | res = lua_toboolean(L, -1); | |
| 177 | lua_pop(L, 1); | |
| 178 | return res; | |
| 179 | } | |
| 180 | else /* a < b? */ | |
| 181 | return lua_compare(L, a, b, LUA_OPLT); | |
| 170 | if (!lua_isnil(L, 2)) { /* function? */ | |
| 171 | int res; | |
| 172 | lua_pushvalue(L, 2); | |
| 173 | lua_pushvalue(L, a-1); /* -1 to compensate function */ | |
| 174 | lua_pushvalue(L, b-2); /* -2 to compensate function and `a' */ | |
| 175 | lua_call(L, 2, 1); | |
| 176 | res = lua_toboolean(L, -1); | |
| 177 | lua_pop(L, 1); | |
| 178 | return res; | |
| 179 | } | |
| 180 | else /* a < b? */ | |
| 181 | return lua_compare(L, a, b, LUA_OPLT); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | static void auxsort (lua_State *L, int l, int u) { |
| 185 | while (l < u) { /* for tail recursion */ | |
| 186 | int i, j; | |
| 187 | /* sort elements a[l], a[(l+u)/2] and a[u] */ | |
| 188 | lua_rawgeti(L, 1, l); | |
| 189 | lua_rawgeti(L, 1, u); | |
| 190 | if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */ | |
| 191 | set2(L, l, u); /* swap a[l] - a[u] */ | |
| 192 | else | |
| 193 | lua_pop(L, 2); | |
| 194 | if (u-l == 1) break; /* only 2 elements */ | |
| 195 | i = (l+u)/2; | |
| 196 | lua_rawgeti(L, 1, i); | |
| 197 | lua_rawgeti(L, 1, l); | |
| 198 | if (sort_comp(L, -2, -1)) /* a[i]<a[l]? */ | |
| 199 | set2(L, i, l); | |
| 200 | else { | |
| 201 | lua_pop(L, 1); /* remove a[l] */ | |
| 202 | lua_rawgeti(L, 1, u); | |
| 203 | if (sort_comp(L, -1, -2)) /* a[u]<a[i]? */ | |
| 204 | set2(L, i, u); | |
| 205 | else | |
| 206 | lua_pop(L, 2); | |
| 207 | } | |
| 208 | if (u-l == 2) break; /* only 3 elements */ | |
| 209 | lua_rawgeti(L, 1, i); /* Pivot */ | |
| 210 | lua_pushvalue(L, -1); | |
| 211 | lua_rawgeti(L, 1, u-1); | |
| 212 | set2(L, i, u-1); | |
| 213 | /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */ | |
| 214 | i = l; j = u-1; | |
| 215 | for (;;) { /* invariant: a[l..i] <= P <= a[j..u] */ | |
| 216 | /* repeat ++i until a[i] >= P */ | |
| 217 | while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { | |
| 218 | if (i>=u) luaL_error(L, "invalid order function for sorting"); | |
| 219 | lua_pop(L, 1); /* remove a[i] */ | |
| 220 | } | |
| 221 | /* repeat --j until a[j] <= P */ | |
| 222 | while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { | |
| 223 | if (j<=l) luaL_error(L, "invalid order function for sorting"); | |
| 224 | lua_pop(L, 1); /* remove a[j] */ | |
| 225 | } | |
| 226 | if (j<i) { | |
| 227 | lua_pop(L, 3); /* pop pivot, a[i], a[j] */ | |
| 228 | break; | |
| 229 | } | |
| 230 | set2(L, i, j); | |
| 231 | } | |
| 232 | lua_rawgeti(L, 1, u-1); | |
| 233 | lua_rawgeti(L, 1, i); | |
| 234 | set2(L, u-1, i); /* swap pivot (a[u-1]) with a[i] */ | |
| 235 | /* a[l..i-1] <= a[i] == P <= a[i+1..u] */ | |
| 236 | /* adjust so that smaller half is in [j..i] and larger one in [l..u] */ | |
| 237 | if (i-l < u-i) { | |
| 238 | j=l; i=i-1; l=i+2; | |
| 239 | } | |
| 240 | else { | |
| 241 | j=i+1; i=u; u=j-2; | |
| 242 | } | |
| 243 | auxsort(L, j, i); /* call recursively the smaller one */ | |
| 244 | } /* repeat the routine for the larger one */ | |
| 185 | while (l < u) { /* for tail recursion */ | |
| 186 | int i, j; | |
| 187 | /* sort elements a[l], a[(l+u)/2] and a[u] */ | |
| 188 | lua_rawgeti(L, 1, l); | |
| 189 | lua_rawgeti(L, 1, u); | |
| 190 | if (sort_comp(L, -1, -2)) /* a[u] < a[l]? */ | |
| 191 | set2(L, l, u); /* swap a[l] - a[u] */ | |
| 192 | else | |
| 193 | lua_pop(L, 2); | |
| 194 | if (u-l == 1) break; /* only 2 elements */ | |
| 195 | i = (l+u)/2; | |
| 196 | lua_rawgeti(L, 1, i); | |
| 197 | lua_rawgeti(L, 1, l); | |
| 198 | if (sort_comp(L, -2, -1)) /* a[i]<a[l]? */ | |
| 199 | set2(L, i, l); | |
| 200 | else { | |
| 201 | lua_pop(L, 1); /* remove a[l] */ | |
| 202 | lua_rawgeti(L, 1, u); | |
| 203 | if (sort_comp(L, -1, -2)) /* a[u]<a[i]? */ | |
| 204 | set2(L, i, u); | |
| 205 | else | |
| 206 | lua_pop(L, 2); | |
| 207 | } | |
| 208 | if (u-l == 2) break; /* only 3 elements */ | |
| 209 | lua_rawgeti(L, 1, i); /* Pivot */ | |
| 210 | lua_pushvalue(L, -1); | |
| 211 | lua_rawgeti(L, 1, u-1); | |
| 212 | set2(L, i, u-1); | |
| 213 | /* a[l] <= P == a[u-1] <= a[u], only need to sort from l+1 to u-2 */ | |
| 214 | i = l; j = u-1; | |
| 215 | for (;;) { /* invariant: a[l..i] <= P <= a[j..u] */ | |
| 216 | /* repeat ++i until a[i] >= P */ | |
| 217 | while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { | |
| 218 | if (i>=u) luaL_error(L, "invalid order function for sorting"); | |
| 219 | lua_pop(L, 1); /* remove a[i] */ | |
| 220 | } | |
| 221 | /* repeat --j until a[j] <= P */ | |
| 222 | while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { | |
| 223 | if (j<=l) luaL_error(L, "invalid order function for sorting"); | |
| 224 | lua_pop(L, 1); /* remove a[j] */ | |
| 225 | } | |
| 226 | if (j<i) { | |
| 227 | lua_pop(L, 3); /* pop pivot, a[i], a[j] */ | |
| 228 | break; | |
| 229 | } | |
| 230 | set2(L, i, j); | |
| 231 | } | |
| 232 | lua_rawgeti(L, 1, u-1); | |
| 233 | lua_rawgeti(L, 1, i); | |
| 234 | set2(L, u-1, i); /* swap pivot (a[u-1]) with a[i] */ | |
| 235 | /* a[l..i-1] <= a[i] == P <= a[i+1..u] */ | |
| 236 | /* adjust so that smaller half is in [j..i] and larger one in [l..u] */ | |
| 237 | if (i-l < u-i) { | |
| 238 | j=l; i=i-1; l=i+2; | |
| 239 | } | |
| 240 | else { | |
| 241 | j=i+1; i=u; u=j-2; | |
| 242 | } | |
| 243 | auxsort(L, j, i); /* call recursively the smaller one */ | |
| 244 | } /* repeat the routine for the larger one */ | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | static int sort (lua_State *L) { |
| 248 | int n = aux_getn(L, 1); | |
| 249 | luaL_checkstack(L, 40, ""); /* assume array is smaller than 2^40 */ | |
| 250 | if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ | |
| 251 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 252 | lua_settop(L, 2); /* make sure there is two arguments */ | |
| 253 | auxsort(L, 1, n); | |
| 254 | return 0; | |
| 248 | int n = aux_getn(L, 1); | |
| 249 | luaL_checkstack(L, 40, ""); /* assume array is smaller than 2^40 */ | |
| 250 | if (!lua_isnoneornil(L, 2)) /* is there a 2nd argument? */ | |
| 251 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 252 | lua_settop(L, 2); /* make sure there is two arguments */ | |
| 253 | auxsort(L, 1, n); | |
| 254 | return 0; | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | /* }====================================================== */ |
| 258 | 258 | |
| 259 | 259 | |
| 260 | 260 | static const luaL_Reg tab_funcs[] = { |
| 261 | ||
| 261 | {"concat", tconcat}, | |
| 262 | 262 | #if defined(LUA_COMPAT_MAXN) |
| 263 | ||
| 263 | {"maxn", maxn}, | |
| 264 | 264 | #endif |
| 265 | {"insert", tinsert}, | |
| 266 | {"pack", pack}, | |
| 267 | {"unpack", unpack}, | |
| 268 | {"remove", tremove}, | |
| 269 | {"sort", sort}, | |
| 270 | {NULL, NULL} | |
| 265 | {"insert", tinsert}, | |
| 266 | {"pack", pack}, | |
| 267 | {"unpack", unpack}, | |
| 268 | {"remove", tremove}, | |
| 269 | {"sort", sort}, | |
| 270 | {NULL, NULL} | |
| 271 | 271 | }; |
| 272 | 272 | |
| 273 | 273 | |
| 274 | 274 | LUAMOD_API int luaopen_table (lua_State *L) { |
| 275 | ||
| 275 | luaL_newlib(L, tab_funcs); | |
| 276 | 276 | #if defined(LUA_COMPAT_UNPACK) |
| 277 | /* _G.unpack = table.unpack */ | |
| 278 | lua_getfield(L, -1, "unpack"); | |
| 279 | lua_setglobal(L, "unpack"); | |
| 277 | /* _G.unpack = table.unpack */ | |
| 278 | lua_getfield(L, -1, "unpack"); | |
| 279 | lua_setglobal(L, "unpack"); | |
| 280 | 280 | #endif |
| 281 | ||
| 281 | return 1; | |
| 282 | 282 | } |
| 283 |
| r31373 | r31374 | |
|---|---|---|
| 10 | 10 | ** should not affect non-POSIX systems |
| 11 | 11 | */ |
| 12 | 12 | #if !defined(_FILE_OFFSET_BITS) |
| 13 | #define _LARGEFILE_SOURCE 1 | |
| 14 | #define _FILE_OFFSET_BITS 64 | |
| 13 | #define _LARGEFILE_SOURCE 1 | |
| 14 | #define _FILE_OFFSET_BITS 64 | |
| 15 | 15 | #endif |
| 16 | 16 | |
| 17 | 17 | |
| r31373 | r31374 | |
| 37 | 37 | ** the standard ones. |
| 38 | 38 | */ |
| 39 | 39 | #define lua_checkmode(mode) \ |
| 40 | (*mode != '\0' && strchr("rwa", *(mode++)) != NULL && \ | |
| 41 | (*mode != '+' || ++mode) && /* skip if char is '+' */ \ | |
| 42 | (*mode != 'b' || ++mode) && /* skip if char is 'b' */ \ | |
| 40 | (*mode != '\0' && strchr("rwa", *(mode++)) != NULL && \ | |
| 41 | (*mode != '+' || ++mode) && /* skip if char is '+' */ \ | |
| 42 | (*mode != 'b' || ++mode) && /* skip if char is 'b' */ \ | |
| 43 | 43 | (*mode == '\0')) |
| 44 | 44 | |
| 45 | 45 | #endif |
| r31373 | r31374 | |
| 51 | 51 | ** ======================================================= |
| 52 | 52 | */ |
| 53 | 53 | |
| 54 | #if !defined(lua_popen) | |
| 54 | #if !defined(lua_popen) /* { */ | |
| 55 | 55 | |
| 56 | #if defined(LUA_USE_POPEN) | |
| 56 | #if defined(LUA_USE_POPEN) /* { */ | |
| 57 | 57 | |
| 58 | #define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) | |
| 59 | #define lua_pclose(L,file) ((void)L, pclose(file)) | |
| 58 | #define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) | |
| 59 | #define lua_pclose(L,file) ((void)L, pclose(file)) | |
| 60 | 60 | |
| 61 | #elif defined(LUA_WIN) | |
| 61 | #elif defined(LUA_WIN) /* }{ */ | |
| 62 | 62 | |
| 63 | #define lua_popen(L,c,m) ((void)L, _popen(c,m)) | |
| 64 | #define lua_pclose(L,file) ((void)L, _pclose(file)) | |
| 63 | #define lua_popen(L,c,m) ((void)L, _popen(c,m)) | |
| 64 | #define lua_pclose(L,file) ((void)L, _pclose(file)) | |
| 65 | 65 | |
| 66 | 66 | |
| 67 | #else | |
| 67 | #else /* }{ */ | |
| 68 | 68 | |
| 69 | #define lua_popen(L,c,m) | |
| 69 | #define lua_popen(L,c,m) ((void)((void)c, m), \ | |
| 70 | 70 | luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) |
| 71 | #define lua_pclose(L,file) | |
| 71 | #define lua_pclose(L,file) ((void)((void)L, file), -1) | |
| 72 | 72 | |
| 73 | 73 | |
| 74 | #endif | |
| 74 | #endif /* } */ | |
| 75 | 75 | |
| 76 | #endif | |
| 76 | #endif /* } */ | |
| 77 | 77 | |
| 78 | 78 | /* }====================================================== */ |
| 79 | 79 | |
| r31373 | r31374 | |
| 84 | 84 | ** ======================================================= |
| 85 | 85 | */ |
| 86 | 86 | |
| 87 | #if !defined(lua_fseek) | |
| 87 | #if !defined(lua_fseek) && !defined(LUA_ANSI) /* { */ | |
| 88 | 88 | |
| 89 | #if defined(LUA_USE_POSIX) | |
| 89 | #if defined(LUA_USE_POSIX) /* { */ | |
| 90 | 90 | |
| 91 | #define l_fseek(f,o,w) fseeko(f,o,w) | |
| 92 | #define l_ftell(f) ftello(f) | |
| 93 | #define l_seeknum off_t | |
| 91 | #define l_fseek(f,o,w) fseeko(f,o,w) | |
| 92 | #define l_ftell(f) ftello(f) | |
| 93 | #define l_seeknum off_t | |
| 94 | 94 | |
| 95 | 95 | #elif defined(LUA_WIN) && !defined(_CRTIMP_TYPEINFO) \ |
| 96 | ||
| 96 | && defined(_MSC_VER) && (_MSC_VER >= 1400) /* }{ */ | |
| 97 | 97 | /* Windows (but not DDK) and Visual C++ 2005 or higher */ |
| 98 | 98 | |
| 99 | #define l_fseek(f,o,w) _fseeki64(f,o,w) | |
| 100 | #define l_ftell(f) _ftelli64(f) | |
| 101 | #define l_seeknum __int64 | |
| 99 | #define l_fseek(f,o,w) _fseeki64(f,o,w) | |
| 100 | #define l_ftell(f) _ftelli64(f) | |
| 101 | #define l_seeknum __int64 | |
| 102 | 102 | |
| 103 | #endif | |
| 103 | #endif /* } */ | |
| 104 | 104 | |
| 105 | #endif | |
| 105 | #endif /* } */ | |
| 106 | 106 | |
| 107 | 107 | |
| 108 | #if !defined(l_fseek) /* default definitions */ | |
| 109 | #define l_fseek(f,o,w) fseek(f,o,w) | |
| 110 | #define l_ftell(f) ftell(f) | |
| 111 | #define l_seeknum long | |
| 108 | #if !defined(l_fseek) /* default definitions */ | |
| 109 | #define l_fseek(f,o,w) fseek(f,o,w) | |
| 110 | #define l_ftell(f) ftell(f) | |
| 111 | #define l_seeknum long | |
| 112 | 112 | #endif |
| 113 | 113 | |
| 114 | 114 | /* }====================================================== */ |
| 115 | 115 | |
| 116 | 116 | |
| 117 | #define IO_PREFIX "_IO_" | |
| 118 | #define IO_INPUT (IO_PREFIX "input") | |
| 119 | #define IO_OUTPUT (IO_PREFIX "output") | |
| 117 | #define IO_PREFIX "_IO_" | |
| 118 | #define IO_INPUT (IO_PREFIX "input") | |
| 119 | #define IO_OUTPUT (IO_PREFIX "output") | |
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | typedef luaL_Stream LStream; |
| 123 | 123 | |
| 124 | 124 | |
| 125 | #define tolstream(L) | |
| 125 | #define tolstream(L) ((LStream *)luaL_checkudata(L, 1, LUA_FILEHANDLE)) | |
| 126 | 126 | |
| 127 | #define isclosed(p) | |
| 127 | #define isclosed(p) ((p)->closef == NULL) | |
| 128 | 128 | |
| 129 | 129 | |
| 130 | 130 | static int io_type (lua_State *L) { |
| 131 | LStream *p; | |
| 132 | luaL_checkany(L, 1); | |
| 133 | p = (LStream *)luaL_testudata(L, 1, LUA_FILEHANDLE); | |
| 134 | if (p == NULL) | |
| 135 | lua_pushnil(L); /* not a file */ | |
| 136 | else if (isclosed(p)) | |
| 137 | lua_pushliteral(L, "closed file"); | |
| 138 | else | |
| 139 | lua_pushliteral(L, "file"); | |
| 140 | return 1; | |
| 131 | LStream *p; | |
| 132 | luaL_checkany(L, 1); | |
| 133 | p = (LStream *)luaL_testudata(L, 1, LUA_FILEHANDLE); | |
| 134 | if (p == NULL) | |
| 135 | lua_pushnil(L); /* not a file */ | |
| 136 | else if (isclosed(p)) | |
| 137 | lua_pushliteral(L, "closed file"); | |
| 138 | else | |
| 139 | lua_pushliteral(L, "file"); | |
| 140 | return 1; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | static int f_tostring (lua_State *L) { |
| 145 | LStream *p = tolstream(L); | |
| 146 | if (isclosed(p)) | |
| 147 | lua_pushliteral(L, "file (closed)"); | |
| 148 | else | |
| 149 | lua_pushfstring(L, "file (%p)", p->f); | |
| 150 | return 1; | |
| 145 | LStream *p = tolstream(L); | |
| 146 | if (isclosed(p)) | |
| 147 | lua_pushliteral(L, "file (closed)"); | |
| 148 | else | |
| 149 | lua_pushfstring(L, "file (%p)", p->f); | |
| 150 | return 1; | |
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
| 154 | 154 | static FILE *tofile (lua_State *L) { |
| 155 | LStream *p = tolstream(L); | |
| 156 | if (isclosed(p)) | |
| 157 | luaL_error(L, "attempt to use a closed file"); | |
| 158 | lua_assert(p->f); | |
| 159 | return p->f; | |
| 155 | LStream *p = tolstream(L); | |
| 156 | if (isclosed(p)) | |
| 157 | luaL_error(L, "attempt to use a closed file"); | |
| 158 | lua_assert(p->f); | |
| 159 | return p->f; | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| r31373 | r31374 | |
| 166 | 166 | ** file is not left opened. |
| 167 | 167 | */ |
| 168 | 168 | static LStream *newprefile (lua_State *L) { |
| 169 | LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream)); | |
| 170 | p->closef = NULL; /* mark file handle as 'closed' */ | |
| 171 | luaL_setmetatable(L, LUA_FILEHANDLE); | |
| 172 | return p; | |
| 169 | LStream *p = (LStream *)lua_newuserdata(L, sizeof(LStream)); | |
| 170 | p->closef = NULL; /* mark file handle as 'closed' */ | |
| 171 | luaL_setmetatable(L, LUA_FILEHANDLE); | |
| 172 | return p; | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| 176 | 176 | static int aux_close (lua_State *L) { |
| 177 | LStream *p = tolstream(L); | |
| 178 | lua_CFunction cf = p->closef; | |
| 179 | p->closef = NULL; /* mark stream as closed */ | |
| 180 | return (*cf)(L); /* close it */ | |
| 177 | LStream *p = tolstream(L); | |
| 178 | lua_CFunction cf = p->closef; | |
| 179 | p->closef = NULL; /* mark stream as closed */ | |
| 180 | return (*cf)(L); /* close it */ | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | 184 | static int io_close (lua_State *L) { |
| 185 | if (lua_isnone(L, 1)) /* no argument? */ | |
| 186 | lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */ | |
| 187 | tofile(L); /* make sure argument is an open stream */ | |
| 188 | return aux_close(L); | |
| 185 | if (lua_isnone(L, 1)) /* no argument? */ | |
| 186 | lua_getfield(L, LUA_REGISTRYINDEX, IO_OUTPUT); /* use standard output */ | |
| 187 | tofile(L); /* make sure argument is an open stream */ | |
| 188 | return aux_close(L); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
| 192 | 192 | static int f_gc (lua_State *L) { |
| 193 | LStream *p = tolstream(L); | |
| 194 | if (!isclosed(p) && p->f != NULL) | |
| 195 | aux_close(L); /* ignore closed and incompletely open files */ | |
| 196 | return 0; | |
| 193 | LStream *p = tolstream(L); | |
| 194 | if (!isclosed(p) && p->f != NULL) | |
| 195 | aux_close(L); /* ignore closed and incompletely open files */ | |
| 196 | return 0; | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| r31373 | r31374 | |
| 201 | 201 | ** function to close regular files |
| 202 | 202 | */ |
| 203 | 203 | static int io_fclose (lua_State *L) { |
| 204 | LStream *p = tolstream(L); | |
| 205 | int res = fclose(p->f); | |
| 206 | return luaL_fileresult(L, (res == 0), NULL); | |
| 204 | LStream *p = tolstream(L); | |
| 205 | int res = fclose(p->f); | |
| 206 | return luaL_fileresult(L, (res == 0), NULL); | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | static LStream *newfile (lua_State *L) { |
| 211 | LStream *p = newprefile(L); | |
| 212 | p->f = NULL; | |
| 213 | p->closef = &io_fclose; | |
| 214 | return p; | |
| 211 | LStream *p = newprefile(L); | |
| 212 | p->f = NULL; | |
| 213 | p->closef = &io_fclose; | |
| 214 | return p; | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | static void opencheck (lua_State *L, const char *fname, const char *mode) { |
| 219 | LStream *p = newfile(L); | |
| 220 | p->f = fopen(fname, mode); | |
| 221 | if (p->f == NULL) | |
| 222 | luaL_error(L, "cannot open file " LUA_QS " (%s)", fname, strerror(errno)); | |
| 219 | LStream *p = newfile(L); | |
| 220 | p->f = fopen(fname, mode); | |
| 221 | if (p->f == NULL) | |
| 222 | luaL_error(L, "cannot open file " LUA_QS " (%s)", fname, strerror(errno)); | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | |
| 226 | 226 | static int io_open (lua_State *L) { |
| 227 | const char *filename = luaL_checkstring(L, 1); | |
| 228 | const char *mode = luaL_optstring(L, 2, "r"); | |
| 229 | LStream *p = newfile(L); | |
| 230 | const char *md = mode; /* to traverse/check mode */ | |
| 231 | luaL_argcheck(L, lua_checkmode(md), 2, "invalid mode"); | |
| 232 | p->f = fopen(filename, mode); | |
| 233 | return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; | |
| 227 | const char *filename = luaL_checkstring(L, 1); | |
| 228 | const char *mode = luaL_optstring(L, 2, "r"); | |
| 229 | LStream *p = newfile(L); | |
| 230 | const char *md = mode; /* to traverse/check mode */ | |
| 231 | luaL_argcheck(L, lua_checkmode(md), 2, "invalid mode"); | |
| 232 | p->f = fopen(filename, mode); | |
| 233 | return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| r31373 | r31374 | |
| 238 | 238 | ** function to close 'popen' files |
| 239 | 239 | */ |
| 240 | 240 | static int io_pclose (lua_State *L) { |
| 241 | LStream *p = tolstream(L); | |
| 242 | return luaL_execresult(L, lua_pclose(L, p->f)); | |
| 241 | LStream *p = tolstream(L); | |
| 242 | return luaL_execresult(L, lua_pclose(L, p->f)); | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
| 246 | 246 | static int io_popen (lua_State *L) { |
| 247 | const char *filename = luaL_checkstring(L, 1); | |
| 248 | const char *mode = luaL_optstring(L, 2, "r"); | |
| 249 | LStream *p = newprefile(L); | |
| 250 | p->f = lua_popen(L, filename, mode); | |
| 251 | p->closef = &io_pclose; | |
| 252 | return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; | |
| 247 | const char *filename = luaL_checkstring(L, 1); | |
| 248 | const char *mode = luaL_optstring(L, 2, "r"); | |
| 249 | LStream *p = newprefile(L); | |
| 250 | p->f = lua_popen(L, filename, mode); | |
| 251 | p->closef = &io_pclose; | |
| 252 | return (p->f == NULL) ? luaL_fileresult(L, 0, filename) : 1; | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | static int io_tmpfile (lua_State *L) { |
| 257 | LStream *p = newfile(L); | |
| 258 | p->f = tmpfile(); | |
| 259 | return (p->f == NULL) ? luaL_fileresult(L, 0, NULL) : 1; | |
| 257 | LStream *p = newfile(L); | |
| 258 | p->f = tmpfile(); | |
| 259 | return (p->f == NULL) ? luaL_fileresult(L, 0, NULL) : 1; | |
| 260 | 260 | } |
| 261 | 261 | |
| 262 | 262 | |
| 263 | 263 | static FILE *getiofile (lua_State *L, const char *findex) { |
| 264 | LStream *p; | |
| 265 | lua_getfield(L, LUA_REGISTRYINDEX, findex); | |
| 266 | p = (LStream *)lua_touserdata(L, -1); | |
| 267 | if (isclosed(p)) | |
| 268 | luaL_error(L, "standard %s file is closed", findex + strlen(IO_PREFIX)); | |
| 269 | return p->f; | |
| 264 | LStream *p; | |
| 265 | lua_getfield(L, LUA_REGISTRYINDEX, findex); | |
| 266 | p = (LStream *)lua_touserdata(L, -1); | |
| 267 | if (isclosed(p)) | |
| 268 | luaL_error(L, "standard %s file is closed", findex + strlen(IO_PREFIX)); | |
| 269 | return p->f; | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | |
| 273 | 273 | static int g_iofile (lua_State *L, const char *f, const char *mode) { |
| 274 | if (!lua_isnoneornil(L, 1)) { | |
| 275 | const char *filename = lua_tostring(L, 1); | |
| 276 | if (filename) | |
| 277 | opencheck(L, filename, mode); | |
| 278 | else { | |
| 279 | tofile(L); /* check that it's a valid file handle */ | |
| 280 | lua_pushvalue(L, 1); | |
| 281 | } | |
| 282 | lua_setfield(L, LUA_REGISTRYINDEX, f); | |
| 283 | } | |
| 284 | /* return current value */ | |
| 285 | lua_getfield(L, LUA_REGISTRYINDEX, f); | |
| 286 | return 1; | |
| 274 | if (!lua_isnoneornil(L, 1)) { | |
| 275 | const char *filename = lua_tostring(L, 1); | |
| 276 | if (filename) | |
| 277 | opencheck(L, filename, mode); | |
| 278 | else { | |
| 279 | tofile(L); /* check that it's a valid file handle */ | |
| 280 | lua_pushvalue(L, 1); | |
| 281 | } | |
| 282 | lua_setfield(L, LUA_REGISTRYINDEX, f); | |
| 283 | } | |
| 284 | /* return current value */ | |
| 285 | lua_getfield(L, LUA_REGISTRYINDEX, f); | |
| 286 | return 1; | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | 289 | |
| 290 | 290 | static int io_input (lua_State *L) { |
| 291 | ||
| 291 | return g_iofile(L, IO_INPUT, "r"); | |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | |
| 295 | 295 | static int io_output (lua_State *L) { |
| 296 | ||
| 296 | return g_iofile(L, IO_OUTPUT, "w"); | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
| r31373 | r31374 | |
| 301 | 301 | |
| 302 | 302 | |
| 303 | 303 | static void aux_lines (lua_State *L, int toclose) { |
| 304 | int i; | |
| 305 | int n = lua_gettop(L) - 1; /* number of arguments to read */ | |
| 306 | /* ensure that arguments will fit here and into 'io_readline' stack */ | |
| 307 | luaL_argcheck(L, n <= LUA_MINSTACK - 3, LUA_MINSTACK - 3, "too many options"); | |
| 308 | lua_pushvalue(L, 1); /* file handle */ | |
| 309 | lua_pushinteger(L, n); /* number of arguments to read */ | |
| 310 | lua_pushboolean(L, toclose); /* close/not close file when finished */ | |
| 311 | for (i = 1; i <= n; i++) lua_pushvalue(L, i + 1); /* copy arguments */ | |
| 312 | lua_pushcclosure(L, io_readline, 3 + n); | |
| 304 | int i; | |
| 305 | int n = lua_gettop(L) - 1; /* number of arguments to read */ | |
| 306 | /* ensure that arguments will fit here and into 'io_readline' stack */ | |
| 307 | luaL_argcheck(L, n <= LUA_MINSTACK - 3, LUA_MINSTACK - 3, "too many options"); | |
| 308 | lua_pushvalue(L, 1); /* file handle */ | |
| 309 | lua_pushinteger(L, n); /* number of arguments to read */ | |
| 310 | lua_pushboolean(L, toclose); /* close/not close file when finished */ | |
| 311 | for (i = 1; i <= n; i++) lua_pushvalue(L, i + 1); /* copy arguments */ | |
| 312 | lua_pushcclosure(L, io_readline, 3 + n); | |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | |
| 316 | 316 | static int f_lines (lua_State *L) { |
| 317 | tofile(L); /* check that it's a valid file handle */ | |
| 318 | aux_lines(L, 0); | |
| 319 | return 1; | |
| 317 | tofile(L); /* check that it's a valid file handle */ | |
| 318 | aux_lines(L, 0); | |
| 319 | return 1; | |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | 322 | |
| 323 | 323 | static int io_lines (lua_State *L) { |
| 324 | int toclose; | |
| 325 | if (lua_isnone(L, 1)) lua_pushnil(L); /* at least one argument */ | |
| 326 | if (lua_isnil(L, 1)) { /* no file name? */ | |
| 327 | lua_getfield(L, LUA_REGISTRYINDEX, IO_INPUT); /* get default input */ | |
| 328 | lua_replace(L, 1); /* put it at index 1 */ | |
| 329 | tofile(L); /* check that it's a valid file handle */ | |
| 330 | toclose = 0; /* do not close it after iteration */ | |
| 331 | } | |
| 332 | else { /* open a new file */ | |
| 333 | const char *filename = luaL_checkstring(L, 1); | |
| 334 | opencheck(L, filename, "r"); | |
| 335 | lua_replace(L, 1); /* put file at index 1 */ | |
| 336 | toclose = 1; /* close it after iteration */ | |
| 337 | } | |
| 338 | aux_lines(L, toclose); | |
| 339 | return 1; | |
| 324 | int toclose; | |
| 325 | if (lua_isnone(L, 1)) lua_pushnil(L); /* at least one argument */ | |
| 326 | if (lua_isnil(L, 1)) { /* no file name? */ | |
| 327 | lua_getfield(L, LUA_REGISTRYINDEX, IO_INPUT); /* get default input */ | |
| 328 | lua_replace(L, 1); /* put it at index 1 */ | |
| 329 | tofile(L); /* check that it's a valid file handle */ | |
| 330 | toclose = 0; /* do not close it after iteration */ | |
| 331 | } | |
| 332 | else { /* open a new file */ | |
| 333 | const char *filename = luaL_checkstring(L, 1); | |
| 334 | opencheck(L, filename, "r"); | |
| 335 | lua_replace(L, 1); /* put file at index 1 */ | |
| 336 | toclose = 1; /* close it after iteration */ | |
| 337 | } | |
| 338 | aux_lines(L, toclose); | |
| 339 | return 1; | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| r31373 | r31374 | |
| 348 | 348 | |
| 349 | 349 | |
| 350 | 350 | static int read_number (lua_State *L, FILE *f) { |
| 351 | lua_Number d; | |
| 352 | if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { | |
| 353 | lua_pushnumber(L, d); | |
| 354 | return 1; | |
| 355 | } | |
| 356 | else { | |
| 357 | lua_pushnil(L); /* "result" to be removed */ | |
| 358 | return 0; /* read fails */ | |
| 359 | } | |
| 351 | lua_Number d; | |
| 352 | if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { | |
| 353 | lua_pushnumber(L, d); | |
| 354 | return 1; | |
| 355 | } | |
| 356 | else { | |
| 357 | lua_pushnil(L); /* "result" to be removed */ | |
| 358 | return 0; /* read fails */ | |
| 359 | } | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | |
| 363 | 363 | static int test_eof (lua_State *L, FILE *f) { |
| 364 | int c = getc(f); | |
| 365 | ungetc(c, f); | |
| 366 | lua_pushlstring(L, NULL, 0); | |
| 367 | return (c != EOF); | |
| 364 | int c = getc(f); | |
| 365 | ungetc(c, f); | |
| 366 | lua_pushlstring(L, NULL, 0); | |
| 367 | return (c != EOF); | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | |
| 371 | 371 | static int read_line (lua_State *L, FILE *f, int chop) { |
| 372 | luaL_Buffer b; | |
| 373 | luaL_buffinit(L, &b); | |
| 374 | for (;;) { | |
| 375 | size_t l; | |
| 376 | char *p = luaL_prepbuffer(&b); | |
| 377 | if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ | |
| 378 | luaL_pushresult(&b); /* close buffer */ | |
| 379 | return (lua_rawlen(L, -1) > 0); /* check whether read something */ | |
| 380 | } | |
| 381 | l = strlen(p); | |
| 382 | if (l == 0 || p[l-1] != '\n') | |
| 383 | luaL_addsize(&b, l); | |
| 384 | else { | |
| 385 | luaL_addsize(&b, l - chop); /* chop 'eol' if needed */ | |
| 386 | luaL_pushresult(&b); /* close buffer */ | |
| 387 | return 1; /* read at least an `eol' */ | |
| 388 | } | |
| 389 | } | |
| 372 | luaL_Buffer b; | |
| 373 | luaL_buffinit(L, &b); | |
| 374 | for (;;) { | |
| 375 | size_t l; | |
| 376 | char *p = luaL_prepbuffer(&b); | |
| 377 | if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ | |
| 378 | luaL_pushresult(&b); /* close buffer */ | |
| 379 | return (lua_rawlen(L, -1) > 0); /* check whether read something */ | |
| 380 | } | |
| 381 | l = strlen(p); | |
| 382 | if (l == 0 || p[l-1] != '\n') | |
| 383 | luaL_addsize(&b, l); | |
| 384 | else { | |
| 385 | luaL_addsize(&b, l - chop); /* chop 'eol' if needed */ | |
| 386 | luaL_pushresult(&b); /* close buffer */ | |
| 387 | return 1; /* read at least an `eol' */ | |
| 388 | } | |
| 389 | } | |
| 390 | 390 | } |
| 391 | 391 | |
| 392 | 392 | |
| 393 | #define MAX_SIZE_T | |
| 393 | #define MAX_SIZE_T (~(size_t)0) | |
| 394 | 394 | |
| 395 | 395 | static void read_all (lua_State *L, FILE *f) { |
| 396 | size_t rlen = LUAL_BUFFERSIZE; /* how much to read in each cycle */ | |
| 397 | luaL_Buffer b; | |
| 398 | luaL_buffinit(L, &b); | |
| 399 | for (;;) { | |
| 400 | char *p = luaL_prepbuffsize(&b, rlen); | |
| 401 | size_t nr = fread(p, sizeof(char), rlen, f); | |
| 402 | luaL_addsize(&b, nr); | |
| 403 | if (nr < rlen) break; /* eof? */ | |
| 404 | else if (rlen <= (MAX_SIZE_T / 4)) /* avoid buffers too large */ | |
| 405 | rlen *= 2; /* double buffer size at each iteration */ | |
| 406 | } | |
| 407 | luaL_pushresult(&b); /* close buffer */ | |
| 396 | size_t rlen = LUAL_BUFFERSIZE; /* how much to read in each cycle */ | |
| 397 | luaL_Buffer b; | |
| 398 | luaL_buffinit(L, &b); | |
| 399 | for (;;) { | |
| 400 | char *p = luaL_prepbuffsize(&b, rlen); | |
| 401 | size_t nr = fread(p, sizeof(char), rlen, f); | |
| 402 | luaL_addsize(&b, nr); | |
| 403 | if (nr < rlen) break; /* eof? */ | |
| 404 | else if (rlen <= (MAX_SIZE_T / 4)) /* avoid buffers too large */ | |
| 405 | rlen *= 2; /* double buffer size at each iteration */ | |
| 406 | } | |
| 407 | luaL_pushresult(&b); /* close buffer */ | |
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | |
| 411 | 411 | static int read_chars (lua_State *L, FILE *f, size_t n) { |
| 412 | size_t nr; /* number of chars actually read */ | |
| 413 | char *p; | |
| 414 | luaL_Buffer b; | |
| 415 | luaL_buffinit(L, &b); | |
| 416 | p = luaL_prepbuffsize(&b, n); /* prepare buffer to read whole block */ | |
| 417 | nr = fread(p, sizeof(char), n, f); /* try to read 'n' chars */ | |
| 418 | luaL_addsize(&b, nr); | |
| 419 | luaL_pushresult(&b); /* close buffer */ | |
| 420 | return (nr > 0); /* true iff read something */ | |
| 412 | size_t nr; /* number of chars actually read */ | |
| 413 | char *p; | |
| 414 | luaL_Buffer b; | |
| 415 | luaL_buffinit(L, &b); | |
| 416 | p = luaL_prepbuffsize(&b, n); /* prepare buffer to read whole block */ | |
| 417 | nr = fread(p, sizeof(char), n, f); /* try to read 'n' chars */ | |
| 418 | luaL_addsize(&b, nr); | |
| 419 | luaL_pushresult(&b); /* close buffer */ | |
| 420 | return (nr > 0); /* true iff read something */ | |
| 421 | 421 | } |
| 422 | 422 | |
| 423 | 423 | |
| 424 | 424 | static int g_read (lua_State *L, FILE *f, int first) { |
| 425 | int nargs = lua_gettop(L) - 1; | |
| 426 | int success; | |
| 427 | int n; | |
| 428 | clearerr(f); | |
| 429 | if (nargs == 0) { /* no arguments? */ | |
| 430 | success = read_line(L, f, 1); | |
| 431 | n = first+1; /* to return 1 result */ | |
| 432 | } | |
| 433 | else { /* ensure stack space for all results and for auxlib's buffer */ | |
| 434 | luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); | |
| 435 | success = 1; | |
| 436 | for (n = first; nargs-- && success; n++) { | |
| 437 | if (lua_type(L, n) == LUA_TNUMBER) { | |
| 438 | size_t l = (size_t)lua_tointeger(L, n); | |
| 439 | success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); | |
| 440 | } | |
| 441 | else { | |
| 442 | const char *p = lua_tostring(L, n); | |
| 443 | luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); | |
| 444 | switch (p[1]) { | |
| 445 | case 'n': /* number */ | |
| 446 | success = read_number(L, f); | |
| 447 | break; | |
| 448 | case 'l': /* line */ | |
| 449 | success = read_line(L, f, 1); | |
| 450 | break; | |
| 451 | case 'L': /* line with end-of-line */ | |
| 452 | success = read_line(L, f, 0); | |
| 453 | break; | |
| 454 | case 'a': /* file */ | |
| 455 | read_all(L, f); /* read entire file */ | |
| 456 | success = 1; /* always success */ | |
| 457 | break; | |
| 458 | default: | |
| 459 | return luaL_argerror(L, n, "invalid format"); | |
| 460 | } | |
| 461 | } | |
| 462 | } | |
| 463 | } | |
| 464 | if (ferror(f)) | |
| 465 | return luaL_fileresult(L, 0, NULL); | |
| 466 | if (!success) { | |
| 467 | lua_pop(L, 1); /* remove last result */ | |
| 468 | lua_pushnil(L); /* push nil instead */ | |
| 469 | } | |
| 470 | return n - first; | |
| 425 | int nargs = lua_gettop(L) - 1; | |
| 426 | int success; | |
| 427 | int n; | |
| 428 | clearerr(f); | |
| 429 | if (nargs == 0) { /* no arguments? */ | |
| 430 | success = read_line(L, f, 1); | |
| 431 | n = first+1; /* to return 1 result */ | |
| 432 | } | |
| 433 | else { /* ensure stack space for all results and for auxlib's buffer */ | |
| 434 | luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); | |
| 435 | success = 1; | |
| 436 | for (n = first; nargs-- && success; n++) { | |
| 437 | if (lua_type(L, n) == LUA_TNUMBER) { | |
| 438 | size_t l = (size_t)lua_tointeger(L, n); | |
| 439 | success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); | |
| 440 | } | |
| 441 | else { | |
| 442 | const char *p = lua_tostring(L, n); | |
| 443 | luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); | |
| 444 | switch (p[1]) { | |
| 445 | case 'n': /* number */ | |
| 446 | success = read_number(L, f); | |
| 447 | break; | |
| 448 | case 'l': /* line */ | |
| 449 | success = read_line(L, f, 1); | |
| 450 | break; | |
| 451 | case 'L': /* line with end-of-line */ | |
| 452 | success = read_line(L, f, 0); | |
| 453 | break; | |
| 454 | case 'a': /* file */ | |
| 455 | read_all(L, f); /* read entire file */ | |
| 456 | success = 1; /* always success */ | |
| 457 | break; | |
| 458 | default: | |
| 459 | return luaL_argerror(L, n, "invalid format"); | |
| 460 | } | |
| 461 | } | |
| 462 | } | |
| 463 | } | |
| 464 | if (ferror(f)) | |
| 465 | return luaL_fileresult(L, 0, NULL); | |
| 466 | if (!success) { | |
| 467 | lua_pop(L, 1); /* remove last result */ | |
| 468 | lua_pushnil(L); /* push nil instead */ | |
| 469 | } | |
| 470 | return n - first; | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | |
| 474 | 474 | static int io_read (lua_State *L) { |
| 475 | ||
| 475 | return g_read(L, getiofile(L, IO_INPUT), 1); | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | |
| 479 | 479 | static int f_read (lua_State *L) { |
| 480 | ||
| 480 | return g_read(L, tofile(L), 2); | |
| 481 | 481 | } |
| 482 | 482 | |
| 483 | 483 | |
| 484 | 484 | static int io_readline (lua_State *L) { |
| 485 | LStream *p = (LStream *)lua_touserdata(L, lua_upvalueindex(1)); | |
| 486 | int i; | |
| 487 | int n = (int)lua_tointeger(L, lua_upvalueindex(2)); | |
| 488 | if (isclosed(p)) /* file is already closed? */ | |
| 489 | return luaL_error(L, "file is already closed"); | |
| 490 | lua_settop(L , 1); | |
| 491 | for (i = 1; i <= n; i++) /* push arguments to 'g_read' */ | |
| 492 | lua_pushvalue(L, lua_upvalueindex(3 + i)); | |
| 493 | n = g_read(L, p->f, 2); /* 'n' is number of results */ | |
| 494 | lua_assert(n > 0); /* should return at least a nil */ | |
| 495 | if (!lua_isnil(L, -n)) /* read at least one value? */ | |
| 496 | return n; /* return them */ | |
| 497 | else { /* first result is nil: EOF or error */ | |
| 498 | if (n > 1) { /* is there error information? */ | |
| 499 | /* 2nd result is error message */ | |
| 500 | return luaL_error(L, "%s", lua_tostring(L, -n + 1)); | |
| 501 | } | |
| 502 | if (lua_toboolean(L, lua_upvalueindex(3))) { /* generator created file? */ | |
| 503 | lua_settop(L, 0); | |
| 504 | lua_pushvalue(L, lua_upvalueindex(1)); | |
| 505 | aux_close(L); /* close it */ | |
| 506 | } | |
| 507 | return 0; | |
| 508 | } | |
| 485 | LStream *p = (LStream *)lua_touserdata(L, lua_upvalueindex(1)); | |
| 486 | int i; | |
| 487 | int n = (int)lua_tointeger(L, lua_upvalueindex(2)); | |
| 488 | if (isclosed(p)) /* file is already closed? */ | |
| 489 | return luaL_error(L, "file is already closed"); | |
| 490 | lua_settop(L , 1); | |
| 491 | for (i = 1; i <= n; i++) /* push arguments to 'g_read' */ | |
| 492 | lua_pushvalue(L, lua_upvalueindex(3 + i)); | |
| 493 | n = g_read(L, p->f, 2); /* 'n' is number of results */ | |
| 494 | lua_assert(n > 0); /* should return at least a nil */ | |
| 495 | if (!lua_isnil(L, -n)) /* read at least one value? */ | |
| 496 | return n; /* return them */ | |
| 497 | else { /* first result is nil: EOF or error */ | |
| 498 | if (n > 1) { /* is there error information? */ | |
| 499 | /* 2nd result is error message */ | |
| 500 | return luaL_error(L, "%s", lua_tostring(L, -n + 1)); | |
| 501 | } | |
| 502 | if (lua_toboolean(L, lua_upvalueindex(3))) { /* generator created file? */ | |
| 503 | lua_settop(L, 0); | |
| 504 | lua_pushvalue(L, lua_upvalueindex(1)); | |
| 505 | aux_close(L); /* close it */ | |
| 506 | } | |
| 507 | return 0; | |
| 508 | } | |
| 509 | 509 | } |
| 510 | 510 | |
| 511 | 511 | /* }====================================================== */ |
| 512 | 512 | |
| 513 | 513 | |
| 514 | 514 | static int g_write (lua_State *L, FILE *f, int arg) { |
| 515 | int nargs = lua_gettop(L) - arg; | |
| 516 | int status = 1; | |
| 517 | for (; nargs--; arg++) { | |
| 518 | if (lua_type(L, arg) == LUA_TNUMBER) { | |
| 519 | /* optimization: could be done exactly as for strings */ | |
| 520 | status = status && | |
| 521 | fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; | |
| 522 | } | |
| 523 | else { | |
| 524 | size_t l; | |
| 525 | const char *s = luaL_checklstring(L, arg, &l); | |
| 526 | status = status && (fwrite(s, sizeof(char), l, f) == l); | |
| 527 | } | |
| 528 | } | |
| 529 | if (status) return 1; /* file handle already on stack top */ | |
| 530 | else return luaL_fileresult(L, status, NULL); | |
| 515 | int nargs = lua_gettop(L) - arg; | |
| 516 | int status = 1; | |
| 517 | for (; nargs--; arg++) { | |
| 518 | if (lua_type(L, arg) == LUA_TNUMBER) { | |
| 519 | /* optimization: could be done exactly as for strings */ | |
| 520 | status = status && | |
| 521 | fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; | |
| 522 | } | |
| 523 | else { | |
| 524 | size_t l; | |
| 525 | const char *s = luaL_checklstring(L, arg, &l); | |
| 526 | status = status && (fwrite(s, sizeof(char), l, f) == l); | |
| 527 | } | |
| 528 | } | |
| 529 | if (status) return 1; /* file handle already on stack top */ | |
| 530 | else return luaL_fileresult(L, status, NULL); | |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | |
| 534 | 534 | static int io_write (lua_State *L) { |
| 535 | ||
| 535 | return g_write(L, getiofile(L, IO_OUTPUT), 1); | |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | 538 | |
| 539 | 539 | static int f_write (lua_State *L) { |
| 540 | FILE *f = tofile(L); | |
| 541 | lua_pushvalue(L, 1); /* push file at the stack top (to be returned) */ | |
| 542 | return g_write(L, f, 2); | |
| 540 | FILE *f = tofile(L); | |
| 541 | lua_pushvalue(L, 1); /* push file at the stack top (to be returned) */ | |
| 542 | return g_write(L, f, 2); | |
| 543 | 543 | } |
| 544 | 544 | |
| 545 | 545 | |
| 546 | 546 | static int f_seek (lua_State *L) { |
| 547 | static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; | |
| 548 | static const char *const modenames[] = {"set", "cur", "end", NULL}; | |
| 549 | FILE *f = tofile(L); | |
| 550 | int op = luaL_checkoption(L, 2, "cur", modenames); | |
| 551 | lua_Number p3 = luaL_optnumber(L, 3, 0); | |
| 552 | l_seeknum offset = (l_seeknum)p3; | |
| 553 | luaL_argcheck(L, (lua_Number)offset == p3, 3, | |
| 554 | "not an integer in proper range"); | |
| 555 | op = l_fseek(f, offset, mode[op]); | |
| 556 | if (op) | |
| 557 | return luaL_fileresult(L, 0, NULL); /* error */ | |
| 558 | else { | |
| 559 | lua_pushnumber(L, (lua_Number)(1.0 * l_ftell(f))); | |
| 560 | return 1; | |
| 561 | } | |
| 547 | static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; | |
| 548 | static const char *const modenames[] = {"set", "cur", "end", NULL}; | |
| 549 | FILE *f = tofile(L); | |
| 550 | int op = luaL_checkoption(L, 2, "cur", modenames); | |
| 551 | lua_Number p3 = luaL_optnumber(L, 3, 0); | |
| 552 | l_seeknum offset = (l_seeknum)p3; | |
| 553 | luaL_argcheck(L, (lua_Number)offset == p3, 3, | |
| 554 | "not an integer in proper range"); | |
| 555 | op = l_fseek(f, offset, mode[op]); | |
| 556 | if (op) | |
| 557 | return luaL_fileresult(L, 0, NULL); /* error */ | |
| 558 | else { | |
| 559 | lua_pushnumber(L, (lua_Number)(1.0 * l_ftell(f))); | |
| 560 | return 1; | |
| 561 | } | |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | |
| 565 | 565 | static int f_setvbuf (lua_State *L) { |
| 566 | static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; | |
| 567 | static const char *const modenames[] = {"no", "full", "line", NULL}; | |
| 568 | FILE *f = tofile(L); | |
| 569 | int op = luaL_checkoption(L, 2, NULL, modenames); | |
| 570 | lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); | |
| 571 | int res = setvbuf(f, NULL, mode[op], sz); | |
| 572 | return luaL_fileresult(L, res == 0, NULL); | |
| 566 | static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; | |
| 567 | static const char *const modenames[] = {"no", "full", "line", NULL}; | |
| 568 | FILE *f = tofile(L); | |
| 569 | int op = luaL_checkoption(L, 2, NULL, modenames); | |
| 570 | lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); | |
| 571 | int res = setvbuf(f, NULL, mode[op], sz); | |
| 572 | return luaL_fileresult(L, res == 0, NULL); | |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | |
| 576 | 576 | |
| 577 | 577 | static int io_flush (lua_State *L) { |
| 578 | ||
| 578 | return luaL_fileresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); | |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | |
| 582 | 582 | static int f_flush (lua_State *L) { |
| 583 | ||
| 583 | return luaL_fileresult(L, fflush(tofile(L)) == 0, NULL); | |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | |
| r31373 | r31374 | |
| 588 | 588 | ** functions for 'io' library |
| 589 | 589 | */ |
| 590 | 590 | static const luaL_Reg iolib[] = { |
| 591 | {"close", io_close}, | |
| 592 | {"flush", io_flush}, | |
| 593 | {"input", io_input}, | |
| 594 | {"lines", io_lines}, | |
| 595 | {"open", io_open}, | |
| 596 | {"output", io_output}, | |
| 597 | {"popen", io_popen}, | |
| 598 | {"read", io_read}, | |
| 599 | {"tmpfile", io_tmpfile}, | |
| 600 | {"type", io_type}, | |
| 601 | {"write", io_write}, | |
| 602 | {NULL, NULL} | |
| 591 | {"close", io_close}, | |
| 592 | {"flush", io_flush}, | |
| 593 | {"input", io_input}, | |
| 594 | {"lines", io_lines}, | |
| 595 | {"open", io_open}, | |
| 596 | {"output", io_output}, | |
| 597 | {"popen", io_popen}, | |
| 598 | {"read", io_read}, | |
| 599 | {"tmpfile", io_tmpfile}, | |
| 600 | {"type", io_type}, | |
| 601 | {"write", io_write}, | |
| 602 | {NULL, NULL} | |
| 603 | 603 | }; |
| 604 | 604 | |
| 605 | 605 | |
| r31373 | r31374 | |
| 607 | 607 | ** methods for file handles |
| 608 | 608 | */ |
| 609 | 609 | static const luaL_Reg flib[] = { |
| 610 | {"close", io_close}, | |
| 611 | {"flush", f_flush}, | |
| 612 | {"lines", f_lines}, | |
| 613 | {"read", f_read}, | |
| 614 | {"seek", f_seek}, | |
| 615 | {"setvbuf", f_setvbuf}, | |
| 616 | {"write", f_write}, | |
| 617 | {"__gc", f_gc}, | |
| 618 | {"__tostring", f_tostring}, | |
| 619 | {NULL, NULL} | |
| 610 | {"close", io_close}, | |
| 611 | {"flush", f_flush}, | |
| 612 | {"lines", f_lines}, | |
| 613 | {"read", f_read}, | |
| 614 | {"seek", f_seek}, | |
| 615 | {"setvbuf", f_setvbuf}, | |
| 616 | {"write", f_write}, | |
| 617 | {"__gc", f_gc}, | |
| 618 | {"__tostring", f_tostring}, | |
| 619 | {NULL, NULL} | |
| 620 | 620 | }; |
| 621 | 621 | |
| 622 | 622 | |
| 623 | 623 | static void createmeta (lua_State *L) { |
| 624 | luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ | |
| 625 | lua_pushvalue(L, -1); /* push metatable */ | |
| 626 | lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ | |
| 627 | luaL_setfuncs(L, flib, 0); /* add file methods to new metatable */ | |
| 628 | lua_pop(L, 1); /* pop new metatable */ | |
| 624 | luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ | |
| 625 | lua_pushvalue(L, -1); /* push metatable */ | |
| 626 | lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ | |
| 627 | luaL_setfuncs(L, flib, 0); /* add file methods to new metatable */ | |
| 628 | lua_pop(L, 1); /* pop new metatable */ | |
| 629 | 629 | } |
| 630 | 630 | |
| 631 | 631 | |
| r31373 | r31374 | |
| 633 | 633 | ** function to (not) close the standard files stdin, stdout, and stderr |
| 634 | 634 | */ |
| 635 | 635 | static int io_noclose (lua_State *L) { |
| 636 | LStream *p = tolstream(L); | |
| 637 | p->closef = &io_noclose; /* keep file opened */ | |
| 638 | lua_pushnil(L); | |
| 639 | lua_pushliteral(L, "cannot close standard file"); | |
| 640 | return 2; | |
| 636 | LStream *p = tolstream(L); | |
| 637 | p->closef = &io_noclose; /* keep file opened */ | |
| 638 | lua_pushnil(L); | |
| 639 | lua_pushliteral(L, "cannot close standard file"); | |
| 640 | return 2; | |
| 641 | 641 | } |
| 642 | 642 | |
| 643 | 643 | |
| 644 | 644 | static void createstdfile (lua_State *L, FILE *f, const char *k, |
| 645 | const char *fname) { | |
| 646 | LStream *p = newprefile(L); | |
| 647 | p->f = f; | |
| 648 | p->closef = &io_noclose; | |
| 649 | if (k != NULL) { | |
| 650 | lua_pushvalue(L, -1); | |
| 651 | lua_setfield(L, LUA_REGISTRYINDEX, k); /* add file to registry */ | |
| 652 | } | |
| 653 | lua_setfield(L, -2, fname); /* add file to module */ | |
| 645 | const char *fname) { | |
| 646 | LStream *p = newprefile(L); | |
| 647 | p->f = f; | |
| 648 | p->closef = &io_noclose; | |
| 649 | if (k != NULL) { | |
| 650 | lua_pushvalue(L, -1); | |
| 651 | lua_setfield(L, LUA_REGISTRYINDEX, k); /* add file to registry */ | |
| 652 | } | |
| 653 | lua_setfield(L, -2, fname); /* add file to module */ | |
| 654 | 654 | } |
| 655 | 655 | |
| 656 | 656 | |
| 657 | 657 | LUAMOD_API int luaopen_io (lua_State *L) { |
| 658 | luaL_newlib(L, iolib); /* new module */ | |
| 659 | createmeta(L); | |
| 660 | /* create (and set) default files */ | |
| 661 | createstdfile(L, stdin, IO_INPUT, "stdin"); | |
| 662 | createstdfile(L, stdout, IO_OUTPUT, "stdout"); | |
| 663 | createstdfile(L, stderr, NULL, "stderr"); | |
| 664 | return 1; | |
| 658 | luaL_newlib(L, iolib); /* new module */ | |
| 659 | createmeta(L); | |
| 660 | /* create (and set) default files */ | |
| 661 | createstdfile(L, stdin, IO_INPUT, "stdin"); | |
| 662 | createstdfile(L, stdout, IO_OUTPUT, "stdout"); | |
| 663 | createstdfile(L, stderr, NULL, "stderr"); | |
| 664 | return 1; | |
| 665 | 665 | } |
| 666 |
| r31373 | r31374 | |
|---|---|---|
| 25 | 25 | ** pattern-matching. This limit is arbitrary. |
| 26 | 26 | */ |
| 27 | 27 | #if !defined(LUA_MAXCAPTURES) |
| 28 | #define LUA_MAXCAPTURES | |
| 28 | #define LUA_MAXCAPTURES 32 | |
| 29 | 29 | #endif |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | /* macro to `unsign' a character */ |
| 33 | #define uchar(c) | |
| 33 | #define uchar(c) ((unsigned char)(c)) | |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | static int str_len (lua_State *L) { |
| 38 | size_t l; | |
| 39 | luaL_checklstring(L, 1, &l); | |
| 40 | lua_pushinteger(L, (lua_Integer)l); | |
| 41 | return 1; | |
| 38 | size_t l; | |
| 39 | luaL_checklstring(L, 1, &l); | |
| 40 | lua_pushinteger(L, (lua_Integer)l); | |
| 41 | return 1; | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | /* translate a relative string position: negative means back from end */ |
| 46 | 46 | static size_t posrelat (ptrdiff_t pos, size_t len) { |
| 47 | if (pos >= 0) return (size_t)pos; | |
| 48 | else if (0u - (size_t)pos > len) return 0; | |
| 49 | else return len - ((size_t)-pos) + 1; | |
| 47 | if (pos >= 0) return (size_t)pos; | |
| 48 | else if (0u - (size_t)pos > len) return 0; | |
| 49 | else return len - ((size_t)-pos) + 1; | |
| 50 | 50 | } |
| 51 | 51 | |
| 52 | 52 | |
| 53 | 53 | static int str_sub (lua_State *L) { |
| 54 | size_t l; | |
| 55 | const char *s = luaL_checklstring(L, 1, &l); | |
| 56 | size_t start = posrelat(luaL_checkinteger(L, 2), l); | |
| 57 | size_t end = posrelat(luaL_optinteger(L, 3, -1), l); | |
| 58 | if (start < 1) start = 1; | |
| 59 | if (end > l) end = l; | |
| 60 | if (start <= end) | |
| 61 | lua_pushlstring(L, s + start - 1, end - start + 1); | |
| 62 | else lua_pushliteral(L, ""); | |
| 63 | return 1; | |
| 54 | size_t l; | |
| 55 | const char *s = luaL_checklstring(L, 1, &l); | |
| 56 | size_t start = posrelat(luaL_checkinteger(L, 2), l); | |
| 57 | size_t end = posrelat(luaL_optinteger(L, 3, -1), l); | |
| 58 | if (start < 1) start = 1; | |
| 59 | if (end > l) end = l; | |
| 60 | if (start <= end) | |
| 61 | lua_pushlstring(L, s + start - 1, end - start + 1); | |
| 62 | else lua_pushliteral(L, ""); | |
| 63 | return 1; | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | static int str_reverse (lua_State *L) { |
| 68 | size_t l, i; | |
| 69 | luaL_Buffer b; | |
| 70 | const char *s = luaL_checklstring(L, 1, &l); | |
| 71 | char *p = luaL_buffinitsize(L, &b, l); | |
| 72 | for (i = 0; i < l; i++) | |
| 73 | p[i] = s[l - i - 1]; | |
| 74 | luaL_pushresultsize(&b, l); | |
| 75 | return 1; | |
| 68 | size_t l, i; | |
| 69 | luaL_Buffer b; | |
| 70 | const char *s = luaL_checklstring(L, 1, &l); | |
| 71 | char *p = luaL_buffinitsize(L, &b, l); | |
| 72 | for (i = 0; i < l; i++) | |
| 73 | p[i] = s[l - i - 1]; | |
| 74 | luaL_pushresultsize(&b, l); | |
| 75 | return 1; | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | static int str_lower (lua_State *L) { |
| 80 | size_t l; | |
| 81 | size_t i; | |
| 82 | luaL_Buffer b; | |
| 83 | const char *s = luaL_checklstring(L, 1, &l); | |
| 84 | char *p = luaL_buffinitsize(L, &b, l); | |
| 85 | for (i=0; i<l; i++) | |
| 86 | p[i] = tolower(uchar(s[i])); | |
| 87 | luaL_pushresultsize(&b, l); | |
| 88 | return 1; | |
| 80 | size_t l; | |
| 81 | size_t i; | |
| 82 | luaL_Buffer b; | |
| 83 | const char *s = luaL_checklstring(L, 1, &l); | |
| 84 | char *p = luaL_buffinitsize(L, &b, l); | |
| 85 | for (i=0; i<l; i++) | |
| 86 | p[i] = tolower(uchar(s[i])); | |
| 87 | luaL_pushresultsize(&b, l); | |
| 88 | return 1; | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | static int str_upper (lua_State *L) { |
| 93 | size_t l; | |
| 94 | size_t i; | |
| 95 | luaL_Buffer b; | |
| 96 | const char *s = luaL_checklstring(L, 1, &l); | |
| 97 | char *p = luaL_buffinitsize(L, &b, l); | |
| 98 | for (i=0; i<l; i++) | |
| 99 | p[i] = toupper(uchar(s[i])); | |
| 100 | luaL_pushresultsize(&b, l); | |
| 101 | return 1; | |
| 93 | size_t l; | |
| 94 | size_t i; | |
| 95 | luaL_Buffer b; | |
| 96 | const char *s = luaL_checklstring(L, 1, &l); | |
| 97 | char *p = luaL_buffinitsize(L, &b, l); | |
| 98 | for (i=0; i<l; i++) | |
| 99 | p[i] = toupper(uchar(s[i])); | |
| 100 | luaL_pushresultsize(&b, l); | |
| 101 | return 1; | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | /* reasonable limit to avoid arithmetic overflow */ |
| 106 | #define MAXSIZE | |
| 106 | #define MAXSIZE ((~(size_t)0) >> 1) | |
| 107 | 107 | |
| 108 | 108 | static int str_rep (lua_State *L) { |
| 109 | size_t l, lsep; | |
| 110 | const char *s = luaL_checklstring(L, 1, &l); | |
| 111 | int n = luaL_checkint(L, 2); | |
| 112 | const char *sep = luaL_optlstring(L, 3, "", &lsep); | |
| 113 | if (n <= 0) lua_pushliteral(L, ""); | |
| 114 | else if (l + lsep < l || l + lsep >= MAXSIZE / n) /* may overflow? */ | |
| 115 | return luaL_error(L, "resulting string too large"); | |
| 116 | else { | |
| 117 | size_t totallen = n * l + (n - 1) * lsep; | |
| 118 | luaL_Buffer b; | |
| 119 | char *p = luaL_buffinitsize(L, &b, totallen); | |
| 120 | while (n-- > 1) { /* first n-1 copies (followed by separator) */ | |
| 121 | memcpy(p, s, l * sizeof(char)); p += l; | |
| 122 | if (lsep > 0) { /* avoid empty 'memcpy' (may be expensive) */ | |
| 123 | memcpy(p, sep, lsep * sizeof(char)); p += lsep; | |
| 124 | } | |
| 125 | } | |
| 126 | memcpy(p, s, l * sizeof(char)); /* last copy (not followed by separator) */ | |
| 127 | luaL_pushresultsize(&b, totallen); | |
| 128 | } | |
| 129 | return 1; | |
| 109 | size_t l, lsep; | |
| 110 | const char *s = luaL_checklstring(L, 1, &l); | |
| 111 | int n = luaL_checkint(L, 2); | |
| 112 | const char *sep = luaL_optlstring(L, 3, "", &lsep); | |
| 113 | if (n <= 0) lua_pushliteral(L, ""); | |
| 114 | else if (l + lsep < l || l + lsep >= MAXSIZE / n) /* may overflow? */ | |
| 115 | return luaL_error(L, "resulting string too large"); | |
| 116 | else { | |
| 117 | size_t totallen = n * l + (n - 1) * lsep; | |
| 118 | luaL_Buffer b; | |
| 119 | char *p = luaL_buffinitsize(L, &b, totallen); | |
| 120 | while (n-- > 1) { /* first n-1 copies (followed by separator) */ | |
| 121 | memcpy(p, s, l * sizeof(char)); p += l; | |
| 122 | if (lsep > 0) { /* avoid empty 'memcpy' (may be expensive) */ | |
| 123 | memcpy(p, sep, lsep * sizeof(char)); p += lsep; | |
| 124 | } | |
| 125 | } | |
| 126 | memcpy(p, s, l * sizeof(char)); /* last copy (not followed by separator) */ | |
| 127 | luaL_pushresultsize(&b, totallen); | |
| 128 | } | |
| 129 | return 1; | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | static int str_byte (lua_State *L) { |
| 134 | size_t l; | |
| 135 | const char *s = luaL_checklstring(L, 1, &l); | |
| 136 | size_t posi = posrelat(luaL_optinteger(L, 2, 1), l); | |
| 137 | size_t pose = posrelat(luaL_optinteger(L, 3, posi), l); | |
| 138 | int n, i; | |
| 139 | if (posi < 1) posi = 1; | |
| 140 | if (pose > l) pose = l; | |
| 141 | if (posi > pose) return 0; /* empty interval; return no values */ | |
| 142 | n = (int)(pose - posi + 1); | |
| 143 | if (posi + n <= pose) /* (size_t -> int) overflow? */ | |
| 144 | return luaL_error(L, "string slice too long"); | |
| 145 | luaL_checkstack(L, n, "string slice too long"); | |
| 146 | for (i=0; i<n; i++) | |
| 147 | lua_pushinteger(L, uchar(s[posi+i-1])); | |
| 148 | return n; | |
| 134 | size_t l; | |
| 135 | const char *s = luaL_checklstring(L, 1, &l); | |
| 136 | size_t posi = posrelat(luaL_optinteger(L, 2, 1), l); | |
| 137 | size_t pose = posrelat(luaL_optinteger(L, 3, posi), l); | |
| 138 | int n, i; | |
| 139 | if (posi < 1) posi = 1; | |
| 140 | if (pose > l) pose = l; | |
| 141 | if (posi > pose) return 0; /* empty interval; return no values */ | |
| 142 | n = (int)(pose - posi + 1); | |
| 143 | if (posi + n <= pose) /* (size_t -> int) overflow? */ | |
| 144 | return luaL_error(L, "string slice too long"); | |
| 145 | luaL_checkstack(L, n, "string slice too long"); | |
| 146 | for (i=0; i<n; i++) | |
| 147 | lua_pushinteger(L, uchar(s[posi+i-1])); | |
| 148 | return n; | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | |
| 152 | 152 | static int str_char (lua_State *L) { |
| 153 | int n = lua_gettop(L); /* number of arguments */ | |
| 154 | int i; | |
| 155 | luaL_Buffer b; | |
| 156 | char *p = luaL_buffinitsize(L, &b, n); | |
| 157 | for (i=1; i<=n; i++) { | |
| 158 | int c = luaL_checkint(L, i); | |
| 159 | luaL_argcheck(L, uchar(c) == c, i, "value out of range"); | |
| 160 | p[i - 1] = uchar(c); | |
| 161 | } | |
| 162 | luaL_pushresultsize(&b, n); | |
| 163 | return 1; | |
| 153 | int n = lua_gettop(L); /* number of arguments */ | |
| 154 | int i; | |
| 155 | luaL_Buffer b; | |
| 156 | char *p = luaL_buffinitsize(L, &b, n); | |
| 157 | for (i=1; i<=n; i++) { | |
| 158 | int c = luaL_checkint(L, i); | |
| 159 | luaL_argcheck(L, uchar(c) == c, i, "value out of range"); | |
| 160 | p[i - 1] = uchar(c); | |
| 161 | } | |
| 162 | luaL_pushresultsize(&b, n); | |
| 163 | return 1; | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | static int writer (lua_State *L, const void* b, size_t size, void* B) { |
| 168 | (void)L; | |
| 169 | luaL_addlstring((luaL_Buffer*) B, (const char *)b, size); | |
| 170 | return 0; | |
| 168 | (void)L; | |
| 169 | luaL_addlstring((luaL_Buffer*) B, (const char *)b, size); | |
| 170 | return 0; | |
| 171 | 171 | } |
| 172 | 172 | |
| 173 | 173 | |
| 174 | 174 | static int str_dump (lua_State *L) { |
| 175 | luaL_Buffer b; | |
| 176 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 177 | lua_settop(L, 1); | |
| 178 | luaL_buffinit(L,&b); | |
| 179 | if (lua_dump(L, writer, &b) != 0) | |
| 180 | return luaL_error(L, "unable to dump given function"); | |
| 181 | luaL_pushresult(&b); | |
| 182 | return 1; | |
| 175 | luaL_Buffer b; | |
| 176 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 177 | lua_settop(L, 1); | |
| 178 | luaL_buffinit(L,&b); | |
| 179 | if (lua_dump(L, writer, &b) != 0) | |
| 180 | return luaL_error(L, "unable to dump given function"); | |
| 181 | luaL_pushresult(&b); | |
| 182 | return 1; | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r31373 | r31374 | |
| 191 | 191 | */ |
| 192 | 192 | |
| 193 | 193 | |
| 194 | #define CAP_UNFINISHED (-1) | |
| 195 | #define CAP_POSITION (-2) | |
| 194 | #define CAP_UNFINISHED (-1) | |
| 195 | #define CAP_POSITION (-2) | |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | typedef struct MatchState { |
| 199 | int matchdepth; /* control for recursive depth (to avoid C stack overflow) */ | |
| 200 | const char *src_init; /* init of source string */ | |
| 201 | const char *src_end; /* end ('\0') of source string */ | |
| 202 | const char *p_end; /* end ('\0') of pattern */ | |
| 203 | lua_State *L; | |
| 204 | int level; /* total number of captures (finished or unfinished) */ | |
| 205 | struct { | |
| 206 | const char *init; | |
| 207 | ptrdiff_t len; | |
| 208 | } capture[LUA_MAXCAPTURES]; | |
| 199 | int matchdepth; /* control for recursive depth (to avoid C stack overflow) */ | |
| 200 | const char *src_init; /* init of source string */ | |
| 201 | const char *src_end; /* end ('\0') of source string */ | |
| 202 | const char *p_end; /* end ('\0') of pattern */ | |
| 203 | lua_State *L; | |
| 204 | int level; /* total number of captures (finished or unfinished) */ | |
| 205 | struct { | |
| 206 | const char *init; | |
| 207 | ptrdiff_t len; | |
| 208 | } capture[LUA_MAXCAPTURES]; | |
| 209 | 209 | } MatchState; |
| 210 | 210 | |
| 211 | 211 | |
| r31373 | r31374 | |
| 215 | 215 | |
| 216 | 216 | /* maximum recursion depth for 'match' */ |
| 217 | 217 | #if !defined(MAXCCALLS) |
| 218 | #define MAXCCALLS | |
| 218 | #define MAXCCALLS 200 | |
| 219 | 219 | #endif |
| 220 | 220 | |
| 221 | 221 | |
| 222 | #define L_ESC '%' | |
| 223 | #define SPECIALS "^$*+?.([%-" | |
| 222 | #define L_ESC '%' | |
| 223 | #define SPECIALS "^$*+?.([%-" | |
| 224 | 224 | |
| 225 | 225 | |
| 226 | 226 | static int check_capture (MatchState *ms, int l) { |
| 227 | l -= '1'; | |
| 228 | if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED) | |
| 229 | return luaL_error(ms->L, "invalid capture index %%%d", l + 1); | |
| 230 | return l; | |
| 227 | l -= '1'; | |
| 228 | if (l < 0 || l >= ms->level || ms->capture[l].len == CAP_UNFINISHED) | |
| 229 | return luaL_error(ms->L, "invalid capture index %%%d", l + 1); | |
| 230 | return l; | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
| 234 | 234 | static int capture_to_close (MatchState *ms) { |
| 235 | int level = ms->level; | |
| 236 | for (level--; level>=0; level--) | |
| 237 | if (ms->capture[level].len == CAP_UNFINISHED) return level; | |
| 238 | return luaL_error(ms->L, "invalid pattern capture"); | |
| 235 | int level = ms->level; | |
| 236 | for (level--; level>=0; level--) | |
| 237 | if (ms->capture[level].len == CAP_UNFINISHED) return level; | |
| 238 | return luaL_error(ms->L, "invalid pattern capture"); | |
| 239 | 239 | } |
| 240 | 240 | |
| 241 | 241 | |
| 242 | 242 | static const char *classend (MatchState *ms, const char *p) { |
| 243 | switch (*p++) { | |
| 244 | case L_ESC: { | |
| 245 | if (p == ms->p_end) | |
| 246 | luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); | |
| 247 | return p+1; | |
| 248 | } | |
| 249 | case '[': { | |
| 250 | if (*p == '^') p++; | |
| 251 | do { /* look for a `]' */ | |
| 252 | if (p == ms->p_end) | |
| 253 | luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); | |
| 254 | if (*(p++) == L_ESC && p < ms->p_end) | |
| 255 | p++; /* skip escapes (e.g. `%]') */ | |
| 256 | } while (*p != ']'); | |
| 257 | return p+1; | |
| 258 | } | |
| 259 | default: { | |
| 260 | return p; | |
| 261 | } | |
| 262 | } | |
| 243 | switch (*p++) { | |
| 244 | case L_ESC: { | |
| 245 | if (p == ms->p_end) | |
| 246 | luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); | |
| 247 | return p+1; | |
| 248 | } | |
| 249 | case '[': { | |
| 250 | if (*p == '^') p++; | |
| 251 | do { /* look for a `]' */ | |
| 252 | if (p == ms->p_end) | |
| 253 | luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); | |
| 254 | if (*(p++) == L_ESC && p < ms->p_end) | |
| 255 | p++; /* skip escapes (e.g. `%]') */ | |
| 256 | } while (*p != ']'); | |
| 257 | return p+1; | |
| 258 | } | |
| 259 | default: { | |
| 260 | return p; | |
| 261 | } | |
| 262 | } | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | |
| 266 | 266 | static int match_class (int c, int cl) { |
| 267 | int res; | |
| 268 | switch (tolower(cl)) { | |
| 269 | case 'a' : res = isalpha(c); break; | |
| 270 | case 'c' : res = iscntrl(c); break; | |
| 271 | case 'd' : res = isdigit(c); break; | |
| 272 | case 'g' : res = isgraph(c); break; | |
| 273 | case 'l' : res = islower(c); break; | |
| 274 | case 'p' : res = ispunct(c); break; | |
| 275 | case 's' : res = isspace(c); break; | |
| 276 | case 'u' : res = isupper(c); break; | |
| 277 | case 'w' : res = isalnum(c); break; | |
| 278 | case 'x' : res = isxdigit(c); break; | |
| 279 | case 'z' : res = (c == 0); break; /* deprecated option */ | |
| 280 | default: return (cl == c); | |
| 281 | } | |
| 282 | return (islower(cl) ? res : !res); | |
| 267 | int res; | |
| 268 | switch (tolower(cl)) { | |
| 269 | case 'a' : res = isalpha(c); break; | |
| 270 | case 'c' : res = iscntrl(c); break; | |
| 271 | case 'd' : res = isdigit(c); break; | |
| 272 | case 'g' : res = isgraph(c); break; | |
| 273 | case 'l' : res = islower(c); break; | |
| 274 | case 'p' : res = ispunct(c); break; | |
| 275 | case 's' : res = isspace(c); break; | |
| 276 | case 'u' : res = isupper(c); break; | |
| 277 | case 'w' : res = isalnum(c); break; | |
| 278 | case 'x' : res = isxdigit(c); break; | |
| 279 | case 'z' : res = (c == 0); break; /* deprecated option */ | |
| 280 | default: return (cl == c); | |
| 281 | } | |
| 282 | return (islower(cl) ? res : !res); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | static int matchbracketclass (int c, const char *p, const char *ec) { |
| 287 | int sig = 1; | |
| 288 | if (*(p+1) == '^') { | |
| 289 | sig = 0; | |
| 290 | p++; /* skip the `^' */ | |
| 291 | } | |
| 292 | while (++p < ec) { | |
| 293 | if (*p == L_ESC) { | |
| 294 | p++; | |
| 295 | if (match_class(c, uchar(*p))) | |
| 296 | return sig; | |
| 297 | } | |
| 298 | else if ((*(p+1) == '-') && (p+2 < ec)) { | |
| 299 | p+=2; | |
| 300 | if (uchar(*(p-2)) <= c && c <= uchar(*p)) | |
| 301 | return sig; | |
| 302 | } | |
| 303 | else if (uchar(*p) == c) return sig; | |
| 304 | } | |
| 305 | return !sig; | |
| 287 | int sig = 1; | |
| 288 | if (*(p+1) == '^') { | |
| 289 | sig = 0; | |
| 290 | p++; /* skip the `^' */ | |
| 291 | } | |
| 292 | while (++p < ec) { | |
| 293 | if (*p == L_ESC) { | |
| 294 | p++; | |
| 295 | if (match_class(c, uchar(*p))) | |
| 296 | return sig; | |
| 297 | } | |
| 298 | else if ((*(p+1) == '-') && (p+2 < ec)) { | |
| 299 | p+=2; | |
| 300 | if (uchar(*(p-2)) <= c && c <= uchar(*p)) | |
| 301 | return sig; | |
| 302 | } | |
| 303 | else if (uchar(*p) == c) return sig; | |
| 304 | } | |
| 305 | return !sig; | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | |
| 309 | 309 | static int singlematch (MatchState *ms, const char *s, const char *p, |
| 310 | const char *ep) { | |
| 311 | if (s >= ms->src_end) | |
| 312 | return 0; | |
| 313 | else { | |
| 314 | int c = uchar(*s); | |
| 315 | switch (*p) { | |
| 316 | case '.': return 1; /* matches any char */ | |
| 317 | case L_ESC: return match_class(c, uchar(*(p+1))); | |
| 318 | case '[': return matchbracketclass(c, p, ep-1); | |
| 319 | default: return (uchar(*p) == c); | |
| 320 | } | |
| 321 | } | |
| 310 | const char *ep) { | |
| 311 | if (s >= ms->src_end) | |
| 312 | return 0; | |
| 313 | else { | |
| 314 | int c = uchar(*s); | |
| 315 | switch (*p) { | |
| 316 | case '.': return 1; /* matches any char */ | |
| 317 | case L_ESC: return match_class(c, uchar(*(p+1))); | |
| 318 | case '[': return matchbracketclass(c, p, ep-1); | |
| 319 | default: return (uchar(*p) == c); | |
| 320 | } | |
| 321 | } | |
| 322 | 322 | } |
| 323 | 323 | |
| 324 | 324 | |
| 325 | 325 | static const char *matchbalance (MatchState *ms, const char *s, |
| 326 | const char *p) { | |
| 327 | if (p >= ms->p_end - 1) | |
| 328 | luaL_error(ms->L, "malformed pattern " | |
| 329 | "(missing arguments to " LUA_QL("%%b") ")"); | |
| 330 | if (*s != *p) return NULL; | |
| 331 | else { | |
| 332 | int b = *p; | |
| 333 | int e = *(p+1); | |
| 334 | int cont = 1; | |
| 335 | while (++s < ms->src_end) { | |
| 336 | if (*s == e) { | |
| 337 | if (--cont == 0) return s+1; | |
| 338 | } | |
| 339 | else if (*s == b) cont++; | |
| 340 | } | |
| 341 | } | |
| 342 | return NULL; /* string ends out of balance */ | |
| 326 | const char *p) { | |
| 327 | if (p >= ms->p_end - 1) | |
| 328 | luaL_error(ms->L, "malformed pattern " | |
| 329 | "(missing arguments to " LUA_QL("%%b") ")"); | |
| 330 | if (*s != *p) return NULL; | |
| 331 | else { | |
| 332 | int b = *p; | |
| 333 | int e = *(p+1); | |
| 334 | int cont = 1; | |
| 335 | while (++s < ms->src_end) { | |
| 336 | if (*s == e) { | |
| 337 | if (--cont == 0) return s+1; | |
| 338 | } | |
| 339 | else if (*s == b) cont++; | |
| 340 | } | |
| 341 | } | |
| 342 | return NULL; /* string ends out of balance */ | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | |
| 346 | 346 | static const char *max_expand (MatchState *ms, const char *s, |
| 347 | const char *p, const char *ep) { | |
| 348 | ptrdiff_t i = 0; /* counts maximum expand for item */ | |
| 349 | while (singlematch(ms, s + i, p, ep)) | |
| 350 | i++; | |
| 351 | /* keeps trying to match with the maximum repetitions */ | |
| 352 | while (i>=0) { | |
| 353 | const char *res = match(ms, (s+i), ep+1); | |
| 354 | if (res) return res; | |
| 355 | i--; /* else didn't match; reduce 1 repetition to try again */ | |
| 356 | } | |
| 357 | return NULL; | |
| 347 | const char *p, const char *ep) { | |
| 348 | ptrdiff_t i = 0; /* counts maximum expand for item */ | |
| 349 | while (singlematch(ms, s + i, p, ep)) | |
| 350 | i++; | |
| 351 | /* keeps trying to match with the maximum repetitions */ | |
| 352 | while (i>=0) { | |
| 353 | const char *res = match(ms, (s+i), ep+1); | |
| 354 | if (res) return res; | |
| 355 | i--; /* else didn't match; reduce 1 repetition to try again */ | |
| 356 | } | |
| 357 | return NULL; | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
| 361 | 361 | static const char *min_expand (MatchState *ms, const char *s, |
| 362 | const char *p, const char *ep) { | |
| 363 | for (;;) { | |
| 364 | const char *res = match(ms, s, ep+1); | |
| 365 | if (res != NULL) | |
| 366 | return res; | |
| 367 | else if (singlematch(ms, s, p, ep)) | |
| 368 | s++; /* try with one more repetition */ | |
| 369 | else return NULL; | |
| 370 | } | |
| 362 | const char *p, const char *ep) { | |
| 363 | for (;;) { | |
| 364 | const char *res = match(ms, s, ep+1); | |
| 365 | if (res != NULL) | |
| 366 | return res; | |
| 367 | else if (singlematch(ms, s, p, ep)) | |
| 368 | s++; /* try with one more repetition */ | |
| 369 | else return NULL; | |
| 370 | } | |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | |
| 374 | 374 | static const char *start_capture (MatchState *ms, const char *s, |
| 375 | const char *p, int what) { | |
| 376 | const char *res; | |
| 377 | int level = ms->level; | |
| 378 | if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); | |
| 379 | ms->capture[level].init = s; | |
| 380 | ms->capture[level].len = what; | |
| 381 | ms->level = level+1; | |
| 382 | if ((res=match(ms, s, p)) == NULL) /* match failed? */ | |
| 383 | ms->level--; /* undo capture */ | |
| 384 | return res; | |
| 375 | const char *p, int what) { | |
| 376 | const char *res; | |
| 377 | int level = ms->level; | |
| 378 | if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); | |
| 379 | ms->capture[level].init = s; | |
| 380 | ms->capture[level].len = what; | |
| 381 | ms->level = level+1; | |
| 382 | if ((res=match(ms, s, p)) == NULL) /* match failed? */ | |
| 383 | ms->level--; /* undo capture */ | |
| 384 | return res; | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
| 388 | 388 | static const char *end_capture (MatchState *ms, const char *s, |
| 389 | const char *p) { | |
| 390 | int l = capture_to_close(ms); | |
| 391 | const char *res; | |
| 392 | ms->capture[l].len = s - ms->capture[l].init; /* close capture */ | |
| 393 | if ((res = match(ms, s, p)) == NULL) /* match failed? */ | |
| 394 | ms->capture[l].len = CAP_UNFINISHED; /* undo capture */ | |
| 395 | return res; | |
| 389 | const char *p) { | |
| 390 | int l = capture_to_close(ms); | |
| 391 | const char *res; | |
| 392 | ms->capture[l].len = s - ms->capture[l].init; /* close capture */ | |
| 393 | if ((res = match(ms, s, p)) == NULL) /* match failed? */ | |
| 394 | ms->capture[l].len = CAP_UNFINISHED; /* undo capture */ | |
| 395 | return res; | |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | |
| 399 | 399 | static const char *match_capture (MatchState *ms, const char *s, int l) { |
| 400 | size_t len; | |
| 401 | l = check_capture(ms, l); | |
| 402 | len = ms->capture[l].len; | |
| 403 | if ((size_t)(ms->src_end-s) >= len && | |
| 404 | memcmp(ms->capture[l].init, s, len) == 0) | |
| 405 | return s+len; | |
| 406 | else return NULL; | |
| 400 | size_t len; | |
| 401 | l = check_capture(ms, l); | |
| 402 | len = ms->capture[l].len; | |
| 403 | if ((size_t)(ms->src_end-s) >= len && | |
| 404 | memcmp(ms->capture[l].init, s, len) == 0) | |
| 405 | return s+len; | |
| 406 | else return NULL; | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | |
| 410 | 410 | static const char *match (MatchState *ms, const char *s, const char *p) { |
| 411 | if (ms->matchdepth-- == 0) | |
| 412 | luaL_error(ms->L, "pattern too complex"); | |
| 413 | init: /* using goto's to optimize tail recursion */ | |
| 414 | if (p != ms->p_end) { /* end of pattern? */ | |
| 415 | switch (*p) { | |
| 416 | case '(': { /* start capture */ | |
| 417 | if (*(p + 1) == ')') /* position capture? */ | |
| 418 | s = start_capture(ms, s, p + 2, CAP_POSITION); | |
| 419 | else | |
| 420 | s = start_capture(ms, s, p + 1, CAP_UNFINISHED); | |
| 421 | break; | |
| 422 | } | |
| 423 | case ')': { /* end capture */ | |
| 424 | s = end_capture(ms, s, p + 1); | |
| 425 | break; | |
| 426 | } | |
| 427 | case '$': { | |
| 428 | if ((p + 1) != ms->p_end) /* is the `$' the last char in pattern? */ | |
| 429 | goto dflt; /* no; go to default */ | |
| 430 | s = (s == ms->src_end) ? s : NULL; /* check end of string */ | |
| 431 | break; | |
| 432 | } | |
| 433 | case L_ESC: { /* escaped sequences not in the format class[*+?-]? */ | |
| 434 | switch (*(p + 1)) { | |
| 435 | case 'b': { /* balanced string? */ | |
| 436 | s = matchbalance(ms, s, p + 2); | |
| 437 | if (s != NULL) { | |
| 438 | p += 4; goto init; /* return match(ms, s, p + 4); */ | |
| 439 | } /* else fail (s == NULL) */ | |
| 440 | break; | |
| 441 | } | |
| 442 | case 'f': { /* frontier? */ | |
| 443 | const char *ep; char previous; | |
| 444 | p += 2; | |
| 445 | if (*p != '[') | |
| 446 | luaL_error(ms->L, "missing " LUA_QL("[") " after " | |
| 447 | LUA_QL("%%f") " in pattern"); | |
| 448 | ep = classend(ms, p); /* points to what is next */ | |
| 449 | previous = (s == ms->src_init) ? '\0' : *(s - 1); | |
| 450 | if (!matchbracketclass(uchar(previous), p, ep - 1) && | |
| 451 | matchbracketclass(uchar(*s), p, ep - 1)) { | |
| 452 | p = ep; goto init; /* return match(ms, s, ep); */ | |
| 453 | } | |
| 454 | s = NULL; /* match failed */ | |
| 455 | break; | |
| 456 | } | |
| 457 | case '0': case '1': case '2': case '3': | |
| 458 | case '4': case '5': case '6': case '7': | |
| 459 | case '8': case '9': { /* capture results (%0-%9)? */ | |
| 460 | s = match_capture(ms, s, uchar(*(p + 1))); | |
| 461 | if (s != NULL) { | |
| 462 | p += 2; goto init; /* return match(ms, s, p + 2) */ | |
| 463 | } | |
| 464 | break; | |
| 465 | } | |
| 466 | default: goto dflt; | |
| 467 | } | |
| 468 | break; | |
| 469 | } | |
| 470 | default: dflt: { /* pattern class plus optional suffix */ | |
| 471 | const char *ep = classend(ms, p); /* points to optional suffix */ | |
| 472 | /* does not match at least once? */ | |
| 473 | if (!singlematch(ms, s, p, ep)) { | |
| 474 | if (*ep == '*' || *ep == '?' || *ep == '-') { /* accept empty? */ | |
| 475 | p = ep + 1; goto init; /* return match(ms, s, ep + 1); */ | |
| 476 | } | |
| 477 | else /* '+' or no suffix */ | |
| 478 | s = NULL; /* fail */ | |
| 479 | } | |
| 480 | else { /* matched once */ | |
| 481 | switch (*ep) { /* handle optional suffix */ | |
| 482 | case '?': { /* optional */ | |
| 483 | const char *res; | |
| 484 | if ((res = match(ms, s + 1, ep + 1)) != NULL) | |
| 485 | s = res; | |
| 486 | else { | |
| 487 | p = ep + 1; goto init; /* else return match(ms, s, ep + 1); */ | |
| 488 | } | |
| 489 | break; | |
| 490 | } | |
| 491 | case '+': /* 1 or more repetitions */ | |
| 492 | s++; /* 1 match already done */ | |
| 493 | /* go through */ | |
| 494 | case '*': /* 0 or more repetitions */ | |
| 495 | s = max_expand(ms, s, p, ep); | |
| 496 | break; | |
| 497 | case '-': /* 0 or more repetitions (minimum) */ | |
| 498 | s = min_expand(ms, s, p, ep); | |
| 499 | break; | |
| 500 | default: /* no suffix */ | |
| 501 | s++; p = ep; goto init; /* return match(ms, s + 1, ep); */ | |
| 502 | } | |
| 503 | } | |
| 504 | break; | |
| 505 | } | |
| 506 | } | |
| 507 | } | |
| 508 | ms->matchdepth++; | |
| 509 | return s; | |
| 411 | if (ms->matchdepth-- == 0) | |
| 412 | luaL_error(ms->L, "pattern too complex"); | |
| 413 | init: /* using goto's to optimize tail recursion */ | |
| 414 | if (p != ms->p_end) { /* end of pattern? */ | |
| 415 | switch (*p) { | |
| 416 | case '(': { /* start capture */ | |
| 417 | if (*(p + 1) == ')') /* position capture? */ | |
| 418 | s = start_capture(ms, s, p + 2, CAP_POSITION); | |
| 419 | else | |
| 420 | s = start_capture(ms, s, p + 1, CAP_UNFINISHED); | |
| 421 | break; | |
| 422 | } | |
| 423 | case ')': { /* end capture */ | |
| 424 | s = end_capture(ms, s, p + 1); | |
| 425 | break; | |
| 426 | } | |
| 427 | case '$': { | |
| 428 | if ((p + 1) != ms->p_end) /* is the `$' the last char in pattern? */ | |
| 429 | goto dflt; /* no; go to default */ | |
| 430 | s = (s == ms->src_end) ? s : NULL; /* check end of string */ | |
| 431 | break; | |
| 432 | } | |
| 433 | case L_ESC: { /* escaped sequences not in the format class[*+?-]? */ | |
| 434 | switch (*(p + 1)) { | |
| 435 | case 'b': { /* balanced string? */ | |
| 436 | s = matchbalance(ms, s, p + 2); | |
| 437 | if (s != NULL) { | |
| 438 | p += 4; goto init; /* return match(ms, s, p + 4); */ | |
| 439 | } /* else fail (s == NULL) */ | |
| 440 | break; | |
| 441 | } | |
| 442 | case 'f': { /* frontier? */ | |
| 443 | const char *ep; char previous; | |
| 444 | p += 2; | |
| 445 | if (*p != '[') | |
| 446 | luaL_error(ms->L, "missing " LUA_QL("[") " after " | |
| 447 | LUA_QL("%%f") " in pattern"); | |
| 448 | ep = classend(ms, p); /* points to what is next */ | |
| 449 | previous = (s == ms->src_init) ? '\0' : *(s - 1); | |
| 450 | if (!matchbracketclass(uchar(previous), p, ep - 1) && | |
| 451 | matchbracketclass(uchar(*s), p, ep - 1)) { | |
| 452 | p = ep; goto init; /* return match(ms, s, ep); */ | |
| 453 | } | |
| 454 | s = NULL; /* match failed */ | |
| 455 | break; | |
| 456 | } | |
| 457 | case '0': case '1': case '2': case '3': | |
| 458 | case '4': case '5': case '6': case '7': | |
| 459 | case '8': case '9': { /* capture results (%0-%9)? */ | |
| 460 | s = match_capture(ms, s, uchar(*(p + 1))); | |
| 461 | if (s != NULL) { | |
| 462 | p += 2; goto init; /* return match(ms, s, p + 2) */ | |
| 463 | } | |
| 464 | break; | |
| 465 | } | |
| 466 | default: goto dflt; | |
| 467 | } | |
| 468 | break; | |
| 469 | } | |
| 470 | default: dflt: { /* pattern class plus optional suffix */ | |
| 471 | const char *ep = classend(ms, p); /* points to optional suffix */ | |
| 472 | /* does not match at least once? */ | |
| 473 | if (!singlematch(ms, s, p, ep)) { | |
| 474 | if (*ep == '*' || *ep == '?' || *ep == '-') { /* accept empty? */ | |
| 475 | p = ep + 1; goto init; /* return match(ms, s, ep + 1); */ | |
| 476 | } | |
| 477 | else /* '+' or no suffix */ | |
| 478 | s = NULL; /* fail */ | |
| 479 | } | |
| 480 | else { /* matched once */ | |
| 481 | switch (*ep) { /* handle optional suffix */ | |
| 482 | case '?': { /* optional */ | |
| 483 | const char *res; | |
| 484 | if ((res = match(ms, s + 1, ep + 1)) != NULL) | |
| 485 | s = res; | |
| 486 | else { | |
| 487 | p = ep + 1; goto init; /* else return match(ms, s, ep + 1); */ | |
| 488 | } | |
| 489 | break; | |
| 490 | } | |
| 491 | case '+': /* 1 or more repetitions */ | |
| 492 | s++; /* 1 match already done */ | |
| 493 | /* go through */ | |
| 494 | case '*': /* 0 or more repetitions */ | |
| 495 | s = max_expand(ms, s, p, ep); | |
| 496 | break; | |
| 497 | case '-': /* 0 or more repetitions (minimum) */ | |
| 498 | s = min_expand(ms, s, p, ep); | |
| 499 | break; | |
| 500 | default: /* no suffix */ | |
| 501 | s++; p = ep; goto init; /* return match(ms, s + 1, ep); */ | |
| 502 | } | |
| 503 | } | |
| 504 | break; | |
| 505 | } | |
| 506 | } | |
| 507 | } | |
| 508 | ms->matchdepth++; | |
| 509 | return s; | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | |
| 513 | 513 | |
| 514 | 514 | static const char *lmemfind (const char *s1, size_t l1, |
| 515 | const char *s2, size_t l2) { | |
| 516 | if (l2 == 0) return s1; /* empty strings are everywhere */ | |
| 517 | else if (l2 > l1) return NULL; /* avoids a negative `l1' */ | |
| 518 | else { | |
| 519 | const char *init; /* to search for a `*s2' inside `s1' */ | |
| 520 | l2--; /* 1st char will be checked by `memchr' */ | |
| 521 | l1 = l1-l2; /* `s2' cannot be found after that */ | |
| 522 | while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { | |
| 523 | init++; /* 1st char is already checked */ | |
| 524 | if (memcmp(init, s2+1, l2) == 0) | |
| 525 | return init-1; | |
| 526 | else { /* correct `l1' and `s1' to try again */ | |
| 527 | l1 -= init-s1; | |
| 528 | s1 = init; | |
| 529 | } | |
| 530 | } | |
| 531 | return NULL; /* not found */ | |
| 532 | } | |
| 515 | const char *s2, size_t l2) { | |
| 516 | if (l2 == 0) return s1; /* empty strings are everywhere */ | |
| 517 | else if (l2 > l1) return NULL; /* avoids a negative `l1' */ | |
| 518 | else { | |
| 519 | const char *init; /* to search for a `*s2' inside `s1' */ | |
| 520 | l2--; /* 1st char will be checked by `memchr' */ | |
| 521 | l1 = l1-l2; /* `s2' cannot be found after that */ | |
| 522 | while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { | |
| 523 | init++; /* 1st char is already checked */ | |
| 524 | if (memcmp(init, s2+1, l2) == 0) | |
| 525 | return init-1; | |
| 526 | else { /* correct `l1' and `s1' to try again */ | |
| 527 | l1 -= init-s1; | |
| 528 | s1 = init; | |
| 529 | } | |
| 530 | } | |
| 531 | return NULL; /* not found */ | |
| 532 | } | |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | 535 | |
| 536 | 536 | static void push_onecapture (MatchState *ms, int i, const char *s, |
| 537 | const char *e) { | |
| 538 | if (i >= ms->level) { | |
| 539 | if (i == 0) /* ms->level == 0, too */ | |
| 540 | lua_pushlstring(ms->L, s, e - s); /* add whole match */ | |
| 541 | else | |
| 542 | luaL_error(ms->L, "invalid capture index"); | |
| 543 | } | |
| 544 | else { | |
| 545 | ptrdiff_t l = ms->capture[i].len; | |
| 546 | if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture"); | |
| 547 | if (l == CAP_POSITION) | |
| 548 | lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1); | |
| 549 | else | |
| 550 | lua_pushlstring(ms->L, ms->capture[i].init, l); | |
| 551 | } | |
| 537 | const char *e) { | |
| 538 | if (i >= ms->level) { | |
| 539 | if (i == 0) /* ms->level == 0, too */ | |
| 540 | lua_pushlstring(ms->L, s, e - s); /* add whole match */ | |
| 541 | else | |
| 542 | luaL_error(ms->L, "invalid capture index"); | |
| 543 | } | |
| 544 | else { | |
| 545 | ptrdiff_t l = ms->capture[i].len; | |
| 546 | if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture"); | |
| 547 | if (l == CAP_POSITION) | |
| 548 | lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1); | |
| 549 | else | |
| 550 | lua_pushlstring(ms->L, ms->capture[i].init, l); | |
| 551 | } | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | |
| 555 | 555 | static int push_captures (MatchState *ms, const char *s, const char *e) { |
| 556 | int i; | |
| 557 | int nlevels = (ms->level == 0 && s) ? 1 : ms->level; | |
| 558 | luaL_checkstack(ms->L, nlevels, "too many captures"); | |
| 559 | for (i = 0; i < nlevels; i++) | |
| 560 | push_onecapture(ms, i, s, e); | |
| 561 | return nlevels; /* number of strings pushed */ | |
| 556 | int i; | |
| 557 | int nlevels = (ms->level == 0 && s) ? 1 : ms->level; | |
| 558 | luaL_checkstack(ms->L, nlevels, "too many captures"); | |
| 559 | for (i = 0; i < nlevels; i++) | |
| 560 | push_onecapture(ms, i, s, e); | |
| 561 | return nlevels; /* number of strings pushed */ | |
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | |
| 565 | 565 | /* check whether pattern has no special characters */ |
| 566 | 566 | static int nospecials (const char *p, size_t l) { |
| 567 | size_t upto = 0; | |
| 568 | do { | |
| 569 | if (strpbrk(p + upto, SPECIALS)) | |
| 570 | return 0; /* pattern has a special character */ | |
| 571 | upto += strlen(p + upto) + 1; /* may have more after \0 */ | |
| 572 | } while (upto <= l); | |
| 573 | return 1; /* no special chars found */ | |
| 567 | size_t upto = 0; | |
| 568 | do { | |
| 569 | if (strpbrk(p + upto, SPECIALS)) | |
| 570 | return 0; /* pattern has a special character */ | |
| 571 | upto += strlen(p + upto) + 1; /* may have more after \0 */ | |
| 572 | } while (upto <= l); | |
| 573 | return 1; /* no special chars found */ | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | |
| 577 | 577 | static int str_find_aux (lua_State *L, int find) { |
| 578 | size_t ls, lp; | |
| 579 | const char *s = luaL_checklstring(L, 1, &ls); | |
| 580 | const char *p = luaL_checklstring(L, 2, &lp); | |
| 581 | size_t init = posrelat(luaL_optinteger(L, 3, 1), ls); | |
| 582 | if (init < 1) init = 1; | |
| 583 | else if (init > ls + 1) { /* start after string's end? */ | |
| 584 | lua_pushnil(L); /* cannot find anything */ | |
| 585 | return 1; | |
| 586 | } | |
| 587 | /* explicit request or no special characters? */ | |
| 588 | if (find && (lua_toboolean(L, 4) || nospecials(p, lp))) { | |
| 589 | /* do a plain search */ | |
| 590 | const char *s2 = lmemfind(s + init - 1, ls - init + 1, p, lp); | |
| 591 | if (s2) { | |
| 592 | lua_pushinteger(L, s2 - s + 1); | |
| 593 | lua_pushinteger(L, s2 - s + lp); | |
| 594 | return 2; | |
| 595 | } | |
| 596 | } | |
| 597 | else { | |
| 598 | MatchState ms; | |
| 599 | const char *s1 = s + init - 1; | |
| 600 | int anchor = (*p == '^'); | |
| 601 | if (anchor) { | |
| 602 | p++; lp--; /* skip anchor character */ | |
| 603 | } | |
| 604 | ms.L = L; | |
| 605 | ms.matchdepth = MAXCCALLS; | |
| 606 | ms.src_init = s; | |
| 607 | ms.src_end = s + ls; | |
| 608 | ms.p_end = p + lp; | |
| 609 | do { | |
| 610 | const char *res; | |
| 611 | ms.level = 0; | |
| 612 | lua_assert(ms.matchdepth == MAXCCALLS); | |
| 613 | if ((res=match(&ms, s1, p)) != NULL) { | |
| 614 | if (find) { | |
| 615 | lua_pushinteger(L, s1 - s + 1); /* start */ | |
| 616 | lua_pushinteger(L, res - s); /* end */ | |
| 617 | return push_captures(&ms, NULL, 0) + 2; | |
| 618 | } | |
| 619 | else | |
| 620 | return push_captures(&ms, s1, res); | |
| 621 | } | |
| 622 | } while (s1++ < ms.src_end && !anchor); | |
| 623 | } | |
| 624 | lua_pushnil(L); /* not found */ | |
| 625 | return 1; | |
| 578 | size_t ls, lp; | |
| 579 | const char *s = luaL_checklstring(L, 1, &ls); | |
| 580 | const char *p = luaL_checklstring(L, 2, &lp); | |
| 581 | size_t init = posrelat(luaL_optinteger(L, 3, 1), ls); | |
| 582 | if (init < 1) init = 1; | |
| 583 | else if (init > ls + 1) { /* start after string's end? */ | |
| 584 | lua_pushnil(L); /* cannot find anything */ | |
| 585 | return 1; | |
| 586 | } | |
| 587 | /* explicit request or no special characters? */ | |
| 588 | if (find && (lua_toboolean(L, 4) || nospecials(p, lp))) { | |
| 589 | /* do a plain search */ | |
| 590 | const char *s2 = lmemfind(s + init - 1, ls - init + 1, p, lp); | |
| 591 | if (s2) { | |
| 592 | lua_pushinteger(L, s2 - s + 1); | |
| 593 | lua_pushinteger(L, s2 - s + lp); | |
| 594 | return 2; | |
| 595 | } | |
| 596 | } | |
| 597 | else { | |
| 598 | MatchState ms; | |
| 599 | const char *s1 = s + init - 1; | |
| 600 | int anchor = (*p == '^'); | |
| 601 | if (anchor) { | |
| 602 | p++; lp--; /* skip anchor character */ | |
| 603 | } | |
| 604 | ms.L = L; | |
| 605 | ms.matchdepth = MAXCCALLS; | |
| 606 | ms.src_init = s; | |
| 607 | ms.src_end = s + ls; | |
| 608 | ms.p_end = p + lp; | |
| 609 | do { | |
| 610 | const char *res; | |
| 611 | ms.level = 0; | |
| 612 | lua_assert(ms.matchdepth == MAXCCALLS); | |
| 613 | if ((res=match(&ms, s1, p)) != NULL) { | |
| 614 | if (find) { | |
| 615 | lua_pushinteger(L, s1 - s + 1); /* start */ | |
| 616 | lua_pushinteger(L, res - s); /* end */ | |
| 617 | return push_captures(&ms, NULL, 0) + 2; | |
| 618 | } | |
| 619 | else | |
| 620 | return push_captures(&ms, s1, res); | |
| 621 | } | |
| 622 | } while (s1++ < ms.src_end && !anchor); | |
| 623 | } | |
| 624 | lua_pushnil(L); /* not found */ | |
| 625 | return 1; | |
| 626 | 626 | } |
| 627 | 627 | |
| 628 | 628 | |
| 629 | 629 | static int str_find (lua_State *L) { |
| 630 | ||
| 630 | return str_find_aux(L, 1); | |
| 631 | 631 | } |
| 632 | 632 | |
| 633 | 633 | |
| 634 | 634 | static int str_match (lua_State *L) { |
| 635 | ||
| 635 | return str_find_aux(L, 0); | |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | |
| 639 | 639 | static int gmatch_aux (lua_State *L) { |
| 640 | MatchState ms; | |
| 641 | size_t ls, lp; | |
| 642 | const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls); | |
| 643 | const char *p = lua_tolstring(L, lua_upvalueindex(2), &lp); | |
| 644 | const char *src; | |
| 645 | ms.L = L; | |
| 646 | ms.matchdepth = MAXCCALLS; | |
| 647 | ms.src_init = s; | |
| 648 | ms.src_end = s+ls; | |
| 649 | ms.p_end = p + lp; | |
| 650 | for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3)); | |
| 651 | src <= ms.src_end; | |
| 652 | src++) { | |
| 653 | const char *e; | |
| 654 | ms.level = 0; | |
| 655 | lua_assert(ms.matchdepth == MAXCCALLS); | |
| 656 | if ((e = match(&ms, src, p)) != NULL) { | |
| 657 | lua_Integer newstart = e-s; | |
| 658 | if (e == src) newstart++; /* empty match? go at least one position */ | |
| 659 | lua_pushinteger(L, newstart); | |
| 660 | lua_replace(L, lua_upvalueindex(3)); | |
| 661 | return push_captures(&ms, src, e); | |
| 662 | } | |
| 663 | } | |
| 664 | return 0; /* not found */ | |
| 640 | MatchState ms; | |
| 641 | size_t ls, lp; | |
| 642 | const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls); | |
| 643 | const char *p = lua_tolstring(L, lua_upvalueindex(2), &lp); | |
| 644 | const char *src; | |
| 645 | ms.L = L; | |
| 646 | ms.matchdepth = MAXCCALLS; | |
| 647 | ms.src_init = s; | |
| 648 | ms.src_end = s+ls; | |
| 649 | ms.p_end = p + lp; | |
| 650 | for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3)); | |
| 651 | src <= ms.src_end; | |
| 652 | src++) { | |
| 653 | const char *e; | |
| 654 | ms.level = 0; | |
| 655 | lua_assert(ms.matchdepth == MAXCCALLS); | |
| 656 | if ((e = match(&ms, src, p)) != NULL) { | |
| 657 | lua_Integer newstart = e-s; | |
| 658 | if (e == src) newstart++; /* empty match? go at least one position */ | |
| 659 | lua_pushinteger(L, newstart); | |
| 660 | lua_replace(L, lua_upvalueindex(3)); | |
| 661 | return push_captures(&ms, src, e); | |
| 662 | } | |
| 663 | } | |
| 664 | return 0; /* not found */ | |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | |
| 668 | 668 | static int gmatch (lua_State *L) { |
| 669 | luaL_checkstring(L, 1); | |
| 670 | luaL_checkstring(L, 2); | |
| 671 | lua_settop(L, 2); | |
| 672 | lua_pushinteger(L, 0); | |
| 673 | lua_pushcclosure(L, gmatch_aux, 3); | |
| 674 | return 1; | |
| 669 | luaL_checkstring(L, 1); | |
| 670 | luaL_checkstring(L, 2); | |
| 671 | lua_settop(L, 2); | |
| 672 | lua_pushinteger(L, 0); | |
| 673 | lua_pushcclosure(L, gmatch_aux, 3); | |
| 674 | return 1; | |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | |
| 678 | 678 | static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, |
| 679 | const char *e) { | |
| 680 | size_t l, i; | |
| 681 | const char *news = lua_tolstring(ms->L, 3, &l); | |
| 682 | for (i = 0; i < l; i++) { | |
| 683 | if (news[i] != L_ESC) | |
| 684 | luaL_addchar(b, news[i]); | |
| 685 | else { | |
| 686 | i++; /* skip ESC */ | |
| 687 | if (!isdigit(uchar(news[i]))) { | |
| 688 | if (news[i] != L_ESC) | |
| 689 | luaL_error(ms->L, "invalid use of " LUA_QL("%c") | |
| 690 | " in replacement string", L_ESC); | |
| 691 | luaL_addchar(b, news[i]); | |
| 692 | } | |
| 693 | else if (news[i] == '0') | |
| 694 | luaL_addlstring(b, s, e - s); | |
| 695 | else { | |
| 696 | push_onecapture(ms, news[i] - '1', s, e); | |
| 697 | luaL_addvalue(b); /* add capture to accumulated result */ | |
| 698 | } | |
| 699 | } | |
| 700 | } | |
| 679 | const char *e) { | |
| 680 | size_t l, i; | |
| 681 | const char *news = lua_tolstring(ms->L, 3, &l); | |
| 682 | for (i = 0; i < l; i++) { | |
| 683 | if (news[i] != L_ESC) | |
| 684 | luaL_addchar(b, news[i]); | |
| 685 | else { | |
| 686 | i++; /* skip ESC */ | |
| 687 | if (!isdigit(uchar(news[i]))) { | |
| 688 | if (news[i] != L_ESC) | |
| 689 | luaL_error(ms->L, "invalid use of " LUA_QL("%c") | |
| 690 | " in replacement string", L_ESC); | |
| 691 | luaL_addchar(b, news[i]); | |
| 692 | } | |
| 693 | else if (news[i] == '0') | |
| 694 | luaL_addlstring(b, s, e - s); | |
| 695 | else { | |
| 696 | push_onecapture(ms, news[i] - '1', s, e); | |
| 697 | luaL_addvalue(b); /* add capture to accumulated result */ | |
| 698 | } | |
| 699 | } | |
| 700 | } | |
| 701 | 701 | } |
| 702 | 702 | |
| 703 | 703 | |
| 704 | 704 | static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, |
| 705 | const char *e, int tr) { | |
| 706 | lua_State *L = ms->L; | |
| 707 | switch (tr) { | |
| 708 | case LUA_TFUNCTION: { | |
| 709 | int n; | |
| 710 | lua_pushvalue(L, 3); | |
| 711 | n = push_captures(ms, s, e); | |
| 712 | lua_call(L, n, 1); | |
| 713 | break; | |
| 714 | } | |
| 715 | case LUA_TTABLE: { | |
| 716 | push_onecapture(ms, 0, s, e); | |
| 717 | lua_gettable(L, 3); | |
| 718 | break; | |
| 719 | } | |
| 720 | default: { /* LUA_TNUMBER or LUA_TSTRING */ | |
| 721 | add_s(ms, b, s, e); | |
| 722 | return; | |
| 723 | } | |
| 724 | } | |
| 725 | if (!lua_toboolean(L, -1)) { /* nil or false? */ | |
| 726 | lua_pop(L, 1); | |
| 727 | lua_pushlstring(L, s, e - s); /* keep original text */ | |
| 728 | } | |
| 729 | else if (!lua_isstring(L, -1)) | |
| 730 | luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); | |
| 731 | luaL_addvalue(b); /* add result to accumulator */ | |
| 705 | const char *e, int tr) { | |
| 706 | lua_State *L = ms->L; | |
| 707 | switch (tr) { | |
| 708 | case LUA_TFUNCTION: { | |
| 709 | int n; | |
| 710 | lua_pushvalue(L, 3); | |
| 711 | n = push_captures(ms, s, e); | |
| 712 | lua_call(L, n, 1); | |
| 713 | break; | |
| 714 | } | |
| 715 | case LUA_TTABLE: { | |
| 716 | push_onecapture(ms, 0, s, e); | |
| 717 | lua_gettable(L, 3); | |
| 718 | break; | |
| 719 | } | |
| 720 | default: { /* LUA_TNUMBER or LUA_TSTRING */ | |
| 721 | add_s(ms, b, s, e); | |
| 722 | return; | |
| 723 | } | |
| 724 | } | |
| 725 | if (!lua_toboolean(L, -1)) { /* nil or false? */ | |
| 726 | lua_pop(L, 1); | |
| 727 | lua_pushlstring(L, s, e - s); /* keep original text */ | |
| 728 | } | |
| 729 | else if (!lua_isstring(L, -1)) | |
| 730 | luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); | |
| 731 | luaL_addvalue(b); /* add result to accumulator */ | |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | |
| 735 | 735 | static int str_gsub (lua_State *L) { |
| 736 | size_t srcl, lp; | |
| 737 | const char *src = luaL_checklstring(L, 1, &srcl); | |
| 738 | const char *p = luaL_checklstring(L, 2, &lp); | |
| 739 | int tr = lua_type(L, 3); | |
| 740 | size_t max_s = luaL_optinteger(L, 4, srcl+1); | |
| 741 | int anchor = (*p == '^'); | |
| 742 | size_t n = 0; | |
| 743 | MatchState ms; | |
| 744 | luaL_Buffer b; | |
| 745 | luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING || | |
| 746 | tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3, | |
| 747 | "string/function/table expected"); | |
| 748 | luaL_buffinit(L, &b); | |
| 749 | if (anchor) { | |
| 750 | p++; lp--; /* skip anchor character */ | |
| 751 | } | |
| 752 | ms.L = L; | |
| 753 | ms.matchdepth = MAXCCALLS; | |
| 754 | ms.src_init = src; | |
| 755 | ms.src_end = src+srcl; | |
| 756 | ms.p_end = p + lp; | |
| 757 | while (n < max_s) { | |
| 758 | const char *e; | |
| 759 | ms.level = 0; | |
| 760 | lua_assert(ms.matchdepth == MAXCCALLS); | |
| 761 | e = match(&ms, src, p); | |
| 762 | if (e) { | |
| 763 | n++; | |
| 764 | add_value(&ms, &b, src, e, tr); | |
| 765 | } | |
| 766 | if (e && e>src) /* non empty match? */ | |
| 767 | src = e; /* skip it */ | |
| 768 | else if (src < ms.src_end) | |
| 769 | luaL_addchar(&b, *src++); | |
| 770 | else break; | |
| 771 | if (anchor) break; | |
| 772 | } | |
| 773 | luaL_addlstring(&b, src, ms.src_end-src); | |
| 774 | luaL_pushresult(&b); | |
| 775 | lua_pushinteger(L, n); /* number of substitutions */ | |
| 776 | return 2; | |
| 736 | size_t srcl, lp; | |
| 737 | const char *src = luaL_checklstring(L, 1, &srcl); | |
| 738 | const char *p = luaL_checklstring(L, 2, &lp); | |
| 739 | int tr = lua_type(L, 3); | |
| 740 | size_t max_s = luaL_optinteger(L, 4, srcl+1); | |
| 741 | int anchor = (*p == '^'); | |
| 742 | size_t n = 0; | |
| 743 | MatchState ms; | |
| 744 | luaL_Buffer b; | |
| 745 | luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING || | |
| 746 | tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3, | |
| 747 | "string/function/table expected"); | |
| 748 | luaL_buffinit(L, &b); | |
| 749 | if (anchor) { | |
| 750 | p++; lp--; /* skip anchor character */ | |
| 751 | } | |
| 752 | ms.L = L; | |
| 753 | ms.matchdepth = MAXCCALLS; | |
| 754 | ms.src_init = src; | |
| 755 | ms.src_end = src+srcl; | |
| 756 | ms.p_end = p + lp; | |
| 757 | while (n < max_s) { | |
| 758 | const char *e; | |
| 759 | ms.level = 0; | |
| 760 | lua_assert(ms.matchdepth == MAXCCALLS); | |
| 761 | e = match(&ms, src, p); | |
| 762 | if (e) { | |
| 763 | n++; | |
| 764 | add_value(&ms, &b, src, e, tr); | |
| 765 | } | |
| 766 | if (e && e>src) /* non empty match? */ | |
| 767 | src = e; /* skip it */ | |
| 768 | else if (src < ms.src_end) | |
| 769 | luaL_addchar(&b, *src++); | |
| 770 | else break; | |
| 771 | if (anchor) break; | |
| 772 | } | |
| 773 | luaL_addlstring(&b, src, ms.src_end-src); | |
| 774 | luaL_pushresult(&b); | |
| 775 | lua_pushinteger(L, n); /* number of substitutions */ | |
| 776 | return 2; | |
| 777 | 777 | } |
| 778 | 778 | |
| 779 | 779 | /* }====================================================== */ |
| r31373 | r31374 | |
| 791 | 791 | ** 'string.format'; LUA_INTFRM_T is the integer type corresponding to |
| 792 | 792 | ** the previous length |
| 793 | 793 | */ |
| 794 | #if !defined(LUA_INTFRMLEN) | |
| 794 | #if !defined(LUA_INTFRMLEN) /* { */ | |
| 795 | 795 | #if defined(LUA_USE_LONGLONG) |
| 796 | 796 | |
| 797 | #define LUA_INTFRMLEN "ll" | |
| 798 | #define LUA_INTFRM_T long long | |
| 797 | #define LUA_INTFRMLEN "ll" | |
| 798 | #define LUA_INTFRM_T long long | |
| 799 | 799 | |
| 800 | 800 | #else |
| 801 | 801 | |
| 802 | #define LUA_INTFRMLEN "l" | |
| 803 | #define LUA_INTFRM_T long | |
| 802 | #define LUA_INTFRMLEN "l" | |
| 803 | #define LUA_INTFRM_T long | |
| 804 | 804 | |
| 805 | 805 | #endif |
| 806 | #endif | |
| 806 | #endif /* } */ | |
| 807 | 807 | |
| 808 | 808 | |
| 809 | 809 | /* |
| r31373 | r31374 | |
| 813 | 813 | */ |
| 814 | 814 | #if !defined(LUA_FLTFRMLEN) |
| 815 | 815 | |
| 816 | #define LUA_FLTFRMLEN "" | |
| 817 | #define LUA_FLTFRM_T double | |
| 816 | #define LUA_FLTFRMLEN "" | |
| 817 | #define LUA_FLTFRM_T double | |
| 818 | 818 | |
| 819 | 819 | #endif |
| 820 | 820 | |
| 821 | 821 | |
| 822 | 822 | /* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ |
| 823 | #define MAX_ITEM | |
| 823 | #define MAX_ITEM 512 | |
| 824 | 824 | /* valid flags in a format specification */ |
| 825 | #define FLAGS | |
| 825 | #define FLAGS "-+ #0" | |
| 826 | 826 | /* |
| 827 | 827 | ** maximum size of each format specification (such as '%-099.99d') |
| 828 | 828 | ** (+10 accounts for %99.99x plus margin of error) |
| 829 | 829 | */ |
| 830 | #define MAX_FORMAT | |
| 830 | #define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10) | |
| 831 | 831 | |
| 832 | 832 | |
| 833 | 833 | static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { |
| 834 | size_t l; | |
| 835 | const char *s = luaL_checklstring(L, arg, &l); | |
| 836 | luaL_addchar(b, '"'); | |
| 837 | while (l--) { | |
| 838 | if (*s == '"' || *s == '\\' || *s == '\n') { | |
| 839 | luaL_addchar(b, '\\'); | |
| 840 | luaL_addchar(b, *s); | |
| 841 | } | |
| 842 | else if (*s == '\0' || iscntrl(uchar(*s))) { | |
| 843 | char buff[10]; | |
| 844 | if (!isdigit(uchar(*(s+1)))) | |
| 845 | sprintf(buff, "\\%d", (int)uchar(*s)); | |
| 846 | else | |
| 847 | sprintf(buff, "\\%03d", (int)uchar(*s)); | |
| 848 | luaL_addstring(b, buff); | |
| 849 | } | |
| 850 | else | |
| 851 | luaL_addchar(b, *s); | |
| 852 | s++; | |
| 853 | } | |
| 854 | luaL_addchar(b, '"'); | |
| 834 | size_t l; | |
| 835 | const char *s = luaL_checklstring(L, arg, &l); | |
| 836 | luaL_addchar(b, '"'); | |
| 837 | while (l--) { | |
| 838 | if (*s == '"' || *s == '\\' || *s == '\n') { | |
| 839 | luaL_addchar(b, '\\'); | |
| 840 | luaL_addchar(b, *s); | |
| 841 | } | |
| 842 | else if (*s == '\0' || iscntrl(uchar(*s))) { | |
| 843 | char buff[10]; | |
| 844 | if (!isdigit(uchar(*(s+1)))) | |
| 845 | sprintf(buff, "\\%d", (int)uchar(*s)); | |
| 846 | else | |
| 847 | sprintf(buff, "\\%03d", (int)uchar(*s)); | |
| 848 | luaL_addstring(b, buff); | |
| 849 | } | |
| 850 | else | |
| 851 | luaL_addchar(b, *s); | |
| 852 | s++; | |
| 853 | } | |
| 854 | luaL_addchar(b, '"'); | |
| 855 | 855 | } |
| 856 | 856 | |
| 857 | 857 | static const char *scanformat (lua_State *L, const char *strfrmt, char *form) { |
| 858 | const char *p = strfrmt; | |
| 859 | while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */ | |
| 860 | if ((size_t)(p - strfrmt) >= sizeof(FLAGS)/sizeof(char)) | |
| 861 | luaL_error(L, "invalid format (repeated flags)"); | |
| 862 | if (isdigit(uchar(*p))) p++; /* skip width */ | |
| 863 | if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ | |
| 864 | if (*p == '.') { | |
| 865 | p++; | |
| 866 | if (isdigit(uchar(*p))) p++; /* skip precision */ | |
| 867 | if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ | |
| 868 | } | |
| 869 | if (isdigit(uchar(*p))) | |
| 870 | luaL_error(L, "invalid format (width or precision too long)"); | |
| 871 | *(form++) = '%'; | |
| 872 | memcpy(form, strfrmt, (p - strfrmt + 1) * sizeof(char)); | |
| 873 | form += p - strfrmt + 1; | |
| 874 | *form = '\0'; | |
| 875 | return p; | |
| 858 | const char *p = strfrmt; | |
| 859 | while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */ | |
| 860 | if ((size_t)(p - strfrmt) >= sizeof(FLAGS)/sizeof(char)) | |
| 861 | luaL_error(L, "invalid format (repeated flags)"); | |
| 862 | if (isdigit(uchar(*p))) p++; /* skip width */ | |
| 863 | if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ | |
| 864 | if (*p == '.') { | |
| 865 | p++; | |
| 866 | if (isdigit(uchar(*p))) p++; /* skip precision */ | |
| 867 | if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ | |
| 868 | } | |
| 869 | if (isdigit(uchar(*p))) | |
| 870 | luaL_error(L, "invalid format (width or precision too long)"); | |
| 871 | *(form++) = '%'; | |
| 872 | memcpy(form, strfrmt, (p - strfrmt + 1) * sizeof(char)); | |
| 873 | form += p - strfrmt + 1; | |
| 874 | *form = '\0'; | |
| 875 | return p; | |
| 876 | 876 | } |
| 877 | 877 | |
| 878 | 878 | |
| r31373 | r31374 | |
| 880 | 880 | ** add length modifier into formats |
| 881 | 881 | */ |
| 882 | 882 | static void addlenmod (char *form, const char *lenmod) { |
| 883 | size_t l = strlen(form); | |
| 884 | size_t lm = strlen(lenmod); | |
| 885 | char spec = form[l - 1]; | |
| 886 | strcpy(form + l - 1, lenmod); | |
| 887 | form[l + lm - 1] = spec; | |
| 888 | form[l + lm] = '\0'; | |
| 883 | size_t l = strlen(form); | |
| 884 | size_t lm = strlen(lenmod); | |
| 885 | char spec = form[l - 1]; | |
| 886 | strcpy(form + l - 1, lenmod); | |
| 887 | form[l + lm - 1] = spec; | |
| 888 | form[l + lm] = '\0'; | |
| 889 | 889 | } |
| 890 | 890 | |
| 891 | 891 | |
| 892 | 892 | static int str_format (lua_State *L) { |
| 893 | int top = lua_gettop(L); | |
| 894 | int arg = 1; | |
| 895 | size_t sfl; | |
| 896 | const char *strfrmt = luaL_checklstring(L, arg, &sfl); | |
| 897 | const char *strfrmt_end = strfrmt+sfl; | |
| 898 | luaL_Buffer b; | |
| 899 | luaL_buffinit(L, &b); | |
| 900 | while (strfrmt < strfrmt_end) { | |
| 901 | if (*strfrmt != L_ESC) | |
| 902 | luaL_addchar(&b, *strfrmt++); | |
| 903 | else if (*++strfrmt == L_ESC) | |
| 904 | luaL_addchar(&b, *strfrmt++); /* %% */ | |
| 905 | else { /* format item */ | |
| 906 | char form[MAX_FORMAT]; /* to store the format (`%...') */ | |
| 907 | char *buff = luaL_prepbuffsize(&b, MAX_ITEM); /* to put formatted item */ | |
| 908 | int nb = 0; /* number of bytes in added item */ | |
| 909 | if (++arg > top) | |
| 910 | luaL_argerror(L, arg, "no value"); | |
| 911 | strfrmt = scanformat(L, strfrmt, form); | |
| 912 | switch (*strfrmt++) { | |
| 913 | case 'c': { | |
| 914 | nb = sprintf(buff, form, luaL_checkint(L, arg)); | |
| 915 | break; | |
| 916 | } | |
| 917 | case 'd': case 'i': { | |
| 918 | lua_Number n = luaL_checknumber(L, arg); | |
| 919 | LUA_INTFRM_T ni = (LUA_INTFRM_T)n; | |
| 920 | lua_Number diff = n - (lua_Number)ni; | |
| 921 | luaL_argcheck(L, -1 < diff && diff < 1, arg, | |
| 922 | "not a number in proper range"); | |
| 923 | addlenmod(form, LUA_INTFRMLEN); | |
| 924 | nb = sprintf(buff, form, ni); | |
| 925 | break; | |
| 926 | } | |
| 927 | case 'o': case 'u': case 'x': case 'X': { | |
| 928 | lua_Number n = luaL_checknumber(L, arg); | |
| 929 | unsigned LUA_INTFRM_T ni = (unsigned LUA_INTFRM_T)n; | |
| 930 | lua_Number diff = n - (lua_Number)ni; | |
| 931 | luaL_argcheck(L, -1 < diff && diff < 1, arg, | |
| 932 | "not a non-negative number in proper range"); | |
| 933 | addlenmod(form, LUA_INTFRMLEN); | |
| 934 | nb = sprintf(buff, form, ni); | |
| 935 | break; | |
| 936 | } | |
| 937 | case 'e': case 'E': case 'f': | |
| 893 | int top = lua_gettop(L); | |
| 894 | int arg = 1; | |
| 895 | size_t sfl; | |
| 896 | const char *strfrmt = luaL_checklstring(L, arg, &sfl); | |
| 897 | const char *strfrmt_end = strfrmt+sfl; | |
| 898 | luaL_Buffer b; | |
| 899 | luaL_buffinit(L, &b); | |
| 900 | while (strfrmt < strfrmt_end) { | |
| 901 | if (*strfrmt != L_ESC) | |
| 902 | luaL_addchar(&b, *strfrmt++); | |
| 903 | else if (*++strfrmt == L_ESC) | |
| 904 | luaL_addchar(&b, *strfrmt++); /* %% */ | |
| 905 | else { /* format item */ | |
| 906 | char form[MAX_FORMAT]; /* to store the format (`%...') */ | |
| 907 | char *buff = luaL_prepbuffsize(&b, MAX_ITEM); /* to put formatted item */ | |
| 908 | int nb = 0; /* number of bytes in added item */ | |
| 909 | if (++arg > top) | |
| 910 | luaL_argerror(L, arg, "no value"); | |
| 911 | strfrmt = scanformat(L, strfrmt, form); | |
| 912 | switch (*strfrmt++) { | |
| 913 | case 'c': { | |
| 914 | nb = sprintf(buff, form, luaL_checkint(L, arg)); | |
| 915 | break; | |
| 916 | } | |
| 917 | case 'd': case 'i': { | |
| 918 | lua_Number n = luaL_checknumber(L, arg); | |
| 919 | LUA_INTFRM_T ni = (LUA_INTFRM_T)n; | |
| 920 | lua_Number diff = n - (lua_Number)ni; | |
| 921 | luaL_argcheck(L, -1 < diff && diff < 1, arg, | |
| 922 | "not a number in proper range"); | |
| 923 | addlenmod(form, LUA_INTFRMLEN); | |
| 924 | nb = sprintf(buff, form, ni); | |
| 925 | break; | |
| 926 | } | |
| 927 | case 'o': case 'u': case 'x': case 'X': { | |
| 928 | lua_Number n = luaL_checknumber(L, arg); | |
| 929 | unsigned LUA_INTFRM_T ni = (unsigned LUA_INTFRM_T)n; | |
| 930 | lua_Number diff = n - (lua_Number)ni; | |
| 931 | luaL_argcheck(L, -1 < diff && diff < 1, arg, | |
| 932 | "not a non-negative number in proper range"); | |
| 933 | addlenmod(form, LUA_INTFRMLEN); | |
| 934 | nb = sprintf(buff, form, ni); | |
| 935 | break; | |
| 936 | } | |
| 937 | case 'e': case 'E': case 'f': | |
| 938 | 938 | #if defined(LUA_USE_AFORMAT) |
| 939 | ||
| 939 | case 'a': case 'A': | |
| 940 | 940 | #endif |
| 941 | case 'g': case 'G': { | |
| 942 | addlenmod(form, LUA_FLTFRMLEN); | |
| 943 | nb = sprintf(buff, form, (LUA_FLTFRM_T)luaL_checknumber(L, arg)); | |
| 944 | break; | |
| 945 | } | |
| 946 | case 'q': { | |
| 947 | addquoted(L, &b, arg); | |
| 948 | break; | |
| 949 | } | |
| 950 | case 's': { | |
| 951 | size_t l; | |
| 952 | const char *s = luaL_tolstring(L, arg, &l); | |
| 953 | if (!strchr(form, '.') && l >= 100) { | |
| 954 | /* no precision and string is too long to be formatted; | |
| 955 | keep original string */ | |
| 956 | luaL_addvalue(&b); | |
| 957 | break; | |
| 958 | } | |
| 959 | else { | |
| 960 | nb = sprintf(buff, form, s); | |
| 961 | lua_pop(L, 1); /* remove result from 'luaL_tolstring' */ | |
| 962 | break; | |
| 963 | } | |
| 964 | } | |
| 965 | default: { /* also treat cases `pnLlh' */ | |
| 966 | return luaL_error(L, "invalid option " LUA_QL("%%%c") " to " | |
| 967 | LUA_QL("format"), *(strfrmt - 1)); | |
| 968 | } | |
| 969 | } | |
| 970 | luaL_addsize(&b, nb); | |
| 971 | } | |
| 972 | } | |
| 973 | luaL_pushresult(&b); | |
| 974 | return 1; | |
| 941 | case 'g': case 'G': { | |
| 942 | addlenmod(form, LUA_FLTFRMLEN); | |
| 943 | nb = sprintf(buff, form, (LUA_FLTFRM_T)luaL_checknumber(L, arg)); | |
| 944 | break; | |
| 945 | } | |
| 946 | case 'q': { | |
| 947 | addquoted(L, &b, arg); | |
| 948 | break; | |
| 949 | } | |
| 950 | case 's': { | |
| 951 | size_t l; | |
| 952 | const char *s = luaL_tolstring(L, arg, &l); | |
| 953 | if (!strchr(form, '.') && l >= 100) { | |
| 954 | /* no precision and string is too long to be formatted; | |
| 955 | keep original string */ | |
| 956 | luaL_addvalue(&b); | |
| 957 | break; | |
| 958 | } | |
| 959 | else { | |
| 960 | nb = sprintf(buff, form, s); | |
| 961 | lua_pop(L, 1); /* remove result from 'luaL_tolstring' */ | |
| 962 | break; | |
| 963 | } | |
| 964 | } | |
| 965 | default: { /* also treat cases `pnLlh' */ | |
| 966 | return luaL_error(L, "invalid option " LUA_QL("%%%c") " to " | |
| 967 | LUA_QL("format"), *(strfrmt - 1)); | |
| 968 | } | |
| 969 | } | |
| 970 | luaL_addsize(&b, nb); | |
| 971 | } | |
| 972 | } | |
| 973 | luaL_pushresult(&b); | |
| 974 | return 1; | |
| 975 | 975 | } |
| 976 | 976 | |
| 977 | 977 | /* }====================================================== */ |
| 978 | 978 | |
| 979 | 979 | |
| 980 | 980 | static const luaL_Reg strlib[] = { |
| 981 | {"byte", str_byte}, | |
| 982 | {"char", str_char}, | |
| 983 | {"dump", str_dump}, | |
| 984 | {"find", str_find}, | |
| 985 | {"format", str_format}, | |
| 986 | {"gmatch", gmatch}, | |
| 987 | {"gsub", str_gsub}, | |
| 988 | {"len", str_len}, | |
| 989 | {"lower", str_lower}, | |
| 990 | {"match", str_match}, | |
| 991 | {"rep", str_rep}, | |
| 992 | {"reverse", str_reverse}, | |
| 993 | {"sub", str_sub}, | |
| 994 | {"upper", str_upper}, | |
| 995 | {NULL, NULL} | |
| 981 | {"byte", str_byte}, | |
| 982 | {"char", str_char}, | |
| 983 | {"dump", str_dump}, | |
| 984 | {"find", str_find}, | |
| 985 | {"format", str_format}, | |
| 986 | {"gmatch", gmatch}, | |
| 987 | {"gsub", str_gsub}, | |
| 988 | {"len", str_len}, | |
| 989 | {"lower", str_lower}, | |
| 990 | {"match", str_match}, | |
| 991 | {"rep", str_rep}, | |
| 992 | {"reverse", str_reverse}, | |
| 993 | {"sub", str_sub}, | |
| 994 | {"upper", str_upper}, | |
| 995 | {NULL, NULL} | |
| 996 | 996 | }; |
| 997 | 997 | |
| 998 | 998 | |
| 999 | 999 | static void createmetatable (lua_State *L) { |
| 1000 | lua_createtable(L, 0, 1); /* table to be metatable for strings */ | |
| 1001 | lua_pushliteral(L, ""); /* dummy string */ | |
| 1002 | lua_pushvalue(L, -2); /* copy table */ | |
| 1003 | lua_setmetatable(L, -2); /* set table as metatable for strings */ | |
| 1004 | lua_pop(L, 1); /* pop dummy string */ | |
| 1005 | lua_pushvalue(L, -2); /* get string library */ | |
| 1006 | lua_setfield(L, -2, "__index"); /* metatable.__index = string */ | |
| 1007 | lua_pop(L, 1); /* pop metatable */ | |
| 1000 | lua_createtable(L, 0, 1); /* table to be metatable for strings */ | |
| 1001 | lua_pushliteral(L, ""); /* dummy string */ | |
| 1002 | lua_pushvalue(L, -2); /* copy table */ | |
| 1003 | lua_setmetatable(L, -2); /* set table as metatable for strings */ | |
| 1004 | lua_pop(L, 1); /* pop dummy string */ | |
| 1005 | lua_pushvalue(L, -2); /* get string library */ | |
| 1006 | lua_setfield(L, -2, "__index"); /* metatable.__index = string */ | |
| 1007 | lua_pop(L, 1); /* pop metatable */ | |
| 1008 | 1008 | } |
| 1009 | 1009 | |
| 1010 | 1010 | |
| r31373 | r31374 | |
| 1012 | 1012 | ** Open string library |
| 1013 | 1013 | */ |
| 1014 | 1014 | LUAMOD_API int luaopen_string (lua_State *L) { |
| 1015 | luaL_newlib(L, strlib); | |
| 1016 | createmetatable(L); | |
| 1017 | return 1; | |
| 1015 | luaL_newlib(L, strlib); | |
| 1016 | createmetatable(L); | |
| 1017 | return 1; | |
| 1018 | 1018 | } |
| 1019 |
| r31373 | r31374 | |
|---|---|---|
| 50 | 50 | |
| 51 | 51 | #if defined(__cplusplus) && !defined(LUA_USE_LONGJMP) |
| 52 | 52 | /* C++ exceptions */ |
| 53 | #define LUAI_THROW(L,c) | |
| 53 | #define LUAI_THROW(L,c) throw(c) | |
| 54 | 54 | #define LUAI_TRY(L,c,a) \ |
| 55 | 55 | try { a } catch(...) { if ((c)->status == 0) (c)->status = -1; } |
| 56 | #define luai_jmpbuf | |
| 56 | #define luai_jmpbuf int /* dummy variable */ | |
| 57 | 57 | |
| 58 | 58 | #elif defined(LUA_USE_ULONGJMP) |
| 59 | 59 | /* in Unix, try _longjmp/_setjmp (more efficient) */ |
| 60 | #define LUAI_THROW(L,c) _longjmp((c)->b, 1) | |
| 61 | #define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } | |
| 62 | #define luai_jmpbuf jmp_buf | |
| 60 | #define LUAI_THROW(L,c) _longjmp((c)->b, 1) | |
| 61 | #define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } | |
| 62 | #define luai_jmpbuf jmp_buf | |
| 63 | 63 | |
| 64 | 64 | #else |
| 65 | 65 | /* default handling with long jumps */ |
| 66 | #define LUAI_THROW(L,c) longjmp((c)->b, 1) | |
| 67 | #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } | |
| 68 | #define luai_jmpbuf jmp_buf | |
| 66 | #define LUAI_THROW(L,c) longjmp((c)->b, 1) | |
| 67 | #define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } | |
| 68 | #define luai_jmpbuf jmp_buf | |
| 69 | 69 | |
| 70 | 70 | #endif |
| 71 | 71 | |
| r31373 | r31374 | |
| 75 | 75 | |
| 76 | 76 | /* chain list of long jump buffers */ |
| 77 | 77 | struct lua_longjmp { |
| 78 | struct lua_longjmp *previous; | |
| 79 | luai_jmpbuf b; | |
| 80 | volatile int status; /* error code */ | |
| 78 | struct lua_longjmp *previous; | |
| 79 | luai_jmpbuf b; | |
| 80 | volatile int status; /* error code */ | |
| 81 | 81 | }; |
| 82 | 82 | |
| 83 | 83 | |
| 84 | 84 | static void seterrorobj (lua_State *L, int errcode, StkId oldtop) { |
| 85 | switch (errcode) { | |
| 86 | case LUA_ERRMEM: { /* memory error? */ | |
| 87 | setsvalue2s(L, oldtop, G(L)->memerrmsg); /* reuse preregistered msg. */ | |
| 88 | break; | |
| 89 | } | |
| 90 | case LUA_ERRERR: { | |
| 91 | setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); | |
| 92 | break; | |
| 93 | } | |
| 94 | default: { | |
| 95 | setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ | |
| 96 | break; | |
| 97 | } | |
| 98 | } | |
| 99 | L->top = oldtop + 1; | |
| 85 | switch (errcode) { | |
| 86 | case LUA_ERRMEM: { /* memory error? */ | |
| 87 | setsvalue2s(L, oldtop, G(L)->memerrmsg); /* reuse preregistered msg. */ | |
| 88 | break; | |
| 89 | } | |
| 90 | case LUA_ERRERR: { | |
| 91 | setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); | |
| 92 | break; | |
| 93 | } | |
| 94 | default: { | |
| 95 | setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ | |
| 96 | break; | |
| 97 | } | |
| 98 | } | |
| 99 | L->top = oldtop + 1; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | l_noret luaD_throw (lua_State *L, int errcode) { |
| 104 | if (L->errorJmp) { /* thread has an error handler? */ | |
| 105 | L->errorJmp->status = errcode; /* set status */ | |
| 106 | LUAI_THROW(L, L->errorJmp); /* jump to it */ | |
| 107 | } | |
| 108 | else { /* thread has no error handler */ | |
| 109 | L->status = cast_byte(errcode); /* mark it as dead */ | |
| 110 | if (G(L)->mainthread->errorJmp) { /* main thread has a handler? */ | |
| 111 | setobjs2s(L, G(L)->mainthread->top++, L->top - 1); /* copy error obj. */ | |
| 112 | luaD_throw(G(L)->mainthread, errcode); /* re-throw in main thread */ | |
| 113 | } | |
| 114 | else { /* no handler at all; abort */ | |
| 115 | if (G(L)->panic) { /* panic function? */ | |
| 116 | lua_unlock(L); | |
| 117 | G(L)->panic(L); /* call it (last chance to jump out) */ | |
| 118 | } | |
| 119 | abort(); | |
| 120 | } | |
| 121 | } | |
| 104 | if (L->errorJmp) { /* thread has an error handler? */ | |
| 105 | L->errorJmp->status = errcode; /* set status */ | |
| 106 | LUAI_THROW(L, L->errorJmp); /* jump to it */ | |
| 107 | } | |
| 108 | else { /* thread has no error handler */ | |
| 109 | L->status = cast_byte(errcode); /* mark it as dead */ | |
| 110 | if (G(L)->mainthread->errorJmp) { /* main thread has a handler? */ | |
| 111 | setobjs2s(L, G(L)->mainthread->top++, L->top - 1); /* copy error obj. */ | |
| 112 | luaD_throw(G(L)->mainthread, errcode); /* re-throw in main thread */ | |
| 113 | } | |
| 114 | else { /* no handler at all; abort */ | |
| 115 | if (G(L)->panic) { /* panic function? */ | |
| 116 | lua_unlock(L); | |
| 117 | G(L)->panic(L); /* call it (last chance to jump out) */ | |
| 118 | } | |
| 119 | abort(); | |
| 120 | } | |
| 121 | } | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { |
| 126 | unsigned short oldnCcalls = L->nCcalls; | |
| 127 | struct lua_longjmp lj; | |
| 128 | lj.status = LUA_OK; | |
| 129 | lj.previous = L->errorJmp; /* chain new error handler */ | |
| 130 | L->errorJmp = &lj; | |
| 131 | LUAI_TRY(L, &lj, | |
| 132 | (*f)(L, ud); | |
| 133 | ); | |
| 134 | L->errorJmp = lj.previous; /* restore old error handler */ | |
| 135 | L->nCcalls = oldnCcalls; | |
| 136 | return lj.status; | |
| 126 | unsigned short oldnCcalls = L->nCcalls; | |
| 127 | struct lua_longjmp lj; | |
| 128 | lj.status = LUA_OK; | |
| 129 | lj.previous = L->errorJmp; /* chain new error handler */ | |
| 130 | L->errorJmp = &lj; | |
| 131 | LUAI_TRY(L, &lj, | |
| 132 | (*f)(L, ud); | |
| 133 | ); | |
| 134 | L->errorJmp = lj.previous; /* restore old error handler */ | |
| 135 | L->nCcalls = oldnCcalls; | |
| 136 | return lj.status; | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | /* }====================================================== */ |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | static void correctstack (lua_State *L, TValue *oldstack) { |
| 143 | CallInfo *ci; | |
| 144 | GCObject *up; | |
| 145 | L->top = (L->top - oldstack) + L->stack; | |
| 146 | for (up = L->openupval; up != NULL; up = up->gch.next) | |
| 147 | gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack; | |
| 148 | for (ci = L->ci; ci != NULL; ci = ci->previous) { | |
| 149 | ci->top = (ci->top - oldstack) + L->stack; | |
| 150 | ci->func = (ci->func - oldstack) + L->stack; | |
| 151 | if (isLua(ci)) | |
| 152 | ci->u.l.base = (ci->u.l.base - oldstack) + L->stack; | |
| 153 | } | |
| 143 | CallInfo *ci; | |
| 144 | GCObject *up; | |
| 145 | L->top = (L->top - oldstack) + L->stack; | |
| 146 | for (up = L->openupval; up != NULL; up = up->gch.next) | |
| 147 | gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack; | |
| 148 | for (ci = L->ci; ci != NULL; ci = ci->previous) { | |
| 149 | ci->top = (ci->top - oldstack) + L->stack; | |
| 150 | ci->func = (ci->func - oldstack) + L->stack; | |
| 151 | if (isLua(ci)) | |
| 152 | ci->u.l.base = (ci->u.l.base - oldstack) + L->stack; | |
| 153 | } | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | /* some space for error handling */ |
| 158 | #define ERRORSTACKSIZE | |
| 158 | #define ERRORSTACKSIZE (LUAI_MAXSTACK + 200) | |
| 159 | 159 | |
| 160 | 160 | |
| 161 | 161 | void luaD_reallocstack (lua_State *L, int newsize) { |
| 162 | TValue *oldstack = L->stack; | |
| 163 | int lim = L->stacksize; | |
| 164 | lua_assert(newsize <= LUAI_MAXSTACK || newsize == ERRORSTACKSIZE); | |
| 165 | lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK); | |
| 166 | luaM_reallocvector(L, L->stack, L->stacksize, newsize, TValue); | |
| 167 | for (; lim < newsize; lim++) | |
| 168 | setnilvalue(L->stack + lim); /* erase new segment */ | |
| 169 | L->stacksize = newsize; | |
| 170 | L->stack_last = L->stack + newsize - EXTRA_STACK; | |
| 171 | correctstack(L, oldstack); | |
| 162 | TValue *oldstack = L->stack; | |
| 163 | int lim = L->stacksize; | |
| 164 | lua_assert(newsize <= LUAI_MAXSTACK || newsize == ERRORSTACKSIZE); | |
| 165 | lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK); | |
| 166 | luaM_reallocvector(L, L->stack, L->stacksize, newsize, TValue); | |
| 167 | for (; lim < newsize; lim++) | |
| 168 | setnilvalue(L->stack + lim); /* erase new segment */ | |
| 169 | L->stacksize = newsize; | |
| 170 | L->stack_last = L->stack + newsize - EXTRA_STACK; | |
| 171 | correctstack(L, oldstack); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | void luaD_growstack (lua_State *L, int n) { |
| 176 | int size = L->stacksize; | |
| 177 | if (size > LUAI_MAXSTACK) /* error after extra size? */ | |
| 178 | luaD_throw(L, LUA_ERRERR); | |
| 179 | else { | |
| 180 | int needed = cast_int(L->top - L->stack) + n + EXTRA_STACK; | |
| 181 | int newsize = 2 * size; | |
| 182 | if (newsize > LUAI_MAXSTACK) newsize = LUAI_MAXSTACK; | |
| 183 | if (newsize < needed) newsize = needed; | |
| 184 | if (newsize > LUAI_MAXSTACK) { /* stack overflow? */ | |
| 185 | luaD_reallocstack(L, ERRORSTACKSIZE); | |
| 186 | luaG_runerror(L, "stack overflow"); | |
| 187 | } | |
| 188 | else | |
| 189 | luaD_reallocstack(L, newsize); | |
| 190 | } | |
| 176 | int size = L->stacksize; | |
| 177 | if (size > LUAI_MAXSTACK) /* error after extra size? */ | |
| 178 | luaD_throw(L, LUA_ERRERR); | |
| 179 | else { | |
| 180 | int needed = cast_int(L->top - L->stack) + n + EXTRA_STACK; | |
| 181 | int newsize = 2 * size; | |
| 182 | if (newsize > LUAI_MAXSTACK) newsize = LUAI_MAXSTACK; | |
| 183 | if (newsize < needed) newsize = needed; | |
| 184 | if (newsize > LUAI_MAXSTACK) { /* stack overflow? */ | |
| 185 | luaD_reallocstack(L, ERRORSTACKSIZE); | |
| 186 | luaG_runerror(L, "stack overflow"); | |
| 187 | } | |
| 188 | else | |
| 189 | luaD_reallocstack(L, newsize); | |
| 190 | } | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | |
| 194 | 194 | static int stackinuse (lua_State *L) { |
| 195 | CallInfo *ci; | |
| 196 | StkId lim = L->top; | |
| 197 | for (ci = L->ci; ci != NULL; ci = ci->previous) { | |
| 198 | lua_assert(ci->top <= L->stack_last); | |
| 199 | if (lim < ci->top) lim = ci->top; | |
| 200 | } | |
| 201 | return cast_int(lim - L->stack) + 1; /* part of stack in use */ | |
| 195 | CallInfo *ci; | |
| 196 | StkId lim = L->top; | |
| 197 | for (ci = L->ci; ci != NULL; ci = ci->previous) { | |
| 198 | lua_assert(ci->top <= L->stack_last); | |
| 199 | if (lim < ci->top) lim = ci->top; | |
| 200 | } | |
| 201 | return cast_int(lim - L->stack) + 1; /* part of stack in use */ | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | 205 | void luaD_shrinkstack (lua_State *L) { |
| 206 | int inuse = stackinuse(L); | |
| 207 | int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; | |
| 208 | if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; | |
| 209 | if (inuse > LUAI_MAXSTACK || /* handling stack overflow? */ | |
| 210 | goodsize >= L->stacksize) /* would grow instead of shrink? */ | |
| 211 | condmovestack(L); /* don't change stack (change only for debugging) */ | |
| 212 | else | |
| 213 | luaD_reallocstack(L, goodsize); /* shrink it */ | |
| 206 | int inuse = stackinuse(L); | |
| 207 | int goodsize = inuse + (inuse / 8) + 2*EXTRA_STACK; | |
| 208 | if (goodsize > LUAI_MAXSTACK) goodsize = LUAI_MAXSTACK; | |
| 209 | if (inuse > LUAI_MAXSTACK || /* handling stack overflow? */ | |
| 210 | goodsize >= L->stacksize) /* would grow instead of shrink? */ | |
| 211 | condmovestack(L); /* don't change stack (change only for debugging) */ | |
| 212 | else | |
| 213 | luaD_reallocstack(L, goodsize); /* shrink it */ | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | void luaD_hook (lua_State *L, int event, int line) { |
| 218 | lua_Hook hook = L->hook; | |
| 219 | if (hook && L->allowhook) { | |
| 220 | CallInfo *ci = L->ci; | |
| 221 | ptrdiff_t top = savestack(L, L->top); | |
| 222 | ptrdiff_t ci_top = savestack(L, ci->top); | |
| 223 | lua_Debug ar; | |
| 224 | ar.event = event; | |
| 225 | ar.currentline = line; | |
| 226 | ar.i_ci = ci; | |
| 227 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ | |
| 228 | ci->top = L->top + LUA_MINSTACK; | |
| 229 | lua_assert(ci->top <= L->stack_last); | |
| 230 | L->allowhook = 0; /* cannot call hooks inside a hook */ | |
| 231 | ci->callstatus |= CIST_HOOKED; | |
| 232 | lua_unlock(L); | |
| 233 | (*hook)(L, &ar); | |
| 234 | lua_lock(L); | |
| 235 | lua_assert(!L->allowhook); | |
| 236 | L->allowhook = 1; | |
| 237 | ci->top = restorestack(L, ci_top); | |
| 238 | L->top = restorestack(L, top); | |
| 239 | ci->callstatus &= ~CIST_HOOKED; | |
| 240 | } | |
| 218 | lua_Hook hook = L->hook; | |
| 219 | if (hook && L->allowhook) { | |
| 220 | CallInfo *ci = L->ci; | |
| 221 | ptrdiff_t top = savestack(L, L->top); | |
| 222 | ptrdiff_t ci_top = savestack(L, ci->top); | |
| 223 | lua_Debug ar; | |
| 224 | ar.event = event; | |
| 225 | ar.currentline = line; | |
| 226 | ar.i_ci = ci; | |
| 227 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ | |
| 228 | ci->top = L->top + LUA_MINSTACK; | |
| 229 | lua_assert(ci->top <= L->stack_last); | |
| 230 | L->allowhook = 0; /* cannot call hooks inside a hook */ | |
| 231 | ci->callstatus |= CIST_HOOKED; | |
| 232 | lua_unlock(L); | |
| 233 | (*hook)(L, &ar); | |
| 234 | lua_lock(L); | |
| 235 | lua_assert(!L->allowhook); | |
| 236 | L->allowhook = 1; | |
| 237 | ci->top = restorestack(L, ci_top); | |
| 238 | L->top = restorestack(L, top); | |
| 239 | ci->callstatus &= ~CIST_HOOKED; | |
| 240 | } | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | |
| 244 | 244 | static void callhook (lua_State *L, CallInfo *ci) { |
| 245 | int hook = LUA_HOOKCALL; | |
| 246 | ci->u.l.savedpc++; /* hooks assume 'pc' is already incremented */ | |
| 247 | if (isLua(ci->previous) && | |
| 248 | GET_OPCODE(*(ci->previous->u.l.savedpc - 1)) == OP_TAILCALL) { | |
| 249 | ci->callstatus |= CIST_TAIL; | |
| 250 | hook = LUA_HOOKTAILCALL; | |
| 251 | } | |
| 252 | luaD_hook(L, hook, -1); | |
| 253 | ci->u.l.savedpc--; /* correct 'pc' */ | |
| 245 | int hook = LUA_HOOKCALL; | |
| 246 | ci->u.l.savedpc++; /* hooks assume 'pc' is already incremented */ | |
| 247 | if (isLua(ci->previous) && | |
| 248 | GET_OPCODE(*(ci->previous->u.l.savedpc - 1)) == OP_TAILCALL) { | |
| 249 | ci->callstatus |= CIST_TAIL; | |
| 250 | hook = LUA_HOOKTAILCALL; | |
| 251 | } | |
| 252 | luaD_hook(L, hook, -1); | |
| 253 | ci->u.l.savedpc--; /* correct 'pc' */ | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
| 257 | 257 | static StkId adjust_varargs (lua_State *L, Proto *p, int actual) { |
| 258 | int i; | |
| 259 | int nfixargs = p->numparams; | |
| 260 | StkId base, fixed; | |
| 261 | lua_assert(actual >= nfixargs); | |
| 262 | /* move fixed parameters to final position */ | |
| 263 | luaD_checkstack(L, p->maxstacksize); /* check again for new 'base' */ | |
| 264 | fixed = L->top - actual; /* first fixed argument */ | |
| 265 | base = L->top; /* final position of first argument */ | |
| 266 | for (i=0; i<nfixargs; i++) { | |
| 267 | setobjs2s(L, L->top++, fixed + i); | |
| 268 | setnilvalue(fixed + i); | |
| 269 | } | |
| 270 | return base; | |
| 258 | int i; | |
| 259 | int nfixargs = p->numparams; | |
| 260 | StkId base, fixed; | |
| 261 | lua_assert(actual >= nfixargs); | |
| 262 | /* move fixed parameters to final position */ | |
| 263 | luaD_checkstack(L, p->maxstacksize); /* check again for new 'base' */ | |
| 264 | fixed = L->top - actual; /* first fixed argument */ | |
| 265 | base = L->top; /* final position of first argument */ | |
| 266 | for (i=0; i<nfixargs; i++) { | |
| 267 | setobjs2s(L, L->top++, fixed + i); | |
| 268 | setnilvalue(fixed + i); | |
| 269 | } | |
| 270 | return base; | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
| 274 | 274 | static StkId tryfuncTM (lua_State *L, StkId func) { |
| 275 | const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL); | |
| 276 | StkId p; | |
| 277 | ptrdiff_t funcr = savestack(L, func); | |
| 278 | if (!ttisfunction(tm)) | |
| 279 | luaG_typeerror(L, func, "call"); | |
| 280 | /* Open a hole inside the stack at `func' */ | |
| 281 | for (p = L->top; p > func; p--) setobjs2s(L, p, p-1); | |
| 282 | incr_top(L); | |
| 283 | func = restorestack(L, funcr); /* previous call may change stack */ | |
| 284 | setobj2s(L, func, tm); /* tag method is the new function to be called */ | |
| 285 | return func; | |
| 275 | const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL); | |
| 276 | StkId p; | |
| 277 | ptrdiff_t funcr = savestack(L, func); | |
| 278 | if (!ttisfunction(tm)) | |
| 279 | luaG_typeerror(L, func, "call"); | |
| 280 | /* Open a hole inside the stack at `func' */ | |
| 281 | for (p = L->top; p > func; p--) setobjs2s(L, p, p-1); | |
| 282 | incr_top(L); | |
| 283 | func = restorestack(L, funcr); /* previous call may change stack */ | |
| 284 | setobj2s(L, func, tm); /* tag method is the new function to be called */ | |
| 285 | return func; | |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | |
| r31373 | r31374 | |
| 294 | 294 | ** returns true if function has been executed (C function) |
| 295 | 295 | */ |
| 296 | 296 | int luaD_precall (lua_State *L, StkId func, int nresults) { |
| 297 | lua_CFunction f; | |
| 298 | CallInfo *ci; | |
| 299 | int n; /* number of arguments (Lua) or returns (C) */ | |
| 300 | ptrdiff_t funcr = savestack(L, func); | |
| 301 | switch (ttype(func)) { | |
| 302 | case LUA_TLCF: /* light C function */ | |
| 303 | f = fvalue(func); | |
| 304 | goto Cfunc; | |
| 305 | case LUA_TCCL: { /* C closure */ | |
| 306 | f = clCvalue(func)->f; | |
| 307 | Cfunc: | |
| 308 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ | |
| 309 | ci = next_ci(L); /* now 'enter' new function */ | |
| 310 | ci->nresults = nresults; | |
| 311 | ci->func = restorestack(L, funcr); | |
| 312 | ci->top = L->top + LUA_MINSTACK; | |
| 313 | lua_assert(ci->top <= L->stack_last); | |
| 314 | ci->callstatus = 0; | |
| 315 | luaC_checkGC(L); /* stack grow uses memory */ | |
| 316 | if (L->hookmask & LUA_MASKCALL) | |
| 317 | luaD_hook(L, LUA_HOOKCALL, -1); | |
| 318 | lua_unlock(L); | |
| 319 | n = (*f)(L); /* do the actual call */ | |
| 320 | lua_lock(L); | |
| 321 | api_checknelems(L, n); | |
| 322 | luaD_poscall(L, L->top - n); | |
| 323 | return 1; | |
| 324 | } | |
| 325 | case LUA_TLCL: { /* Lua function: prepare its call */ | |
| 326 | StkId base; | |
| 327 | Proto *p = clLvalue(func)->p; | |
| 328 | n = cast_int(L->top - func) - 1; /* number of real arguments */ | |
| 329 | luaD_checkstack(L, p->maxstacksize); | |
| 330 | for (; n < p->numparams; n++) | |
| 331 | setnilvalue(L->top++); /* complete missing arguments */ | |
| 332 | if (!p->is_vararg) { | |
| 333 | func = restorestack(L, funcr); | |
| 334 | base = func + 1; | |
| 335 | } | |
| 336 | else { | |
| 337 | base = adjust_varargs(L, p, n); | |
| 338 | func = restorestack(L, funcr); /* previous call can change stack */ | |
| 339 | } | |
| 340 | ci = next_ci(L); /* now 'enter' new function */ | |
| 341 | ci->nresults = nresults; | |
| 342 | ci->func = func; | |
| 343 | ci->u.l.base = base; | |
| 344 | ci->top = base + p->maxstacksize; | |
| 345 | lua_assert(ci->top <= L->stack_last); | |
| 346 | ci->u.l.savedpc = p->code; /* starting point */ | |
| 347 | ci->callstatus = CIST_LUA; | |
| 348 | L->top = ci->top; | |
| 349 | luaC_checkGC(L); /* stack grow uses memory */ | |
| 350 | if (L->hookmask & LUA_MASKCALL) | |
| 351 | callhook(L, ci); | |
| 352 | return 0; | |
| 353 | } | |
| 354 | default: { /* not a function */ | |
| 355 | func = tryfuncTM(L, func); /* retry with 'function' tag method */ | |
| 356 | return luaD_precall(L, func, nresults); /* now it must be a function */ | |
| 357 | } | |
| 358 | } | |
| 297 | lua_CFunction f; | |
| 298 | CallInfo *ci; | |
| 299 | int n; /* number of arguments (Lua) or returns (C) */ | |
| 300 | ptrdiff_t funcr = savestack(L, func); | |
| 301 | switch (ttype(func)) { | |
| 302 | case LUA_TLCF: /* light C function */ | |
| 303 | f = fvalue(func); | |
| 304 | goto Cfunc; | |
| 305 | case LUA_TCCL: { /* C closure */ | |
| 306 | f = clCvalue(func)->f; | |
| 307 | Cfunc: | |
| 308 | luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ | |
| 309 | ci = next_ci(L); /* now 'enter' new function */ | |
| 310 | ci->nresults = nresults; | |
| 311 | ci->func = restorestack(L, funcr); | |
| 312 | ci->top = L->top + LUA_MINSTACK; | |
| 313 | lua_assert(ci->top <= L->stack_last); | |
| 314 | ci->callstatus = 0; | |
| 315 | luaC_checkGC(L); /* stack grow uses memory */ | |
| 316 | if (L->hookmask & LUA_MASKCALL) | |
| 317 | luaD_hook(L, LUA_HOOKCALL, -1); | |
| 318 | lua_unlock(L); | |
| 319 | n = (*f)(L); /* do the actual call */ | |
| 320 | lua_lock(L); | |
| 321 | api_checknelems(L, n); | |
| 322 | luaD_poscall(L, L->top - n); | |
| 323 | return 1; | |
| 324 | } | |
| 325 | case LUA_TLCL: { /* Lua function: prepare its call */ | |
| 326 | StkId base; | |
| 327 | Proto *p = clLvalue(func)->p; | |
| 328 | n = cast_int(L->top - func) - 1; /* number of real arguments */ | |
| 329 | luaD_checkstack(L, p->maxstacksize); | |
| 330 | for (; n < p->numparams; n++) | |
| 331 | setnilvalue(L->top++); /* complete missing arguments */ | |
| 332 | if (!p->is_vararg) { | |
| 333 | func = restorestack(L, funcr); | |
| 334 | base = func + 1; | |
| 335 | } | |
| 336 | else { | |
| 337 | base = adjust_varargs(L, p, n); | |
| 338 | func = restorestack(L, funcr); /* previous call can change stack */ | |
| 339 | } | |
| 340 | ci = next_ci(L); /* now 'enter' new function */ | |
| 341 | ci->nresults = nresults; | |
| 342 | ci->func = func; | |
| 343 | ci->u.l.base = base; | |
| 344 | ci->top = base + p->maxstacksize; | |
| 345 | lua_assert(ci->top <= L->stack_last); | |
| 346 | ci->u.l.savedpc = p->code; /* starting point */ | |
| 347 | ci->callstatus = CIST_LUA; | |
| 348 | L->top = ci->top; | |
| 349 | luaC_checkGC(L); /* stack grow uses memory */ | |
| 350 | if (L->hookmask & LUA_MASKCALL) | |
| 351 | callhook(L, ci); | |
| 352 | return 0; | |
| 353 | } | |
| 354 | default: { /* not a function */ | |
| 355 | func = tryfuncTM(L, func); /* retry with 'function' tag method */ | |
| 356 | return luaD_precall(L, func, nresults); /* now it must be a function */ | |
| 357 | } | |
| 358 | } | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| 362 | 362 | int luaD_poscall (lua_State *L, StkId firstResult) { |
| 363 | StkId res; | |
| 364 | int wanted, i; | |
| 365 | CallInfo *ci = L->ci; | |
| 366 | if (L->hookmask & (LUA_MASKRET | LUA_MASKLINE)) { | |
| 367 | if (L->hookmask & LUA_MASKRET) { | |
| 368 | ptrdiff_t fr = savestack(L, firstResult); /* hook may change stack */ | |
| 369 | luaD_hook(L, LUA_HOOKRET, -1); | |
| 370 | firstResult = restorestack(L, fr); | |
| 371 | } | |
| 372 | L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */ | |
| 373 | } | |
| 374 | res = ci->func; /* res == final position of 1st result */ | |
| 375 | wanted = ci->nresults; | |
| 376 | L->ci = ci = ci->previous; /* back to caller */ | |
| 377 | /* move results to correct place */ | |
| 378 | for (i = wanted; i != 0 && firstResult < L->top; i--) | |
| 379 | setobjs2s(L, res++, firstResult++); | |
| 380 | while (i-- > 0) | |
| 381 | setnilvalue(res++); | |
| 382 | L->top = res; | |
| 383 | return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ | |
| 363 | StkId res; | |
| 364 | int wanted, i; | |
| 365 | CallInfo *ci = L->ci; | |
| 366 | if (L->hookmask & (LUA_MASKRET | LUA_MASKLINE)) { | |
| 367 | if (L->hookmask & LUA_MASKRET) { | |
| 368 | ptrdiff_t fr = savestack(L, firstResult); /* hook may change stack */ | |
| 369 | luaD_hook(L, LUA_HOOKRET, -1); | |
| 370 | firstResult = restorestack(L, fr); | |
| 371 | } | |
| 372 | L->oldpc = ci->previous->u.l.savedpc; /* 'oldpc' for caller function */ | |
| 373 | } | |
| 374 | res = ci->func; /* res == final position of 1st result */ | |
| 375 | wanted = ci->nresults; | |
| 376 | L->ci = ci = ci->previous; /* back to caller */ | |
| 377 | /* move results to correct place */ | |
| 378 | for (i = wanted; i != 0 && firstResult < L->top; i--) | |
| 379 | setobjs2s(L, res++, firstResult++); | |
| 380 | while (i-- > 0) | |
| 381 | setnilvalue(res++); | |
| 382 | L->top = res; | |
| 383 | return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ | |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
| r31373 | r31374 | |
| 391 | 391 | ** function position. |
| 392 | 392 | */ |
| 393 | 393 | void luaD_call (lua_State *L, StkId func, int nResults, int allowyield) { |
| 394 | if (++L->nCcalls >= LUAI_MAXCCALLS) { | |
| 395 | if (L->nCcalls == LUAI_MAXCCALLS) | |
| 396 | luaG_runerror(L, "C stack overflow"); | |
| 397 | else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3))) | |
| 398 | luaD_throw(L, LUA_ERRERR); /* error while handing stack error */ | |
| 399 | } | |
| 400 | if (!allowyield) L->nny++; | |
| 401 | if (!luaD_precall(L, func, nResults)) /* is a Lua function? */ | |
| 402 | luaV_execute(L); /* call it */ | |
| 403 | if (!allowyield) L->nny--; | |
| 404 | L->nCcalls--; | |
| 394 | if (++L->nCcalls >= LUAI_MAXCCALLS) { | |
| 395 | if (L->nCcalls == LUAI_MAXCCALLS) | |
| 396 | luaG_runerror(L, "C stack overflow"); | |
| 397 | else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3))) | |
| 398 | luaD_throw(L, LUA_ERRERR); /* error while handing stack error */ | |
| 399 | } | |
| 400 | if (!allowyield) L->nny++; | |
| 401 | if (!luaD_precall(L, func, nResults)) /* is a Lua function? */ | |
| 402 | luaV_execute(L); /* call it */ | |
| 403 | if (!allowyield) L->nny--; | |
| 404 | L->nCcalls--; | |
| 405 | 405 | } |
| 406 | 406 | |
| 407 | 407 | |
| 408 | 408 | static void finishCcall (lua_State *L) { |
| 409 | CallInfo *ci = L->ci; | |
| 410 | int n; | |
| 411 | lua_assert(ci->u.c.k != NULL); /* must have a continuation */ | |
| 412 | lua_assert(L->nny == 0); | |
| 413 | if (ci->callstatus & CIST_YPCALL) { /* was inside a pcall? */ | |
| 414 | ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */ | |
| 415 | L->errfunc = ci->u.c.old_errfunc; | |
| 416 | } | |
| 417 | /* finish 'lua_callk'/'lua_pcall' */ | |
| 418 | adjustresults(L, ci->nresults); | |
| 419 | /* call continuation function */ | |
| 420 | if (!(ci->callstatus & CIST_STAT)) /* no call status? */ | |
| 421 | ci->u.c.status = LUA_YIELD; /* 'default' status */ | |
| 422 | lua_assert(ci->u.c.status != LUA_OK); | |
| 423 | ci->callstatus = (ci->callstatus & ~(CIST_YPCALL | CIST_STAT)) | CIST_YIELDED; | |
| 424 | lua_unlock(L); | |
| 425 | n = (*ci->u.c.k)(L); | |
| 426 | lua_lock(L); | |
| 427 | api_checknelems(L, n); | |
| 428 | /* finish 'luaD_precall' */ | |
| 429 | luaD_poscall(L, L->top - n); | |
| 409 | CallInfo *ci = L->ci; | |
| 410 | int n; | |
| 411 | lua_assert(ci->u.c.k != NULL); /* must have a continuation */ | |
| 412 | lua_assert(L->nny == 0); | |
| 413 | if (ci->callstatus & CIST_YPCALL) { /* was inside a pcall? */ | |
| 414 | ci->callstatus &= ~CIST_YPCALL; /* finish 'lua_pcall' */ | |
| 415 | L->errfunc = ci->u.c.old_errfunc; | |
| 416 | } | |
| 417 | /* finish 'lua_callk'/'lua_pcall' */ | |
| 418 | adjustresults(L, ci->nresults); | |
| 419 | /* call continuation function */ | |
| 420 | if (!(ci->callstatus & CIST_STAT)) /* no call status? */ | |
| 421 | ci->u.c.status = LUA_YIELD; /* 'default' status */ | |
| 422 | lua_assert(ci->u.c.status != LUA_OK); | |
| 423 | ci->callstatus = (ci->callstatus & ~(CIST_YPCALL | CIST_STAT)) | CIST_YIELDED; | |
| 424 | lua_unlock(L); | |
| 425 | n = (*ci->u.c.k)(L); | |
| 426 | lua_lock(L); | |
| 427 | api_checknelems(L, n); | |
| 428 | /* finish 'luaD_precall' */ | |
| 429 | luaD_poscall(L, L->top - n); | |
| 430 | 430 | } |
| 431 | 431 | |
| 432 | 432 | |
| 433 | 433 | static void unroll (lua_State *L, void *ud) { |
| 434 | UNUSED(ud); | |
| 435 | for (;;) { | |
| 436 | if (L->ci == &L->base_ci) /* stack is empty? */ | |
| 437 | return; /* coroutine finished normally */ | |
| 438 | if (!isLua(L->ci)) /* C function? */ | |
| 439 | finishCcall(L); | |
| 440 | else { /* Lua function */ | |
| 441 | luaV_finishOp(L); /* finish interrupted instruction */ | |
| 442 | luaV_execute(L); /* execute down to higher C 'boundary' */ | |
| 443 | } | |
| 444 | } | |
| 434 | UNUSED(ud); | |
| 435 | for (;;) { | |
| 436 | if (L->ci == &L->base_ci) /* stack is empty? */ | |
| 437 | return; /* coroutine finished normally */ | |
| 438 | if (!isLua(L->ci)) /* C function? */ | |
| 439 | finishCcall(L); | |
| 440 | else { /* Lua function */ | |
| 441 | luaV_finishOp(L); /* finish interrupted instruction */ | |
| 442 | luaV_execute(L); /* execute down to higher C 'boundary' */ | |
| 443 | } | |
| 444 | } | |
| 445 | 445 | } |
| 446 | 446 | |
| 447 | 447 | |
| r31373 | r31374 | |
| 449 | 449 | ** check whether thread has a suspended protected call |
| 450 | 450 | */ |
| 451 | 451 | static CallInfo *findpcall (lua_State *L) { |
| 452 | CallInfo *ci; | |
| 453 | for (ci = L->ci; ci != NULL; ci = ci->previous) { /* search for a pcall */ | |
| 454 | if (ci->callstatus & CIST_YPCALL) | |
| 455 | return ci; | |
| 456 | } | |
| 457 | return NULL; /* no pending pcall */ | |
| 452 | CallInfo *ci; | |
| 453 | for (ci = L->ci; ci != NULL; ci = ci->previous) { /* search for a pcall */ | |
| 454 | if (ci->callstatus & CIST_YPCALL) | |
| 455 | return ci; | |
| 456 | } | |
| 457 | return NULL; /* no pending pcall */ | |
| 458 | 458 | } |
| 459 | 459 | |
| 460 | 460 | |
| 461 | 461 | static int recover (lua_State *L, int status) { |
| 462 | StkId oldtop; | |
| 463 | CallInfo *ci = findpcall(L); | |
| 464 | if (ci == NULL) return 0; /* no recovery point */ | |
| 465 | /* "finish" luaD_pcall */ | |
| 466 | oldtop = restorestack(L, ci->extra); | |
| 467 | luaF_close(L, oldtop); | |
| 468 | seterrorobj(L, status, oldtop); | |
| 469 | L->ci = ci; | |
| 470 | L->allowhook = ci->u.c.old_allowhook; | |
| 471 | L->nny = 0; /* should be zero to be yieldable */ | |
| 472 | luaD_shrinkstack(L); | |
| 473 | L->errfunc = ci->u.c.old_errfunc; | |
| 474 | ci->callstatus |= CIST_STAT; /* call has error status */ | |
| 475 | ci->u.c.status = status; /* (here it is) */ | |
| 476 | return 1; /* continue running the coroutine */ | |
| 462 | StkId oldtop; | |
| 463 | CallInfo *ci = findpcall(L); | |
| 464 | if (ci == NULL) return 0; /* no recovery point */ | |
| 465 | /* "finish" luaD_pcall */ | |
| 466 | oldtop = restorestack(L, ci->extra); | |
| 467 | luaF_close(L, oldtop); | |
| 468 | seterrorobj(L, status, oldtop); | |
| 469 | L->ci = ci; | |
| 470 | L->allowhook = ci->u.c.old_allowhook; | |
| 471 | L->nny = 0; /* should be zero to be yieldable */ | |
| 472 | luaD_shrinkstack(L); | |
| 473 | L->errfunc = ci->u.c.old_errfunc; | |
| 474 | ci->callstatus |= CIST_STAT; /* call has error status */ | |
| 475 | ci->u.c.status = status; /* (here it is) */ | |
| 476 | return 1; /* continue running the coroutine */ | |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | |
| r31373 | r31374 | |
| 483 | 483 | ** error handler and should not kill the coroutine.) |
| 484 | 484 | */ |
| 485 | 485 | static l_noret resume_error (lua_State *L, const char *msg, StkId firstArg) { |
| 486 | L->top = firstArg; /* remove args from the stack */ | |
| 487 | setsvalue2s(L, L->top, luaS_new(L, msg)); /* push error message */ | |
| 488 | api_incr_top(L); | |
| 489 | luaD_throw(L, -1); /* jump back to 'lua_resume' */ | |
| 486 | L->top = firstArg; /* remove args from the stack */ | |
| 487 | setsvalue2s(L, L->top, luaS_new(L, msg)); /* push error message */ | |
| 488 | api_incr_top(L); | |
| 489 | luaD_throw(L, -1); /* jump back to 'lua_resume' */ | |
| 490 | 490 | } |
| 491 | 491 | |
| 492 | 492 | |
| r31373 | r31374 | |
| 494 | 494 | ** do the work for 'lua_resume' in protected mode |
| 495 | 495 | */ |
| 496 | 496 | static void resume (lua_State *L, void *ud) { |
| 497 | int nCcalls = L->nCcalls; | |
| 498 | StkId firstArg = cast(StkId, ud); | |
| 499 | CallInfo *ci = L->ci; | |
| 500 | if (nCcalls >= LUAI_MAXCCALLS) | |
| 501 | resume_error(L, "C stack overflow", firstArg); | |
| 502 | if (L->status == LUA_OK) { /* may be starting a coroutine */ | |
| 503 | if (ci != &L->base_ci) /* not in base level? */ | |
| 504 | resume_error(L, "cannot resume non-suspended coroutine", firstArg); | |
| 505 | /* coroutine is in base level; start running it */ | |
| 506 | if (!luaD_precall(L, firstArg - 1, LUA_MULTRET)) /* Lua function? */ | |
| 507 | luaV_execute(L); /* call it */ | |
| 508 | } | |
| 509 | else if (L->status != LUA_YIELD) | |
| 510 | resume_error(L, "cannot resume dead coroutine", firstArg); | |
| 511 | else { /* resuming from previous yield */ | |
| 512 | L->status = LUA_OK; | |
| 513 | ci->func = restorestack(L, ci->extra); | |
| 514 | if (isLua(ci)) /* yielded inside a hook? */ | |
| 515 | luaV_execute(L); /* just continue running Lua code */ | |
| 516 | else { /* 'common' yield */ | |
| 517 | if (ci->u.c.k != NULL) { /* does it have a continuation? */ | |
| 518 | int n; | |
| 519 | ci->u.c.status = LUA_YIELD; /* 'default' status */ | |
| 520 | ci->callstatus |= CIST_YIELDED; | |
| 521 | lua_unlock(L); | |
| 522 | n = (*ci->u.c.k)(L); /* call continuation */ | |
| 523 | lua_lock(L); | |
| 524 | api_checknelems(L, n); | |
| 525 | firstArg = L->top - n; /* yield results come from continuation */ | |
| 526 | } | |
| 527 | luaD_poscall(L, firstArg); /* finish 'luaD_precall' */ | |
| 528 | } | |
| 529 | unroll(L, NULL); | |
| 530 | } | |
| 531 | lua_assert(nCcalls == L->nCcalls); | |
| 497 | int nCcalls = L->nCcalls; | |
| 498 | StkId firstArg = cast(StkId, ud); | |
| 499 | CallInfo *ci = L->ci; | |
| 500 | if (nCcalls >= LUAI_MAXCCALLS) | |
| 501 | resume_error(L, "C stack overflow", firstArg); | |
| 502 | if (L->status == LUA_OK) { /* may be starting a coroutine */ | |
| 503 | if (ci != &L->base_ci) /* not in base level? */ | |
| 504 | resume_error(L, "cannot resume non-suspended coroutine", firstArg); | |
| 505 | /* coroutine is in base level; start running it */ | |
| 506 | if (!luaD_precall(L, firstArg - 1, LUA_MULTRET)) /* Lua function? */ | |
| 507 | luaV_execute(L); /* call it */ | |
| 508 | } | |
| 509 | else if (L->status != LUA_YIELD) | |
| 510 | resume_error(L, "cannot resume dead coroutine", firstArg); | |
| 511 | else { /* resuming from previous yield */ | |
| 512 | L->status = LUA_OK; | |
| 513 | ci->func = restorestack(L, ci->extra); | |
| 514 | if (isLua(ci)) /* yielded inside a hook? */ | |
| 515 | luaV_execute(L); /* just continue running Lua code */ | |
| 516 | else { /* 'common' yield */ | |
| 517 | if (ci->u.c.k != NULL) { /* does it have a continuation? */ | |
| 518 | int n; | |
| 519 | ci->u.c.status = LUA_YIELD; /* 'default' status */ | |
| 520 | ci->callstatus |= CIST_YIELDED; | |
| 521 | lua_unlock(L); | |
| 522 | n = (*ci->u.c.k)(L); /* call continuation */ | |
| 523 | lua_lock(L); | |
| 524 | api_checknelems(L, n); | |
| 525 | firstArg = L->top - n; /* yield results come from continuation */ | |
| 526 | } | |
| 527 | luaD_poscall(L, firstArg); /* finish 'luaD_precall' */ | |
| 528 | } | |
| 529 | unroll(L, NULL); | |
| 530 | } | |
| 531 | lua_assert(nCcalls == L->nCcalls); | |
| 532 | 532 | } |
| 533 | 533 | |
| 534 | 534 | |
| 535 | 535 | LUA_API int lua_resume (lua_State *L, lua_State *from, int nargs) { |
| 536 | int status; | |
| 537 | int oldnny = L->nny; /* save 'nny' */ | |
| 538 | lua_lock(L); | |
| 539 | luai_userstateresume(L, nargs); | |
| 540 | L->nCcalls = (from) ? from->nCcalls + 1 : 1; | |
| 541 | L->nny = 0; /* allow yields */ | |
| 542 | api_checknelems(L, (L->status == LUA_OK) ? nargs + 1 : nargs); | |
| 543 | status = luaD_rawrunprotected(L, resume, L->top - nargs); | |
| 544 | if (status == -1) /* error calling 'lua_resume'? */ | |
| 545 | status = LUA_ERRRUN; | |
| 546 | else { /* yield or regular error */ | |
| 547 | while (status != LUA_OK && status != LUA_YIELD) { /* error? */ | |
| 548 | if (recover(L, status)) /* recover point? */ | |
| 549 | status = luaD_rawrunprotected(L, unroll, NULL); /* run continuation */ | |
| 550 | else { /* unrecoverable error */ | |
| 551 | L->status = cast_byte(status); /* mark thread as `dead' */ | |
| 552 | seterrorobj(L, status, L->top); | |
| 553 | L->ci->top = L->top; | |
| 554 | break; | |
| 555 | } | |
| 556 | } | |
| 557 | lua_assert(status == L->status); | |
| 558 | } | |
| 559 | L->nny = oldnny; /* restore 'nny' */ | |
| 560 | L->nCcalls--; | |
| 561 | lua_assert(L->nCcalls == ((from) ? from->nCcalls : 0)); | |
| 562 | lua_unlock(L); | |
| 563 | return status; | |
| 536 | int status; | |
| 537 | int oldnny = L->nny; /* save 'nny' */ | |
| 538 | lua_lock(L); | |
| 539 | luai_userstateresume(L, nargs); | |
| 540 | L->nCcalls = (from) ? from->nCcalls + 1 : 1; | |
| 541 | L->nny = 0; /* allow yields */ | |
| 542 | api_checknelems(L, (L->status == LUA_OK) ? nargs + 1 : nargs); | |
| 543 | status = luaD_rawrunprotected(L, resume, L->top - nargs); | |
| 544 | if (status == -1) /* error calling 'lua_resume'? */ | |
| 545 | status = LUA_ERRRUN; | |
| 546 | else { /* yield or regular error */ | |
| 547 | while (status != LUA_OK && status != LUA_YIELD) { /* error? */ | |
| 548 | if (recover(L, status)) /* recover point? */ | |
| 549 | status = luaD_rawrunprotected(L, unroll, NULL); /* run continuation */ | |
| 550 | else { /* unrecoverable error */ | |
| 551 | L->status = cast_byte(status); /* mark thread as `dead' */ | |
| 552 | seterrorobj(L, status, L->top); | |
| 553 | L->ci->top = L->top; | |
| 554 | break; | |
| 555 | } | |
| 556 | } | |
| 557 | lua_assert(status == L->status); | |
| 558 | } | |
| 559 | L->nny = oldnny; /* restore 'nny' */ | |
| 560 | L->nCcalls--; | |
| 561 | lua_assert(L->nCcalls == ((from) ? from->nCcalls : 0)); | |
| 562 | lua_unlock(L); | |
| 563 | return status; | |
| 564 | 564 | } |
| 565 | 565 | |
| 566 | 566 | |
| 567 | 567 | LUA_API int lua_yieldk (lua_State *L, int nresults, int ctx, lua_CFunction k) { |
| 568 | CallInfo *ci = L->ci; | |
| 569 | luai_userstateyield(L, nresults); | |
| 570 | lua_lock(L); | |
| 571 | api_checknelems(L, nresults); | |
| 572 | if (L->nny > 0) { | |
| 573 | if (L != G(L)->mainthread) | |
| 574 | luaG_runerror(L, "attempt to yield across a C-call boundary"); | |
| 575 | else | |
| 576 | luaG_runerror(L, "attempt to yield from outside a coroutine"); | |
| 577 | } | |
| 578 | L->status = LUA_YIELD; | |
| 579 | ci->extra = savestack(L, ci->func); /* save current 'func' */ | |
| 580 | if (isLua(ci)) { /* inside a hook? */ | |
| 581 | api_check(L, k == NULL, "hooks cannot continue after yielding"); | |
| 582 | } | |
| 583 | else { | |
| 584 | if ((ci->u.c.k = k) != NULL) /* is there a continuation? */ | |
| 585 | ci->u.c.ctx = ctx; /* save context */ | |
| 586 | ci->func = L->top - nresults - 1; /* protect stack below results */ | |
| 587 | luaD_throw(L, LUA_YIELD); | |
| 588 | } | |
| 589 | lua_assert(ci->callstatus & CIST_HOOKED); /* must be inside a hook */ | |
| 590 | lua_unlock(L); | |
| 591 | return 0; /* return to 'luaD_hook' */ | |
| 568 | CallInfo *ci = L->ci; | |
| 569 | luai_userstateyield(L, nresults); | |
| 570 | lua_lock(L); | |
| 571 | api_checknelems(L, nresults); | |
| 572 | if (L->nny > 0) { | |
| 573 | if (L != G(L)->mainthread) | |
| 574 | luaG_runerror(L, "attempt to yield across a C-call boundary"); | |
| 575 | else | |
| 576 | luaG_runerror(L, "attempt to yield from outside a coroutine"); | |
| 577 | } | |
| 578 | L->status = LUA_YIELD; | |
| 579 | ci->extra = savestack(L, ci->func); /* save current 'func' */ | |
| 580 | if (isLua(ci)) { /* inside a hook? */ | |
| 581 | api_check(L, k == NULL, "hooks cannot continue after yielding"); | |
| 582 | } | |
| 583 | else { | |
| 584 | if ((ci->u.c.k = k) != NULL) /* is there a continuation? */ | |
| 585 | ci->u.c.ctx = ctx; /* save context */ | |
| 586 | ci->func = L->top - nresults - 1; /* protect stack below results */ | |
| 587 | luaD_throw(L, LUA_YIELD); | |
| 588 | } | |
| 589 | lua_assert(ci->callstatus & CIST_HOOKED); /* must be inside a hook */ | |
| 590 | lua_unlock(L); | |
| 591 | return 0; /* return to 'luaD_hook' */ | |
| 592 | 592 | } |
| 593 | 593 | |
| 594 | 594 | |
| 595 | 595 | int luaD_pcall (lua_State *L, Pfunc func, void *u, |
| 596 | ptrdiff_t old_top, ptrdiff_t ef) { | |
| 597 | int status; | |
| 598 | CallInfo *old_ci = L->ci; | |
| 599 | lu_byte old_allowhooks = L->allowhook; | |
| 600 | unsigned short old_nny = L->nny; | |
| 601 | ptrdiff_t old_errfunc = L->errfunc; | |
| 602 | L->errfunc = ef; | |
| 603 | status = luaD_rawrunprotected(L, func, u); | |
| 604 | if (status != LUA_OK) { /* an error occurred? */ | |
| 605 | StkId oldtop = restorestack(L, old_top); | |
| 606 | luaF_close(L, oldtop); /* close possible pending closures */ | |
| 607 | seterrorobj(L, status, oldtop); | |
| 608 | L->ci = old_ci; | |
| 609 | L->allowhook = old_allowhooks; | |
| 610 | L->nny = old_nny; | |
| 611 | luaD_shrinkstack(L); | |
| 612 | } | |
| 613 | L->errfunc = old_errfunc; | |
| 614 | return status; | |
| 596 | ptrdiff_t old_top, ptrdiff_t ef) { | |
| 597 | int status; | |
| 598 | CallInfo *old_ci = L->ci; | |
| 599 | lu_byte old_allowhooks = L->allowhook; | |
| 600 | unsigned short old_nny = L->nny; | |
| 601 | ptrdiff_t old_errfunc = L->errfunc; | |
| 602 | L->errfunc = ef; | |
| 603 | status = luaD_rawrunprotected(L, func, u); | |
| 604 | if (status != LUA_OK) { /* an error occurred? */ | |
| 605 | StkId oldtop = restorestack(L, old_top); | |
| 606 | luaF_close(L, oldtop); /* close possible pending closures */ | |
| 607 | seterrorobj(L, status, oldtop); | |
| 608 | L->ci = old_ci; | |
| 609 | L->allowhook = old_allowhooks; | |
| 610 | L->nny = old_nny; | |
| 611 | luaD_shrinkstack(L); | |
| 612 | } | |
| 613 | L->errfunc = old_errfunc; | |
| 614 | return status; | |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | |
| r31373 | r31374 | |
| 620 | 620 | ** Execute a protected parser. |
| 621 | 621 | */ |
| 622 | 622 | struct SParser { /* data to `f_parser' */ |
| 623 | ZIO *z; | |
| 624 | Mbuffer buff; /* dynamic structure used by the scanner */ | |
| 625 | Dyndata dyd; /* dynamic structures used by the parser */ | |
| 626 | const char *mode; | |
| 627 | const char *name; | |
| 623 | ZIO *z; | |
| 624 | Mbuffer buff; /* dynamic structure used by the scanner */ | |
| 625 | Dyndata dyd; /* dynamic structures used by the parser */ | |
| 626 | const char *mode; | |
| 627 | const char *name; | |
| 628 | 628 | }; |
| 629 | 629 | |
| 630 | 630 | |
| 631 | 631 | static void checkmode (lua_State *L, const char *mode, const char *x) { |
| 632 | if (mode && strchr(mode, x[0]) == NULL) { | |
| 633 | luaO_pushfstring(L, | |
| 634 | "attempt to load a %s chunk (mode is " LUA_QS ")", x, mode); | |
| 635 | luaD_throw(L, LUA_ERRSYNTAX); | |
| 636 | } | |
| 632 | if (mode && strchr(mode, x[0]) == NULL) { | |
| 633 | luaO_pushfstring(L, | |
| 634 | "attempt to load a %s chunk (mode is " LUA_QS ")", x, mode); | |
| 635 | luaD_throw(L, LUA_ERRSYNTAX); | |
| 636 | } | |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | |
| 640 | 640 | static void f_parser (lua_State *L, void *ud) { |
| 641 | int i; | |
| 642 | Closure *cl; | |
| 643 | struct SParser *p = cast(struct SParser *, ud); | |
| 644 | int c = zgetc(p->z); /* read first character */ | |
| 645 | if (c == LUA_SIGNATURE[0]) { | |
| 646 | checkmode(L, p->mode, "binary"); | |
| 647 | cl = luaU_undump(L, p->z, &p->buff, p->name); | |
| 648 | } | |
| 649 | else { | |
| 650 | checkmode(L, p->mode, "text"); | |
| 651 | cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); | |
| 652 | } | |
| 653 | lua_assert(cl->l.nupvalues == cl->l.p->sizeupvalues); | |
| 654 | for (i = 0; i < cl->l.nupvalues; i++) { /* initialize upvalues */ | |
| 655 | UpVal *up = luaF_newupval(L); | |
| 656 | cl->l.upvals[i] = up; | |
| 657 | luaC_objbarrier(L, cl, up); | |
| 658 | } | |
| 641 | int i; | |
| 642 | Closure *cl; | |
| 643 | struct SParser *p = cast(struct SParser *, ud); | |
| 644 | int c = zgetc(p->z); /* read first character */ | |
| 645 | if (c == LUA_SIGNATURE[0]) { | |
| 646 | checkmode(L, p->mode, "binary"); | |
| 647 | cl = luaU_undump(L, p->z, &p->buff, p->name); | |
| 648 | } | |
| 649 | else { | |
| 650 | checkmode(L, p->mode, "text"); | |
| 651 | cl = luaY_parser(L, p->z, &p->buff, &p->dyd, p->name, c); | |
| 652 | } | |
| 653 | lua_assert(cl->l.nupvalues == cl->l.p->sizeupvalues); | |
| 654 | for (i = 0; i < cl->l.nupvalues; i++) { /* initialize upvalues */ | |
| 655 | UpVal *up = luaF_newupval(L); | |
| 656 | cl->l.upvals[i] = up; | |
| 657 | luaC_objbarrier(L, cl, up); | |
| 658 | } | |
| 659 | 659 | } |
| 660 | 660 | |
| 661 | 661 | |
| 662 | 662 | int luaD_protectedparser (lua_State *L, ZIO *z, const char *name, |
| 663 | const char *mode) { | |
| 664 | struct SParser p; | |
| 665 | int status; | |
| 666 | L->nny++; /* cannot yield during parsing */ | |
| 667 | p.z = z; p.name = name; p.mode = mode; | |
| 668 | p.dyd.actvar.arr = NULL; p.dyd.actvar.size = 0; | |
| 669 | p.dyd.gt.arr = NULL; p.dyd.gt.size = 0; | |
| 670 | p.dyd.label.arr = NULL; p.dyd.label.size = 0; | |
| 671 | luaZ_initbuffer(L, &p.buff); | |
| 672 | status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); | |
| 673 | luaZ_freebuffer(L, &p.buff); | |
| 674 | luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size); | |
| 675 | luaM_freearray(L, p.dyd.gt.arr, p.dyd.gt.size); | |
| 676 | luaM_freearray(L, p.dyd.label.arr, p.dyd.label.size); | |
| 677 | L->nny--; | |
| 678 | return status; | |
| 663 | const char *mode) { | |
| 664 | struct SParser p; | |
| 665 | int status; | |
| 666 | L->nny++; /* cannot yield during parsing */ | |
| 667 | p.z = z; p.name = name; p.mode = mode; | |
| 668 | p.dyd.actvar.arr = NULL; p.dyd.actvar.size = 0; | |
| 669 | p.dyd.gt.arr = NULL; p.dyd.gt.size = 0; | |
| 670 | p.dyd.label.arr = NULL; p.dyd.label.size = 0; | |
| 671 | luaZ_initbuffer(L, &p.buff); | |
| 672 | status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); | |
| 673 | luaZ_freebuffer(L, &p.buff); | |
| 674 | luaM_freearray(L, p.dyd.actvar.arr, p.dyd.actvar.size); | |
| 675 | luaM_freearray(L, p.dyd.gt.arr, p.dyd.gt.size); | |
| 676 | luaM_freearray(L, p.dyd.label.arr, p.dyd.label.size); | |
| 677 | L->nny--; | |
| 678 | return status; | |
| 679 | 679 | } |
| 680 | ||
| 681 |
| r31373 | r31374 | |
|---|---|---|
| 16 | 16 | #include "lundump.h" |
| 17 | 17 | |
| 18 | 18 | typedef struct { |
| 19 | lua_State* L; | |
| 20 | lua_Writer writer; | |
| 21 | void* data; | |
| 22 | int strip; | |
| 23 | int status; | |
| 19 | lua_State* L; | |
| 20 | lua_Writer writer; | |
| 21 | void* data; | |
| 22 | int strip; | |
| 23 | int status; | |
| 24 | 24 | } DumpState; |
| 25 | 25 | |
| 26 | #define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) | |
| 27 | #define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) | |
| 26 | #define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) | |
| 27 | #define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) | |
| 28 | 28 | |
| 29 | 29 | static void DumpBlock(const void* b, size_t size, DumpState* D) |
| 30 | 30 | { |
| 31 | if (D->status==0) | |
| 32 | { | |
| 33 | lua_unlock(D->L); | |
| 34 | D->status=(*D->writer)(D->L,b,size,D->data); | |
| 35 | lua_lock(D->L); | |
| 36 | } | |
| 31 | if (D->status==0) | |
| 32 | { | |
| 33 | lua_unlock(D->L); | |
| 34 | D->status=(*D->writer)(D->L,b,size,D->data); | |
| 35 | lua_lock(D->L); | |
| 36 | } | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | static void DumpChar(int y, DumpState* D) |
| 40 | 40 | { |
| 41 | char x=(char)y; | |
| 42 | DumpVar(x,D); | |
| 41 | char x=(char)y; | |
| 42 | DumpVar(x,D); | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | static void DumpInt(int x, DumpState* D) |
| 46 | 46 | { |
| 47 | ||
| 47 | DumpVar(x,D); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static void DumpNumber(lua_Number x, DumpState* D) |
| 51 | 51 | { |
| 52 | ||
| 52 | DumpVar(x,D); | |
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | static void DumpVector(const void* b, int n, size_t size, DumpState* D) |
| 56 | 56 | { |
| 57 | DumpInt(n,D); | |
| 58 | DumpMem(b,n,size,D); | |
| 57 | DumpInt(n,D); | |
| 58 | DumpMem(b,n,size,D); | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static void DumpString(const TString* s, DumpState* D) |
| 62 | 62 | { |
| 63 | if (s==NULL) | |
| 64 | { | |
| 65 | size_t size=0; | |
| 66 | DumpVar(size,D); | |
| 67 | } | |
| 68 | else | |
| 69 | { | |
| 70 | size_t size=s->tsv.len+1; /* include trailing '\0' */ | |
| 71 | DumpVar(size,D); | |
| 72 | DumpBlock(getstr(s),size*sizeof(char),D); | |
| 73 | } | |
| 63 | if (s==NULL) | |
| 64 | { | |
| 65 | size_t size=0; | |
| 66 | DumpVar(size,D); | |
| 67 | } | |
| 68 | else | |
| 69 | { | |
| 70 | size_t size=s->tsv.len+1; /* include trailing '\0' */ | |
| 71 | DumpVar(size,D); | |
| 72 | DumpBlock(getstr(s),size*sizeof(char),D); | |
| 73 | } | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | #define DumpCode(f,D) | |
| 76 | #define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) | |
| 77 | 77 | |
| 78 | 78 | static void DumpFunction(const Proto* f, DumpState* D); |
| 79 | 79 | |
| 80 | 80 | static void DumpConstants(const Proto* f, DumpState* D) |
| 81 | 81 | { |
| 82 | int i,n=f->sizek; | |
| 83 | DumpInt(n,D); | |
| 84 | for (i=0; i<n; i++) | |
| 85 | { | |
| 86 | const TValue* o=&f->k[i]; | |
| 87 | DumpChar(ttypenv(o),D); | |
| 88 | switch (ttypenv(o)) | |
| 89 | { | |
| 90 | case LUA_TNIL: | |
| 82 | int i,n=f->sizek; | |
| 83 | DumpInt(n,D); | |
| 84 | for (i=0; i<n; i++) | |
| 85 | { | |
| 86 | const TValue* o=&f->k[i]; | |
| 87 | DumpChar(ttypenv(o),D); | |
| 88 | switch (ttypenv(o)) | |
| 89 | { | |
| 90 | case LUA_TNIL: | |
| 91 | 91 | break; |
| 92 | ||
| 92 | case LUA_TBOOLEAN: | |
| 93 | 93 | DumpChar(bvalue(o),D); |
| 94 | 94 | break; |
| 95 | ||
| 95 | case LUA_TNUMBER: | |
| 96 | 96 | DumpNumber(nvalue(o),D); |
| 97 | 97 | break; |
| 98 | ||
| 98 | case LUA_TSTRING: | |
| 99 | 99 | DumpString(rawtsvalue(o),D); |
| 100 | 100 | break; |
| 101 | default: lua_assert(0); | |
| 102 | } | |
| 103 | } | |
| 104 | n=f->sizep; | |
| 105 | DumpInt(n,D); | |
| 106 | for (i=0; i<n; i++) DumpFunction(f->p[i],D); | |
| 101 | default: lua_assert(0); | |
| 102 | } | |
| 103 | } | |
| 104 | n=f->sizep; | |
| 105 | DumpInt(n,D); | |
| 106 | for (i=0; i<n; i++) DumpFunction(f->p[i],D); | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | static void DumpUpvalues(const Proto* f, DumpState* D) |
| 110 | 110 | { |
| 111 | int i,n=f->sizeupvalues; | |
| 112 | DumpInt(n,D); | |
| 113 | for (i=0; i<n; i++) | |
| 114 | { | |
| 115 | DumpChar(f->upvalues[i].instack,D); | |
| 116 | DumpChar(f->upvalues[i].idx,D); | |
| 117 | } | |
| 111 | int i,n=f->sizeupvalues; | |
| 112 | DumpInt(n,D); | |
| 113 | for (i=0; i<n; i++) | |
| 114 | { | |
| 115 | DumpChar(f->upvalues[i].instack,D); | |
| 116 | DumpChar(f->upvalues[i].idx,D); | |
| 117 | } | |
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | static void DumpDebug(const Proto* f, DumpState* D) |
| 121 | 121 | { |
| 122 | int i,n; | |
| 123 | DumpString((D->strip) ? NULL : f->source,D); | |
| 124 | n= (D->strip) ? 0 : f->sizelineinfo; | |
| 125 | DumpVector(f->lineinfo,n,sizeof(int),D); | |
| 126 | n= (D->strip) ? 0 : f->sizelocvars; | |
| 127 | DumpInt(n,D); | |
| 128 | for (i=0; i<n; i++) | |
| 129 | { | |
| 130 | DumpString(f->locvars[i].varname,D); | |
| 131 | DumpInt(f->locvars[i].startpc,D); | |
| 132 | DumpInt(f->locvars[i].endpc,D); | |
| 133 | } | |
| 134 | n= (D->strip) ? 0 : f->sizeupvalues; | |
| 135 | DumpInt(n,D); | |
| 136 | for (i=0; i<n; i++) DumpString(f->upvalues[i].name,D); | |
| 122 | int i,n; | |
| 123 | DumpString((D->strip) ? NULL : f->source,D); | |
| 124 | n= (D->strip) ? 0 : f->sizelineinfo; | |
| 125 | DumpVector(f->lineinfo,n,sizeof(int),D); | |
| 126 | n= (D->strip) ? 0 : f->sizelocvars; | |
| 127 | DumpInt(n,D); | |
| 128 | for (i=0; i<n; i++) | |
| 129 | { | |
| 130 | DumpString(f->locvars[i].varname,D); | |
| 131 | DumpInt(f->locvars[i].startpc,D); | |
| 132 | DumpInt(f->locvars[i].endpc,D); | |
| 133 | } | |
| 134 | n= (D->strip) ? 0 : f->sizeupvalues; | |
| 135 | DumpInt(n,D); | |
| 136 | for (i=0; i<n; i++) DumpString(f->upvalues[i].name,D); | |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | static void DumpFunction(const Proto* f, DumpState* D) |
| 140 | 140 | { |
| 141 | DumpInt(f->linedefined,D); | |
| 142 | DumpInt(f->lastlinedefined,D); | |
| 143 | DumpChar(f->numparams,D); | |
| 144 | DumpChar(f->is_vararg,D); | |
| 145 | DumpChar(f->maxstacksize,D); | |
| 146 | DumpCode(f,D); | |
| 147 | DumpConstants(f,D); | |
| 148 | DumpUpvalues(f,D); | |
| 149 | DumpDebug(f,D); | |
| 141 | DumpInt(f->linedefined,D); | |
| 142 | DumpInt(f->lastlinedefined,D); | |
| 143 | DumpChar(f->numparams,D); | |
| 144 | DumpChar(f->is_vararg,D); | |
| 145 | DumpChar(f->maxstacksize,D); | |
| 146 | DumpCode(f,D); | |
| 147 | DumpConstants(f,D); | |
| 148 | DumpUpvalues(f,D); | |
| 149 | DumpDebug(f,D); | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | static void DumpHeader(DumpState* D) |
| 153 | 153 | { |
| 154 | lu_byte h[LUAC_HEADERSIZE]; | |
| 155 | luaU_header(h); | |
| 156 | DumpBlock(h,LUAC_HEADERSIZE,D); | |
| 154 | lu_byte h[LUAC_HEADERSIZE]; | |
| 155 | luaU_header(h); | |
| 156 | DumpBlock(h,LUAC_HEADERSIZE,D); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | /* |
| r31373 | r31374 | |
| 161 | 161 | */ |
| 162 | 162 | int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) |
| 163 | 163 | { |
| 164 | DumpState D; | |
| 165 | D.L=L; | |
| 166 | D.writer=w; | |
| 167 | D.data=data; | |
| 168 | D.strip=strip; | |
| 169 | D.status=0; | |
| 170 | DumpHeader(&D); | |
| 171 | DumpFunction(f,&D); | |
| 172 | return D.status; | |
| 164 | DumpState D; | |
| 165 | D.L=L; | |
| 166 | D.writer=w; | |
| 167 | D.data=data; | |
| 168 | D.strip=strip; | |
| 169 | D.status=0; | |
| 170 | DumpHeader(&D); | |
| 171 | DumpFunction(f,&D); | |
| 172 | return D.status; | |
| 173 | 173 | } |
| r31373 | r31374 | |
|---|---|---|
| 15 | 15 | |
| 16 | 16 | /* number of bits to consider in a number */ |
| 17 | 17 | #if !defined(LUA_NBITS) |
| 18 | #define LUA_NBITS | |
| 18 | #define LUA_NBITS 32 | |
| 19 | 19 | #endif |
| 20 | 20 | |
| 21 | 21 | |
| 22 | #define ALLONES | |
| 22 | #define ALLONES (~(((~(lua_Unsigned)0) << (LUA_NBITS - 1)) << 1)) | |
| 23 | 23 | |
| 24 | 24 | /* macro to trim extra bits */ |
| 25 | #define trim(x) | |
| 25 | #define trim(x) ((x) & ALLONES) | |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | /* builds a number with 'n' ones (1 <= n <= LUA_NBITS) */ |
| 29 | #define mask(n) | |
| 29 | #define mask(n) (~((ALLONES << 1) << ((n) - 1))) | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | typedef lua_Unsigned b_uint; |
| r31373 | r31374 | |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | static b_uint andaux (lua_State *L) { |
| 37 | int i, n = lua_gettop(L); | |
| 38 | b_uint r = ~(b_uint)0; | |
| 39 | for (i = 1; i <= n; i++) | |
| 40 | r &= luaL_checkunsigned(L, i); | |
| 41 | return trim(r); | |
| 37 | int i, n = lua_gettop(L); | |
| 38 | b_uint r = ~(b_uint)0; | |
| 39 | for (i = 1; i <= n; i++) | |
| 40 | r &= luaL_checkunsigned(L, i); | |
| 41 | return trim(r); | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | static int b_and (lua_State *L) { |
| 46 | b_uint r = andaux(L); | |
| 47 | lua_pushunsigned(L, r); | |
| 48 | return 1; | |
| 46 | b_uint r = andaux(L); | |
| 47 | lua_pushunsigned(L, r); | |
| 48 | return 1; | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | static int b_test (lua_State *L) { |
| 53 | b_uint r = andaux(L); | |
| 54 | lua_pushboolean(L, r != 0); | |
| 55 | return 1; | |
| 53 | b_uint r = andaux(L); | |
| 54 | lua_pushboolean(L, r != 0); | |
| 55 | return 1; | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | static int b_or (lua_State *L) { |
| 60 | int i, n = lua_gettop(L); | |
| 61 | b_uint r = 0; | |
| 62 | for (i = 1; i <= n; i++) | |
| 63 | r |= luaL_checkunsigned(L, i); | |
| 64 | lua_pushunsigned(L, trim(r)); | |
| 65 | return 1; | |
| 60 | int i, n = lua_gettop(L); | |
| 61 | b_uint r = 0; | |
| 62 | for (i = 1; i <= n; i++) | |
| 63 | r |= luaL_checkunsigned(L, i); | |
| 64 | lua_pushunsigned(L, trim(r)); | |
| 65 | return 1; | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | static int b_xor (lua_State *L) { |
| 70 | int i, n = lua_gettop(L); | |
| 71 | b_uint r = 0; | |
| 72 | for (i = 1; i <= n; i++) | |
| 73 | r ^= luaL_checkunsigned(L, i); | |
| 74 | lua_pushunsigned(L, trim(r)); | |
| 75 | return 1; | |
| 70 | int i, n = lua_gettop(L); | |
| 71 | b_uint r = 0; | |
| 72 | for (i = 1; i <= n; i++) | |
| 73 | r ^= luaL_checkunsigned(L, i); | |
| 74 | lua_pushunsigned(L, trim(r)); | |
| 75 | return 1; | |
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | static int b_not (lua_State *L) { |
| 80 | b_uint r = ~luaL_checkunsigned(L, 1); | |
| 81 | lua_pushunsigned(L, trim(r)); | |
| 82 | return 1; | |
| 80 | b_uint r = ~luaL_checkunsigned(L, 1); | |
| 81 | lua_pushunsigned(L, trim(r)); | |
| 82 | return 1; | |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | 85 | |
| 86 | 86 | static int b_shift (lua_State *L, b_uint r, int i) { |
| 87 | if (i < 0) { /* shift right? */ | |
| 88 | i = -i; | |
| 89 | r = trim(r); | |
| 90 | if (i >= LUA_NBITS) r = 0; | |
| 91 | else r >>= i; | |
| 92 | } | |
| 93 | else { /* shift left */ | |
| 94 | if (i >= LUA_NBITS) r = 0; | |
| 95 | else r <<= i; | |
| 96 | r = trim(r); | |
| 97 | } | |
| 98 | lua_pushunsigned(L, r); | |
| 99 | return 1; | |
| 87 | if (i < 0) { /* shift right? */ | |
| 88 | i = -i; | |
| 89 | r = trim(r); | |
| 90 | if (i >= LUA_NBITS) r = 0; | |
| 91 | else r >>= i; | |
| 92 | } | |
| 93 | else { /* shift left */ | |
| 94 | if (i >= LUA_NBITS) r = 0; | |
| 95 | else r <<= i; | |
| 96 | r = trim(r); | |
| 97 | } | |
| 98 | lua_pushunsigned(L, r); | |
| 99 | return 1; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | static int b_lshift (lua_State *L) { |
| 104 | ||
| 104 | return b_shift(L, luaL_checkunsigned(L, 1), luaL_checkint(L, 2)); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | static int b_rshift (lua_State *L) { |
| 109 | ||
| 109 | return b_shift(L, luaL_checkunsigned(L, 1), -luaL_checkint(L, 2)); | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | static int b_arshift (lua_State *L) { |
| 114 | b_uint r = luaL_checkunsigned(L, 1); | |
| 115 | int i = luaL_checkint(L, 2); | |
| 116 | if (i < 0 || !(r & ((b_uint)1 << (LUA_NBITS - 1)))) | |
| 117 | return b_shift(L, r, -i); | |
| 118 | else { /* arithmetic shift for 'negative' number */ | |
| 119 | if (i >= LUA_NBITS) r = ALLONES; | |
| 120 | else | |
| 121 | r = trim((r >> i) | ~(~(b_uint)0 >> i)); /* add signal bit */ | |
| 122 | lua_pushunsigned(L, r); | |
| 123 | return 1; | |
| 124 | } | |
| 114 | b_uint r = luaL_checkunsigned(L, 1); | |
| 115 | int i = luaL_checkint(L, 2); | |
| 116 | if (i < 0 || !(r & ((b_uint)1 << (LUA_NBITS - 1)))) | |
| 117 | return b_shift(L, r, -i); | |
| 118 | else { /* arithmetic shift for 'negative' number */ | |
| 119 | if (i >= LUA_NBITS) r = ALLONES; | |
| 120 | else | |
| 121 | r = trim((r >> i) | ~(~(b_uint)0 >> i)); /* add signal bit */ | |
| 122 | lua_pushunsigned(L, r); | |
| 123 | return 1; | |
| 124 | } | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| 128 | 128 | static int b_rot (lua_State *L, int i) { |
| 129 | b_uint r = luaL_checkunsigned(L, 1); | |
| 130 | i &= (LUA_NBITS - 1); /* i = i % NBITS */ | |
| 131 | r = trim(r); | |
| 132 | if (i != 0) /* avoid undefined shift of LUA_NBITS when i == 0 */ | |
| 133 | r = (r << i) | (r >> (LUA_NBITS - i)); | |
| 134 | lua_pushunsigned(L, trim(r)); | |
| 135 | return 1; | |
| 129 | b_uint r = luaL_checkunsigned(L, 1); | |
| 130 | i &= (LUA_NBITS - 1); /* i = i % NBITS */ | |
| 131 | r = trim(r); | |
| 132 | if (i != 0) /* avoid undefined shift of LUA_NBITS when i == 0 */ | |
| 133 | r = (r << i) | (r >> (LUA_NBITS - i)); | |
| 134 | lua_pushunsigned(L, trim(r)); | |
| 135 | return 1; | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | static int b_lrot (lua_State *L) { |
| 140 | ||
| 140 | return b_rot(L, luaL_checkint(L, 2)); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | static int b_rrot (lua_State *L) { |
| 145 | ||
| 145 | return b_rot(L, -luaL_checkint(L, 2)); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| r31373 | r31374 | |
| 153 | 153 | ** 'width' being used uninitialized.) |
| 154 | 154 | */ |
| 155 | 155 | static int fieldargs (lua_State *L, int farg, int *width) { |
| 156 | int f = luaL_checkint(L, farg); | |
| 157 | int w = luaL_optint(L, farg + 1, 1); | |
| 158 | luaL_argcheck(L, 0 <= f, farg, "field cannot be negative"); | |
| 159 | luaL_argcheck(L, 0 < w, farg + 1, "width must be positive"); | |
| 160 | if (f + w > LUA_NBITS) | |
| 161 | luaL_error(L, "trying to access non-existent bits"); | |
| 162 | *width = w; | |
| 163 | return f; | |
| 156 | int f = luaL_checkint(L, farg); | |
| 157 | int w = luaL_optint(L, farg + 1, 1); | |
| 158 | luaL_argcheck(L, 0 <= f, farg, "field cannot be negative"); | |
| 159 | luaL_argcheck(L, 0 < w, farg + 1, "width must be positive"); | |
| 160 | if (f + w > LUA_NBITS) | |
| 161 | luaL_error(L, "trying to access non-existent bits"); | |
| 162 | *width = w; | |
| 163 | return f; | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | static int b_extract (lua_State *L) { |
| 168 | int w; | |
| 169 | b_uint r = luaL_checkunsigned(L, 1); | |
| 170 | int f = fieldargs(L, 2, &w); | |
| 171 | r = (r >> f) & mask(w); | |
| 172 | lua_pushunsigned(L, r); | |
| 173 | return 1; | |
| 168 | int w; | |
| 169 | b_uint r = luaL_checkunsigned(L, 1); | |
| 170 | int f = fieldargs(L, 2, &w); | |
| 171 | r = (r >> f) & mask(w); | |
| 172 | lua_pushunsigned(L, r); | |
| 173 | return 1; | |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | |
| 177 | 177 | static int b_replace (lua_State *L) { |
| 178 | int w; | |
| 179 | b_uint r = luaL_checkunsigned(L, 1); | |
| 180 | b_uint v = luaL_checkunsigned(L, 2); | |
| 181 | int f = fieldargs(L, 3, &w); | |
| 182 | int m = mask(w); | |
| 183 | v &= m; /* erase bits outside given width */ | |
| 184 | r = (r & ~(m << f)) | (v << f); | |
| 185 | lua_pushunsigned(L, r); | |
| 186 | return 1; | |
| 178 | int w; | |
| 179 | b_uint r = luaL_checkunsigned(L, 1); | |
| 180 | b_uint v = luaL_checkunsigned(L, 2); | |
| 181 | int f = fieldargs(L, 3, &w); | |
| 182 | int m = mask(w); | |
| 183 | v &= m; /* erase bits outside given width */ | |
| 184 | r = (r & ~(m << f)) | (v << f); | |
| 185 | lua_pushunsigned(L, r); | |
| 186 | return 1; | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
| 190 | 190 | static const luaL_Reg bitlib[] = { |
| 191 | {"arshift", b_arshift}, | |
| 192 | {"band", b_and}, | |
| 193 | {"bnot", b_not}, | |
| 194 | {"bor", b_or}, | |
| 195 | {"bxor", b_xor}, | |
| 196 | {"btest", b_test}, | |
| 197 | {"extract", b_extract}, | |
| 198 | {"lrotate", b_lrot}, | |
| 199 | {"lshift", b_lshift}, | |
| 200 | {"replace", b_replace}, | |
| 201 | {"rrotate", b_rrot}, | |
| 202 | {"rshift", b_rshift}, | |
| 203 | {NULL, NULL} | |
| 191 | {"arshift", b_arshift}, | |
| 192 | {"band", b_and}, | |
| 193 | {"bnot", b_not}, | |
| 194 | {"bor", b_or}, | |
| 195 | {"bxor", b_xor}, | |
| 196 | {"btest", b_test}, | |
| 197 | {"extract", b_extract}, | |
| 198 | {"lrotate", b_lrot}, | |
| 199 | {"lshift", b_lshift}, | |
| 200 | {"replace", b_replace}, | |
| 201 | {"rrotate", b_rrot}, | |
| 202 | {"rshift", b_rshift}, | |
| 203 | {NULL, NULL} | |
| 204 | 204 | }; |
| 205 | 205 | |
| 206 | 206 | |
| 207 | 207 | |
| 208 | 208 | LUAMOD_API int luaopen_bit32 (lua_State *L) { |
| 209 | luaL_newlib(L, bitlib); | |
| 210 | return 1; | |
| 209 | luaL_newlib(L, bitlib); | |
| 210 | return 1; | |
| 211 | 211 | } |
| 212 |
| r31373 | r31374 | |
|---|---|---|
| 20 | 20 | #include "lundump.h" |
| 21 | 21 | |
| 22 | 22 | static void PrintFunction(const Proto* f, int full); |
| 23 | #define luaU_print | |
| 23 | #define luaU_print PrintFunction | |
| 24 | 24 | |
| 25 | #define PROGNAME "luac" /* default program name */ | |
| 26 | #define OUTPUT PROGNAME ".out" /* default output file */ | |
| 25 | #define PROGNAME "luac" /* default program name */ | |
| 26 | #define OUTPUT PROGNAME ".out" /* default output file */ | |
| 27 | 27 | |
| 28 | static int listing=0; /* list bytecodes? */ | |
| 29 | static int dumping=1; /* dump bytecodes? */ | |
| 30 | static int stripping=0; /* strip debug information? */ | |
| 31 | static char Output[]={ OUTPUT }; /* default output file name */ | |
| 32 | static const char* output=Output; /* actual output file name */ | |
| 33 | static const char* progname=PROGNAME; /* actual program name */ | |
| 28 | static int listing=0; /* list bytecodes? */ | |
| 29 | static int dumping=1; /* dump bytecodes? */ | |
| 30 | static int stripping=0; /* strip debug information? */ | |
| 31 | static char Output[]={ OUTPUT }; /* default output file name */ | |
| 32 | static const char* output=Output; /* actual output file name */ | |
| 33 | static const char* progname=PROGNAME; /* actual program name */ | |
| 34 | 34 | |
| 35 | 35 | static void fatal(const char* message) |
| 36 | 36 | { |
| 37 | fprintf(stderr,"%s: %s\n",progname,message); | |
| 38 | exit(EXIT_FAILURE); | |
| 37 | fprintf(stderr,"%s: %s\n",progname,message); | |
| 38 | exit(EXIT_FAILURE); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static void cannot(const char* what) |
| 42 | 42 | { |
| 43 | fprintf(stderr,"%s: cannot %s %s: %s\n",progname,what,output,strerror(errno)); | |
| 44 | exit(EXIT_FAILURE); | |
| 43 | fprintf(stderr,"%s: cannot %s %s: %s\n",progname,what,output,strerror(errno)); | |
| 44 | exit(EXIT_FAILURE); | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | static void usage(const char* message) |
| 48 | 48 | { |
| 49 | if (*message=='-') | |
| 50 | fprintf(stderr,"%s: unrecognized option " LUA_QS "\n",progname,message); | |
| 51 | else | |
| 52 | fprintf(stderr,"%s: %s\n",progname,message); | |
| 53 | fprintf(stderr, | |
| 54 | "usage: %s [options] [filenames]\n" | |
| 55 | "Available options are:\n" | |
| 56 | " -l list (use -l -l for full listing)\n" | |
| 57 | " -o name output to file " LUA_QL("name") " (default is \"%s\")\n" | |
| 58 | " -p parse only\n" | |
| 59 | " -s strip debug information\n" | |
| 60 | " -v show version information\n" | |
| 61 | " -- stop handling options\n" | |
| 62 | " - stop handling options and process stdin\n" | |
| 63 | ,progname,Output); | |
| 64 | exit(EXIT_FAILURE); | |
| 49 | if (*message=='-') | |
| 50 | fprintf(stderr,"%s: unrecognized option " LUA_QS "\n",progname,message); | |
| 51 | else | |
| 52 | fprintf(stderr,"%s: %s\n",progname,message); | |
| 53 | fprintf(stderr, | |
| 54 | "usage: %s [options] [filenames]\n" | |
| 55 | "Available options are:\n" | |
| 56 | " -l list (use -l -l for full listing)\n" | |
| 57 | " -o name output to file " LUA_QL("name") " (default is \"%s\")\n" | |
| 58 | " -p parse only\n" | |
| 59 | " -s strip debug information\n" | |
| 60 | " -v show version information\n" | |
| 61 | " -- stop handling options\n" | |
| 62 | " - stop handling options and process stdin\n" | |
| 63 | ,progname,Output); | |
| 64 | exit(EXIT_FAILURE); | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | #define IS(s) | |
| 67 | #define IS(s) (strcmp(argv[i],s)==0) | |
| 68 | 68 | |
| 69 | 69 | static int doargs(int argc, char* argv[]) |
| 70 | 70 | { |
| 71 | int i; | |
| 72 | int version=0; | |
| 73 | if (argv[0]!=NULL && *argv[0]!=0) progname=argv[0]; | |
| 74 | for (i=1; i<argc; i++) | |
| 75 | { | |
| 76 | if (*argv[i]!='-') /* end of options; keep it */ | |
| 77 | break; | |
| 78 | else if (IS("--")) /* end of options; skip it */ | |
| 79 | { | |
| 80 | ++i; | |
| 81 | if (version) ++version; | |
| 82 | break; | |
| 83 | } | |
| 84 | else if (IS("-")) /* end of options; use stdin */ | |
| 85 | break; | |
| 86 | else if (IS("-l")) /* list */ | |
| 87 | ++listing; | |
| 88 | else if (IS("-o")) /* output file */ | |
| 89 | { | |
| 90 | output=argv[++i]; | |
| 91 | if (output==NULL || *output==0 || (*output=='-' && output[1]!=0)) | |
| 92 | usage(LUA_QL("-o") " needs argument"); | |
| 93 | if (IS("-")) output=NULL; | |
| 94 | } | |
| 95 | else if (IS("-p")) /* parse only */ | |
| 96 | dumping=0; | |
| 97 | else if (IS("-s")) /* strip debug information */ | |
| 98 | stripping=1; | |
| 99 | else if (IS("-v")) /* show version */ | |
| 100 | ++version; | |
| 101 | else /* unknown option */ | |
| 102 | usage(argv[i]); | |
| 103 | } | |
| 104 | if (i==argc && (listing || !dumping)) | |
| 105 | { | |
| 106 | dumping=0; | |
| 107 | argv[--i]=Output; | |
| 108 | } | |
| 109 | if (version) | |
| 110 | { | |
| 111 | printf("%s\n",LUA_COPYRIGHT); | |
| 112 | if (version==argc-1) exit(EXIT_SUCCESS); | |
| 113 | } | |
| 114 | return i; | |
| 71 | int i; | |
| 72 | int version=0; | |
| 73 | if (argv[0]!=NULL && *argv[0]!=0) progname=argv[0]; | |
| 74 | for (i=1; i<argc; i++) | |
| 75 | { | |
| 76 | if (*argv[i]!='-') /* end of options; keep it */ | |
| 77 | break; | |
| 78 | else if (IS("--")) /* end of options; skip it */ | |
| 79 | { | |
| 80 | ++i; | |
| 81 | if (version) ++version; | |
| 82 | break; | |
| 83 | } | |
| 84 | else if (IS("-")) /* end of options; use stdin */ | |
| 85 | break; | |
| 86 | else if (IS("-l")) /* list */ | |
| 87 | ++listing; | |
| 88 | else if (IS("-o")) /* output file */ | |
| 89 | { | |
| 90 | output=argv[++i]; | |
| 91 | if (output==NULL || *output==0 || (*output=='-' && output[1]!=0)) | |
| 92 | usage(LUA_QL("-o") " needs argument"); | |
| 93 | if (IS("-")) output=NULL; | |
| 94 | } | |
| 95 | else if (IS("-p")) /* parse only */ | |
| 96 | dumping=0; | |
| 97 | else if (IS("-s")) /* strip debug information */ | |
| 98 | stripping=1; | |
| 99 | else if (IS("-v")) /* show version */ | |
| 100 | ++version; | |
| 101 | else /* unknown option */ | |
| 102 | usage(argv[i]); | |
| 103 | } | |
| 104 | if (i==argc && (listing || !dumping)) | |
| 105 | { | |
| 106 | dumping=0; | |
| 107 | argv[--i]=Output; | |
| 108 | } | |
| 109 | if (version) | |
| 110 | { | |
| 111 | printf("%s\n",LUA_COPYRIGHT); | |
| 112 | if (version==argc-1) exit(EXIT_SUCCESS); | |
| 113 | } | |
| 114 | return i; | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | #define FUNCTION "(function()end)();" |
| 118 | 118 | |
| 119 | 119 | static const char* reader(lua_State *L, void *ud, size_t *size) |
| 120 | 120 | { |
| 121 | UNUSED(L); | |
| 122 | if ((*(int*)ud)--) | |
| 123 | { | |
| 124 | *size=sizeof(FUNCTION)-1; | |
| 125 | return FUNCTION; | |
| 126 | } | |
| 127 | else | |
| 128 | { | |
| 129 | *size=0; | |
| 130 | return NULL; | |
| 131 | } | |
| 121 | UNUSED(L); | |
| 122 | if ((*(int*)ud)--) | |
| 123 | { | |
| 124 | *size=sizeof(FUNCTION)-1; | |
| 125 | return FUNCTION; | |
| 126 | } | |
| 127 | else | |
| 128 | { | |
| 129 | *size=0; | |
| 130 | return NULL; | |
| 131 | } | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | #define toproto(L,i) getproto(L->top+(i)) |
| 135 | 135 | |
| 136 | 136 | static const Proto* combine(lua_State* L, int n) |
| 137 | 137 | { |
| 138 | if (n==1) | |
| 139 | return toproto(L,-1); | |
| 140 | else | |
| 141 | { | |
| 142 | Proto* f; | |
| 143 | int i=n; | |
| 144 | if (lua_load(L,reader,&i,"=(" PROGNAME ")",NULL)!=LUA_OK) fatal(lua_tostring(L,-1)); | |
| 145 | f=toproto(L,-1); | |
| 146 | for (i=0; i<n; i++) | |
| 147 | { | |
| 148 | f->p[i]=toproto(L,i-n-1); | |
| 149 | if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0; | |
| 150 | } | |
| 151 | f->sizelineinfo=0; | |
| 152 | return f; | |
| 153 | } | |
| 138 | if (n==1) | |
| 139 | return toproto(L,-1); | |
| 140 | else | |
| 141 | { | |
| 142 | Proto* f; | |
| 143 | int i=n; | |
| 144 | if (lua_load(L,reader,&i,"=(" PROGNAME ")",NULL)!=LUA_OK) fatal(lua_tostring(L,-1)); | |
| 145 | f=toproto(L,-1); | |
| 146 | for (i=0; i<n; i++) | |
| 147 | { | |
| 148 | f->p[i]=toproto(L,i-n-1); | |
| 149 | if (f->p[i]->sizeupvalues>0) f->p[i]->upvalues[0].instack=0; | |
| 150 | } | |
| 151 | f->sizelineinfo=0; | |
| 152 | return f; | |
| 153 | } | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | static int writer(lua_State* L, const void* p, size_t size, void* u) |
| 157 | 157 | { |
| 158 | UNUSED(L); | |
| 159 | return (fwrite(p,size,1,(FILE*)u)!=1) && (size!=0); | |
| 158 | UNUSED(L); | |
| 159 | return (fwrite(p,size,1,(FILE*)u)!=1) && (size!=0); | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | static int pmain(lua_State* L) |
| 163 | 163 | { |
| 164 | int argc=(int)lua_tointeger(L,1); | |
| 165 | char** argv=(char**)lua_touserdata(L,2); | |
| 166 | const Proto* f; | |
| 167 | int i; | |
| 168 | if (!lua_checkstack(L,argc)) fatal("too many input files"); | |
| 169 | for (i=0; i<argc; i++) | |
| 170 | { | |
| 171 | const char* filename=IS("-") ? NULL : argv[i]; | |
| 172 | if (luaL_loadfile(L,filename)!=LUA_OK) fatal(lua_tostring(L,-1)); | |
| 173 | } | |
| 174 | f=combine(L,argc); | |
| 175 | if (listing) luaU_print(f,listing>1); | |
| 176 | if (dumping) | |
| 177 | { | |
| 178 | FILE* D= (output==NULL) ? stdout : fopen(output,"wb"); | |
| 179 | if (D==NULL) cannot("open"); | |
| 180 | lua_lock(L); | |
| 181 | luaU_dump(L,f,writer,D,stripping); | |
| 182 | lua_unlock(L); | |
| 183 | if (ferror(D)) cannot("write"); | |
| 184 | if (fclose(D)) cannot("close"); | |
| 185 | } | |
| 186 | return 0; | |
| 164 | int argc=(int)lua_tointeger(L,1); | |
| 165 | char** argv=(char**)lua_touserdata(L,2); | |
| 166 | const Proto* f; | |
| 167 | int i; | |
| 168 | if (!lua_checkstack(L,argc)) fatal("too many input files"); | |
| 169 | for (i=0; i<argc; i++) | |
| 170 | { | |
| 171 | const char* filename=IS("-") ? NULL : argv[i]; | |
| 172 | if (luaL_loadfile(L,filename)!=LUA_OK) fatal(lua_tostring(L,-1)); | |
| 173 | } | |
| 174 | f=combine(L,argc); | |
| 175 | if (listing) luaU_print(f,listing>1); | |
| 176 | if (dumping) | |
| 177 | { | |
| 178 | FILE* D= (output==NULL) ? stdout : fopen(output,"wb"); | |
| 179 | if (D==NULL) cannot("open"); | |
| 180 | lua_lock(L); | |
| 181 | luaU_dump(L,f,writer,D,stripping); | |
| 182 | lua_unlock(L); | |
| 183 | if (ferror(D)) cannot("write"); | |
| 184 | if (fclose(D)) cannot("close"); | |
| 185 | } | |
| 186 | return 0; | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | int main(int argc, char* argv[]) |
| 190 | 190 | { |
| 191 | lua_State* L; | |
| 192 | int i=doargs(argc,argv); | |
| 193 | argc-=i; argv+=i; | |
| 194 | if (argc<=0) usage("no input files given"); | |
| 195 | L=luaL_newstate(); | |
| 196 | if (L==NULL) fatal("cannot create state: not enough memory"); | |
| 197 | lua_pushcfunction(L,&pmain); | |
| 198 | lua_pushinteger(L,argc); | |
| 199 | lua_pushlightuserdata(L,argv); | |
| 200 | if (lua_pcall(L,2,0,0)!=LUA_OK) fatal(lua_tostring(L,-1)); | |
| 201 | lua_close(L); | |
| 202 | return EXIT_SUCCESS; | |
| 191 | lua_State* L; | |
| 192 | int i=doargs(argc,argv); | |
| 193 | argc-=i; argv+=i; | |
| 194 | if (argc<=0) usage("no input files given"); | |
| 195 | L=luaL_newstate(); | |
| 196 | if (L==NULL) fatal("cannot create state: not enough memory"); | |
| 197 | lua_pushcfunction(L,&pmain); | |
| 198 | lua_pushinteger(L,argc); | |
| 199 | lua_pushlightuserdata(L,argv); | |
| 200 | if (lua_pcall(L,2,0,0)!=LUA_OK) fatal(lua_tostring(L,-1)); | |
| 201 | lua_close(L); | |
| 202 | return EXIT_SUCCESS; | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | /* |
| r31373 | r31374 | |
| 218 | 218 | #include "lobject.h" |
| 219 | 219 | #include "lopcodes.h" |
| 220 | 220 | |
| 221 | #define VOID(p) | |
| 221 | #define VOID(p) ((const void*)(p)) | |
| 222 | 222 | |
| 223 | 223 | static void PrintString(const TString* ts) |
| 224 | 224 | { |
| 225 | const char* s=getstr(ts); | |
| 226 | size_t i,n=ts->tsv.len; | |
| 227 | printf("%c",'"'); | |
| 228 | for (i=0; i<n; i++) | |
| 229 | { | |
| 230 | int c=(int)(unsigned char)s[i]; | |
| 231 | switch (c) | |
| 232 | { | |
| 233 | case '"': printf("\\\""); break; | |
| 234 | case '\\': printf("\\\\"); break; | |
| 235 | case '\a': printf("\\a"); break; | |
| 236 | case '\b': printf("\\b"); break; | |
| 237 | case '\f': printf("\\f"); break; | |
| 238 | case '\n': printf("\\n"); break; | |
| 239 | case '\r': printf("\\r"); break; | |
| 240 | case '\t': printf("\\t"); break; | |
| 241 | case '\v': printf("\\v"); break; | |
| 242 | default: if (isprint(c)) | |
| 243 | printf("%c",c); | |
| 225 | const char* s=getstr(ts); | |
| 226 | size_t i,n=ts->tsv.len; | |
| 227 | printf("%c",'"'); | |
| 228 | for (i=0; i<n; i++) | |
| 229 | { | |
| 230 | int c=(int)(unsigned char)s[i]; | |
| 231 | switch (c) | |
| 232 | { | |
| 233 | case '"': printf("\\\""); break; | |
| 234 | case '\\': printf("\\\\"); break; | |
| 235 | case '\a': printf("\\a"); break; | |
| 236 | case '\b': printf("\\b"); break; | |
| 237 | case '\f': printf("\\f"); break; | |
| 238 | case '\n': printf("\\n"); break; | |
| 239 | case '\r': printf("\\r"); break; | |
| 240 | case '\t': printf("\\t"); break; | |
| 241 | case '\v': printf("\\v"); break; | |
| 242 | default: if (isprint(c)) | |
| 243 | printf("%c",c); | |
| 244 | 244 | else |
| 245 | 245 | printf("\\%03d",c); |
| 246 | } | |
| 247 | } | |
| 248 | printf("%c",'"'); | |
| 246 | } | |
| 247 | } | |
| 248 | printf("%c",'"'); | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | static void PrintConstant(const Proto* f, int i) |
| 252 | 252 | { |
| 253 | const TValue* o=&f->k[i]; | |
| 254 | switch (ttypenv(o)) | |
| 255 | { | |
| 256 | case LUA_TNIL: | |
| 253 | const TValue* o=&f->k[i]; | |
| 254 | switch (ttypenv(o)) | |
| 255 | { | |
| 256 | case LUA_TNIL: | |
| 257 | 257 | printf("nil"); |
| 258 | 258 | break; |
| 259 | ||
| 259 | case LUA_TBOOLEAN: | |
| 260 | 260 | printf(bvalue(o) ? "true" : "false"); |
| 261 | 261 | break; |
| 262 | ||
| 262 | case LUA_TNUMBER: | |
| 263 | 263 | printf(LUA_NUMBER_FMT,nvalue(o)); |
| 264 | 264 | break; |
| 265 | ||
| 265 | case LUA_TSTRING: | |
| 266 | 266 | PrintString(rawtsvalue(o)); |
| 267 | 267 | break; |
| 268 | ||
| 268 | default: /* cannot happen */ | |
| 269 | 269 | printf("? type=%d",ttype(o)); |
| 270 | 270 | break; |
| 271 | ||
| 271 | } | |
| 272 | 272 | } |
| 273 | 273 | |
| 274 | 274 | #define UPVALNAME(x) ((f->upvalues[x].name) ? getstr(f->upvalues[x].name) : "-") |
| 275 | #define MYK(x) | |
| 275 | #define MYK(x) (-1-(x)) | |
| 276 | 276 | |
| 277 | 277 | static void PrintCode(const Proto* f) |
| 278 | 278 | { |
| 279 | const Instruction* code=f->code; | |
| 280 | int pc,n=f->sizecode; | |
| 281 | for (pc=0; pc<n; pc++) | |
| 282 | { | |
| 283 | Instruction i=code[pc]; | |
| 284 | OpCode o=GET_OPCODE(i); | |
| 285 | int a=GETARG_A(i); | |
| 286 | int b=GETARG_B(i); | |
| 287 | int c=GETARG_C(i); | |
| 288 | int ax=GETARG_Ax(i); | |
| 289 | int bx=GETARG_Bx(i); | |
| 290 | int sbx=GETARG_sBx(i); | |
| 291 | int line=getfuncline(f,pc); | |
| 292 | printf("\t%d\t",pc+1); | |
| 293 | if (line>0) printf("[%d]\t",line); else printf("[-]\t"); | |
| 294 | printf("%-9s\t",luaP_opnames[o]); | |
| 295 | switch (getOpMode(o)) | |
| 296 | { | |
| 297 | case iABC: | |
| 298 | printf("%d",a); | |
| 299 | if (getBMode(o)!=OpArgN) printf(" %d",ISK(b) ? (MYK(INDEXK(b))) : b); | |
| 300 | if (getCMode(o)!=OpArgN) printf(" %d",ISK(c) ? (MYK(INDEXK(c))) : c); | |
| 301 | break; | |
| 302 | case iABx: | |
| 303 | printf("%d",a); | |
| 304 | if (getBMode(o)==OpArgK) printf(" %d",MYK(bx)); | |
| 305 | if (getBMode(o)==OpArgU) printf(" %d",bx); | |
| 306 | break; | |
| 307 | case iAsBx: | |
| 308 | printf("%d %d",a,sbx); | |
| 309 | break; | |
| 310 | case iAx: | |
| 311 | printf("%d",MYK(ax)); | |
| 312 | break; | |
| 313 | } | |
| 314 | switch (o) | |
| 315 | { | |
| 316 | case OP_LOADK: | |
| 317 | printf("\t; "); PrintConstant(f,bx); | |
| 318 | break; | |
| 319 | case OP_GETUPVAL: | |
| 320 | case OP_SETUPVAL: | |
| 321 | printf("\t; %s",UPVALNAME(b)); | |
| 322 | break; | |
| 323 | case OP_GETTABUP: | |
| 324 | printf("\t; %s",UPVALNAME(b)); | |
| 325 | if (ISK(c)) { printf(" "); PrintConstant(f,INDEXK(c)); } | |
| 326 | break; | |
| 327 | case OP_SETTABUP: | |
| 328 | printf("\t; %s",UPVALNAME(a)); | |
| 329 | if (ISK(b)) { printf(" "); PrintConstant(f,INDEXK(b)); } | |
| 330 | if (ISK(c)) { printf(" "); PrintConstant(f,INDEXK(c)); } | |
| 331 | break; | |
| 332 | case OP_GETTABLE: | |
| 333 | case OP_SELF: | |
| 334 | if (ISK(c)) { printf("\t; "); PrintConstant(f,INDEXK(c)); } | |
| 335 | break; | |
| 336 | case OP_SETTABLE: | |
| 337 | case OP_ADD: | |
| 338 | case OP_SUB: | |
| 339 | case OP_MUL: | |
| 340 | case OP_DIV: | |
| 341 | case OP_POW: | |
| 342 | case OP_EQ: | |
| 343 | case OP_LT: | |
| 344 | case OP_LE: | |
| 345 | if (ISK(b) || ISK(c)) | |
| 346 | { | |
| 347 | printf("\t; "); | |
| 348 | if (ISK(b)) PrintConstant(f,INDEXK(b)); else printf("-"); | |
| 349 | printf(" "); | |
| 350 | if (ISK(c)) PrintConstant(f,INDEXK(c)); else printf("-"); | |
| 351 | } | |
| 352 | break; | |
| 353 | case OP_JMP: | |
| 354 | case OP_FORLOOP: | |
| 355 | case OP_FORPREP: | |
| 356 | case OP_TFORLOOP: | |
| 357 | printf("\t; to %d",sbx+pc+2); | |
| 358 | break; | |
| 359 | case OP_CLOSURE: | |
| 360 | printf("\t; %p",VOID(f->p[bx])); | |
| 361 | break; | |
| 362 | case OP_SETLIST: | |
| 363 | if (c==0) printf("\t; %d",(int)code[++pc]); else printf("\t; %d",c); | |
| 364 | break; | |
| 365 | case OP_EXTRAARG: | |
| 366 | printf("\t; "); PrintConstant(f,ax); | |
| 367 | break; | |
| 368 | default: | |
| 369 | break; | |
| 370 | } | |
| 371 | printf("\n"); | |
| 372 | } | |
| 279 | const Instruction* code=f->code; | |
| 280 | int pc,n=f->sizecode; | |
| 281 | for (pc=0; pc<n; pc++) | |
| 282 | { | |
| 283 | Instruction i=code[pc]; | |
| 284 | OpCode o=GET_OPCODE(i); | |
| 285 | int a=GETARG_A(i); | |
| 286 | int b=GETARG_B(i); | |
| 287 | int c=GETARG_C(i); | |
| 288 | int ax=GETARG_Ax(i); | |
| 289 | int bx=GETARG_Bx(i); | |
| 290 | int sbx=GETARG_sBx(i); | |
| 291 | int line=getfuncline(f,pc); | |
| 292 | printf("\t%d\t",pc+1); | |
| 293 | if (line>0) printf("[%d]\t",line); else printf("[-]\t"); | |
| 294 | printf("%-9s\t",luaP_opnames[o]); | |
| 295 | switch (getOpMode(o)) | |
| 296 | { | |
| 297 | case iABC: | |
| 298 | printf("%d",a); | |
| 299 | if (getBMode(o)!=OpArgN) printf(" %d",ISK(b) ? (MYK(INDEXK(b))) : b); | |
| 300 | if (getCMode(o)!=OpArgN) printf(" %d",ISK(c) ? (MYK(INDEXK(c))) : c); | |
| 301 | break; | |
| 302 | case iABx: | |
| 303 | printf("%d",a); | |
| 304 | if (getBMode(o)==OpArgK) printf(" %d",MYK(bx)); | |
| 305 | if (getBMode(o)==OpArgU) printf(" %d",bx); | |
| 306 | break; | |
| 307 | case iAsBx: | |
| 308 | printf("%d %d",a,sbx); | |
| 309 | break; | |
| 310 | case iAx: | |
| 311 | printf("%d",MYK(ax)); | |
| 312 | break; | |
| 313 | } | |
| 314 | switch (o) | |
| 315 | { | |
| 316 | case OP_LOADK: | |
| 317 | printf("\t; "); PrintConstant(f,bx); | |
| 318 | break; | |
| 319 | case OP_GETUPVAL: | |
| 320 | case OP_SETUPVAL: | |
| 321 | printf("\t; %s",UPVALNAME(b)); | |
| 322 | break; | |
| 323 | case OP_GETTABUP: | |
| 324 | printf("\t; %s",UPVALNAME(b)); | |
| 325 | if (ISK(c)) { printf(" "); PrintConstant(f,INDEXK(c)); } | |
| 326 | break; | |
| 327 | case OP_SETTABUP: | |
| 328 | printf("\t; %s",UPVALNAME(a)); | |
| 329 | if (ISK(b)) { printf(" "); PrintConstant(f,INDEXK(b)); } | |
| 330 | if (ISK(c)) { printf(" "); PrintConstant(f,INDEXK(c)); } | |
| 331 | break; | |
| 332 | case OP_GETTABLE: | |
| 333 | case OP_SELF: | |
| 334 | if (ISK(c)) { printf("\t; "); PrintConstant(f,INDEXK(c)); } | |
| 335 | break; | |
| 336 | case OP_SETTABLE: | |
| 337 | case OP_ADD: | |
| 338 | case OP_SUB: | |
| 339 | case OP_MUL: | |
| 340 | case OP_DIV: | |
| 341 | case OP_POW: | |
| 342 | case OP_EQ: | |
| 343 | case OP_LT: | |
| 344 | case OP_LE: | |
| 345 | if (ISK(b) || ISK(c)) | |
| 346 | { | |
| 347 | printf("\t; "); | |
| 348 | if (ISK(b)) PrintConstant(f,INDEXK(b)); else printf("-"); | |
| 349 | printf(" "); | |
| 350 | if (ISK(c)) PrintConstant(f,INDEXK(c)); else printf("-"); | |
| 351 | } | |
| 352 | break; | |
| 353 | case OP_JMP: | |
| 354 | case OP_FORLOOP: | |
| 355 | case OP_FORPREP: | |
| 356 | case OP_TFORLOOP: | |
| 357 | printf("\t; to %d",sbx+pc+2); | |
| 358 | break; | |
| 359 | case OP_CLOSURE: | |
| 360 | printf("\t; %p",VOID(f->p[bx])); | |
| 361 | break; | |
| 362 | case OP_SETLIST: | |
| 363 | if (c==0) printf("\t; %d",(int)code[++pc]); else printf("\t; %d",c); | |
| 364 | break; | |
| 365 | case OP_EXTRAARG: | |
| 366 | printf("\t; "); PrintConstant(f,ax); | |
| 367 | break; | |
| 368 | default: | |
| 369 | break; | |
| 370 | } | |
| 371 | printf("\n"); | |
| 372 | } | |
| 373 | 373 | } |
| 374 | 374 | |
| 375 | #define SS(x) ((x==1)?"":"s") | |
| 376 | #define S(x) (int)(x),SS(x) | |
| 375 | #define SS(x) ((x==1)?"":"s") | |
| 376 | #define S(x) (int)(x),SS(x) | |
| 377 | 377 | |
| 378 | 378 | static void PrintHeader(const Proto* f) |
| 379 | 379 | { |
| 380 | const char* s=f->source ? getstr(f->source) : "=?"; | |
| 381 | if (*s=='@' || *s=='=') | |
| 382 | s++; | |
| 383 | else if (*s==LUA_SIGNATURE[0]) | |
| 384 | s="(bstring)"; | |
| 385 | else | |
| 386 | s="(string)"; | |
| 387 | printf("\n%s <%s:%d,%d> (%d instruction%s at %p)\n", | |
| 388 | (f->linedefined==0)?"main":"function",s, | |
| 380 | const char* s=f->source ? getstr(f->source) : "=?"; | |
| 381 | if (*s=='@' || *s=='=') | |
| 382 | s++; | |
| 383 | else if (*s==LUA_SIGNATURE[0]) | |
| 384 | s="(bstring)"; | |
| 385 | else | |
| 386 | s="(string)"; | |
| 387 | printf("\n%s <%s:%d,%d> (%d instruction%s at %p)\n", | |
| 388 | (f->linedefined==0)?"main":"function",s, | |
| 389 | 389 | f->linedefined,f->lastlinedefined, |
| 390 | 390 | S(f->sizecode),VOID(f)); |
| 391 | ||
| 391 | printf("%d%s param%s, %d slot%s, %d upvalue%s, ", | |
| 392 | 392 | (int)(f->numparams),f->is_vararg?"+":"",SS(f->numparams), |
| 393 | 393 | S(f->maxstacksize),S(f->sizeupvalues)); |
| 394 | ||
| 394 | printf("%d local%s, %d constant%s, %d function%s\n", | |
| 395 | 395 | S(f->sizelocvars),S(f->sizek),S(f->sizep)); |
| 396 | 396 | } |
| 397 | 397 | |
| 398 | 398 | static void PrintDebug(const Proto* f) |
| 399 | 399 | { |
| 400 | int i,n; | |
| 401 | n=f->sizek; | |
| 402 | printf("constants (%d) for %p:\n",n,VOID(f)); | |
| 403 | for (i=0; i<n; i++) | |
| 404 | { | |
| 405 | printf("\t%d\t",i+1); | |
| 406 | PrintConstant(f,i); | |
| 407 | printf("\n"); | |
| 408 | } | |
| 409 | n=f->sizelocvars; | |
| 410 | printf("locals (%d) for %p:\n",n,VOID(f)); | |
| 411 | for (i=0; i<n; i++) | |
| 412 | { | |
| 413 | printf("\t%d\t%s\t%d\t%d\n", | |
| 414 | i,getstr(f->locvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1); | |
| 415 | } | |
| 416 | n=f->sizeupvalues; | |
| 417 | printf("upvalues (%d) for %p:\n",n,VOID(f)); | |
| 418 | for (i=0; i<n; i++) | |
| 419 | { | |
| 420 | printf("\t%d\t%s\t%d\t%d\n", | |
| 421 | i,UPVALNAME(i),f->upvalues[i].instack,f->upvalues[i].idx); | |
| 422 | } | |
| 400 | int i,n; | |
| 401 | n=f->sizek; | |
| 402 | printf("constants (%d) for %p:\n",n,VOID(f)); | |
| 403 | for (i=0; i<n; i++) | |
| 404 | { | |
| 405 | printf("\t%d\t",i+1); | |
| 406 | PrintConstant(f,i); | |
| 407 | printf("\n"); | |
| 408 | } | |
| 409 | n=f->sizelocvars; | |
| 410 | printf("locals (%d) for %p:\n",n,VOID(f)); | |
| 411 | for (i=0; i<n; i++) | |
| 412 | { | |
| 413 | printf("\t%d\t%s\t%d\t%d\n", | |
| 414 | i,getstr(f->locvars[i].varname),f->locvars[i].startpc+1,f->locvars[i].endpc+1); | |
| 415 | } | |
| 416 | n=f->sizeupvalues; | |
| 417 | printf("upvalues (%d) for %p:\n",n,VOID(f)); | |
| 418 | for (i=0; i<n; i++) | |
| 419 | { | |
| 420 | printf("\t%d\t%s\t%d\t%d\n", | |
| 421 | i,UPVALNAME(i),f->upvalues[i].instack,f->upvalues[i].idx); | |
| 422 | } | |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | 425 | static void PrintFunction(const Proto* f, int full) |
| 426 | 426 | { |
| 427 | int i,n=f->sizep; | |
| 428 | PrintHeader(f); | |
| 429 | PrintCode(f); | |
| 430 | if (full) PrintDebug(f); | |
| 431 | for (i=0; i<n; i++) PrintFunction(f->p[i],full); | |
| 427 | int i,n=f->sizep; | |
| 428 | PrintHeader(f); | |
| 429 | PrintCode(f); | |
| 430 | if (full) PrintDebug(f); | |
| 431 | for (i=0; i<n; i++) PrintFunction(f->p[i],full); | |
| 432 | 432 | } |
| r31373 | r31374 | |
|---|---|---|
| 26 | 26 | #if !defined(LUA_STRFTIMEOPTIONS) |
| 27 | 27 | |
| 28 | 28 | #if !defined(LUA_USE_POSIX) |
| 29 | #define LUA_STRFTIMEOPTIONS | |
| 29 | #define LUA_STRFTIMEOPTIONS { "aAbBcdHIjmMpSUwWxXyYz%", "" } | |
| 30 | 30 | #else |
| 31 | 31 | #define LUA_STRFTIMEOPTIONS \ |
| 32 | 32 | { "aAbBcCdDeFgGhHIjmMnprRStTuUVwWxXyYzZ%", "" \ |
| 33 | "", "E", "cCxXyY", \ | |
| 34 | "O", "deHImMSuUVwWy" } | |
| 33 | "", "E", "cCxXyY", \ | |
| 34 | "O", "deHImMSuUVwWy" } | |
| 35 | 35 | #endif |
| 36 | 36 | |
| 37 | 37 | #endif |
| r31373 | r31374 | |
| 44 | 44 | */ |
| 45 | 45 | #if defined(LUA_USE_MKSTEMP) |
| 46 | 46 | #include <unistd.h> |
| 47 | #define LUA_TMPNAMBUFSIZE | |
| 47 | #define LUA_TMPNAMBUFSIZE 32 | |
| 48 | 48 | #define lua_tmpnam(b,e) { \ |
| 49 | strcpy(b, "/tmp/lua_XXXXXX"); \ | |
| 50 | e = mkstemp(b); \ | |
| 51 | if (e != -1) close(e); \ | |
| 52 | e = (e == -1); } | |
| 49 | strcpy(b, "/tmp/lua_XXXXXX"); \ | |
| 50 | e = mkstemp(b); \ | |
| 51 | if (e != -1) close(e); \ | |
| 52 | e = (e == -1); } | |
| 53 | 53 | |
| 54 | 54 | #elif !defined(lua_tmpnam) |
| 55 | 55 | |
| 56 | #define LUA_TMPNAMBUFSIZE L_tmpnam | |
| 57 | #define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } | |
| 56 | #define LUA_TMPNAMBUFSIZE L_tmpnam | |
| 57 | #define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } | |
| 58 | 58 | |
| 59 | 59 | #endif |
| 60 | 60 | |
| r31373 | r31374 | |
| 65 | 65 | */ |
| 66 | 66 | #if defined(LUA_USE_GMTIME_R) |
| 67 | 67 | |
| 68 | #define l_gmtime(t,r) gmtime_r(t,r) | |
| 69 | #define l_localtime(t,r) localtime_r(t,r) | |
| 68 | #define l_gmtime(t,r) gmtime_r(t,r) | |
| 69 | #define l_localtime(t,r) localtime_r(t,r) | |
| 70 | 70 | |
| 71 | 71 | #elif !defined(l_gmtime) |
| 72 | 72 | |
| 73 | #define l_gmtime(t,r) ((void)r, gmtime(t)) | |
| 74 | #define l_localtime(t,r) ((void)r, localtime(t)) | |
| 73 | #define l_gmtime(t,r) ((void)r, gmtime(t)) | |
| 74 | #define l_localtime(t,r) ((void)r, localtime(t)) | |
| 75 | 75 | |
| 76 | 76 | #endif |
| 77 | 77 | |
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | static int os_execute (lua_State *L) { |
| 81 | const char *cmd = luaL_optstring(L, 1, NULL); | |
| 82 | int stat = system(cmd); | |
| 83 | if (cmd != NULL) | |
| 84 | return luaL_execresult(L, stat); | |
| 85 | else { | |
| 86 | lua_pushboolean(L, stat); /* true if there is a shell */ | |
| 87 | return 1; | |
| 88 | } | |
| 81 | const char *cmd = luaL_optstring(L, 1, NULL); | |
| 82 | int stat = system(cmd); | |
| 83 | if (cmd != NULL) | |
| 84 | return luaL_execresult(L, stat); | |
| 85 | else { | |
| 86 | lua_pushboolean(L, stat); /* true if there is a shell */ | |
| 87 | return 1; | |
| 88 | } | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | static int os_remove (lua_State *L) { |
| 93 | const char *filename = luaL_checkstring(L, 1); | |
| 94 | return luaL_fileresult(L, remove(filename) == 0, filename); | |
| 93 | const char *filename = luaL_checkstring(L, 1); | |
| 94 | return luaL_fileresult(L, remove(filename) == 0, filename); | |
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | static int os_rename (lua_State *L) { |
| 99 | const char *fromname = luaL_checkstring(L, 1); | |
| 100 | const char *toname = luaL_checkstring(L, 2); | |
| 101 | return luaL_fileresult(L, rename(fromname, toname) == 0, NULL); | |
| 99 | const char *fromname = luaL_checkstring(L, 1); | |
| 100 | const char *toname = luaL_checkstring(L, 2); | |
| 101 | return luaL_fileresult(L, rename(fromname, toname) == 0, NULL); | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | static int os_tmpname (lua_State *L) { |
| 106 | char buff[LUA_TMPNAMBUFSIZE]; | |
| 107 | int err; | |
| 108 | lua_tmpnam(buff, err); | |
| 109 | if (err) | |
| 110 | return luaL_error(L, "unable to generate a unique filename"); | |
| 111 | lua_pushstring(L, buff); | |
| 112 | return 1; | |
| 106 | char buff[LUA_TMPNAMBUFSIZE]; | |
| 107 | int err; | |
| 108 | lua_tmpnam(buff, err); | |
| 109 | if (err) | |
| 110 | return luaL_error(L, "unable to generate a unique filename"); | |
| 111 | lua_pushstring(L, buff); | |
| 112 | return 1; | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | static int os_getenv (lua_State *L) { |
| 117 | lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ | |
| 118 | return 1; | |
| 117 | lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ | |
| 118 | return 1; | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | static int os_clock (lua_State *L) { |
| 123 | lua_pushnumber(L, ((lua_Number)(1.0*clock()))/(lua_Number)CLOCKS_PER_SEC); | |
| 124 | return 1; | |
| 123 | lua_pushnumber(L, ((lua_Number)(1.0*clock()))/(lua_Number)CLOCKS_PER_SEC); | |
| 124 | return 1; | |
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | |
| r31373 | r31374 | |
| 134 | 134 | */ |
| 135 | 135 | |
| 136 | 136 | static void setfield (lua_State *L, const char *key, int value) { |
| 137 | lua_pushinteger(L, value); | |
| 138 | lua_setfield(L, -2, key); | |
| 137 | lua_pushinteger(L, value); | |
| 138 | lua_setfield(L, -2, key); | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | static void setboolfield (lua_State *L, const char *key, int value) { |
| 142 | if (value < 0) /* undefined? */ | |
| 143 | return; /* does not set field */ | |
| 144 | lua_pushboolean(L, value); | |
| 145 | lua_setfield(L, -2, key); | |
| 142 | if (value < 0) /* undefined? */ | |
| 143 | return; /* does not set field */ | |
| 144 | lua_pushboolean(L, value); | |
| 145 | lua_setfield(L, -2, key); | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | static int getboolfield (lua_State *L, const char *key) { |
| 149 | int res; | |
| 150 | lua_getfield(L, -1, key); | |
| 151 | res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); | |
| 152 | lua_pop(L, 1); | |
| 153 | return res; | |
| 149 | int res; | |
| 150 | lua_getfield(L, -1, key); | |
| 151 | res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); | |
| 152 | lua_pop(L, 1); | |
| 153 | return res; | |
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | static int getfield (lua_State *L, const char *key, int d) { |
| 158 | int res, isnum; | |
| 159 | lua_getfield(L, -1, key); | |
| 160 | res = (int)lua_tointegerx(L, -1, &isnum); | |
| 161 | if (!isnum) { | |
| 162 | if (d < 0) | |
| 163 | return luaL_error(L, "field " LUA_QS " missing in date table", key); | |
| 164 | res = d; | |
| 165 | } | |
| 166 | lua_pop(L, 1); | |
| 167 | return res; | |
| 158 | int res, isnum; | |
| 159 | lua_getfield(L, -1, key); | |
| 160 | res = (int)lua_tointegerx(L, -1, &isnum); | |
| 161 | if (!isnum) { | |
| 162 | if (d < 0) | |
| 163 | return luaL_error(L, "field " LUA_QS " missing in date table", key); | |
| 164 | res = d; | |
| 165 | } | |
| 166 | lua_pop(L, 1); | |
| 167 | return res; | |
| 168 | 168 | } |
| 169 | 169 | |
| 170 | 170 | |
| 171 | 171 | static const char *checkoption (lua_State *L, const char *conv, char *buff) { |
| 172 | static const char *const options[] = LUA_STRFTIMEOPTIONS; | |
| 173 | unsigned int i; | |
| 174 | for (i = 0; i < sizeof(options)/sizeof(options[0]); i += 2) { | |
| 175 | if (*conv != '\0' && strchr(options[i], *conv) != NULL) { | |
| 176 | buff[1] = *conv; | |
| 177 | if (*options[i + 1] == '\0') { /* one-char conversion specifier? */ | |
| 178 | buff[2] = '\0'; /* end buffer */ | |
| 179 | return conv + 1; | |
| 180 | } | |
| 181 | else if (*(conv + 1) != '\0' && | |
| 182 | strchr(options[i + 1], *(conv + 1)) != NULL) { | |
| 183 | buff[2] = *(conv + 1); /* valid two-char conversion specifier */ | |
| 184 | buff[3] = '\0'; /* end buffer */ | |
| 185 | return conv + 2; | |
| 186 | } | |
| 187 | } | |
| 188 | } | |
| 189 | luaL_argerror(L, 1, | |
| 190 | lua_pushfstring(L, "invalid conversion specifier '%%%s'", conv)); | |
| 191 | return conv; /* to avoid warnings */ | |
| 172 | static const char *const options[] = LUA_STRFTIMEOPTIONS; | |
| 173 | unsigned int i; | |
| 174 | for (i = 0; i < sizeof(options)/sizeof(options[0]); i += 2) { | |
| 175 | if (*conv != '\0' && strchr(options[i], *conv) != NULL) { | |
| 176 | buff[1] = *conv; | |
| 177 | if (*options[i + 1] == '\0') { /* one-char conversion specifier? */ | |
| 178 | buff[2] = '\0'; /* end buffer */ | |
| 179 | return conv + 1; | |
| 180 | } | |
| 181 | else if (*(conv + 1) != '\0' && | |
| 182 | strchr(options[i + 1], *(conv + 1)) != NULL) { | |
| 183 | buff[2] = *(conv + 1); /* valid two-char conversion specifier */ | |
| 184 | buff[3] = '\0'; /* end buffer */ | |
| 185 | return conv + 2; | |
| 186 | } | |
| 187 | } | |
| 188 | } | |
| 189 | luaL_argerror(L, 1, | |
| 190 | lua_pushfstring(L, "invalid conversion specifier '%%%s'", conv)); | |
| 191 | return conv; /* to avoid warnings */ | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | |
| 195 | 195 | static int os_date (lua_State *L) { |
| 196 | const char *s = luaL_optstring(L, 1, "%c"); | |
| 197 | time_t t = luaL_opt(L, luaL_checknumber, 2, time(NULL)); | |
| 198 | struct tm tmr, *stm; | |
| 199 | if (*s == '!') { /* UTC? */ | |
| 200 | stm = l_gmtime(&t, &tmr); | |
| 201 | s++; /* skip `!' */ | |
| 202 | } | |
| 203 | else | |
| 204 | stm = l_localtime(&t, &tmr); | |
| 205 | if (stm == NULL) /* invalid date? */ | |
| 206 | lua_pushnil(L); | |
| 207 | else if (strcmp(s, "*t") == 0) { | |
| 208 | lua_createtable(L, 0, 9); /* 9 = number of fields */ | |
| 209 | setfield(L, "sec", stm->tm_sec); | |
| 210 | setfield(L, "min", stm->tm_min); | |
| 211 | setfield(L, "hour", stm->tm_hour); | |
| 212 | setfield(L, "day", stm->tm_mday); | |
| 213 | setfield(L, "month", stm->tm_mon+1); | |
| 214 | setfield(L, "year", stm->tm_year+1900); | |
| 215 | setfield(L, "wday", stm->tm_wday+1); | |
| 216 | setfield(L, "yday", stm->tm_yday+1); | |
| 217 | setboolfield(L, "isdst", stm->tm_isdst); | |
| 218 | } | |
| 219 | else { | |
| 220 | char cc[4]; | |
| 221 | luaL_Buffer b; | |
| 222 | cc[0] = '%'; | |
| 223 | luaL_buffinit(L, &b); | |
| 224 | while (*s) { | |
| 225 | if (*s != '%') /* no conversion specifier? */ | |
| 226 | luaL_addchar(&b, *s++); | |
| 227 | else { | |
| 228 | size_t reslen; | |
| 229 | char buff[200]; /* should be big enough for any conversion result */ | |
| 230 | s = checkoption(L, s + 1, cc); | |
| 231 | reslen = strftime(buff, sizeof(buff), cc, stm); | |
| 232 | luaL_addlstring(&b, buff, reslen); | |
| 233 | } | |
| 234 | } | |
| 235 | luaL_pushresult(&b); | |
| 236 | } | |
| 237 | return 1; | |
| 196 | const char *s = luaL_optstring(L, 1, "%c"); | |
| 197 | time_t t = luaL_opt(L, luaL_checknumber, 2, time(NULL)); | |
| 198 | struct tm tmr, *stm; | |
| 199 | if (*s == '!') { /* UTC? */ | |
| 200 | stm = l_gmtime(&t, &tmr); | |
| 201 | s++; /* skip `!' */ | |
| 202 | } | |
| 203 | else | |
| 204 | stm = l_localtime(&t, &tmr); | |
| 205 | if (stm == NULL) /* invalid date? */ | |
| 206 | lua_pushnil(L); | |
| 207 | else if (strcmp(s, "*t") == 0) { | |
| 208 | lua_createtable(L, 0, 9); /* 9 = number of fields */ | |
| 209 | setfield(L, "sec", stm->tm_sec); | |
| 210 | setfield(L, "min", stm->tm_min); | |
| 211 | setfield(L, "hour", stm->tm_hour); | |
| 212 | setfield(L, "day", stm->tm_mday); | |
| 213 | setfield(L, "month", stm->tm_mon+1); | |
| 214 | setfield(L, "year", stm->tm_year+1900); | |
| 215 | setfield(L, "wday", stm->tm_wday+1); | |
| 216 | setfield(L, "yday", stm->tm_yday+1); | |
| 217 | setboolfield(L, "isdst", stm->tm_isdst); | |
| 218 | } | |
| 219 | else { | |
| 220 | char cc[4]; | |
| 221 | luaL_Buffer b; | |
| 222 | cc[0] = '%'; | |
| 223 | luaL_buffinit(L, &b); | |
| 224 | while (*s) { | |
| 225 | if (*s != '%') /* no conversion specifier? */ | |
| 226 | luaL_addchar(&b, *s++); | |
| 227 | else { | |
| 228 | size_t reslen; | |
| 229 | char buff[200]; /* should be big enough for any conversion result */ | |
| 230 | s = checkoption(L, s + 1, cc); | |
| 231 | reslen = strftime(buff, sizeof(buff), cc, stm); | |
| 232 | luaL_addlstring(&b, buff, reslen); | |
| 233 | } | |
| 234 | } | |
| 235 | luaL_pushresult(&b); | |
| 236 | } | |
| 237 | return 1; | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | |
| 241 | 241 | static int os_time (lua_State *L) { |
| 242 | time_t t; | |
| 243 | if (lua_isnoneornil(L, 1)) /* called without args? */ | |
| 244 | t = time(NULL); /* get current time */ | |
| 245 | else { | |
| 246 | struct tm ts; | |
| 247 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 248 | lua_settop(L, 1); /* make sure table is at the top */ | |
| 249 | ts.tm_sec = getfield(L, "sec", 0); | |
| 250 | ts.tm_min = getfield(L, "min", 0); | |
| 251 | ts.tm_hour = getfield(L, "hour", 12); | |
| 252 | ts.tm_mday = getfield(L, "day", -1); | |
| 253 | ts.tm_mon = getfield(L, "month", -1) - 1; | |
| 254 | ts.tm_year = getfield(L, "year", -1) - 1900; | |
| 255 | ts.tm_isdst = getboolfield(L, "isdst"); | |
| 256 | t = mktime(&ts); | |
| 257 | } | |
| 258 | if (t == (time_t)(-1)) | |
| 259 | lua_pushnil(L); | |
| 260 | else | |
| 261 | lua_pushnumber(L, (lua_Number)t); | |
| 262 | return 1; | |
| 242 | time_t t; | |
| 243 | if (lua_isnoneornil(L, 1)) /* called without args? */ | |
| 244 | t = time(NULL); /* get current time */ | |
| 245 | else { | |
| 246 | struct tm ts; | |
| 247 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 248 | lua_settop(L, 1); /* make sure table is at the top */ | |
| 249 | ts.tm_sec = getfield(L, "sec", 0); | |
| 250 | ts.tm_min = getfield(L, "min", 0); | |
| 251 | ts.tm_hour = getfield(L, "hour", 12); | |
| 252 | ts.tm_mday = getfield(L, "day", -1); | |
| 253 | ts.tm_mon = getfield(L, "month", -1) - 1; | |
| 254 | ts.tm_year = getfield(L, "year", -1) - 1900; | |
| 255 | ts.tm_isdst = getboolfield(L, "isdst"); | |
| 256 | t = mktime(&ts); | |
| 257 | } | |
| 258 | if (t == (time_t)(-1)) | |
| 259 | lua_pushnil(L); | |
| 260 | else | |
| 261 | lua_pushnumber(L, (lua_Number)t); | |
| 262 | return 1; | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | |
| 266 | 266 | static int os_difftime (lua_State *L) { |
| 267 | lua_pushnumber(L, difftime((luaL_checknumber(L, 1)), | |
| 268 | (luaL_optnumber(L, 2, 0)))); | |
| 269 | return 1; | |
| 267 | lua_pushnumber(L, difftime((luaL_checknumber(L, 1)), | |
| 268 | (luaL_optnumber(L, 2, 0)))); | |
| 269 | return 1; | |
| 270 | 270 | } |
| 271 | 271 | |
| 272 | 272 | /* }====================================================== */ |
| 273 | 273 | |
| 274 | 274 | |
| 275 | 275 | static int os_setlocale (lua_State *L) { |
| 276 | static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, | |
| 277 | LC_NUMERIC, LC_TIME}; | |
| 278 | static const char *const catnames[] = {"all", "collate", "ctype", "monetary", | |
| 279 | "numeric", "time", NULL}; | |
| 280 | const char *l = luaL_optstring(L, 1, NULL); | |
| 281 | int op = luaL_checkoption(L, 2, "all", catnames); | |
| 282 | lua_pushstring(L, setlocale(cat[op], l)); | |
| 283 | return 1; | |
| 276 | static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, | |
| 277 | LC_NUMERIC, LC_TIME}; | |
| 278 | static const char *const catnames[] = {"all", "collate", "ctype", "monetary", | |
| 279 | "numeric", "time", NULL}; | |
| 280 | const char *l = luaL_optstring(L, 1, NULL); | |
| 281 | int op = luaL_checkoption(L, 2, "all", catnames); | |
| 282 | lua_pushstring(L, setlocale(cat[op], l)); | |
| 283 | return 1; | |
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | |
| 287 | 287 | static int os_exit (lua_State *L) { |
| 288 | int status; | |
| 289 | if (lua_isboolean(L, 1)) | |
| 290 | status = (lua_toboolean(L, 1) ? EXIT_SUCCESS : EXIT_FAILURE); | |
| 291 | else | |
| 292 | status = luaL_optint(L, 1, EXIT_SUCCESS); | |
| 293 | if (lua_toboolean(L, 2)) | |
| 294 | lua_close(L); | |
| 295 | if (L) exit(status); /* 'if' to avoid warnings for unreachable 'return' */ | |
| 296 | return 0; | |
| 288 | int status; | |
| 289 | if (lua_isboolean(L, 1)) | |
| 290 | status = (lua_toboolean(L, 1) ? EXIT_SUCCESS : EXIT_FAILURE); | |
| 291 | else | |
| 292 | status = luaL_optint(L, 1, EXIT_SUCCESS); | |
| 293 | if (lua_toboolean(L, 2)) | |
| 294 | lua_close(L); | |
| 295 | if (L) exit(status); /* 'if' to avoid warnings for unreachable 'return' */ | |
| 296 | return 0; | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | |
| 300 | 300 | static const luaL_Reg syslib[] = { |
| 301 | {"clock", os_clock}, | |
| 302 | {"date", os_date}, | |
| 303 | {"difftime", os_difftime}, | |
| 304 | {"execute", os_execute}, | |
| 305 | {"exit", os_exit}, | |
| 306 | {"getenv", os_getenv}, | |
| 307 | {"remove", os_remove}, | |
| 308 | {"rename", os_rename}, | |
| 309 | {"setlocale", os_setlocale}, | |
| 310 | {"time", os_time}, | |
| 311 | {"tmpname", os_tmpname}, | |
| 312 | {NULL, NULL} | |
| 301 | {"clock", os_clock}, | |
| 302 | {"date", os_date}, | |
| 303 | {"difftime", os_difftime}, | |
| 304 | {"execute", os_execute}, | |
| 305 | {"exit", os_exit}, | |
| 306 | {"getenv", os_getenv}, | |
| 307 | {"remove", os_remove}, | |
| 308 | {"rename", os_rename}, | |
| 309 | {"setlocale", os_setlocale}, | |
| 310 | {"time", os_time}, | |
| 311 | {"tmpname", os_tmpname}, | |
| 312 | {NULL, NULL} | |
| 313 | 313 | }; |
| 314 | 314 | |
| 315 | 315 | /* }====================================================== */ |
| r31373 | r31374 | |
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | LUAMOD_API int luaopen_os (lua_State *L) { |
| 320 | luaL_newlib(L, syslib); | |
| 321 | return 1; | |
| 320 | luaL_newlib(L, syslib); | |
| 321 | return 1; | |
| 322 | 322 | } |
| 323 |
| r31373 | r31374 | |
|---|---|---|
| 21 | 21 | #include "lzio.h" |
| 22 | 22 | |
| 23 | 23 | typedef struct { |
| 24 | lua_State* L; | |
| 25 | ZIO* Z; | |
| 26 | Mbuffer* b; | |
| 27 | const char* name; | |
| 24 | lua_State* L; | |
| 25 | ZIO* Z; | |
| 26 | Mbuffer* b; | |
| 27 | const char* name; | |
| 28 | 28 | } LoadState; |
| 29 | 29 | |
| 30 | 30 | static l_noret error(LoadState* S, const char* why) |
| 31 | 31 | { |
| 32 | luaO_pushfstring(S->L,"%s: %s precompiled chunk",S->name,why); | |
| 33 | luaD_throw(S->L,LUA_ERRSYNTAX); | |
| 32 | luaO_pushfstring(S->L,"%s: %s precompiled chunk",S->name,why); | |
| 33 | luaD_throw(S->L,LUA_ERRSYNTAX); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | #define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) | |
| 37 | #define LoadByte(S) (lu_byte)LoadChar(S) | |
| 38 | #define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) | |
| 39 | #define LoadVector(S,b,n,size) LoadMem(S,b,n,size) | |
| 36 | #define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) | |
| 37 | #define LoadByte(S) (lu_byte)LoadChar(S) | |
| 38 | #define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) | |
| 39 | #define LoadVector(S,b,n,size) LoadMem(S,b,n,size) | |
| 40 | 40 | |
| 41 | 41 | #if !defined(luai_verifycode) |
| 42 | #define luai_verifycode(L,b,f) | |
| 42 | #define luai_verifycode(L,b,f) /* empty */ | |
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | 45 | static void LoadBlock(LoadState* S, void* b, size_t size) |
| 46 | 46 | { |
| 47 | ||
| 47 | if (luaZ_read(S->Z,b,size)!=0) error(S,"truncated"); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | static int LoadChar(LoadState* S) |
| 51 | 51 | { |
| 52 | char x; | |
| 53 | LoadVar(S,x); | |
| 54 | return x; | |
| 52 | char x; | |
| 53 | LoadVar(S,x); | |
| 54 | return x; | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | static int LoadInt(LoadState* S) |
| 58 | 58 | { |
| 59 | int x; | |
| 60 | LoadVar(S,x); | |
| 61 | if (x<0) error(S,"corrupted"); | |
| 62 | return x; | |
| 59 | int x; | |
| 60 | LoadVar(S,x); | |
| 61 | if (x<0) error(S,"corrupted"); | |
| 62 | return x; | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | static lua_Number LoadNumber(LoadState* S) |
| 66 | 66 | { |
| 67 | lua_Number x; | |
| 68 | LoadVar(S,x); | |
| 69 | return x; | |
| 67 | lua_Number x; | |
| 68 | LoadVar(S,x); | |
| 69 | return x; | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | static TString* LoadString(LoadState* S) |
| 73 | 73 | { |
| 74 | size_t size; | |
| 75 | LoadVar(S,size); | |
| 76 | if (size==0) | |
| 77 | return NULL; | |
| 78 | else | |
| 79 | { | |
| 80 | char* s=luaZ_openspace(S->L,S->b,size); | |
| 81 | LoadBlock(S,s,size*sizeof(char)); | |
| 82 | return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ | |
| 83 | } | |
| 74 | size_t size; | |
| 75 | LoadVar(S,size); | |
| 76 | if (size==0) | |
| 77 | return NULL; | |
| 78 | else | |
| 79 | { | |
| 80 | char* s=luaZ_openspace(S->L,S->b,size); | |
| 81 | LoadBlock(S,s,size*sizeof(char)); | |
| 82 | return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ | |
| 83 | } | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | static void LoadCode(LoadState* S, Proto* f) |
| 87 | 87 | { |
| 88 | int n=LoadInt(S); | |
| 89 | f->code=luaM_newvector(S->L,n,Instruction); | |
| 90 | f->sizecode=n; | |
| 91 | LoadVector(S,f->code,n,sizeof(Instruction)); | |
| 88 | int n=LoadInt(S); | |
| 89 | f->code=luaM_newvector(S->L,n,Instruction); | |
| 90 | f->sizecode=n; | |
| 91 | LoadVector(S,f->code,n,sizeof(Instruction)); | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | static void LoadFunction(LoadState* S, Proto* f); |
| 95 | 95 | |
| 96 | 96 | static void LoadConstants(LoadState* S, Proto* f) |
| 97 | 97 | { |
| 98 | int i,n; | |
| 99 | n=LoadInt(S); | |
| 100 | f->k=luaM_newvector(S->L,n,TValue); | |
| 101 | f->sizek=n; | |
| 102 | for (i=0; i<n; i++) setnilvalue(&f->k[i]); | |
| 103 | for (i=0; i<n; i++) | |
| 104 | { | |
| 105 | TValue* o=&f->k[i]; | |
| 106 | int t=LoadChar(S); | |
| 107 | switch (t) | |
| 108 | { | |
| 109 | case LUA_TNIL: | |
| 98 | int i,n; | |
| 99 | n=LoadInt(S); | |
| 100 | f->k=luaM_newvector(S->L,n,TValue); | |
| 101 | f->sizek=n; | |
| 102 | for (i=0; i<n; i++) setnilvalue(&f->k[i]); | |
| 103 | for (i=0; i<n; i++) | |
| 104 | { | |
| 105 | TValue* o=&f->k[i]; | |
| 106 | int t=LoadChar(S); | |
| 107 | switch (t) | |
| 108 | { | |
| 109 | case LUA_TNIL: | |
| 110 | 110 | setnilvalue(o); |
| 111 | 111 | break; |
| 112 | ||
| 112 | case LUA_TBOOLEAN: | |
| 113 | 113 | setbvalue(o,LoadChar(S)); |
| 114 | 114 | break; |
| 115 | ||
| 115 | case LUA_TNUMBER: | |
| 116 | 116 | setnvalue(o,LoadNumber(S)); |
| 117 | 117 | break; |
| 118 | ||
| 118 | case LUA_TSTRING: | |
| 119 | 119 | setsvalue2n(S->L,o,LoadString(S)); |
| 120 | 120 | break; |
| 121 | default: lua_assert(0); | |
| 122 | } | |
| 123 | } | |
| 124 | n=LoadInt(S); | |
| 125 | f->p=luaM_newvector(S->L,n,Proto*); | |
| 126 | f->sizep=n; | |
| 127 | for (i=0; i<n; i++) f->p[i]=NULL; | |
| 128 | for (i=0; i<n; i++) | |
| 129 | { | |
| 130 | f->p[i]=luaF_newproto(S->L); | |
| 131 | LoadFunction(S,f->p[i]); | |
| 132 | } | |
| 121 | default: lua_assert(0); | |
| 122 | } | |
| 123 | } | |
| 124 | n=LoadInt(S); | |
| 125 | f->p=luaM_newvector(S->L,n,Proto*); | |
| 126 | f->sizep=n; | |
| 127 | for (i=0; i<n; i++) f->p[i]=NULL; | |
| 128 | for (i=0; i<n; i++) | |
| 129 | { | |
| 130 | f->p[i]=luaF_newproto(S->L); | |
| 131 | LoadFunction(S,f->p[i]); | |
| 132 | } | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | static void LoadUpvalues(LoadState* S, Proto* f) |
| 136 | 136 | { |
| 137 | int i,n; | |
| 138 | n=LoadInt(S); | |
| 139 | f->upvalues=luaM_newvector(S->L,n,Upvaldesc); | |
| 140 | f->sizeupvalues=n; | |
| 141 | for (i=0; i<n; i++) f->upvalues[i].name=NULL; | |
| 142 | for (i=0; i<n; i++) | |
| 143 | { | |
| 144 | f->upvalues[i].instack=LoadByte(S); | |
| 145 | f->upvalues[i].idx=LoadByte(S); | |
| 146 | } | |
| 137 | int i,n; | |
| 138 | n=LoadInt(S); | |
| 139 | f->upvalues=luaM_newvector(S->L,n,Upvaldesc); | |
| 140 | f->sizeupvalues=n; | |
| 141 | for (i=0; i<n; i++) f->upvalues[i].name=NULL; | |
| 142 | for (i=0; i<n; i++) | |
| 143 | { | |
| 144 | f->upvalues[i].instack=LoadByte(S); | |
| 145 | f->upvalues[i].idx=LoadByte(S); | |
| 146 | } | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | static void LoadDebug(LoadState* S, Proto* f) |
| 150 | 150 | { |
| 151 | int i,n; | |
| 152 | f->source=LoadString(S); | |
| 153 | n=LoadInt(S); | |
| 154 | f->lineinfo=luaM_newvector(S->L,n,int); | |
| 155 | f->sizelineinfo=n; | |
| 156 | LoadVector(S,f->lineinfo,n,sizeof(int)); | |
| 157 | n=LoadInt(S); | |
| 158 | f->locvars=luaM_newvector(S->L,n,LocVar); | |
| 159 | f->sizelocvars=n; | |
| 160 | for (i=0; i<n; i++) f->locvars[i].varname=NULL; | |
| 161 | for (i=0; i<n; i++) | |
| 162 | { | |
| 163 | f->locvars[i].varname=LoadString(S); | |
| 164 | f->locvars[i].startpc=LoadInt(S); | |
| 165 | f->locvars[i].endpc=LoadInt(S); | |
| 166 | } | |
| 167 | n=LoadInt(S); | |
| 168 | for (i=0; i<n; i++) f->upvalues[i].name=LoadString(S); | |
| 151 | int i,n; | |
| 152 | f->source=LoadString(S); | |
| 153 | n=LoadInt(S); | |
| 154 | f->lineinfo=luaM_newvector(S->L,n,int); | |
| 155 | f->sizelineinfo=n; | |
| 156 | LoadVector(S,f->lineinfo,n,sizeof(int)); | |
| 157 | n=LoadInt(S); | |
| 158 | f->locvars=luaM_newvector(S->L,n,LocVar); | |
| 159 | f->sizelocvars=n; | |
| 160 | for (i=0; i<n; i++) f->locvars[i].varname=NULL; | |
| 161 | for (i=0; i<n; i++) | |
| 162 | { | |
| 163 | f->locvars[i].varname=LoadString(S); | |
| 164 | f->locvars[i].startpc=LoadInt(S); | |
| 165 | f->locvars[i].endpc=LoadInt(S); | |
| 166 | } | |
| 167 | n=LoadInt(S); | |
| 168 | for (i=0; i<n; i++) f->upvalues[i].name=LoadString(S); | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | static void LoadFunction(LoadState* S, Proto* f) |
| 172 | 172 | { |
| 173 | f->linedefined=LoadInt(S); | |
| 174 | f->lastlinedefined=LoadInt(S); | |
| 175 | f->numparams=LoadByte(S); | |
| 176 | f->is_vararg=LoadByte(S); | |
| 177 | f->maxstacksize=LoadByte(S); | |
| 178 | LoadCode(S,f); | |
| 179 | LoadConstants(S,f); | |
| 180 | LoadUpvalues(S,f); | |
| 181 | LoadDebug(S,f); | |
| 173 | f->linedefined=LoadInt(S); | |
| 174 | f->lastlinedefined=LoadInt(S); | |
| 175 | f->numparams=LoadByte(S); | |
| 176 | f->is_vararg=LoadByte(S); | |
| 177 | f->maxstacksize=LoadByte(S); | |
| 178 | LoadCode(S,f); | |
| 179 | LoadConstants(S,f); | |
| 180 | LoadUpvalues(S,f); | |
| 181 | LoadDebug(S,f); | |
| 182 | 182 | } |
| 183 | 183 | |
| 184 | 184 | /* the code below must be consistent with the code in luaU_header */ |
| 185 | #define N0 LUAC_HEADERSIZE | |
| 186 | #define N1 (sizeof(LUA_SIGNATURE)-sizeof(char)) | |
| 187 | #define N2 N1+2 | |
| 188 | #define N3 N2+6 | |
| 185 | #define N0 LUAC_HEADERSIZE | |
| 186 | #define N1 (sizeof(LUA_SIGNATURE)-sizeof(char)) | |
| 187 | #define N2 N1+2 | |
| 188 | #define N3 N2+6 | |
| 189 | 189 | |
| 190 | 190 | static void LoadHeader(LoadState* S) |
| 191 | 191 | { |
| 192 | lu_byte h[LUAC_HEADERSIZE]; | |
| 193 | lu_byte s[LUAC_HEADERSIZE]; | |
| 194 | luaU_header(h); | |
| 195 | memcpy(s,h,sizeof(char)); /* first char already read */ | |
| 196 | LoadBlock(S,s+sizeof(char),LUAC_HEADERSIZE-sizeof(char)); | |
| 197 | if (memcmp(h,s,N0)==0) return; | |
| 198 | if (memcmp(h,s,N1)!=0) error(S,"not a"); | |
| 199 | if (memcmp(h,s,N2)!=0) error(S,"version mismatch in"); | |
| 200 | if (memcmp(h,s,N3)!=0) error(S,"incompatible"); else error(S,"corrupted"); | |
| 192 | lu_byte h[LUAC_HEADERSIZE]; | |
| 193 | lu_byte s[LUAC_HEADERSIZE]; | |
| 194 | luaU_header(h); | |
| 195 | memcpy(s,h,sizeof(char)); /* first char already read */ | |
| 196 | LoadBlock(S,s+sizeof(char),LUAC_HEADERSIZE-sizeof(char)); | |
| 197 | if (memcmp(h,s,N0)==0) return; | |
| 198 | if (memcmp(h,s,N1)!=0) error(S,"not a"); | |
| 199 | if (memcmp(h,s,N2)!=0) error(S,"version mismatch in"); | |
| 200 | if (memcmp(h,s,N3)!=0) error(S,"incompatible"); else error(S,"corrupted"); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | /* |
| r31373 | r31374 | |
| 205 | 205 | */ |
| 206 | 206 | Closure* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) |
| 207 | 207 | { |
| 208 | LoadState S; | |
| 209 | Closure* cl; | |
| 210 | if (*name=='@' || *name=='=') | |
| 211 | S.name=name+1; | |
| 212 | else if (*name==LUA_SIGNATURE[0]) | |
| 213 | S.name="binary string"; | |
| 214 | else | |
| 215 | S.name=name; | |
| 216 | S.L=L; | |
| 217 | S.Z=Z; | |
| 218 | S.b=buff; | |
| 219 | LoadHeader(&S); | |
| 220 | cl=luaF_newLclosure(L,1); | |
| 221 | setclLvalue(L,L->top,cl); incr_top(L); | |
| 222 | cl->l.p=luaF_newproto(L); | |
| 223 | LoadFunction(&S,cl->l.p); | |
| 224 | if (cl->l.p->sizeupvalues != 1) | |
| 225 | { | |
| 226 | Proto* p=cl->l.p; | |
| 227 | cl=luaF_newLclosure(L,cl->l.p->sizeupvalues); | |
| 228 | cl->l.p=p; | |
| 229 | setclLvalue(L,L->top-1,cl); | |
| 230 | } | |
| 231 | luai_verifycode(L,buff,cl->l.p); | |
| 232 | return cl; | |
| 208 | LoadState S; | |
| 209 | Closure* cl; | |
| 210 | if (*name=='@' || *name=='=') | |
| 211 | S.name=name+1; | |
| 212 | else if (*name==LUA_SIGNATURE[0]) | |
| 213 | S.name="binary string"; | |
| 214 | else | |
| 215 | S.name=name; | |
| 216 | S.L=L; | |
| 217 | S.Z=Z; | |
| 218 | S.b=buff; | |
| 219 | LoadHeader(&S); | |
| 220 | cl=luaF_newLclosure(L,1); | |
| 221 | setclLvalue(L,L->top,cl); incr_top(L); | |
| 222 | cl->l.p=luaF_newproto(L); | |
| 223 | LoadFunction(&S,cl->l.p); | |
| 224 | if (cl->l.p->sizeupvalues != 1) | |
| 225 | { | |
| 226 | Proto* p=cl->l.p; | |
| 227 | cl=luaF_newLclosure(L,cl->l.p->sizeupvalues); | |
| 228 | cl->l.p=p; | |
| 229 | setclLvalue(L,L->top-1,cl); | |
| 230 | } | |
| 231 | luai_verifycode(L,buff,cl->l.p); | |
| 232 | return cl; | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | #define MYINT(s) (s[0]-'0') | |
| 236 | #define VERSION MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) | |
| 237 | #define FORMAT 0 /* this is the official format */ | |
| 235 | #define MYINT(s) (s[0]-'0') | |
| 236 | #define VERSION MYINT(LUA_VERSION_MAJOR)*16+MYINT(LUA_VERSION_MINOR) | |
| 237 | #define FORMAT 0 /* this is the official format */ | |
| 238 | 238 | |
| 239 | 239 | /* |
| 240 | 240 | * make header for precompiled chunks |
| r31373 | r31374 | |
| 243 | 243 | */ |
| 244 | 244 | void luaU_header (lu_byte* h) |
| 245 | 245 | { |
| 246 | int x=1; | |
| 247 | memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-sizeof(char)); | |
| 248 | h+=sizeof(LUA_SIGNATURE)-sizeof(char); | |
| 249 | *h++=cast_byte(VERSION); | |
| 250 | *h++=cast_byte(FORMAT); | |
| 251 | *h++=cast_byte(*(char*)&x); /* endianness */ | |
| 252 | *h++=cast_byte(sizeof(int)); | |
| 253 | *h++=cast_byte(sizeof(size_t)); | |
| 254 | *h++=cast_byte(sizeof(Instruction)); | |
| 255 | *h++=cast_byte(sizeof(lua_Number)); | |
| 256 | *h++=cast_byte(((lua_Number)0.5)==0); /* is lua_Number integral? */ | |
| 257 | memcpy(h,LUAC_TAIL,sizeof(LUAC_TAIL)-sizeof(char)); | |
| 246 | int x=1; | |
| 247 | memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-sizeof(char)); | |
| 248 | h+=sizeof(LUA_SIGNATURE)-sizeof(char); | |
| 249 | *h++=cast_byte(VERSION); | |
| 250 | *h++=cast_byte(FORMAT); | |
| 251 | *h++=cast_byte(*(char*)&x); /* endianness */ | |
| 252 | *h++=cast_byte(sizeof(int)); | |
| 253 | *h++=cast_byte(sizeof(size_t)); | |
| 254 | *h++=cast_byte(sizeof(Instruction)); | |
| 255 | *h++=cast_byte(sizeof(lua_Number)); | |
| 256 | *h++=cast_byte(((lua_Number)0.5)==0); /* is lua_Number integral? */ | |
| 257 | memcpy(h,LUAC_TAIL,sizeof(LUAC_TAIL)-sizeof(char)); | |
| 258 | 258 | } |
| r31373 | r31374 | |
|---|---|---|
| 51 | 51 | |
| 52 | 52 | /* compile time features */ |
| 53 | 53 | #if !defined(SQLITE_OMIT_PROGRESS_CALLBACK) |
| 54 | ||
| 54 | #define SQLITE_OMIT_PROGRESS_CALLBACK 0 | |
| 55 | 55 | #endif |
| 56 | 56 | #if !defined(LSQLITE_OMIT_UPDATE_HOOK) |
| 57 | ||
| 57 | #define LSQLITE_OMIT_UPDATE_HOOK 0 | |
| 58 | 58 | #endif |
| 59 | 59 | |
| 60 | 60 | typedef struct sdb sdb; |
| r31373 | r31374 | |
| 63 | 63 | |
| 64 | 64 | /* to use as C user data so i know what function sqlite is calling */ |
| 65 | 65 | struct sdb_func { |
| 66 | /* references to associated lua values */ | |
| 67 | int fn_step; | |
| 68 | int fn_finalize; | |
| 69 | int udata; | |
| 66 | /* references to associated lua values */ | |
| 67 | int fn_step; | |
| 68 | int fn_finalize; | |
| 69 | int udata; | |
| 70 | 70 | |
| 71 | sdb *db; | |
| 72 | char aggregate; | |
| 71 | sdb *db; | |
| 72 | char aggregate; | |
| 73 | 73 | |
| 74 | ||
| 74 | sdb_func *next; | |
| 75 | 75 | }; |
| 76 | 76 | |
| 77 | 77 | /* information about database */ |
| 78 | 78 | struct sdb { |
| 79 | /* associated lua state */ | |
| 80 | lua_State *L; | |
| 81 | /* sqlite database handle */ | |
| 82 | sqlite3 *db; | |
| 79 | /* associated lua state */ | |
| 80 | lua_State *L; | |
| 81 | /* sqlite database handle */ | |
| 82 | sqlite3 *db; | |
| 83 | 83 | |
| 84 | /* sql functions stack usage */ | |
| 85 | sdb_func *func; /* top SQL function being called */ | |
| 84 | /* sql functions stack usage */ | |
| 85 | sdb_func *func; /* top SQL function being called */ | |
| 86 | 86 | |
| 87 | /* references */ | |
| 88 | int busy_cb; /* busy callback */ | |
| 89 | int busy_udata; | |
| 87 | /* references */ | |
| 88 | int busy_cb; /* busy callback */ | |
| 89 | int busy_udata; | |
| 90 | 90 | |
| 91 | int progress_cb; /* progress handler */ | |
| 92 | int progress_udata; | |
| 91 | int progress_cb; /* progress handler */ | |
| 92 | int progress_udata; | |
| 93 | 93 | |
| 94 | int trace_cb; /* trace callback */ | |
| 95 | int trace_udata; | |
| 94 | int trace_cb; /* trace callback */ | |
| 95 | int trace_udata; | |
| 96 | 96 | |
| 97 | 97 | #if !defined(LSQLITE_OMIT_UPDATE_HOOK) || !LSQLITE_OMIT_UPDATE_HOOK |
| 98 | 98 | |
| 99 | int update_hook_cb; /* update_hook callback */ | |
| 100 | int update_hook_udata; | |
| 99 | int update_hook_cb; /* update_hook callback */ | |
| 100 | int update_hook_udata; | |
| 101 | 101 | |
| 102 | int commit_hook_cb; /* commit_hook callback */ | |
| 103 | int commit_hook_udata; | |
| 102 | int commit_hook_cb; /* commit_hook callback */ | |
| 103 | int commit_hook_udata; | |
| 104 | 104 | |
| 105 | int rollback_hook_cb; /* rollback_hook callback */ | |
| 106 | int rollback_hook_udata; | |
| 105 | int rollback_hook_cb; /* rollback_hook callback */ | |
| 106 | int rollback_hook_udata; | |
| 107 | 107 | |
| 108 | 108 | #endif |
| 109 | 109 | }; |
| r31373 | r31374 | |
| 120 | 120 | */ |
| 121 | 121 | |
| 122 | 122 | static void vm_push_column(lua_State *L, sqlite3_stmt *vm, int idx) { |
| 123 | switch (sqlite3_column_type(vm, idx)) { | |
| 124 | case SQLITE_INTEGER: | |
| 125 | { | |
| 126 | sqlite_int64 i64 = sqlite3_column_int64(vm, idx); | |
| 127 | lua_Number n = (lua_Number)i64; | |
| 128 | if (n == i64) | |
| 129 | lua_pushnumber(L, n); | |
| 130 | else | |
| 131 | lua_pushlstring(L, (const char*)sqlite3_column_text(vm, idx), sqlite3_column_bytes(vm, idx)); | |
| 132 | } | |
| 133 | break; | |
| 134 | case SQLITE_FLOAT: | |
| 135 | lua_pushnumber(L, sqlite3_column_double(vm, idx)); | |
| 136 | break; | |
| 137 | case SQLITE_TEXT: | |
| 138 | lua_pushlstring(L, (const char*)sqlite3_column_text(vm, idx), sqlite3_column_bytes(vm, idx)); | |
| 139 | break; | |
| 140 | case SQLITE_BLOB: | |
| 141 | lua_pushlstring(L, (const char*)sqlite3_column_blob(vm, idx), sqlite3_column_bytes(vm, idx)); | |
| 142 | break; | |
| 143 | case SQLITE_NULL: | |
| 144 | lua_pushnil(L); | |
| 145 | break; | |
| 146 | default: | |
| 147 | lua_pushnil(L); | |
| 148 | break; | |
| 149 | } | |
| 123 | switch (sqlite3_column_type(vm, idx)) { | |
| 124 | case SQLITE_INTEGER: | |
| 125 | { | |
| 126 | sqlite_int64 i64 = sqlite3_column_int64(vm, idx); | |
| 127 | lua_Number n = (lua_Number)i64; | |
| 128 | if (n == i64) | |
| 129 | lua_pushnumber(L, n); | |
| 130 | else | |
| 131 | lua_pushlstring(L, (const char*)sqlite3_column_text(vm, idx), sqlite3_column_bytes(vm, idx)); | |
| 132 | } | |
| 133 | break; | |
| 134 | case SQLITE_FLOAT: | |
| 135 | lua_pushnumber(L, sqlite3_column_double(vm, idx)); | |
| 136 | break; | |
| 137 | case SQLITE_TEXT: | |
| 138 | lua_pushlstring(L, (const char*)sqlite3_column_text(vm, idx), sqlite3_column_bytes(vm, idx)); | |
| 139 | break; | |
| 140 | case SQLITE_BLOB: | |
| 141 | lua_pushlstring(L, (const char*)sqlite3_column_blob(vm, idx), sqlite3_column_bytes(vm, idx)); | |
| 142 | break; | |
| 143 | case SQLITE_NULL: | |
| 144 | lua_pushnil(L); | |
| 145 | break; | |
| 146 | default: | |
| 147 | lua_pushnil(L); | |
| 148 | break; | |
| 149 | } | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | /* virtual machine information */ |
| 153 | 153 | struct sdb_vm { |
| 154 | sdb *db; /* associated database handle */ | |
| 155 | sqlite3_stmt *vm; /* virtual machine */ | |
| 154 | sdb *db; /* associated database handle */ | |
| 155 | sqlite3_stmt *vm; /* virtual machine */ | |
| 156 | 156 | |
| 157 | /* sqlite3_step info */ | |
| 158 | int columns; /* number of columns in result */ | |
| 159 | char has_values; /* true when step succeeds */ | |
| 157 | /* sqlite3_step info */ | |
| 158 | int columns; /* number of columns in result */ | |
| 159 | char has_values; /* true when step succeeds */ | |
| 160 | 160 | |
| 161 | ||
| 161 | char temp; /* temporary vm used in db:rows */ | |
| 162 | 162 | }; |
| 163 | 163 | |
| 164 | 164 | /* called with sql text on the lua stack */ |
| 165 | 165 | static sdb_vm *newvm(lua_State *L, sdb *db) { |
| 166 | ||
| 166 | sdb_vm *svm = (sdb_vm*)lua_newuserdata(L, sizeof(sdb_vm)); | |
| 167 | 167 | |
| 168 | luaL_getmetatable(L, sqlite_vm_meta); | |
| 169 | lua_setmetatable(L, -2); /* set metatable */ | |
| 168 | luaL_getmetatable(L, sqlite_vm_meta); | |
| 169 | lua_setmetatable(L, -2); /* set metatable */ | |
| 170 | 170 | |
| 171 | svm->db = db; | |
| 172 | svm->columns = 0; | |
| 173 | svm->has_values = 0; | |
| 174 | svm->vm = NULL; | |
| 175 | svm->temp = 0; | |
| 171 | svm->db = db; | |
| 172 | svm->columns = 0; | |
| 173 | svm->has_values = 0; | |
| 174 | svm->vm = NULL; | |
| 175 | svm->temp = 0; | |
| 176 | 176 | |
| 177 | /* add an entry on the database table: svm -> sql text */ | |
| 178 | lua_pushlightuserdata(L, db); | |
| 179 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 180 | lua_pushlightuserdata(L, svm); | |
| 181 | lua_pushvalue(L, -4); /* the sql text */ | |
| 182 | lua_rawset(L, -3); | |
| 183 | lua_pop(L, 1); | |
| 177 | /* add an entry on the database table: svm -> sql text */ | |
| 178 | lua_pushlightuserdata(L, db); | |
| 179 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 180 | lua_pushlightuserdata(L, svm); | |
| 181 | lua_pushvalue(L, -4); /* the sql text */ | |
| 182 | lua_rawset(L, -3); | |
| 183 | lua_pop(L, 1); | |
| 184 | 184 | |
| 185 | ||
| 185 | return svm; | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | static int cleanupvm(lua_State *L, sdb_vm *svm) { |
| 189 | /* remove entry in database table - no harm if not present in the table */ | |
| 190 | lua_pushlightuserdata(L, svm->db); | |
| 191 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 192 | lua_pushlightuserdata(L, svm); | |
| 193 | lua_pushnil(L); | |
| 194 | lua_rawset(L, -3); | |
| 195 | lua_pop(L, 1); | |
| 189 | /* remove entry in database table - no harm if not present in the table */ | |
| 190 | lua_pushlightuserdata(L, svm->db); | |
| 191 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 192 | lua_pushlightuserdata(L, svm); | |
| 193 | lua_pushnil(L); | |
| 194 | lua_rawset(L, -3); | |
| 195 | lua_pop(L, 1); | |
| 196 | 196 | |
| 197 | svm->columns = 0; | |
| 198 | svm->has_values = 0; | |
| 197 | svm->columns = 0; | |
| 198 | svm->has_values = 0; | |
| 199 | 199 | |
| 200 | ||
| 200 | if (!svm->vm) return 0; | |
| 201 | 201 | |
| 202 | lua_pushnumber(L, sqlite3_finalize(svm->vm)); | |
| 203 | svm->vm = NULL; | |
| 204 | return 1; | |
| 202 | lua_pushnumber(L, sqlite3_finalize(svm->vm)); | |
| 203 | svm->vm = NULL; | |
| 204 | return 1; | |
| 205 | 205 | } |
| 206 | 206 | |
| 207 | 207 | static int stepvm(lua_State *L, sdb_vm *svm) { |
| 208 | 208 | // MAME: fixed Visual Studio compiler warning lsqlite3.c(235) : warning C4701: potentially uninitialized local variable 'result' used |
| 209 | int result = 0; | |
| 210 | int loop_limit = 3; | |
| 211 | while ( loop_limit-- ) { | |
| 212 | result = sqlite3_step(svm->vm); | |
| 213 | if ( result==SQLITE_ERROR ) { | |
| 214 | result = sqlite3_reset (svm->vm); | |
| 215 | } | |
| 216 | if ( result==SQLITE_SCHEMA ) { | |
| 217 | sqlite3_stmt *vn; | |
| 218 | const char *sql; | |
| 219 | /* recover sql text */ | |
| 220 | lua_pushlightuserdata(L, svm->db); | |
| 221 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 222 | lua_pushlightuserdata(L, svm); | |
| 223 | lua_rawget(L, -2); /* sql text */ | |
| 224 | sql = luaL_checkstring(L, -1); | |
| 225 | /* re-prepare */ | |
| 226 | result = sqlite3_prepare(svm->db->db, sql, -1, &vn, NULL); | |
| 227 | if (result != SQLITE_OK) break; | |
| 228 | sqlite3_transfer_bindings(svm->vm, vn); | |
| 229 | sqlite3_finalize(svm->vm); | |
| 230 | svm->vm = vn; | |
| 231 | lua_pop(L,2); | |
| 232 | } else { | |
| 233 | break; | |
| 234 | } | |
| 235 | } | |
| 236 | return result; | |
| 209 | int result = 0; | |
| 210 | int loop_limit = 3; | |
| 211 | while ( loop_limit-- ) { | |
| 212 | result = sqlite3_step(svm->vm); | |
| 213 | if ( result==SQLITE_ERROR ) { | |
| 214 | result = sqlite3_reset (svm->vm); | |
| 215 | } | |
| 216 | if ( result==SQLITE_SCHEMA ) { | |
| 217 | sqlite3_stmt *vn; | |
| 218 | const char *sql; | |
| 219 | /* recover sql text */ | |
| 220 | lua_pushlightuserdata(L, svm->db); | |
| 221 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 222 | lua_pushlightuserdata(L, svm); | |
| 223 | lua_rawget(L, -2); /* sql text */ | |
| 224 | sql = luaL_checkstring(L, -1); | |
| 225 | /* re-prepare */ | |
| 226 | result = sqlite3_prepare(svm->db->db, sql, -1, &vn, NULL); | |
| 227 | if (result != SQLITE_OK) break; | |
| 228 | sqlite3_transfer_bindings(svm->vm, vn); | |
| 229 | sqlite3_finalize(svm->vm); | |
| 230 | svm->vm = vn; | |
| 231 | lua_pop(L,2); | |
| 232 | } else { | |
| 233 | break; | |
| 234 | } | |
| 235 | } | |
| 236 | return result; | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | static sdb_vm *lsqlite_getvm(lua_State *L, int index) { |
| 240 | sdb_vm *svm = (sdb_vm*)luaL_checkudata(L, index, sqlite_vm_meta); | |
| 241 | if (svm == NULL) luaL_argerror(L, index, "bad sqlite virtual machine"); | |
| 242 | return svm; | |
| 240 | sdb_vm *svm = (sdb_vm*)luaL_checkudata(L, index, sqlite_vm_meta); | |
| 241 | if (svm == NULL) luaL_argerror(L, index, "bad sqlite virtual machine"); | |
| 242 | return svm; | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | static sdb_vm *lsqlite_checkvm(lua_State *L, int index) { |
| 246 | sdb_vm *svm = lsqlite_getvm(L, index); | |
| 247 | if (svm->vm == NULL) luaL_argerror(L, index, "attempt to use closed sqlite virtual machine"); | |
| 248 | return svm; | |
| 246 | sdb_vm *svm = lsqlite_getvm(L, index); | |
| 247 | if (svm->vm == NULL) luaL_argerror(L, index, "attempt to use closed sqlite virtual machine"); | |
| 248 | return svm; | |
| 249 | 249 | } |
| 250 | 250 | |
| 251 | 251 | static int dbvm_isopen(lua_State *L) { |
| 252 | sdb_vm *svm = lsqlite_getvm(L, 1); | |
| 253 | lua_pushboolean(L, svm->vm != NULL ? 1 : 0); | |
| 254 | return 1; | |
| 252 | sdb_vm *svm = lsqlite_getvm(L, 1); | |
| 253 | lua_pushboolean(L, svm->vm != NULL ? 1 : 0); | |
| 254 | return 1; | |
| 255 | 255 | } |
| 256 | 256 | |
| 257 | 257 | static int dbvm_tostring(lua_State *L) { |
| 258 | char buff[39]; | |
| 259 | sdb_vm *svm = lsqlite_getvm(L, 1); | |
| 260 | if (svm->vm == NULL) | |
| 261 | strcpy(buff, "closed"); | |
| 262 | else | |
| 263 | sprintf(buff, "%p", svm); | |
| 264 | lua_pushfstring(L, "sqlite virtual machine (%s)", buff); | |
| 265 | return 1; | |
| 258 | char buff[39]; | |
| 259 | sdb_vm *svm = lsqlite_getvm(L, 1); | |
| 260 | if (svm->vm == NULL) | |
| 261 | strcpy(buff, "closed"); | |
| 262 | else | |
| 263 | sprintf(buff, "%p", svm); | |
| 264 | lua_pushfstring(L, "sqlite virtual machine (%s)", buff); | |
| 265 | return 1; | |
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | static int dbvm_gc(lua_State *L) { |
| 269 | sdb_vm *svm = lsqlite_getvm(L, 1); | |
| 270 | if (svm->vm != NULL) /* ignore closed vms */ | |
| 271 | cleanupvm(L, svm); | |
| 272 | return 0; | |
| 269 | sdb_vm *svm = lsqlite_getvm(L, 1); | |
| 270 | if (svm->vm != NULL) /* ignore closed vms */ | |
| 271 | cleanupvm(L, svm); | |
| 272 | return 0; | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | static int dbvm_step(lua_State *L) { |
| 276 | int result; | |
| 277 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 276 | int result; | |
| 277 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 278 | 278 | |
| 279 | result = stepvm(L, svm); | |
| 280 | svm->has_values = result == SQLITE_ROW ? 1 : 0; | |
| 281 | svm->columns = sqlite3_data_count(svm->vm); | |
| 279 | result = stepvm(L, svm); | |
| 280 | svm->has_values = result == SQLITE_ROW ? 1 : 0; | |
| 281 | svm->columns = sqlite3_data_count(svm->vm); | |
| 282 | 282 | |
| 283 | lua_pushnumber(L, result); | |
| 284 | return 1; | |
| 283 | lua_pushnumber(L, result); | |
| 284 | return 1; | |
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | static int dbvm_finalize(lua_State *L) { |
| 288 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 289 | return cleanupvm(L, svm); | |
| 288 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 289 | return cleanupvm(L, svm); | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | static int dbvm_reset(lua_State *L) { |
| 293 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 294 | sqlite3_reset(svm->vm); | |
| 295 | lua_pushnumber(L, sqlite3_errcode(svm->db->db)); | |
| 296 | return 1; | |
| 293 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 294 | sqlite3_reset(svm->vm); | |
| 295 | lua_pushnumber(L, sqlite3_errcode(svm->db->db)); | |
| 296 | return 1; | |
| 297 | 297 | } |
| 298 | 298 | |
| 299 | 299 | static void dbvm_check_contents(lua_State *L, sdb_vm *svm) { |
| 300 | if (!svm->has_values) { | |
| 301 | luaL_error(L, "misuse of function"); | |
| 302 | } | |
| 300 | if (!svm->has_values) { | |
| 301 | luaL_error(L, "misuse of function"); | |
| 302 | } | |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | 305 | static void dbvm_check_index(lua_State *L, sdb_vm *svm, int index) { |
| 306 | if (index < 0 || index >= svm->columns) { | |
| 307 | luaL_error(L, "index out of range [0..%d]", svm->columns - 1); | |
| 308 | } | |
| 306 | if (index < 0 || index >= svm->columns) { | |
| 307 | luaL_error(L, "index out of range [0..%d]", svm->columns - 1); | |
| 308 | } | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | static void dbvm_check_bind_index(lua_State *L, sdb_vm *svm, int index) { |
| 312 | if (index < 1 || index > sqlite3_bind_parameter_count(svm->vm)) { | |
| 313 | luaL_error(L, "bind index out of range [1..%d]", sqlite3_bind_parameter_count(svm->vm)); | |
| 314 | } | |
| 312 | if (index < 1 || index > sqlite3_bind_parameter_count(svm->vm)) { | |
| 313 | luaL_error(L, "bind index out of range [1..%d]", sqlite3_bind_parameter_count(svm->vm)); | |
| 314 | } | |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | 317 | /* |
| r31373 | r31374 | |
| 320 | 320 | ** ======================================================= |
| 321 | 321 | */ |
| 322 | 322 | static int dbvm_columns(lua_State *L) { |
| 323 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 324 | lua_pushnumber(L, sqlite3_column_count(svm->vm)); | |
| 325 | return 1; | |
| 323 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 324 | lua_pushnumber(L, sqlite3_column_count(svm->vm)); | |
| 325 | return 1; | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /* |
| r31373 | r31374 | |
| 332 | 332 | */ |
| 333 | 333 | |
| 334 | 334 | static int dbvm_get_value(lua_State *L) { |
| 335 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 336 | int index = luaL_checkint(L, 2); | |
| 337 | dbvm_check_contents(L, svm); | |
| 338 | dbvm_check_index(L, svm, index); | |
| 339 | vm_push_column(L, svm->vm, index); | |
| 340 | return 1; | |
| 335 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 336 | int index = luaL_checkint(L, 2); | |
| 337 | dbvm_check_contents(L, svm); | |
| 338 | dbvm_check_index(L, svm, index); | |
| 339 | vm_push_column(L, svm->vm, index); | |
| 340 | return 1; | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | static int dbvm_get_name(lua_State *L) { |
| 344 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 345 | int index = luaL_checknumber(L, 2); | |
| 346 | dbvm_check_index(L, svm, index); | |
| 347 | lua_pushstring(L, sqlite3_column_name(svm->vm, index)); | |
| 348 | return 1; | |
| 344 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 345 | int index = luaL_checknumber(L, 2); | |
| 346 | dbvm_check_index(L, svm, index); | |
| 347 | lua_pushstring(L, sqlite3_column_name(svm->vm, index)); | |
| 348 | return 1; | |
| 349 | 349 | } |
| 350 | 350 | |
| 351 | 351 | static int dbvm_get_type(lua_State *L) { |
| 352 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 353 | int index = luaL_checknumber(L, 2); | |
| 354 | dbvm_check_index(L, svm, index); | |
| 355 | lua_pushstring(L, sqlite3_column_decltype(svm->vm, index)); | |
| 356 | return 1; | |
| 352 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 353 | int index = luaL_checknumber(L, 2); | |
| 354 | dbvm_check_index(L, svm, index); | |
| 355 | lua_pushstring(L, sqlite3_column_decltype(svm->vm, index)); | |
| 356 | return 1; | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | static int dbvm_get_values(lua_State *L) { |
| 360 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 361 | sqlite3_stmt *vm = svm->vm; | |
| 362 | int columns = svm->columns; | |
| 363 | int n; | |
| 364 | dbvm_check_contents(L, svm); | |
| 360 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 361 | sqlite3_stmt *vm = svm->vm; | |
| 362 | int columns = svm->columns; | |
| 363 | int n; | |
| 364 | dbvm_check_contents(L, svm); | |
| 365 | 365 | |
| 366 | lua_newtable(L); | |
| 367 | for (n = 0; n < columns;) { | |
| 368 | vm_push_column(L, vm, n++); | |
| 369 | lua_rawseti(L, -2, n); | |
| 370 | } | |
| 371 | return 1; | |
| 366 | lua_newtable(L); | |
| 367 | for (n = 0; n < columns;) { | |
| 368 | vm_push_column(L, vm, n++); | |
| 369 | lua_rawseti(L, -2, n); | |
| 370 | } | |
| 371 | return 1; | |
| 372 | 372 | } |
| 373 | 373 | |
| 374 | 374 | static int dbvm_get_names(lua_State *L) { |
| 375 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 376 | sqlite3_stmt *vm = svm->vm; | |
| 377 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 378 | int n; | |
| 375 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 376 | sqlite3_stmt *vm = svm->vm; | |
| 377 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 378 | int n; | |
| 379 | 379 | |
| 380 | lua_newtable(L); | |
| 381 | for (n = 0; n < columns;) { | |
| 382 | lua_pushstring(L, sqlite3_column_name(vm, n++)); | |
| 383 | lua_rawseti(L, -2, n); | |
| 384 | } | |
| 385 | return 1; | |
| 380 | lua_newtable(L); | |
| 381 | for (n = 0; n < columns;) { | |
| 382 | lua_pushstring(L, sqlite3_column_name(vm, n++)); | |
| 383 | lua_rawseti(L, -2, n); | |
| 384 | } | |
| 385 | return 1; | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | static int dbvm_get_types(lua_State *L) { |
| 389 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 390 | sqlite3_stmt *vm = svm->vm; | |
| 391 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 392 | int n; | |
| 389 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 390 | sqlite3_stmt *vm = svm->vm; | |
| 391 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 392 | int n; | |
| 393 | 393 | |
| 394 | lua_newtable(L); | |
| 395 | for (n = 0; n < columns;) { | |
| 396 | lua_pushstring(L, sqlite3_column_decltype(vm, n++)); | |
| 397 | lua_rawseti(L, -2, n); | |
| 398 | } | |
| 399 | return 1; | |
| 394 | lua_newtable(L); | |
| 395 | for (n = 0; n < columns;) { | |
| 396 | lua_pushstring(L, sqlite3_column_decltype(vm, n++)); | |
| 397 | lua_rawseti(L, -2, n); | |
| 398 | } | |
| 399 | return 1; | |
| 400 | 400 | } |
| 401 | 401 | |
| 402 | 402 | static int dbvm_get_uvalues(lua_State *L) { |
| 403 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 404 | sqlite3_stmt *vm = svm->vm; | |
| 405 | int columns = svm->columns; | |
| 406 | int n; | |
| 407 | dbvm_check_contents(L, svm); | |
| 403 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 404 | sqlite3_stmt *vm = svm->vm; | |
| 405 | int columns = svm->columns; | |
| 406 | int n; | |
| 407 | dbvm_check_contents(L, svm); | |
| 408 | 408 | |
| 409 | lua_checkstack(L, columns); | |
| 410 | for (n = 0; n < columns; ++n) | |
| 411 | vm_push_column(L, vm, n); | |
| 412 | return columns; | |
| 409 | lua_checkstack(L, columns); | |
| 410 | for (n = 0; n < columns; ++n) | |
| 411 | vm_push_column(L, vm, n); | |
| 412 | return columns; | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | static int dbvm_get_unames(lua_State *L) { |
| 416 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 417 | sqlite3_stmt *vm = svm->vm; | |
| 418 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 419 | int n; | |
| 416 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 417 | sqlite3_stmt *vm = svm->vm; | |
| 418 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 419 | int n; | |
| 420 | 420 | |
| 421 | lua_checkstack(L, columns); | |
| 422 | for (n = 0; n < columns; ++n) | |
| 423 | lua_pushstring(L, sqlite3_column_name(vm, n)); | |
| 424 | return columns; | |
| 421 | lua_checkstack(L, columns); | |
| 422 | for (n = 0; n < columns; ++n) | |
| 423 | lua_pushstring(L, sqlite3_column_name(vm, n)); | |
| 424 | return columns; | |
| 425 | 425 | } |
| 426 | 426 | |
| 427 | 427 | static int dbvm_get_utypes(lua_State *L) { |
| 428 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 429 | sqlite3_stmt *vm = svm->vm; | |
| 430 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 431 | int n; | |
| 428 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 429 | sqlite3_stmt *vm = svm->vm; | |
| 430 | int columns = sqlite3_column_count(vm); /* valid as soon as statement prepared */ | |
| 431 | int n; | |
| 432 | 432 | |
| 433 | lua_checkstack(L, columns); | |
| 434 | for (n = 0; n < columns; ++n) | |
| 435 | lua_pushstring(L, sqlite3_column_decltype(vm, n)); | |
| 436 | return columns; | |
| 433 | lua_checkstack(L, columns); | |
| 434 | for (n = 0; n < columns; ++n) | |
| 435 | lua_pushstring(L, sqlite3_column_decltype(vm, n)); | |
| 436 | return columns; | |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | static int dbvm_get_named_values(lua_State *L) { |
| 440 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 441 | sqlite3_stmt *vm = svm->vm; | |
| 442 | int columns = svm->columns; | |
| 443 | int n; | |
| 444 | dbvm_check_contents(L, svm); | |
| 440 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 441 | sqlite3_stmt *vm = svm->vm; | |
| 442 | int columns = svm->columns; | |
| 443 | int n; | |
| 444 | dbvm_check_contents(L, svm); | |
| 445 | 445 | |
| 446 | lua_newtable(L); | |
| 447 | for (n = 0; n < columns; ++n) { | |
| 448 | lua_pushstring(L, sqlite3_column_name(vm, n)); | |
| 449 | vm_push_column(L, vm, n); | |
| 450 | lua_rawset(L, -3); | |
| 451 | } | |
| 452 | return 1; | |
| 446 | lua_newtable(L); | |
| 447 | for (n = 0; n < columns; ++n) { | |
| 448 | lua_pushstring(L, sqlite3_column_name(vm, n)); | |
| 449 | vm_push_column(L, vm, n); | |
| 450 | lua_rawset(L, -3); | |
| 451 | } | |
| 452 | return 1; | |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | 455 | static int dbvm_get_named_types(lua_State *L) { |
| 456 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 457 | sqlite3_stmt *vm = svm->vm; | |
| 458 | int columns = sqlite3_column_count(vm); | |
| 459 | int n; | |
| 456 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 457 | sqlite3_stmt *vm = svm->vm; | |
| 458 | int columns = sqlite3_column_count(vm); | |
| 459 | int n; | |
| 460 | 460 | |
| 461 | lua_newtable(L); | |
| 462 | for (n = 0; n < columns; ++n) { | |
| 463 | lua_pushstring(L, sqlite3_column_name(vm, n)); | |
| 464 | lua_pushstring(L, sqlite3_column_decltype(vm, n)); | |
| 465 | lua_rawset(L, -3); | |
| 466 | } | |
| 467 | return 1; | |
| 461 | lua_newtable(L); | |
| 462 | for (n = 0; n < columns; ++n) { | |
| 463 | lua_pushstring(L, sqlite3_column_name(vm, n)); | |
| 464 | lua_pushstring(L, sqlite3_column_decltype(vm, n)); | |
| 465 | lua_rawset(L, -3); | |
| 466 | } | |
| 467 | return 1; | |
| 468 | 468 | } |
| 469 | 469 | |
| 470 | 470 | /* |
| r31373 | r31374 | |
| 474 | 474 | */ |
| 475 | 475 | |
| 476 | 476 | static int dbvm_bind_index(lua_State *L, sqlite3_stmt *vm, int index, int lindex) { |
| 477 | switch (lua_type(L, lindex)) { | |
| 478 | case LUA_TSTRING: | |
| 479 | return sqlite3_bind_text(vm, index, lua_tostring(L, lindex), lua_strlen(L, lindex), SQLITE_TRANSIENT); | |
| 480 | case LUA_TNUMBER: | |
| 481 | return sqlite3_bind_double(vm, index, lua_tonumber(L, lindex)); | |
| 482 | case LUA_TBOOLEAN: | |
| 483 | return sqlite3_bind_int(vm, index, lua_toboolean(L, lindex) ? 1 : 0); | |
| 484 | case LUA_TNONE: | |
| 485 | case LUA_TNIL: | |
| 486 | return sqlite3_bind_null(vm, index); | |
| 487 | default: | |
| 488 | luaL_error(L, "index (%d) - invalid data type for bind (%s)", index, lua_typename(L, lua_type(L, lindex))); | |
| 489 | return SQLITE_MISUSE; /*!*/ | |
| 490 | } | |
| 477 | switch (lua_type(L, lindex)) { | |
| 478 | case LUA_TSTRING: | |
| 479 | return sqlite3_bind_text(vm, index, lua_tostring(L, lindex), lua_strlen(L, lindex), SQLITE_TRANSIENT); | |
| 480 | case LUA_TNUMBER: | |
| 481 | return sqlite3_bind_double(vm, index, lua_tonumber(L, lindex)); | |
| 482 | case LUA_TBOOLEAN: | |
| 483 | return sqlite3_bind_int(vm, index, lua_toboolean(L, lindex) ? 1 : 0); | |
| 484 | case LUA_TNONE: | |
| 485 | case LUA_TNIL: | |
| 486 | return sqlite3_bind_null(vm, index); | |
| 487 | default: | |
| 488 | luaL_error(L, "index (%d) - invalid data type for bind (%s)", index, lua_typename(L, lua_type(L, lindex))); | |
| 489 | return SQLITE_MISUSE; /*!*/ | |
| 490 | } | |
| 491 | 491 | } |
| 492 | 492 | |
| 493 | 493 | |
| 494 | 494 | static int dbvm_bind_parameter_count(lua_State *L) { |
| 495 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 496 | lua_pushnumber(L, sqlite3_bind_parameter_count(svm->vm)); | |
| 497 | return 1; | |
| 495 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 496 | lua_pushnumber(L, sqlite3_bind_parameter_count(svm->vm)); | |
| 497 | return 1; | |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | static int dbvm_bind_parameter_name(lua_State *L) { |
| 501 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 502 | int index = luaL_checknumber(L, 2); | |
| 503 | dbvm_check_bind_index(L, svm, index); | |
| 504 | lua_pushstring(L, sqlite3_bind_parameter_name(svm->vm, index)); | |
| 505 | return 1; | |
| 501 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 502 | int index = luaL_checknumber(L, 2); | |
| 503 | dbvm_check_bind_index(L, svm, index); | |
| 504 | lua_pushstring(L, sqlite3_bind_parameter_name(svm->vm, index)); | |
| 505 | return 1; | |
| 506 | 506 | } |
| 507 | 507 | |
| 508 | 508 | static int dbvm_bind(lua_State *L) { |
| 509 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 510 | sqlite3_stmt *vm = svm->vm; | |
| 511 | int index = luaL_checkint(L, 2); | |
| 512 | int result; | |
| 509 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 510 | sqlite3_stmt *vm = svm->vm; | |
| 511 | int index = luaL_checkint(L, 2); | |
| 512 | int result; | |
| 513 | 513 | |
| 514 | dbvm_check_bind_index(L, svm, index); | |
| 515 | result = dbvm_bind_index(L, vm, index, 3); | |
| 514 | dbvm_check_bind_index(L, svm, index); | |
| 515 | result = dbvm_bind_index(L, vm, index, 3); | |
| 516 | 516 | |
| 517 | lua_pushnumber(L, result); | |
| 518 | return 1; | |
| 517 | lua_pushnumber(L, result); | |
| 518 | return 1; | |
| 519 | 519 | } |
| 520 | 520 | |
| 521 | 521 | static int dbvm_bind_blob(lua_State *L) { |
| 522 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 523 | int index = luaL_checkint(L, 2); | |
| 524 | const char *value = luaL_checkstring(L, 3); | |
| 525 | int len = lua_strlen(L, 3); | |
| 522 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 523 | int index = luaL_checkint(L, 2); | |
| 524 | const char *value = luaL_checkstring(L, 3); | |
| 525 | int len = lua_strlen(L, 3); | |
| 526 | 526 | |
| 527 | lua_pushnumber(L, sqlite3_bind_blob(svm->vm, index, value, len, SQLITE_TRANSIENT)); | |
| 528 | return 1; | |
| 527 | lua_pushnumber(L, sqlite3_bind_blob(svm->vm, index, value, len, SQLITE_TRANSIENT)); | |
| 528 | return 1; | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | static int dbvm_bind_values(lua_State *L) { |
| 532 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 533 | sqlite3_stmt *vm = svm->vm; | |
| 534 | int top = lua_gettop(L); | |
| 535 | int result, n; | |
| 532 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 533 | sqlite3_stmt *vm = svm->vm; | |
| 534 | int top = lua_gettop(L); | |
| 535 | int result, n; | |
| 536 | 536 | |
| 537 | if (top - 1 != sqlite3_bind_parameter_count(vm)) | |
| 538 | luaL_error(L, | |
| 539 | "incorrect number of parameters to bind (%d given, %d to bind)", | |
| 540 | top - 1, | |
| 541 | sqlite3_bind_parameter_count(vm) | |
| 542 | ); | |
| 537 | if (top - 1 != sqlite3_bind_parameter_count(vm)) | |
| 538 | luaL_error(L, | |
| 539 | "incorrect number of parameters to bind (%d given, %d to bind)", | |
| 540 | top - 1, | |
| 541 | sqlite3_bind_parameter_count(vm) | |
| 542 | ); | |
| 543 | 543 | |
| 544 | for (n = 2; n <= top; ++n) { | |
| 545 | if ((result = dbvm_bind_index(L, vm, n - 1, n)) != SQLITE_OK) { | |
| 546 | lua_pushnumber(L, result); | |
| 547 | return 1; | |
| 548 | } | |
| 549 | } | |
| 544 | for (n = 2; n <= top; ++n) { | |
| 545 | if ((result = dbvm_bind_index(L, vm, n - 1, n)) != SQLITE_OK) { | |
| 546 | lua_pushnumber(L, result); | |
| 547 | return 1; | |
| 548 | } | |
| 549 | } | |
| 550 | 550 | |
| 551 | lua_pushnumber(L, SQLITE_OK); | |
| 552 | return 1; | |
| 551 | lua_pushnumber(L, SQLITE_OK); | |
| 552 | return 1; | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | static int dbvm_bind_names(lua_State *L) { |
| 556 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 557 | sqlite3_stmt *vm = svm->vm; | |
| 558 | int count = sqlite3_bind_parameter_count(vm); | |
| 559 | const char *name; | |
| 560 | int result, n; | |
| 561 | luaL_checktype(L, 2, LUA_TTABLE); | |
| 556 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 557 | sqlite3_stmt *vm = svm->vm; | |
| 558 | int count = sqlite3_bind_parameter_count(vm); | |
| 559 | const char *name; | |
| 560 | int result, n; | |
| 561 | luaL_checktype(L, 2, LUA_TTABLE); | |
| 562 | 562 | |
| 563 | for (n = 1; n <= count; ++n) { | |
| 564 | name = sqlite3_bind_parameter_name(vm, n); | |
| 565 | if (name && (name[0] == ':' || name[0] == '$')) { | |
| 566 | lua_pushstring(L, ++name); | |
| 567 | lua_gettable(L, 2); | |
| 568 | result = dbvm_bind_index(L, vm, n, -1); | |
| 569 | lua_pop(L, 1); | |
| 570 | } | |
| 571 | else { | |
| 572 | lua_pushnumber(L, n); | |
| 573 | lua_gettable(L, 2); | |
| 574 | result = dbvm_bind_index(L, vm, n, -1); | |
| 575 | lua_pop(L, 1); | |
| 576 | } | |
| 563 | for (n = 1; n <= count; ++n) { | |
| 564 | name = sqlite3_bind_parameter_name(vm, n); | |
| 565 | if (name && (name[0] == ':' || name[0] == '$')) { | |
| 566 | lua_pushstring(L, ++name); | |
| 567 | lua_gettable(L, 2); | |
| 568 | result = dbvm_bind_index(L, vm, n, -1); | |
| 569 | lua_pop(L, 1); | |
| 570 | } | |
| 571 | else { | |
| 572 | lua_pushnumber(L, n); | |
| 573 | lua_gettable(L, 2); | |
| 574 | result = dbvm_bind_index(L, vm, n, -1); | |
| 575 | lua_pop(L, 1); | |
| 576 | } | |
| 577 | 577 | |
| 578 | if (result != SQLITE_OK) { | |
| 579 | lua_pushnumber(L, result); | |
| 580 | return 1; | |
| 581 | } | |
| 582 | } | |
| 578 | if (result != SQLITE_OK) { | |
| 579 | lua_pushnumber(L, result); | |
| 580 | return 1; | |
| 581 | } | |
| 582 | } | |
| 583 | 583 | |
| 584 | lua_pushnumber(L, SQLITE_OK); | |
| 585 | return 1; | |
| 584 | lua_pushnumber(L, SQLITE_OK); | |
| 585 | return 1; | |
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | /* |
| r31373 | r31374 | |
| 599 | 599 | ** Creates a new 'table' and leaves it in the stack |
| 600 | 600 | */ |
| 601 | 601 | static sdb *newdb (lua_State *L) { |
| 602 | sdb *db = (sdb*)lua_newuserdata(L, sizeof(sdb)); | |
| 603 | db->L = L; | |
| 604 | db->db = NULL; /* database handle is currently `closed' */ | |
| 605 | db->func = NULL; | |
| 602 | sdb *db = (sdb*)lua_newuserdata(L, sizeof(sdb)); | |
| 603 | db->L = L; | |
| 604 | db->db = NULL; /* database handle is currently `closed' */ | |
| 605 | db->func = NULL; | |
| 606 | 606 | |
| 607 | db->busy_cb = | |
| 608 | db->busy_udata = | |
| 609 | db->progress_cb = | |
| 610 | db->progress_udata = | |
| 611 | db->trace_cb = | |
| 612 | db->trace_udata = | |
| 607 | db->busy_cb = | |
| 608 | db->busy_udata = | |
| 609 | db->progress_cb = | |
| 610 | db->progress_udata = | |
| 611 | db->trace_cb = | |
| 612 | db->trace_udata = | |
| 613 | 613 | #if !defined(LSQLITE_OMIT_UPDATE_HOOK) || !LSQLITE_OMIT_UPDATE_HOOK |
| 614 | db->update_hook_cb = | |
| 615 | db->update_hook_udata = | |
| 616 | db->commit_hook_cb = | |
| 617 | db->commit_hook_udata = | |
| 618 | db->rollback_hook_cb = | |
| 619 | db->rollback_hook_udata = | |
| 614 | db->update_hook_cb = | |
| 615 | db->update_hook_udata = | |
| 616 | db->commit_hook_cb = | |
| 617 | db->commit_hook_udata = | |
| 618 | db->rollback_hook_cb = | |
| 619 | db->rollback_hook_udata = | |
| 620 | 620 | #endif |
| 621 | ||
| 621 | LUA_NOREF; | |
| 622 | 622 | |
| 623 | luaL_getmetatable(L, sqlite_meta); | |
| 624 | lua_setmetatable(L, -2); /* set metatable */ | |
| 623 | luaL_getmetatable(L, sqlite_meta); | |
| 624 | lua_setmetatable(L, -2); /* set metatable */ | |
| 625 | 625 | |
| 626 | /* to keep track of 'open' virtual machines */ | |
| 627 | lua_pushlightuserdata(L, db); | |
| 628 | lua_newtable(L); | |
| 629 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 626 | /* to keep track of 'open' virtual machines */ | |
| 627 | lua_pushlightuserdata(L, db); | |
| 628 | lua_newtable(L); | |
| 629 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 630 | 630 | |
| 631 | ||
| 631 | return db; | |
| 632 | 632 | } |
| 633 | 633 | |
| 634 | 634 | static int cleanupdb(lua_State *L, sdb *db) { |
| 635 | sdb_func *func; | |
| 636 | sdb_func *func_next; | |
| 637 | int top; | |
| 638 | int result; | |
| 635 | sdb_func *func; | |
| 636 | sdb_func *func_next; | |
| 637 | int top; | |
| 638 | int result; | |
| 639 | 639 | |
| 640 | /* free associated virtual machines */ | |
| 641 | lua_pushlightuserdata(L, db); | |
| 642 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 640 | /* free associated virtual machines */ | |
| 641 | lua_pushlightuserdata(L, db); | |
| 642 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 643 | 643 | |
| 644 | /* close all used handles */ | |
| 645 | top = lua_gettop(L); | |
| 646 | lua_pushnil(L); | |
| 647 | while (lua_next(L, -2)) { | |
| 648 | sdb_vm *svm = (sdb_vm *)lua_touserdata(L, -2); /* key: vm; val: sql text */ | |
| 649 | cleanupvm(L, svm); | |
| 644 | /* close all used handles */ | |
| 645 | top = lua_gettop(L); | |
| 646 | lua_pushnil(L); | |
| 647 | while (lua_next(L, -2)) { | |
| 648 | sdb_vm *svm = (sdb_vm *)lua_touserdata(L, -2); /* key: vm; val: sql text */ | |
| 649 | cleanupvm(L, svm); | |
| 650 | 650 | |
| 651 | lua_settop(L, top); | |
| 652 | lua_pushnil(L); | |
| 653 | } | |
| 651 | lua_settop(L, top); | |
| 652 | lua_pushnil(L); | |
| 653 | } | |
| 654 | 654 | |
| 655 | ||
| 655 | lua_pop(L, 1); /* pop vm table */ | |
| 656 | 656 | |
| 657 | /* remove entry in lua registry table */ | |
| 658 | lua_pushlightuserdata(L, db); | |
| 659 | lua_pushnil(L); | |
| 660 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 657 | /* remove entry in lua registry table */ | |
| 658 | lua_pushlightuserdata(L, db); | |
| 659 | lua_pushnil(L); | |
| 660 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 661 | 661 | |
| 662 | /* 'free' all references */ | |
| 663 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 664 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 665 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 666 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 667 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_cb); | |
| 668 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_udata); | |
| 662 | /* 'free' all references */ | |
| 663 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 664 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 665 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 666 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 667 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_cb); | |
| 668 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_udata); | |
| 669 | 669 | #if !defined(LSQLITE_OMIT_UPDATE_HOOK) || !LSQLITE_OMIT_UPDATE_HOOK |
| 670 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_cb); | |
| 671 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_udata); | |
| 672 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_cb); | |
| 673 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_udata); | |
| 674 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); | |
| 675 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); | |
| 670 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_cb); | |
| 671 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_udata); | |
| 672 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_cb); | |
| 673 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_udata); | |
| 674 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); | |
| 675 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); | |
| 676 | 676 | #endif |
| 677 | 677 | |
| 678 | /* close database */ | |
| 679 | result = sqlite3_close(db->db); | |
| 680 | db->db = NULL; | |
| 678 | /* close database */ | |
| 679 | result = sqlite3_close(db->db); | |
| 680 | db->db = NULL; | |
| 681 | 681 | |
| 682 | /* free associated memory with created functions */ | |
| 683 | func = db->func; | |
| 684 | while (func) { | |
| 685 | func_next = func->next; | |
| 686 | luaL_unref(L, LUA_REGISTRYINDEX, func->fn_step); | |
| 687 | luaL_unref(L, LUA_REGISTRYINDEX, func->fn_finalize); | |
| 688 | luaL_unref(L, LUA_REGISTRYINDEX, func->udata); | |
| 689 | free(func); | |
| 690 | func = func_next; | |
| 691 | } | |
| 692 | db->func = NULL; | |
| 693 | return result; | |
| 682 | /* free associated memory with created functions */ | |
| 683 | func = db->func; | |
| 684 | while (func) { | |
| 685 | func_next = func->next; | |
| 686 | luaL_unref(L, LUA_REGISTRYINDEX, func->fn_step); | |
| 687 | luaL_unref(L, LUA_REGISTRYINDEX, func->fn_finalize); | |
| 688 | luaL_unref(L, LUA_REGISTRYINDEX, func->udata); | |
| 689 | free(func); | |
| 690 | func = func_next; | |
| 691 | } | |
| 692 | db->func = NULL; | |
| 693 | return result; | |
| 694 | 694 | } |
| 695 | 695 | |
| 696 | 696 | static sdb *lsqlite_getdb(lua_State *L, int index) { |
| 697 | sdb *db = (sdb*)luaL_checkudata(L, index, sqlite_meta); | |
| 698 | if (db == NULL) luaL_typerror(L, index, "sqlite database"); | |
| 699 | return db; | |
| 697 | sdb *db = (sdb*)luaL_checkudata(L, index, sqlite_meta); | |
| 698 | if (db == NULL) luaL_typerror(L, index, "sqlite database"); | |
| 699 | return db; | |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | static sdb *lsqlite_checkdb(lua_State *L, int index) { |
| 703 | sdb *db = lsqlite_getdb(L, index); | |
| 704 | if (db->db == NULL) luaL_argerror(L, index, "attempt to use closed sqlite database"); | |
| 705 | return db; | |
| 703 | sdb *db = lsqlite_getdb(L, index); | |
| 704 | if (db->db == NULL) luaL_argerror(L, index, "attempt to use closed sqlite database"); | |
| 705 | return db; | |
| 706 | 706 | } |
| 707 | 707 | |
| 708 | 708 | |
| r31373 | r31374 | |
| 712 | 712 | ** ======================================================= |
| 713 | 713 | */ |
| 714 | 714 | typedef struct { |
| 715 | sqlite3_context *ctx; | |
| 716 | int ud; | |
| 715 | sqlite3_context *ctx; | |
| 716 | int ud; | |
| 717 | 717 | } lcontext; |
| 718 | 718 | |
| 719 | 719 | static lcontext *lsqlite_make_context(lua_State *L) { |
| 720 | lcontext *ctx = (lcontext*)lua_newuserdata(L, sizeof(lcontext)); | |
| 721 | lua_rawgeti(L, LUA_REGISTRYINDEX, sqlite_ctx_meta_ref); | |
| 722 | lua_setmetatable(L, -2); | |
| 723 | ctx->ctx = NULL; | |
| 724 | ctx->ud = LUA_NOREF; | |
| 725 | return ctx; | |
| 720 | lcontext *ctx = (lcontext*)lua_newuserdata(L, sizeof(lcontext)); | |
| 721 | lua_rawgeti(L, LUA_REGISTRYINDEX, sqlite_ctx_meta_ref); | |
| 722 | lua_setmetatable(L, -2); | |
| 723 | ctx->ctx = NULL; | |
| 724 | ctx->ud = LUA_NOREF; | |
| 725 | return ctx; | |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | static lcontext *lsqlite_getcontext(lua_State *L, int index) { |
| 729 | lcontext *ctx = (lcontext*)luaL_checkudata(L, index, sqlite_ctx_meta); | |
| 730 | if (ctx == NULL) luaL_typerror(L, index, "sqlite context"); | |
| 731 | return ctx; | |
| 729 | lcontext *ctx = (lcontext*)luaL_checkudata(L, index, sqlite_ctx_meta); | |
| 730 | if (ctx == NULL) luaL_typerror(L, index, "sqlite context"); | |
| 731 | return ctx; | |
| 732 | 732 | } |
| 733 | 733 | |
| 734 | 734 | static lcontext *lsqlite_checkcontext(lua_State *L, int index) { |
| 735 | lcontext *ctx = lsqlite_getcontext(L, index); | |
| 736 | if (ctx->ctx == NULL) luaL_argerror(L, index, "invalid sqlite context"); | |
| 737 | return ctx; | |
| 735 | lcontext *ctx = lsqlite_getcontext(L, index); | |
| 736 | if (ctx->ctx == NULL) luaL_argerror(L, index, "invalid sqlite context"); | |
| 737 | return ctx; | |
| 738 | 738 | } |
| 739 | 739 | |
| 740 | 740 | static int lcontext_tostring(lua_State *L) { |
| 741 | char buff[39]; | |
| 742 | lcontext *ctx = lsqlite_getcontext(L, 1); | |
| 743 | if (ctx->ctx == NULL) | |
| 744 | strcpy(buff, "closed"); | |
| 745 | else | |
| 746 | sprintf(buff, "%p", ctx->ctx); | |
| 747 | lua_pushfstring(L, "sqlite function context (%s)", buff); | |
| 748 | return 1; | |
| 741 | char buff[39]; | |
| 742 | lcontext *ctx = lsqlite_getcontext(L, 1); | |
| 743 | if (ctx->ctx == NULL) | |
| 744 | strcpy(buff, "closed"); | |
| 745 | else | |
| 746 | sprintf(buff, "%p", ctx->ctx); | |
| 747 | lua_pushfstring(L, "sqlite function context (%s)", buff); | |
| 748 | return 1; | |
| 749 | 749 | } |
| 750 | 750 | |
| 751 | 751 | static void lcontext_check_aggregate(lua_State *L, lcontext *ctx) { |
| 752 | sdb_func *func = (sdb_func*)sqlite3_user_data(ctx->ctx); | |
| 753 | if (!func->aggregate) { | |
| 754 | luaL_error(L, "attempt to call aggregate method from scalar function"); | |
| 755 | } | |
| 752 | sdb_func *func = (sdb_func*)sqlite3_user_data(ctx->ctx); | |
| 753 | if (!func->aggregate) { | |
| 754 | luaL_error(L, "attempt to call aggregate method from scalar function"); | |
| 755 | } | |
| 756 | 756 | } |
| 757 | 757 | |
| 758 | 758 | static int lcontext_user_data(lua_State *L) { |
| 759 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 760 | sdb_func *func = (sdb_func*)sqlite3_user_data(ctx->ctx); | |
| 761 | lua_rawgeti(L, LUA_REGISTRYINDEX, func->udata); | |
| 762 | return 1; | |
| 759 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 760 | sdb_func *func = (sdb_func*)sqlite3_user_data(ctx->ctx); | |
| 761 | lua_rawgeti(L, LUA_REGISTRYINDEX, func->udata); | |
| 762 | return 1; | |
| 763 | 763 | } |
| 764 | 764 | |
| 765 | 765 | static int lcontext_get_aggregate_context(lua_State *L) { |
| 766 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 767 | lcontext_check_aggregate(L, ctx); | |
| 768 | lua_rawgeti(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 769 | return 1; | |
| 766 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 767 | lcontext_check_aggregate(L, ctx); | |
| 768 | lua_rawgeti(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 769 | return 1; | |
| 770 | 770 | } |
| 771 | 771 | |
| 772 | 772 | static int lcontext_set_aggregate_context(lua_State *L) { |
| 773 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 774 | lcontext_check_aggregate(L, ctx); | |
| 775 | lua_settop(L, 2); | |
| 776 | luaL_unref(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 777 | ctx->ud = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 778 | return 0; | |
| 773 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 774 | lcontext_check_aggregate(L, ctx); | |
| 775 | lua_settop(L, 2); | |
| 776 | luaL_unref(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 777 | ctx->ud = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 778 | return 0; | |
| 779 | 779 | } |
| 780 | 780 | |
| 781 | 781 | static int lcontext_aggregate_count(lua_State *L) { |
| 782 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 783 | lcontext_check_aggregate(L, ctx); | |
| 784 | lua_pushnumber(L, sqlite3_aggregate_count(ctx->ctx)); | |
| 785 | return 1; | |
| 782 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 783 | lcontext_check_aggregate(L, ctx); | |
| 784 | lua_pushnumber(L, sqlite3_aggregate_count(ctx->ctx)); | |
| 785 | return 1; | |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | #if 0 |
| r31373 | r31374 | |
| 791 | 791 | #endif |
| 792 | 792 | |
| 793 | 793 | static int lcontext_result(lua_State *L) { |
| 794 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 795 | switch (lua_type(L, 2)) { | |
| 796 | case LUA_TNUMBER: | |
| 797 | sqlite3_result_double(ctx->ctx, luaL_checknumber(L, 2)); | |
| 798 | break; | |
| 799 | case LUA_TSTRING: | |
| 800 | sqlite3_result_text(ctx->ctx, luaL_checkstring(L, 2), lua_strlen(L, 2), SQLITE_TRANSIENT); | |
| 801 | break; | |
| 802 | case LUA_TNIL: | |
| 803 | case LUA_TNONE: | |
| 804 | sqlite3_result_null(ctx->ctx); | |
| 805 | break; | |
| 806 | default: | |
| 807 | luaL_error(L, "invalid result type %s", lua_typename(L, 2)); | |
| 808 | break; | |
| 809 | } | |
| 794 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 795 | switch (lua_type(L, 2)) { | |
| 796 | case LUA_TNUMBER: | |
| 797 | sqlite3_result_double(ctx->ctx, luaL_checknumber(L, 2)); | |
| 798 | break; | |
| 799 | case LUA_TSTRING: | |
| 800 | sqlite3_result_text(ctx->ctx, luaL_checkstring(L, 2), lua_strlen(L, 2), SQLITE_TRANSIENT); | |
| 801 | break; | |
| 802 | case LUA_TNIL: | |
| 803 | case LUA_TNONE: | |
| 804 | sqlite3_result_null(ctx->ctx); | |
| 805 | break; | |
| 806 | default: | |
| 807 | luaL_error(L, "invalid result type %s", lua_typename(L, 2)); | |
| 808 | break; | |
| 809 | } | |
| 810 | 810 | |
| 811 | ||
| 811 | return 0; | |
| 812 | 812 | } |
| 813 | 813 | |
| 814 | 814 | static int lcontext_result_blob(lua_State *L) { |
| 815 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 816 | const char *blob = luaL_checkstring(L, 2); | |
| 817 | int size = lua_strlen(L, 2); | |
| 818 | sqlite3_result_blob(ctx->ctx, (const void*)blob, size, SQLITE_TRANSIENT); | |
| 819 | return 0; | |
| 815 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 816 | const char *blob = luaL_checkstring(L, 2); | |
| 817 | int size = lua_strlen(L, 2); | |
| 818 | sqlite3_result_blob(ctx->ctx, (const void*)blob, size, SQLITE_TRANSIENT); | |
| 819 | return 0; | |
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | static int lcontext_result_double(lua_State *L) { |
| 823 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 824 | double d = luaL_checknumber(L, 2); | |
| 825 | sqlite3_result_double(ctx->ctx, d); | |
| 826 | return 0; | |
| 823 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 824 | double d = luaL_checknumber(L, 2); | |
| 825 | sqlite3_result_double(ctx->ctx, d); | |
| 826 | return 0; | |
| 827 | 827 | } |
| 828 | 828 | |
| 829 | 829 | static int lcontext_result_error(lua_State *L) { |
| 830 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 831 | const char *err = luaL_checkstring(L, 2); | |
| 832 | int size = lua_strlen(L, 2); | |
| 833 | sqlite3_result_error(ctx->ctx, err, size); | |
| 834 | return 0; | |
| 830 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 831 | const char *err = luaL_checkstring(L, 2); | |
| 832 | int size = lua_strlen(L, 2); | |
| 833 | sqlite3_result_error(ctx->ctx, err, size); | |
| 834 | return 0; | |
| 835 | 835 | } |
| 836 | 836 | |
| 837 | 837 | static int lcontext_result_int(lua_State *L) { |
| 838 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 839 | int i = luaL_checkint(L, 2); | |
| 840 | sqlite3_result_int(ctx->ctx, i); | |
| 841 | return 0; | |
| 838 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 839 | int i = luaL_checkint(L, 2); | |
| 840 | sqlite3_result_int(ctx->ctx, i); | |
| 841 | return 0; | |
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | static int lcontext_result_null(lua_State *L) { |
| 845 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 846 | sqlite3_result_null(ctx->ctx); | |
| 847 | return 0; | |
| 845 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 846 | sqlite3_result_null(ctx->ctx); | |
| 847 | return 0; | |
| 848 | 848 | } |
| 849 | 849 | |
| 850 | 850 | static int lcontext_result_text(lua_State *L) { |
| 851 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 852 | const char *text = luaL_checkstring(L, 2); | |
| 853 | int size = lua_strlen(L, 2); | |
| 854 | sqlite3_result_text(ctx->ctx, text, size, SQLITE_TRANSIENT); | |
| 855 | return 0; | |
| 851 | lcontext *ctx = lsqlite_checkcontext(L, 1); | |
| 852 | const char *text = luaL_checkstring(L, 2); | |
| 853 | int size = lua_strlen(L, 2); | |
| 854 | sqlite3_result_text(ctx->ctx, text, size, SQLITE_TRANSIENT); | |
| 855 | return 0; | |
| 856 | 856 | } |
| 857 | 857 | |
| 858 | 858 | /* |
| r31373 | r31374 | |
| 862 | 862 | */ |
| 863 | 863 | |
| 864 | 864 | static int db_isopen(lua_State *L) { |
| 865 | sdb *db = lsqlite_getdb(L, 1); | |
| 866 | lua_pushboolean(L, db->db != NULL ? 1 : 0); | |
| 867 | return 1; | |
| 865 | sdb *db = lsqlite_getdb(L, 1); | |
| 866 | lua_pushboolean(L, db->db != NULL ? 1 : 0); | |
| 867 | return 1; | |
| 868 | 868 | } |
| 869 | 869 | |
| 870 | 870 | static int db_last_insert_rowid(lua_State *L) { |
| 871 | sdb *db = lsqlite_checkdb(L, 1); | |
| 872 | /* conversion warning: int64 -> luaNumber */ | |
| 873 | sqlite_int64 rowid = sqlite3_last_insert_rowid(db->db); | |
| 874 | lua_Number n = (lua_Number)rowid; | |
| 875 | if (n == rowid) | |
| 876 | lua_pushnumber(L, n); | |
| 877 | else | |
| 878 | lua_pushfstring(L, "%ll", rowid); | |
| 879 | return 1; | |
| 871 | sdb *db = lsqlite_checkdb(L, 1); | |
| 872 | /* conversion warning: int64 -> luaNumber */ | |
| 873 | sqlite_int64 rowid = sqlite3_last_insert_rowid(db->db); | |
| 874 | lua_Number n = (lua_Number)rowid; | |
| 875 | if (n == rowid) | |
| 876 | lua_pushnumber(L, n); | |
| 877 | else | |
| 878 | lua_pushfstring(L, "%ll", rowid); | |
| 879 | return 1; | |
| 880 | 880 | } |
| 881 | 881 | |
| 882 | 882 | static int db_changes(lua_State *L) { |
| 883 | sdb *db = lsqlite_checkdb(L, 1); | |
| 884 | lua_pushnumber(L, sqlite3_changes(db->db)); | |
| 885 | return 1; | |
| 883 | sdb *db = lsqlite_checkdb(L, 1); | |
| 884 | lua_pushnumber(L, sqlite3_changes(db->db)); | |
| 885 | return 1; | |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | 888 | static int db_total_changes(lua_State *L) { |
| 889 | sdb *db = lsqlite_checkdb(L, 1); | |
| 890 | lua_pushnumber(L, sqlite3_total_changes(db->db)); | |
| 891 | return 1; | |
| 889 | sdb *db = lsqlite_checkdb(L, 1); | |
| 890 | lua_pushnumber(L, sqlite3_total_changes(db->db)); | |
| 891 | return 1; | |
| 892 | 892 | } |
| 893 | 893 | |
| 894 | 894 | static int db_errcode(lua_State *L) { |
| 895 | sdb *db = lsqlite_checkdb(L, 1); | |
| 896 | lua_pushnumber(L, sqlite3_errcode(db->db)); | |
| 897 | return 1; | |
| 895 | sdb *db = lsqlite_checkdb(L, 1); | |
| 896 | lua_pushnumber(L, sqlite3_errcode(db->db)); | |
| 897 | return 1; | |
| 898 | 898 | } |
| 899 | 899 | |
| 900 | 900 | static int db_errmsg(lua_State *L) { |
| 901 | sdb *db = lsqlite_checkdb(L, 1); | |
| 902 | lua_pushstring(L, sqlite3_errmsg(db->db)); | |
| 903 | return 1; | |
| 901 | sdb *db = lsqlite_checkdb(L, 1); | |
| 902 | lua_pushstring(L, sqlite3_errmsg(db->db)); | |
| 903 | return 1; | |
| 904 | 904 | } |
| 905 | 905 | |
| 906 | 906 | static int db_interrupt(lua_State *L) { |
| 907 | sdb *db = lsqlite_checkdb(L, 1); | |
| 908 | sqlite3_interrupt(db->db); | |
| 909 | return 0; | |
| 907 | sdb *db = lsqlite_checkdb(L, 1); | |
| 908 | sqlite3_interrupt(db->db); | |
| 909 | return 0; | |
| 910 | 910 | } |
| 911 | 911 | |
| 912 | 912 | /* |
| r31373 | r31374 | |
| 914 | 914 | */ |
| 915 | 915 | |
| 916 | 916 | static void db_push_value(lua_State *L, sqlite3_value *value) { |
| 917 | switch (sqlite3_value_type(value)) { | |
| 918 | case SQLITE_TEXT: | |
| 919 | lua_pushlstring(L, (const char*)sqlite3_value_text(value), sqlite3_value_bytes(value)); | |
| 920 | break; | |
| 917 | switch (sqlite3_value_type(value)) { | |
| 918 | case SQLITE_TEXT: | |
| 919 | lua_pushlstring(L, (const char*)sqlite3_value_text(value), sqlite3_value_bytes(value)); | |
| 920 | break; | |
| 921 | 921 | |
| 922 | case SQLITE_INTEGER: | |
| 923 | { | |
| 924 | sqlite_int64 i64 = sqlite3_value_int64(value); | |
| 925 | lua_Number n = (lua_Number)i64; | |
| 926 | if (n == i64) | |
| 927 | lua_pushnumber(L, n); | |
| 928 | else | |
| 929 | lua_pushlstring(L, (const char*)sqlite3_value_text(value), sqlite3_value_bytes(value)); | |
| 930 | } | |
| 931 | break; | |
| 922 | case SQLITE_INTEGER: | |
| 923 | { | |
| 924 | sqlite_int64 i64 = sqlite3_value_int64(value); | |
| 925 | lua_Number n = (lua_Number)i64; | |
| 926 | if (n == i64) | |
| 927 | lua_pushnumber(L, n); | |
| 928 | else | |
| 929 | lua_pushlstring(L, (const char*)sqlite3_value_text(value), sqlite3_value_bytes(value)); | |
| 930 | } | |
| 931 | break; | |
| 932 | 932 | |
| 933 | case SQLITE_FLOAT: | |
| 934 | lua_pushnumber(L, sqlite3_value_double(value)); | |
| 935 | break; | |
| 933 | case SQLITE_FLOAT: | |
| 934 | lua_pushnumber(L, sqlite3_value_double(value)); | |
| 935 | break; | |
| 936 | 936 | |
| 937 | case SQLITE_BLOB: | |
| 938 | lua_pushlstring(L, (const char*)sqlite3_value_blob(value), sqlite3_value_bytes(value)); | |
| 939 | break; | |
| 937 | case SQLITE_BLOB: | |
| 938 | lua_pushlstring(L, (const char*)sqlite3_value_blob(value), sqlite3_value_bytes(value)); | |
| 939 | break; | |
| 940 | 940 | |
| 941 | case SQLITE_NULL: | |
| 942 | lua_pushnil(L); | |
| 943 | break; | |
| 941 | case SQLITE_NULL: | |
| 942 | lua_pushnil(L); | |
| 943 | break; | |
| 944 | 944 | |
| 945 | default: | |
| 946 | /* things done properly (SQLite + Lua SQLite) | |
| 947 | ** this should never happen */ | |
| 948 | lua_pushnil(L); | |
| 949 | break; | |
| 950 | } | |
| 945 | default: | |
| 946 | /* things done properly (SQLite + Lua SQLite) | |
| 947 | ** this should never happen */ | |
| 948 | lua_pushnil(L); | |
| 949 | break; | |
| 950 | } | |
| 951 | 951 | } |
| 952 | 952 | |
| 953 | 953 | /* |
| r31373 | r31374 | |
| 957 | 957 | /* scalar function to be called |
| 958 | 958 | ** callback params: context, values... */ |
| 959 | 959 | static void db_sql_normal_function(sqlite3_context *context, int argc, sqlite3_value **argv) { |
| 960 | sdb_func *func = (sdb_func*)sqlite3_user_data(context); | |
| 961 | lua_State *L = func->db->L; | |
| 962 | int n; | |
| 963 | lcontext *ctx; | |
| 960 | sdb_func *func = (sdb_func*)sqlite3_user_data(context); | |
| 961 | lua_State *L = func->db->L; | |
| 962 | int n; | |
| 963 | lcontext *ctx; | |
| 964 | 964 | |
| 965 | ||
| 965 | int top = lua_gettop(L); | |
| 966 | 966 | |
| 967 | /* ensure there is enough space in the stack */ | |
| 968 | lua_checkstack(L, argc + 3); | |
| 967 | /* ensure there is enough space in the stack */ | |
| 968 | lua_checkstack(L, argc + 3); | |
| 969 | 969 | |
| 970 | ||
| 970 | lua_rawgeti(L, LUA_REGISTRYINDEX, func->fn_step); /* function to call */ | |
| 971 | 971 | |
| 972 | if (!func->aggregate) { | |
| 973 | ctx = lsqlite_make_context(L); /* push context - used to set results */ | |
| 974 | } | |
| 975 | else { | |
| 976 | /* reuse context userdata value */ | |
| 977 | void *p = sqlite3_aggregate_context(context, 1); | |
| 978 | /* i think it is OK to use assume that using a light user data | |
| 979 | ** as an entry on LUA REGISTRY table will be unique */ | |
| 980 | lua_pushlightuserdata(L, p); | |
| 981 | lua_rawget(L, LUA_REGISTRYINDEX); /* context table */ | |
| 972 | if (!func->aggregate) { | |
| 973 | ctx = lsqlite_make_context(L); /* push context - used to set results */ | |
| 974 | } | |
| 975 | else { | |
| 976 | /* reuse context userdata value */ | |
| 977 | void *p = sqlite3_aggregate_context(context, 1); | |
| 978 | /* i think it is OK to use assume that using a light user data | |
| 979 | ** as an entry on LUA REGISTRY table will be unique */ | |
| 980 | lua_pushlightuserdata(L, p); | |
| 981 | lua_rawget(L, LUA_REGISTRYINDEX); /* context table */ | |
| 982 | 982 | |
| 983 | if (lua_isnil(L, -1)) { /* not yet created? */ | |
| 984 | lua_pop(L, 1); | |
| 985 | ctx = lsqlite_make_context(L); | |
| 986 | lua_pushlightuserdata(L, p); | |
| 987 | lua_pushvalue(L, -2); | |
| 988 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 989 | } | |
| 990 | else | |
| 991 | ctx = lsqlite_getcontext(L, -1); | |
| 992 | } | |
| 983 | if (lua_isnil(L, -1)) { /* not yet created? */ | |
| 984 | lua_pop(L, 1); | |
| 985 | ctx = lsqlite_make_context(L); | |
| 986 | lua_pushlightuserdata(L, p); | |
| 987 | lua_pushvalue(L, -2); | |
| 988 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 989 | } | |
| 990 | else | |
| 991 | ctx = lsqlite_getcontext(L, -1); | |
| 992 | } | |
| 993 | 993 | |
| 994 | /* push params */ | |
| 995 | for (n = 0; n < argc; ++n) { | |
| 996 | db_push_value(L, argv[n]); | |
| 997 | } | |
| 994 | /* push params */ | |
| 995 | for (n = 0; n < argc; ++n) { | |
| 996 | db_push_value(L, argv[n]); | |
| 997 | } | |
| 998 | 998 | |
| 999 | /* set context */ | |
| 1000 | ctx->ctx = context; | |
| 999 | /* set context */ | |
| 1000 | ctx->ctx = context; | |
| 1001 | 1001 | |
| 1002 | if (lua_pcall(L, argc + 1, 0, 0)) { | |
| 1003 | const char *errmsg = lua_tostring(L, -1); | |
| 1004 | int size = lua_strlen(L, -1); | |
| 1005 | sqlite3_result_error(context, errmsg, size); | |
| 1006 | } | |
| 1002 | if (lua_pcall(L, argc + 1, 0, 0)) { | |
| 1003 | const char *errmsg = lua_tostring(L, -1); | |
| 1004 | int size = lua_strlen(L, -1); | |
| 1005 | sqlite3_result_error(context, errmsg, size); | |
| 1006 | } | |
| 1007 | 1007 | |
| 1008 | /* invalidate context */ | |
| 1009 | ctx->ctx = NULL; | |
| 1008 | /* invalidate context */ | |
| 1009 | ctx->ctx = NULL; | |
| 1010 | 1010 | |
| 1011 | if (!func->aggregate) { | |
| 1012 | luaL_unref(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 1013 | } | |
| 1011 | if (!func->aggregate) { | |
| 1012 | luaL_unref(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 1013 | } | |
| 1014 | 1014 | |
| 1015 | ||
| 1015 | lua_settop(L, top); | |
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | static void db_sql_finalize_function(sqlite3_context *context) { |
| 1019 | sdb_func *func = (sdb_func*)sqlite3_user_data(context); | |
| 1020 | lua_State *L = func->db->L; | |
| 1021 | void *p = sqlite3_aggregate_context(context, 1); /* minimal mem usage */ | |
| 1022 | lcontext *ctx; | |
| 1023 | int top = lua_gettop(L); | |
| 1019 | sdb_func *func = (sdb_func*)sqlite3_user_data(context); | |
| 1020 | lua_State *L = func->db->L; | |
| 1021 | void *p = sqlite3_aggregate_context(context, 1); /* minimal mem usage */ | |
| 1022 | lcontext *ctx; | |
| 1023 | int top = lua_gettop(L); | |
| 1024 | 1024 | |
| 1025 | ||
| 1025 | lua_rawgeti(L, LUA_REGISTRYINDEX, func->fn_finalize); /* function to call */ | |
| 1026 | 1026 | |
| 1027 | /* i think it is OK to use assume that using a light user data | |
| 1028 | ** as an entry on LUA REGISTRY table will be unique */ | |
| 1029 | lua_pushlightuserdata(L, p); | |
| 1030 | lua_rawget(L, LUA_REGISTRYINDEX); /* context table */ | |
| 1027 | /* i think it is OK to use assume that using a light user data | |
| 1028 | ** as an entry on LUA REGISTRY table will be unique */ | |
| 1029 | lua_pushlightuserdata(L, p); | |
| 1030 | lua_rawget(L, LUA_REGISTRYINDEX); /* context table */ | |
| 1031 | 1031 | |
| 1032 | if (lua_isnil(L, -1)) { /* not yet created? - shouldn't happen in finalize function */ | |
| 1033 | lua_pop(L, 1); | |
| 1034 | ctx = lsqlite_make_context(L); | |
| 1035 | lua_pushlightuserdata(L, p); | |
| 1036 | lua_pushvalue(L, -2); | |
| 1037 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 1038 | } | |
| 1039 | else | |
| 1040 | ctx = lsqlite_getcontext(L, -1); | |
| 1032 | if (lua_isnil(L, -1)) { /* not yet created? - shouldn't happen in finalize function */ | |
| 1033 | lua_pop(L, 1); | |
| 1034 | ctx = lsqlite_make_context(L); | |
| 1035 | lua_pushlightuserdata(L, p); | |
| 1036 | lua_pushvalue(L, -2); | |
| 1037 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 1038 | } | |
| 1039 | else | |
| 1040 | ctx = lsqlite_getcontext(L, -1); | |
| 1041 | 1041 | |
| 1042 | /* set context */ | |
| 1043 | ctx->ctx = context; | |
| 1042 | /* set context */ | |
| 1043 | ctx->ctx = context; | |
| 1044 | 1044 | |
| 1045 | if (lua_pcall(L, 1, 0, 0)) { | |
| 1046 | sqlite3_result_error(context, lua_tostring(L, -1), -1); | |
| 1047 | } | |
| 1045 | if (lua_pcall(L, 1, 0, 0)) { | |
| 1046 | sqlite3_result_error(context, lua_tostring(L, -1), -1); | |
| 1047 | } | |
| 1048 | 1048 | |
| 1049 | /* invalidate context */ | |
| 1050 | ctx->ctx = NULL; | |
| 1049 | /* invalidate context */ | |
| 1050 | ctx->ctx = NULL; | |
| 1051 | 1051 | |
| 1052 | /* cleanup context */ | |
| 1053 | luaL_unref(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 1054 | /* remove it from registry */ | |
| 1055 | lua_pushlightuserdata(L, p); | |
| 1056 | lua_pushnil(L); | |
| 1057 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 1052 | /* cleanup context */ | |
| 1053 | luaL_unref(L, LUA_REGISTRYINDEX, ctx->ud); | |
| 1054 | /* remove it from registry */ | |
| 1055 | lua_pushlightuserdata(L, p); | |
| 1056 | lua_pushnil(L); | |
| 1057 | lua_rawset(L, LUA_REGISTRYINDEX); | |
| 1058 | 1058 | |
| 1059 | ||
| 1059 | lua_settop(L, top); | |
| 1060 | 1060 | } |
| 1061 | 1061 | |
| 1062 | 1062 | /* |
| r31373 | r31374 | |
| 1072 | 1072 | ** Params of finalize: context |
| 1073 | 1073 | */ |
| 1074 | 1074 | static int db_register_function(lua_State *L, int aggregate) { |
| 1075 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1076 | const char *name; | |
| 1077 | int args; | |
| 1078 | int result; | |
| 1079 | sdb_func *func; | |
| 1075 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1076 | const char *name; | |
| 1077 | int args; | |
| 1078 | int result; | |
| 1079 | sdb_func *func; | |
| 1080 | 1080 | |
| 1081 | /* safety measure */ | |
| 1082 | if (aggregate) aggregate = 1; | |
| 1081 | /* safety measure */ | |
| 1082 | if (aggregate) aggregate = 1; | |
| 1083 | 1083 | |
| 1084 | name = luaL_checkstring(L, 2); | |
| 1085 | args = luaL_checkint(L, 3); | |
| 1086 | luaL_checktype(L, 4, LUA_TFUNCTION); | |
| 1087 | if (aggregate) luaL_checktype(L, 5, LUA_TFUNCTION); | |
| 1084 | name = luaL_checkstring(L, 2); | |
| 1085 | args = luaL_checkint(L, 3); | |
| 1086 | luaL_checktype(L, 4, LUA_TFUNCTION); | |
| 1087 | if (aggregate) luaL_checktype(L, 5, LUA_TFUNCTION); | |
| 1088 | 1088 | |
| 1089 | /* maybe an alternative way to allocate memory should be used/avoided */ | |
| 1090 | func = (sdb_func*)malloc(sizeof(sdb_func)); | |
| 1091 | if (func == NULL) { | |
| 1092 | luaL_error(L, "out of memory"); | |
| 1093 | } | |
| 1089 | /* maybe an alternative way to allocate memory should be used/avoided */ | |
| 1090 | func = (sdb_func*)malloc(sizeof(sdb_func)); | |
| 1091 | if (func == NULL) { | |
| 1092 | luaL_error(L, "out of memory"); | |
| 1093 | } | |
| 1094 | 1094 | |
| 1095 | result = sqlite3_create_function( | |
| 1096 | db->db, name, args, SQLITE_UTF8, func, | |
| 1097 | aggregate ? NULL : db_sql_normal_function, | |
| 1098 | aggregate ? db_sql_normal_function : NULL, | |
| 1099 | aggregate ? db_sql_finalize_function : NULL | |
| 1100 | ); | |
| 1095 | result = sqlite3_create_function( | |
| 1096 | db->db, name, args, SQLITE_UTF8, func, | |
| 1097 | aggregate ? NULL : db_sql_normal_function, | |
| 1098 | aggregate ? db_sql_normal_function : NULL, | |
| 1099 | aggregate ? db_sql_finalize_function : NULL | |
| 1100 | ); | |
| 1101 | 1101 | |
| 1102 | if (result == SQLITE_OK) { | |
| 1103 | /* safety measures for userdata field to be present in the stack */ | |
| 1104 | lua_settop(L, 5 + aggregate); | |
| 1102 | if (result == SQLITE_OK) { | |
| 1103 | /* safety measures for userdata field to be present in the stack */ | |
| 1104 | lua_settop(L, 5 + aggregate); | |
| 1105 | 1105 | |
| 1106 | /* save registered function in db function list */ | |
| 1107 | func->db = db; | |
| 1108 | func->aggregate = aggregate; | |
| 1109 | func->next = db->func; | |
| 1110 | db->func = func; | |
| 1106 | /* save registered function in db function list */ | |
| 1107 | func->db = db; | |
| 1108 | func->aggregate = aggregate; | |
| 1109 | func->next = db->func; | |
| 1110 | db->func = func; | |
| 1111 | 1111 | |
| 1112 | /* save the setp/normal function callback */ | |
| 1113 | lua_pushvalue(L, 4); | |
| 1114 | func->fn_step = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1115 | /* save user data */ | |
| 1116 | lua_pushvalue(L, 5+aggregate); | |
| 1117 | func->udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1112 | /* save the setp/normal function callback */ | |
| 1113 | lua_pushvalue(L, 4); | |
| 1114 | func->fn_step = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1115 | /* save user data */ | |
| 1116 | lua_pushvalue(L, 5+aggregate); | |
| 1117 | func->udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1118 | 1118 | |
| 1119 | if (aggregate) { | |
| 1120 | lua_pushvalue(L, 5); | |
| 1121 | func->fn_finalize = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1122 | } | |
| 1123 | else | |
| 1124 | func->fn_finalize = LUA_NOREF; | |
| 1125 | } | |
| 1126 | else { | |
| 1127 | /* free allocated memory */ | |
| 1128 | free(func); | |
| 1129 | } | |
| 1119 | if (aggregate) { | |
| 1120 | lua_pushvalue(L, 5); | |
| 1121 | func->fn_finalize = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1122 | } | |
| 1123 | else | |
| 1124 | func->fn_finalize = LUA_NOREF; | |
| 1125 | } | |
| 1126 | else { | |
| 1127 | /* free allocated memory */ | |
| 1128 | free(func); | |
| 1129 | } | |
| 1130 | 1130 | |
| 1131 | lua_pushboolean(L, result == SQLITE_OK ? 1 : 0); | |
| 1132 | return 1; | |
| 1131 | lua_pushboolean(L, result == SQLITE_OK ? 1 : 0); | |
| 1132 | return 1; | |
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | static int db_create_function(lua_State *L) { |
| 1136 | ||
| 1136 | return db_register_function(L, 0); | |
| 1137 | 1137 | } |
| 1138 | 1138 | |
| 1139 | 1139 | static int db_create_aggregate(lua_State *L) { |
| 1140 | ||
| 1140 | return db_register_function(L, 1); | |
| 1141 | 1141 | } |
| 1142 | 1142 | |
| 1143 | 1143 | /* create_collation; contributed by Thomas Lauer |
| 1144 | 1144 | */ |
| 1145 | 1145 | |
| 1146 | 1146 | typedef struct { |
| 1147 | lua_State *L; | |
| 1148 | int ref; | |
| 1147 | lua_State *L; | |
| 1148 | int ref; | |
| 1149 | 1149 | } scc; |
| 1150 | 1150 | |
| 1151 | 1151 | static int collwrapper(scc *co,int l1,const void *p1, |
| 1152 | int l2,const void *p2) { | |
| 1153 | int res=0; | |
| 1154 | lua_State *L=co->L; | |
| 1155 | lua_rawgeti(L,LUA_REGISTRYINDEX,co->ref); | |
| 1156 | lua_pushlstring(L,(const char*)p1,l1); | |
| 1157 | lua_pushlstring(L,(const char*)p2,l2); | |
| 1158 | if (lua_pcall(L,2,1,0)==0) res=lua_tonumber(L,-1); | |
| 1159 | lua_pop(L,1); | |
| 1160 | return res; | |
| 1152 | int l2,const void *p2) { | |
| 1153 | int res=0; | |
| 1154 | lua_State *L=co->L; | |
| 1155 | lua_rawgeti(L,LUA_REGISTRYINDEX,co->ref); | |
| 1156 | lua_pushlstring(L,(const char*)p1,l1); | |
| 1157 | lua_pushlstring(L,(const char*)p2,l2); | |
| 1158 | if (lua_pcall(L,2,1,0)==0) res=lua_tonumber(L,-1); | |
| 1159 | lua_pop(L,1); | |
| 1160 | return res; | |
| 1161 | 1161 | } |
| 1162 | 1162 | |
| 1163 | 1163 | static void collfree(scc *co) { |
| 1164 | if (co) { | |
| 1165 | luaL_unref(co->L,LUA_REGISTRYINDEX,co->ref); | |
| 1166 | free(co); | |
| 1167 | } | |
| 1164 | if (co) { | |
| 1165 | luaL_unref(co->L,LUA_REGISTRYINDEX,co->ref); | |
| 1166 | free(co); | |
| 1167 | } | |
| 1168 | 1168 | } |
| 1169 | 1169 | |
| 1170 | 1170 | static int db_create_collation(lua_State *L) { |
| 1171 | sdb *db=lsqlite_checkdb(L,1); | |
| 1172 | const char *collname=luaL_checkstring(L,2); | |
| 1173 | scc *co=NULL; | |
| 1174 | int (*collfunc)(scc *,int,const void *,int,const void *)=NULL; | |
| 1175 | lua_settop(L,3); /* default args to nil, and exclude extras */ | |
| 1176 | if (lua_isfunction(L,3)) collfunc=collwrapper; | |
| 1177 | else if (!lua_isnil(L,3)) | |
| 1178 | luaL_error(L,"create_collation: function or nil expected"); | |
| 1179 | if (collfunc != NULL) { | |
| 1180 | co=(scc *)malloc(sizeof(scc)); /* userdata is a no-no as it | |
| 1171 | sdb *db=lsqlite_checkdb(L,1); | |
| 1172 | const char *collname=luaL_checkstring(L,2); | |
| 1173 | scc *co=NULL; | |
| 1174 | int (*collfunc)(scc *,int,const void *,int,const void *)=NULL; | |
| 1175 | lua_settop(L,3); /* default args to nil, and exclude extras */ | |
| 1176 | if (lua_isfunction(L,3)) collfunc=collwrapper; | |
| 1177 | else if (!lua_isnil(L,3)) | |
| 1178 | luaL_error(L,"create_collation: function or nil expected"); | |
| 1179 | if (collfunc != NULL) { | |
| 1180 | co=(scc *)malloc(sizeof(scc)); /* userdata is a no-no as it | |
| 1181 | 1181 | will be garbage-collected */ |
| 1182 | if (co) { | |
| 1183 | co->L=L; | |
| 1184 | /* lua_settop(L,3) above means we don't need: lua_pushvalue(L,3); */ | |
| 1185 | co->ref=luaL_ref(L,LUA_REGISTRYINDEX); | |
| 1186 | } | |
| 1187 | else luaL_error(L,"create_collation: could not allocate callback"); | |
| 1188 | } | |
| 1189 | sqlite3_create_collation_v2(db->db, collname, SQLITE_UTF8, | |
| 1190 | (void *)co, | |
| 1191 | (int(*)(void*,int,const void*,int,const void*))collfunc, | |
| 1192 | (void(*)(void*))collfree); | |
| 1193 | return 0; | |
| 1182 | if (co) { | |
| 1183 | co->L=L; | |
| 1184 | /* lua_settop(L,3) above means we don't need: lua_pushvalue(L,3); */ | |
| 1185 | co->ref=luaL_ref(L,LUA_REGISTRYINDEX); | |
| 1186 | } | |
| 1187 | else luaL_error(L,"create_collation: could not allocate callback"); | |
| 1188 | } | |
| 1189 | sqlite3_create_collation_v2(db->db, collname, SQLITE_UTF8, | |
| 1190 | (void *)co, | |
| 1191 | (int(*)(void*,int,const void*,int,const void*))collfunc, | |
| 1192 | (void(*)(void*))collfree); | |
| 1193 | return 0; | |
| 1194 | 1194 | } |
| 1195 | 1195 | |
| 1196 | 1196 | /* |
| r31373 | r31374 | |
| 1201 | 1201 | ** Params: userdata, sql |
| 1202 | 1202 | */ |
| 1203 | 1203 | static void db_trace_callback(void *user, const char *sql) { |
| 1204 | sdb *db = (sdb*)user; | |
| 1205 | lua_State *L = db->L; | |
| 1206 | int top = lua_gettop(L); | |
| 1204 | sdb *db = (sdb*)user; | |
| 1205 | lua_State *L = db->L; | |
| 1206 | int top = lua_gettop(L); | |
| 1207 | 1207 | |
| 1208 | /* setup lua callback call */ | |
| 1209 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->trace_cb); /* get callback */ | |
| 1210 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->trace_udata); /* get callback user data */ | |
| 1211 | lua_pushstring(L, sql); /* traced sql statement */ | |
| 1208 | /* setup lua callback call */ | |
| 1209 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->trace_cb); /* get callback */ | |
| 1210 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->trace_udata); /* get callback user data */ | |
| 1211 | lua_pushstring(L, sql); /* traced sql statement */ | |
| 1212 | 1212 | |
| 1213 | /* call lua function */ | |
| 1214 | lua_pcall(L, 2, 0, 0); | |
| 1215 | /* ignore any error generated by this function */ | |
| 1213 | /* call lua function */ | |
| 1214 | lua_pcall(L, 2, 0, 0); | |
| 1215 | /* ignore any error generated by this function */ | |
| 1216 | 1216 | |
| 1217 | ||
| 1217 | lua_settop(L, top); | |
| 1218 | 1218 | } |
| 1219 | 1219 | |
| 1220 | 1220 | static int db_trace(lua_State *L) { |
| 1221 | ||
| 1221 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1222 | 1222 | |
| 1223 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1224 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_cb); | |
| 1225 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_udata); | |
| 1223 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1224 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_cb); | |
| 1225 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_udata); | |
| 1226 | 1226 | |
| 1227 | db->trace_cb = | |
| 1228 | db->trace_udata = LUA_NOREF; | |
| 1227 | db->trace_cb = | |
| 1228 | db->trace_udata = LUA_NOREF; | |
| 1229 | 1229 | |
| 1230 | /* clear trace handler */ | |
| 1231 | sqlite3_trace(db->db, NULL, NULL); | |
| 1232 | } | |
| 1233 | else { | |
| 1234 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1230 | /* clear trace handler */ | |
| 1231 | sqlite3_trace(db->db, NULL, NULL); | |
| 1232 | } | |
| 1233 | else { | |
| 1234 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1235 | 1235 | |
| 1236 | /* make sure we have an userdata field (even if nil) */ | |
| 1237 | lua_settop(L, 3); | |
| 1236 | /* make sure we have an userdata field (even if nil) */ | |
| 1237 | lua_settop(L, 3); | |
| 1238 | 1238 | |
| 1239 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_cb); | |
| 1240 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_udata); | |
| 1239 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_cb); | |
| 1240 | luaL_unref(L, LUA_REGISTRYINDEX, db->trace_udata); | |
| 1241 | 1241 | |
| 1242 | db->trace_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1243 | db->trace_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1242 | db->trace_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1243 | db->trace_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1244 | 1244 | |
| 1245 | /* set trace handler */ | |
| 1246 | sqlite3_trace(db->db, db_trace_callback, db); | |
| 1247 | } | |
| 1245 | /* set trace handler */ | |
| 1246 | sqlite3_trace(db->db, db_trace_callback, db); | |
| 1247 | } | |
| 1248 | 1248 | |
| 1249 | ||
| 1249 | return 0; | |
| 1250 | 1250 | } |
| 1251 | 1251 | |
| 1252 | 1252 | #if !defined(LSQLITE_OMIT_UPDATE_HOOK) || !LSQLITE_OMIT_UPDATE_HOOK |
| r31373 | r31374 | |
| 1256 | 1256 | ** Params: database, callback function, userdata |
| 1257 | 1257 | ** |
| 1258 | 1258 | ** callback function: |
| 1259 | ** Params: userdata, {one of SQLITE_INSERT, SQLITE_DELETE, or SQLITE_UPDATE}, | |
| 1259 | ** Params: userdata, {one of SQLITE_INSERT, SQLITE_DELETE, or SQLITE_UPDATE}, | |
| 1260 | 1260 | ** database name, table name (containing the affected row), rowid of the row |
| 1261 | 1261 | */ |
| 1262 | 1262 | static void db_update_hook_callback(void *user, int op, char const *dbname, char const *tblname, sqlite3_int64 rowid) { |
| 1263 | sdb *db = (sdb*)user; | |
| 1264 | lua_State *L = db->L; | |
| 1265 | int top = lua_gettop(L); | |
| 1266 | lua_Number n; | |
| 1263 | sdb *db = (sdb*)user; | |
| 1264 | lua_State *L = db->L; | |
| 1265 | int top = lua_gettop(L); | |
| 1266 | lua_Number n; | |
| 1267 | 1267 | |
| 1268 | /* setup lua callback call */ | |
| 1269 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->update_hook_cb); /* get callback */ | |
| 1270 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->update_hook_udata); /* get callback user data */ | |
| 1271 | lua_pushnumber(L, (lua_Number )op); | |
| 1272 | lua_pushstring(L, dbname); /* update_hook database name */ | |
| 1273 | lua_pushstring(L, tblname); /* update_hook database name */ | |
| 1274 | n = (lua_Number)rowid; | |
| 1275 | if (n == rowid) | |
| 1276 | lua_pushnumber(L, n); | |
| 1277 | else | |
| 1278 | lua_pushfstring(L, "%ll", rowid); | |
| 1268 | /* setup lua callback call */ | |
| 1269 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->update_hook_cb); /* get callback */ | |
| 1270 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->update_hook_udata); /* get callback user data */ | |
| 1271 | lua_pushnumber(L, (lua_Number )op); | |
| 1272 | lua_pushstring(L, dbname); /* update_hook database name */ | |
| 1273 | lua_pushstring(L, tblname); /* update_hook database name */ | |
| 1274 | n = (lua_Number)rowid; | |
| 1275 | if (n == rowid) | |
| 1276 | lua_pushnumber(L, n); | |
| 1277 | else | |
| 1278 | lua_pushfstring(L, "%ll", rowid); | |
| 1279 | 1279 | |
| 1280 | /* call lua function */ | |
| 1281 | lua_pcall(L, 5, 0, 0); | |
| 1282 | /* ignore any error generated by this function */ | |
| 1280 | /* call lua function */ | |
| 1281 | lua_pcall(L, 5, 0, 0); | |
| 1282 | /* ignore any error generated by this function */ | |
| 1283 | 1283 | |
| 1284 | ||
| 1284 | lua_settop(L, top); | |
| 1285 | 1285 | } |
| 1286 | 1286 | |
| 1287 | 1287 | static int db_update_hook(lua_State *L) { |
| 1288 | ||
| 1288 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1289 | 1289 | |
| 1290 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1291 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_cb); | |
| 1292 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_udata); | |
| 1290 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1291 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_cb); | |
| 1292 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_udata); | |
| 1293 | 1293 | |
| 1294 | db->update_hook_cb = | |
| 1295 | db->update_hook_udata = LUA_NOREF; | |
| 1294 | db->update_hook_cb = | |
| 1295 | db->update_hook_udata = LUA_NOREF; | |
| 1296 | 1296 | |
| 1297 | /* clear update_hook handler */ | |
| 1298 | sqlite3_update_hook(db->db, NULL, NULL); | |
| 1299 | } | |
| 1300 | else { | |
| 1301 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1297 | /* clear update_hook handler */ | |
| 1298 | sqlite3_update_hook(db->db, NULL, NULL); | |
| 1299 | } | |
| 1300 | else { | |
| 1301 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1302 | 1302 | |
| 1303 | /* make sure we have an userdata field (even if nil) */ | |
| 1304 | lua_settop(L, 3); | |
| 1303 | /* make sure we have an userdata field (even if nil) */ | |
| 1304 | lua_settop(L, 3); | |
| 1305 | 1305 | |
| 1306 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_cb); | |
| 1307 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_udata); | |
| 1306 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_cb); | |
| 1307 | luaL_unref(L, LUA_REGISTRYINDEX, db->update_hook_udata); | |
| 1308 | 1308 | |
| 1309 | db->update_hook_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1310 | db->update_hook_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1309 | db->update_hook_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1310 | db->update_hook_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1311 | 1311 | |
| 1312 | /* set update_hook handler */ | |
| 1313 | sqlite3_update_hook(db->db, db_update_hook_callback, db); | |
| 1314 | } | |
| 1312 | /* set update_hook handler */ | |
| 1313 | sqlite3_update_hook(db->db, db_update_hook_callback, db); | |
| 1314 | } | |
| 1315 | 1315 | |
| 1316 | ||
| 1316 | return 0; | |
| 1317 | 1317 | } |
| 1318 | 1318 | |
| 1319 | 1319 | /* |
| r31373 | r31374 | |
| 1323 | 1323 | ** callback function: |
| 1324 | 1324 | ** Params: userdata |
| 1325 | 1325 | ** Returned value: Return false or nil to continue the COMMIT operation normally. |
| 1326 | ** return true (non false, non nil), then the COMMIT is converted into a ROLLBACK. | |
| 1326 | ** return true (non false, non nil), then the COMMIT is converted into a ROLLBACK. | |
| 1327 | 1327 | */ |
| 1328 | 1328 | static int db_commit_hook_callback(void *user) { |
| 1329 | sdb *db = (sdb*)user; | |
| 1330 | lua_State *L = db->L; | |
| 1331 | int top = lua_gettop(L); | |
| 1332 | int rollback = 0; | |
| 1329 | sdb *db = (sdb*)user; | |
| 1330 | lua_State *L = db->L; | |
| 1331 | int top = lua_gettop(L); | |
| 1332 | int rollback = 0; | |
| 1333 | 1333 | |
| 1334 | /* setup lua callback call */ | |
| 1335 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->commit_hook_cb); /* get callback */ | |
| 1336 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->commit_hook_udata); /* get callback user data */ | |
| 1334 | /* setup lua callback call */ | |
| 1335 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->commit_hook_cb); /* get callback */ | |
| 1336 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->commit_hook_udata); /* get callback user data */ | |
| 1337 | 1337 | |
| 1338 | /* call lua function */ | |
| 1339 | if (!lua_pcall(L, 1, 1, 0)) | |
| 1340 | rollback = lua_toboolean(L, -1); /* use result if there was no error */ | |
| 1338 | /* call lua function */ | |
| 1339 | if (!lua_pcall(L, 1, 1, 0)) | |
| 1340 | rollback = lua_toboolean(L, -1); /* use result if there was no error */ | |
| 1341 | 1341 | |
| 1342 | lua_settop(L, top); | |
| 1343 | return rollback; | |
| 1342 | lua_settop(L, top); | |
| 1343 | return rollback; | |
| 1344 | 1344 | } |
| 1345 | 1345 | |
| 1346 | 1346 | static int db_commit_hook(lua_State *L) { |
| 1347 | ||
| 1347 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1348 | 1348 | |
| 1349 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1350 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_cb); | |
| 1351 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_udata); | |
| 1349 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1350 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_cb); | |
| 1351 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_udata); | |
| 1352 | 1352 | |
| 1353 | db->commit_hook_cb = | |
| 1354 | db->commit_hook_udata = LUA_NOREF; | |
| 1353 | db->commit_hook_cb = | |
| 1354 | db->commit_hook_udata = LUA_NOREF; | |
| 1355 | 1355 | |
| 1356 | /* clear commit_hook handler */ | |
| 1357 | sqlite3_commit_hook(db->db, NULL, NULL); | |
| 1358 | } | |
| 1359 | else { | |
| 1360 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1356 | /* clear commit_hook handler */ | |
| 1357 | sqlite3_commit_hook(db->db, NULL, NULL); | |
| 1358 | } | |
| 1359 | else { | |
| 1360 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1361 | 1361 | |
| 1362 | /* make sure we have an userdata field (even if nil) */ | |
| 1363 | lua_settop(L, 3); | |
| 1362 | /* make sure we have an userdata field (even if nil) */ | |
| 1363 | lua_settop(L, 3); | |
| 1364 | 1364 | |
| 1365 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_cb); | |
| 1366 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_udata); | |
| 1365 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_cb); | |
| 1366 | luaL_unref(L, LUA_REGISTRYINDEX, db->commit_hook_udata); | |
| 1367 | 1367 | |
| 1368 | db->commit_hook_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1369 | db->commit_hook_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1368 | db->commit_hook_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1369 | db->commit_hook_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1370 | 1370 | |
| 1371 | /* set commit_hook handler */ | |
| 1372 | sqlite3_commit_hook(db->db, db_commit_hook_callback, db); | |
| 1373 | } | |
| 1371 | /* set commit_hook handler */ | |
| 1372 | sqlite3_commit_hook(db->db, db_commit_hook_callback, db); | |
| 1373 | } | |
| 1374 | 1374 | |
| 1375 | ||
| 1375 | return 0; | |
| 1376 | 1376 | } |
| 1377 | 1377 | |
| 1378 | 1378 | /* |
| r31373 | r31374 | |
| 1383 | 1383 | ** Params: userdata |
| 1384 | 1384 | */ |
| 1385 | 1385 | static void db_rollback_hook_callback(void *user) { |
| 1386 | sdb *db = (sdb*)user; | |
| 1387 | lua_State *L = db->L; | |
| 1388 | int top = lua_gettop(L); | |
| 1386 | sdb *db = (sdb*)user; | |
| 1387 | lua_State *L = db->L; | |
| 1388 | int top = lua_gettop(L); | |
| 1389 | 1389 | |
| 1390 | /* setup lua callback call */ | |
| 1391 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); /* get callback */ | |
| 1392 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); /* get callback user data */ | |
| 1390 | /* setup lua callback call */ | |
| 1391 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); /* get callback */ | |
| 1392 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); /* get callback user data */ | |
| 1393 | 1393 | |
| 1394 | /* call lua function */ | |
| 1395 | lua_pcall(L, 1, 0, 0); | |
| 1396 | /* ignore any error generated by this function */ | |
| 1394 | /* call lua function */ | |
| 1395 | lua_pcall(L, 1, 0, 0); | |
| 1396 | /* ignore any error generated by this function */ | |
| 1397 | 1397 | |
| 1398 | ||
| 1398 | lua_settop(L, top); | |
| 1399 | 1399 | } |
| 1400 | 1400 | |
| 1401 | 1401 | static int db_rollback_hook(lua_State *L) { |
| 1402 | ||
| 1402 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1403 | 1403 | |
| 1404 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1405 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); | |
| 1406 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); | |
| 1404 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1405 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); | |
| 1406 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); | |
| 1407 | 1407 | |
| 1408 | db->rollback_hook_cb = | |
| 1409 | db->rollback_hook_udata = LUA_NOREF; | |
| 1408 | db->rollback_hook_cb = | |
| 1409 | db->rollback_hook_udata = LUA_NOREF; | |
| 1410 | 1410 | |
| 1411 | /* clear rollback_hook handler */ | |
| 1412 | sqlite3_rollback_hook(db->db, NULL, NULL); | |
| 1413 | } | |
| 1414 | else { | |
| 1415 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1411 | /* clear rollback_hook handler */ | |
| 1412 | sqlite3_rollback_hook(db->db, NULL, NULL); | |
| 1413 | } | |
| 1414 | else { | |
| 1415 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1416 | 1416 | |
| 1417 | /* make sure we have an userdata field (even if nil) */ | |
| 1418 | lua_settop(L, 3); | |
| 1417 | /* make sure we have an userdata field (even if nil) */ | |
| 1418 | lua_settop(L, 3); | |
| 1419 | 1419 | |
| 1420 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); | |
| 1421 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); | |
| 1420 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_cb); | |
| 1421 | luaL_unref(L, LUA_REGISTRYINDEX, db->rollback_hook_udata); | |
| 1422 | 1422 | |
| 1423 | db->rollback_hook_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1424 | db->rollback_hook_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1423 | db->rollback_hook_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1424 | db->rollback_hook_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1425 | 1425 | |
| 1426 | /* set rollback_hook handler */ | |
| 1427 | sqlite3_rollback_hook(db->db, db_rollback_hook_callback, db); | |
| 1428 | } | |
| 1426 | /* set rollback_hook handler */ | |
| 1427 | sqlite3_rollback_hook(db->db, db_rollback_hook_callback, db); | |
| 1428 | } | |
| 1429 | 1429 | |
| 1430 | ||
| 1430 | return 0; | |
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | #endif /* #if !defined(LSQLITE_OMIT_UPDATE_HOOK) || !LSQLITE_OMIT_UPDATE_HOOK */ |
| r31373 | r31374 | |
| 1443 | 1443 | ** returns: 0 to return immediatly and return SQLITE_ABORT, non-zero to continue |
| 1444 | 1444 | */ |
| 1445 | 1445 | static int db_progress_callback(void *user) { |
| 1446 | int result = 1; /* abort by default */ | |
| 1447 | sdb *db = (sdb*)user; | |
| 1448 | lua_State *L = db->L; | |
| 1449 | int top = lua_gettop(L); | |
| 1446 | int result = 1; /* abort by default */ | |
| 1447 | sdb *db = (sdb*)user; | |
| 1448 | lua_State *L = db->L; | |
| 1449 | int top = lua_gettop(L); | |
| 1450 | 1450 | |
| 1451 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 1452 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 1451 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 1452 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 1453 | 1453 | |
| 1454 | /* call lua function */ | |
| 1455 | if (!lua_pcall(L, 1, 1, 0)) | |
| 1456 | result = lua_toboolean(L, -1); | |
| 1454 | /* call lua function */ | |
| 1455 | if (!lua_pcall(L, 1, 1, 0)) | |
| 1456 | result = lua_toboolean(L, -1); | |
| 1457 | 1457 | |
| 1458 | lua_settop(L, top); | |
| 1459 | return result; | |
| 1458 | lua_settop(L, top); | |
| 1459 | return result; | |
| 1460 | 1460 | } |
| 1461 | 1461 | |
| 1462 | 1462 | static int db_progress_handler(lua_State *L) { |
| 1463 | ||
| 1463 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1464 | 1464 | |
| 1465 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1466 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 1467 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 1465 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1466 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 1467 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 1468 | 1468 | |
| 1469 | db->progress_cb = | |
| 1470 | db->progress_udata = LUA_NOREF; | |
| 1469 | db->progress_cb = | |
| 1470 | db->progress_udata = LUA_NOREF; | |
| 1471 | 1471 | |
| 1472 | /* clear busy handler */ | |
| 1473 | sqlite3_progress_handler(db->db, 0, NULL, NULL); | |
| 1474 | } | |
| 1475 | else { | |
| 1476 | int nop = luaL_checkint(L, 2); /* number of opcodes */ | |
| 1477 | luaL_checktype(L, 3, LUA_TFUNCTION); | |
| 1472 | /* clear busy handler */ | |
| 1473 | sqlite3_progress_handler(db->db, 0, NULL, NULL); | |
| 1474 | } | |
| 1475 | else { | |
| 1476 | int nop = luaL_checkint(L, 2); /* number of opcodes */ | |
| 1477 | luaL_checktype(L, 3, LUA_TFUNCTION); | |
| 1478 | 1478 | |
| 1479 | /* make sure we have an userdata field (even if nil) */ | |
| 1480 | lua_settop(L, 4); | |
| 1479 | /* make sure we have an userdata field (even if nil) */ | |
| 1480 | lua_settop(L, 4); | |
| 1481 | 1481 | |
| 1482 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 1483 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 1482 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_cb); | |
| 1483 | luaL_unref(L, LUA_REGISTRYINDEX, db->progress_udata); | |
| 1484 | 1484 | |
| 1485 | db->progress_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1486 | db->progress_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1485 | db->progress_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1486 | db->progress_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1487 | 1487 | |
| 1488 | /* set progress callback */ | |
| 1489 | sqlite3_progress_handler(db->db, nop, db_progress_callback, db); | |
| 1490 | } | |
| 1488 | /* set progress callback */ | |
| 1489 | sqlite3_progress_handler(db->db, nop, db_progress_callback, db); | |
| 1490 | } | |
| 1491 | 1491 | |
| 1492 | ||
| 1492 | return 0; | |
| 1493 | 1493 | } |
| 1494 | 1494 | |
| 1495 | 1495 | #else /* #if !defined(SQLITE_OMIT_PROGRESS_CALLBACK) || !SQLITE_OMIT_PROGRESS_CALLBACK */ |
| 1496 | 1496 | |
| 1497 | 1497 | static int db_progress_handler(lua_State *L) { |
| 1498 | lua_pushliteral(L, "progress callback support disabled at compile time"); | |
| 1499 | lua_error(L); | |
| 1500 | return 0; | |
| 1498 | lua_pushliteral(L, "progress callback support disabled at compile time"); | |
| 1499 | lua_error(L); | |
| 1500 | return 0; | |
| 1501 | 1501 | } |
| 1502 | 1502 | |
| 1503 | 1503 | #endif /* #if !defined(SQLITE_OMIT_PROGRESS_CALLBACK) || !SQLITE_OMIT_PROGRESS_CALLBACK */ |
| r31373 | r31374 | |
| 1511 | 1511 | ** returns: 0 to return immediatly and return SQLITE_BUSY, non-zero to try again |
| 1512 | 1512 | */ |
| 1513 | 1513 | static int db_busy_callback(void *user, int tries) { |
| 1514 | int retry = 0; /* abort by default */ | |
| 1515 | sdb *db = (sdb*)user; | |
| 1516 | lua_State *L = db->L; | |
| 1517 | int top = lua_gettop(L); | |
| 1514 | int retry = 0; /* abort by default */ | |
| 1515 | sdb *db = (sdb*)user; | |
| 1516 | lua_State *L = db->L; | |
| 1517 | int top = lua_gettop(L); | |
| 1518 | 1518 | |
| 1519 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1520 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1521 | lua_pushnumber(L, tries); | |
| 1519 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1520 | lua_rawgeti(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1521 | lua_pushnumber(L, tries); | |
| 1522 | 1522 | |
| 1523 | /* call lua function */ | |
| 1524 | if (!lua_pcall(L, 2, 1, 0)) | |
| 1525 | retry = lua_toboolean(L, -1); | |
| 1523 | /* call lua function */ | |
| 1524 | if (!lua_pcall(L, 2, 1, 0)) | |
| 1525 | retry = lua_toboolean(L, -1); | |
| 1526 | 1526 | |
| 1527 | lua_settop(L, top); | |
| 1528 | return retry; | |
| 1527 | lua_settop(L, top); | |
| 1528 | return retry; | |
| 1529 | 1529 | } |
| 1530 | 1530 | |
| 1531 | 1531 | static int db_busy_handler(lua_State *L) { |
| 1532 | ||
| 1532 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1533 | 1533 | |
| 1534 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1535 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1536 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1534 | if (lua_gettop(L) < 2 || lua_isnil(L, 2)) { | |
| 1535 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1536 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1537 | 1537 | |
| 1538 | db->busy_cb = | |
| 1539 | db->busy_udata = LUA_NOREF; | |
| 1538 | db->busy_cb = | |
| 1539 | db->busy_udata = LUA_NOREF; | |
| 1540 | 1540 | |
| 1541 | /* clear busy handler */ | |
| 1542 | sqlite3_busy_handler(db->db, NULL, NULL); | |
| 1543 | } | |
| 1544 | else { | |
| 1545 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1546 | /* make sure we have an userdata field (even if nil) */ | |
| 1547 | lua_settop(L, 3); | |
| 1541 | /* clear busy handler */ | |
| 1542 | sqlite3_busy_handler(db->db, NULL, NULL); | |
| 1543 | } | |
| 1544 | else { | |
| 1545 | luaL_checktype(L, 2, LUA_TFUNCTION); | |
| 1546 | /* make sure we have an userdata field (even if nil) */ | |
| 1547 | lua_settop(L, 3); | |
| 1548 | 1548 | |
| 1549 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1550 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1549 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1550 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1551 | 1551 | |
| 1552 | db->busy_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1553 | db->busy_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1552 | db->busy_udata = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1553 | db->busy_cb = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 1554 | 1554 | |
| 1555 | /* set busy handler */ | |
| 1556 | sqlite3_busy_handler(db->db, db_busy_callback, db); | |
| 1557 | } | |
| 1555 | /* set busy handler */ | |
| 1556 | sqlite3_busy_handler(db->db, db_busy_callback, db); | |
| 1557 | } | |
| 1558 | 1558 | |
| 1559 | ||
| 1559 | return 0; | |
| 1560 | 1560 | } |
| 1561 | 1561 | |
| 1562 | 1562 | static int db_busy_timeout(lua_State *L) { |
| 1563 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1564 | int timeout = luaL_checkint(L, 2); | |
| 1565 | sqlite3_busy_timeout(db->db, timeout); | |
| 1563 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1564 | int timeout = luaL_checkint(L, 2); | |
| 1565 | sqlite3_busy_timeout(db->db, timeout); | |
| 1566 | 1566 | |
| 1567 | /* if there was a timeout callback registered, it is now | |
| 1568 | ** invalid/useless. free any references we may have */ | |
| 1569 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1570 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1571 | db->busy_cb = | |
| 1572 | db->busy_udata = LUA_NOREF; | |
| 1567 | /* if there was a timeout callback registered, it is now | |
| 1568 | ** invalid/useless. free any references we may have */ | |
| 1569 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_cb); | |
| 1570 | luaL_unref(L, LUA_REGISTRYINDEX, db->busy_udata); | |
| 1571 | db->busy_cb = | |
| 1572 | db->busy_udata = LUA_NOREF; | |
| 1573 | 1573 | |
| 1574 | ||
| 1574 | return 0; | |
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | /* |
| r31373 | r31374 | |
| 1583 | 1583 | ** Returns: 0 to continue, other value will cause abort |
| 1584 | 1584 | */ |
| 1585 | 1585 | static int db_exec_callback(void* user, int columns, char **data, char **names) { |
| 1586 | int result = SQLITE_ABORT; /* abort by default */ | |
| 1587 | lua_State *L = (lua_State*)user; | |
| 1588 | int n; | |
| 1586 | int result = SQLITE_ABORT; /* abort by default */ | |
| 1587 | lua_State *L = (lua_State*)user; | |
| 1588 | int n; | |
| 1589 | 1589 | |
| 1590 | ||
| 1590 | int top = lua_gettop(L); | |
| 1591 | 1591 | |
| 1592 | lua_pushvalue(L, 3); /* function to call */ | |
| 1593 | lua_pushvalue(L, 4); /* user data */ | |
| 1594 | lua_pushnumber(L, columns); /* total number of rows in result */ | |
| 1592 | lua_pushvalue(L, 3); /* function to call */ | |
| 1593 | lua_pushvalue(L, 4); /* user data */ | |
| 1594 | lua_pushnumber(L, columns); /* total number of rows in result */ | |
| 1595 | 1595 | |
| 1596 | /* column values */ | |
| 1597 | lua_pushvalue(L, 6); | |
| 1598 | for (n = 0; n < columns;) { | |
| 1599 | lua_pushstring(L, data[n++]); | |
| 1600 | lua_rawseti(L, -2, n); | |
| 1601 | } | |
| 1596 | /* column values */ | |
| 1597 | lua_pushvalue(L, 6); | |
| 1598 | for (n = 0; n < columns;) { | |
| 1599 | lua_pushstring(L, data[n++]); | |
| 1600 | lua_rawseti(L, -2, n); | |
| 1601 | } | |
| 1602 | 1602 | |
| 1603 | /* columns names */ | |
| 1604 | lua_pushvalue(L, 5); | |
| 1605 | if (lua_isnil(L, -1)) { | |
| 1606 | lua_pop(L, 1); | |
| 1607 | lua_newtable(L); | |
| 1608 | lua_pushvalue(L, -1); | |
| 1609 | lua_replace(L, 5); | |
| 1610 | for (n = 0; n < columns;) { | |
| 1611 | lua_pushstring(L, names[n++]); | |
| 1612 | lua_rawseti(L, -2, n); | |
| 1613 | } | |
| 1614 | } | |
| 1603 | /* columns names */ | |
| 1604 | lua_pushvalue(L, 5); | |
| 1605 | if (lua_isnil(L, -1)) { | |
| 1606 | lua_pop(L, 1); | |
| 1607 | lua_newtable(L); | |
| 1608 | lua_pushvalue(L, -1); | |
| 1609 | lua_replace(L, 5); | |
| 1610 | for (n = 0; n < columns;) { | |
| 1611 | lua_pushstring(L, names[n++]); | |
| 1612 | lua_rawseti(L, -2, n); | |
| 1613 | } | |
| 1614 | } | |
| 1615 | 1615 | |
| 1616 | /* call lua function */ | |
| 1617 | if (!lua_pcall(L, 4, 1, 0)) { | |
| 1618 | if (lua_isnumber(L, -1)) | |
| 1619 | result = lua_tonumber(L, -1); | |
| 1620 | } | |
| 1616 | /* call lua function */ | |
| 1617 | if (!lua_pcall(L, 4, 1, 0)) { | |
| 1618 | if (lua_isnumber(L, -1)) | |
| 1619 | result = lua_tonumber(L, -1); | |
| 1620 | } | |
| 1621 | 1621 | |
| 1622 | lua_settop(L, top); | |
| 1623 | return result; | |
| 1622 | lua_settop(L, top); | |
| 1623 | return result; | |
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 | static int db_exec(lua_State *L) { |
| 1627 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1628 | const char *sql = luaL_checkstring(L, 2); | |
| 1629 | int result; | |
| 1627 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1628 | const char *sql = luaL_checkstring(L, 2); | |
| 1629 | int result; | |
| 1630 | 1630 | |
| 1631 | if (!lua_isnoneornil(L, 3)) { | |
| 1632 | /* stack: | |
| 1633 | ** 3: callback function | |
| 1634 | ** 4: userdata | |
| 1635 | ** 5: column names | |
| 1636 | ** 6: reusable column values | |
| 1637 | */ | |
| 1638 | luaL_checktype(L, 3, LUA_TFUNCTION); | |
| 1639 | lua_settop(L, 4); /* 'trap' userdata - nil extra parameters */ | |
| 1640 | lua_pushnil(L); /* column names not known at this point */ | |
| 1641 | lua_newtable(L); /* column values table */ | |
| 1631 | if (!lua_isnoneornil(L, 3)) { | |
| 1632 | /* stack: | |
| 1633 | ** 3: callback function | |
| 1634 | ** 4: userdata | |
| 1635 | ** 5: column names | |
| 1636 | ** 6: reusable column values | |
| 1637 | */ | |
| 1638 | luaL_checktype(L, 3, LUA_TFUNCTION); | |
| 1639 | lua_settop(L, 4); /* 'trap' userdata - nil extra parameters */ | |
| 1640 | lua_pushnil(L); /* column names not known at this point */ | |
| 1641 | lua_newtable(L); /* column values table */ | |
| 1642 | 1642 | |
| 1643 | result = sqlite3_exec(db->db, sql, db_exec_callback, L, NULL); | |
| 1644 | } | |
| 1645 | else { | |
| 1646 | /* no callbacks */ | |
| 1647 | result = sqlite3_exec(db->db, sql, NULL, NULL, NULL); | |
| 1648 | } | |
| 1643 | result = sqlite3_exec(db->db, sql, db_exec_callback, L, NULL); | |
| 1644 | } | |
| 1645 | else { | |
| 1646 | /* no callbacks */ | |
| 1647 | result = sqlite3_exec(db->db, sql, NULL, NULL, NULL); | |
| 1648 | } | |
| 1649 | 1649 | |
| 1650 | lua_pushnumber(L, result); | |
| 1651 | return 1; | |
| 1650 | lua_pushnumber(L, result); | |
| 1651 | return 1; | |
| 1652 | 1652 | } |
| 1653 | 1653 | |
| 1654 | 1654 | /* |
| r31373 | r31374 | |
| 1656 | 1656 | ** returns: code, compiled length or error message |
| 1657 | 1657 | */ |
| 1658 | 1658 | static int db_prepare(lua_State *L) { |
| 1659 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1660 | const char *sql = luaL_checkstring(L, 2); | |
| 1661 | int sql_len = lua_strlen(L, 2); | |
| 1662 | const char *sqltail; | |
| 1663 | sdb_vm *svm; | |
| 1664 | lua_settop(L,2); /* sql is on top of stack for call to newvm */ | |
| 1665 | svm = newvm(L, db); | |
| 1659 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1660 | const char *sql = luaL_checkstring(L, 2); | |
| 1661 | int sql_len = lua_strlen(L, 2); | |
| 1662 | const char *sqltail; | |
| 1663 | sdb_vm *svm; | |
| 1664 | lua_settop(L,2); /* sql is on top of stack for call to newvm */ | |
| 1665 | svm = newvm(L, db); | |
| 1666 | 1666 | |
| 1667 | if (sqlite3_prepare(db->db, sql, sql_len, &svm->vm, &sqltail) != SQLITE_OK) { | |
| 1668 | cleanupvm(L, svm); | |
| 1667 | if (sqlite3_prepare(db->db, sql, sql_len, &svm->vm, &sqltail) != SQLITE_OK) { | |
| 1668 | cleanupvm(L, svm); | |
| 1669 | 1669 | |
| 1670 | lua_pushnil(L); | |
| 1671 | lua_pushnumber(L, sqlite3_errcode(db->db)); | |
| 1672 | return 2; | |
| 1673 | } | |
| 1670 | lua_pushnil(L); | |
| 1671 | lua_pushnumber(L, sqlite3_errcode(db->db)); | |
| 1672 | return 2; | |
| 1673 | } | |
| 1674 | 1674 | |
| 1675 | /* vm already in the stack */ | |
| 1676 | lua_pushstring(L, sqltail); | |
| 1677 | return 2; | |
| 1675 | /* vm already in the stack */ | |
| 1676 | lua_pushstring(L, sqltail); | |
| 1677 | return 2; | |
| 1678 | 1678 | } |
| 1679 | 1679 | |
| 1680 | 1680 | static int db_do_next_row(lua_State *L, int packed) { |
| 1681 | int result; | |
| 1682 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 1683 | sqlite3_stmt *vm; | |
| 1684 | int columns; | |
| 1685 | int i; | |
| 1681 | int result; | |
| 1682 | sdb_vm *svm = lsqlite_checkvm(L, 1); | |
| 1683 | sqlite3_stmt *vm; | |
| 1684 | int columns; | |
| 1685 | int i; | |
| 1686 | 1686 | |
| 1687 | result = stepvm(L, svm); | |
| 1688 | vm = svm->vm; /* stepvm may change svm->vm if re-prepare is needed */ | |
| 1689 | svm->has_values = result == SQLITE_ROW ? 1 : 0; | |
| 1690 | svm->columns = columns = sqlite3_data_count(vm); | |
| 1687 | result = stepvm(L, svm); | |
| 1688 | vm = svm->vm; /* stepvm may change svm->vm if re-prepare is needed */ | |
| 1689 | svm->has_values = result == SQLITE_ROW ? 1 : 0; | |
| 1690 | svm->columns = columns = sqlite3_data_count(vm); | |
| 1691 | 1691 | |
| 1692 | if (result == SQLITE_ROW) { | |
| 1693 | if (packed) { | |
| 1694 | lua_newtable(L); | |
| 1695 | if (packed == 1) { | |
| 1696 | for (i = 0; i < columns;) { | |
| 1697 | vm_push_column(L, vm, i); | |
| 1698 | lua_rawseti(L, -2, ++i); | |
| 1699 | } | |
| 1700 | } | |
| 1701 | else { | |
| 1702 | for (i = 0; i < columns; ++i) { | |
| 1703 | lua_pushstring(L, sqlite3_column_name(vm, i)); | |
| 1704 | vm_push_column(L, vm, i); | |
| 1705 | lua_rawset(L, -3); | |
| 1706 | } | |
| 1707 | } | |
| 1708 | return 1; | |
| 1709 | } | |
| 1710 | else { | |
| 1711 | lua_checkstack(L, columns); | |
| 1712 | for (i = 0; i < columns; ++i) | |
| 1713 | vm_push_column(L, vm, i); | |
| 1714 | return svm->columns; | |
| 1715 | } | |
| 1716 | } | |
| 1692 | if (result == SQLITE_ROW) { | |
| 1693 | if (packed) { | |
| 1694 | lua_newtable(L); | |
| 1695 | if (packed == 1) { | |
| 1696 | for (i = 0; i < columns;) { | |
| 1697 | vm_push_column(L, vm, i); | |
| 1698 | lua_rawseti(L, -2, ++i); | |
| 1699 | } | |
| 1700 | } | |
| 1701 | else { | |
| 1702 | for (i = 0; i < columns; ++i) { | |
| 1703 | lua_pushstring(L, sqlite3_column_name(vm, i)); | |
| 1704 | vm_push_column(L, vm, i); | |
| 1705 | lua_rawset(L, -3); | |
| 1706 | } | |
| 1707 | } | |
| 1708 | return 1; | |
| 1709 | } | |
| 1710 | else { | |
| 1711 | lua_checkstack(L, columns); | |
| 1712 | for (i = 0; i < columns; ++i) | |
| 1713 | vm_push_column(L, vm, i); | |
| 1714 | return svm->columns; | |
| 1715 | } | |
| 1716 | } | |
| 1717 | 1717 | |
| 1718 | if (svm->temp) { | |
| 1719 | /* finalize and check for errors */ | |
| 1720 | result = sqlite3_finalize(vm); | |
| 1721 | svm->vm = NULL; | |
| 1722 | cleanupvm(L, svm); | |
| 1723 | } | |
| 1724 | else if (result == SQLITE_DONE) { | |
| 1725 | result = sqlite3_reset(vm); | |
| 1726 | } | |
| 1718 | if (svm->temp) { | |
| 1719 | /* finalize and check for errors */ | |
| 1720 | result = sqlite3_finalize(vm); | |
| 1721 | svm->vm = NULL; | |
| 1722 | cleanupvm(L, svm); | |
| 1723 | } | |
| 1724 | else if (result == SQLITE_DONE) { | |
| 1725 | result = sqlite3_reset(vm); | |
| 1726 | } | |
| 1727 | 1727 | |
| 1728 | if (result != SQLITE_OK) { | |
| 1729 | lua_pushstring(L, sqlite3_errmsg(svm->db->db)); | |
| 1730 | lua_error(L); | |
| 1731 | } | |
| 1732 | return 0; | |
| 1728 | if (result != SQLITE_OK) { | |
| 1729 | lua_pushstring(L, sqlite3_errmsg(svm->db->db)); | |
| 1730 | lua_error(L); | |
| 1731 | } | |
| 1732 | return 0; | |
| 1733 | 1733 | } |
| 1734 | 1734 | |
| 1735 | 1735 | static int db_next_row(lua_State *L) { |
| 1736 | ||
| 1736 | return db_do_next_row(L, 0); | |
| 1737 | 1737 | } |
| 1738 | 1738 | |
| 1739 | 1739 | static int db_next_packed_row(lua_State *L) { |
| 1740 | ||
| 1740 | return db_do_next_row(L, 1); | |
| 1741 | 1741 | } |
| 1742 | 1742 | |
| 1743 | 1743 | static int db_next_named_row(lua_State *L) { |
| 1744 | ||
| 1744 | return db_do_next_row(L, 2); | |
| 1745 | 1745 | } |
| 1746 | 1746 | |
| 1747 | 1747 | static int dbvm_do_rows(lua_State *L, int(*f)(lua_State *)) { |
| 1748 | /* sdb_vm *svm = */ | |
| 1749 | lsqlite_checkvm(L, 1); | |
| 1750 | lua_pushvalue(L,1); | |
| 1751 | lua_pushcfunction(L, f); | |
| 1752 | lua_insert(L, -2); | |
| 1753 | return 2; | |
| 1748 | /* sdb_vm *svm = */ | |
| 1749 | lsqlite_checkvm(L, 1); | |
| 1750 | lua_pushvalue(L,1); | |
| 1751 | lua_pushcfunction(L, f); | |
| 1752 | lua_insert(L, -2); | |
| 1753 | return 2; | |
| 1754 | 1754 | } |
| 1755 | 1755 | |
| 1756 | 1756 | static int dbvm_rows(lua_State *L) { |
| 1757 | ||
| 1757 | return dbvm_do_rows(L, db_next_packed_row); | |
| 1758 | 1758 | } |
| 1759 | 1759 | |
| 1760 | 1760 | static int dbvm_nrows(lua_State *L) { |
| 1761 | ||
| 1761 | return dbvm_do_rows(L, db_next_named_row); | |
| 1762 | 1762 | } |
| 1763 | 1763 | |
| 1764 | 1764 | static int dbvm_urows(lua_State *L) { |
| 1765 | ||
| 1765 | return dbvm_do_rows(L, db_next_row); | |
| 1766 | 1766 | } |
| 1767 | 1767 | |
| 1768 | 1768 | static int db_do_rows(lua_State *L, int(*f)(lua_State *)) { |
| 1769 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1770 | const char *sql = luaL_checkstring(L, 2); | |
| 1771 | sdb_vm *svm; | |
| 1772 | lua_settop(L,2); /* sql is on top of stack for call to newvm */ | |
| 1773 | svm = newvm(L, db); | |
| 1774 | svm->temp = 1; | |
| 1769 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1770 | const char *sql = luaL_checkstring(L, 2); | |
| 1771 | sdb_vm *svm; | |
| 1772 | lua_settop(L,2); /* sql is on top of stack for call to newvm */ | |
| 1773 | svm = newvm(L, db); | |
| 1774 | svm->temp = 1; | |
| 1775 | 1775 | |
| 1776 | if (sqlite3_prepare(db->db, sql, -1, &svm->vm, NULL) != SQLITE_OK) { | |
| 1777 | cleanupvm(L, svm); | |
| 1776 | if (sqlite3_prepare(db->db, sql, -1, &svm->vm, NULL) != SQLITE_OK) { | |
| 1777 | cleanupvm(L, svm); | |
| 1778 | 1778 | |
| 1779 | lua_pushstring(L, sqlite3_errmsg(svm->db->db)); | |
| 1780 | lua_error(L); | |
| 1781 | } | |
| 1779 | lua_pushstring(L, sqlite3_errmsg(svm->db->db)); | |
| 1780 | lua_error(L); | |
| 1781 | } | |
| 1782 | 1782 | |
| 1783 | lua_pushcfunction(L, f); | |
| 1784 | lua_insert(L, -2); | |
| 1785 | return 2; | |
| 1783 | lua_pushcfunction(L, f); | |
| 1784 | lua_insert(L, -2); | |
| 1785 | return 2; | |
| 1786 | 1786 | } |
| 1787 | 1787 | |
| 1788 | 1788 | static int db_rows(lua_State *L) { |
| 1789 | ||
| 1789 | return db_do_rows(L, db_next_packed_row); | |
| 1790 | 1790 | } |
| 1791 | 1791 | |
| 1792 | 1792 | static int db_nrows(lua_State *L) { |
| 1793 | ||
| 1793 | return db_do_rows(L, db_next_named_row); | |
| 1794 | 1794 | } |
| 1795 | 1795 | |
| 1796 | 1796 | /* unpacked version of db:rows */ |
| 1797 | 1797 | static int db_urows(lua_State *L) { |
| 1798 | ||
| 1798 | return db_do_rows(L, db_next_row); | |
| 1799 | 1799 | } |
| 1800 | 1800 | |
| 1801 | 1801 | static int db_tostring(lua_State *L) { |
| 1802 | char buff[32]; | |
| 1803 | sdb *db = lsqlite_getdb(L, 1); | |
| 1804 | if (db->db == NULL) | |
| 1805 | strcpy(buff, "closed"); | |
| 1806 | else | |
| 1807 | sprintf(buff, "%p", lua_touserdata(L, 1)); | |
| 1808 | lua_pushfstring(L, "sqlite database (%s)", buff); | |
| 1809 | return 1; | |
| 1802 | char buff[32]; | |
| 1803 | sdb *db = lsqlite_getdb(L, 1); | |
| 1804 | if (db->db == NULL) | |
| 1805 | strcpy(buff, "closed"); | |
| 1806 | else | |
| 1807 | sprintf(buff, "%p", lua_touserdata(L, 1)); | |
| 1808 | lua_pushfstring(L, "sqlite database (%s)", buff); | |
| 1809 | return 1; | |
| 1810 | 1810 | } |
| 1811 | 1811 | |
| 1812 | 1812 | static int db_close(lua_State *L) { |
| 1813 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1814 | lua_pushnumber(L, cleanupdb(L, db)); | |
| 1815 | return 1; | |
| 1813 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1814 | lua_pushnumber(L, cleanupdb(L, db)); | |
| 1815 | return 1; | |
| 1816 | 1816 | } |
| 1817 | 1817 | |
| 1818 | 1818 | static int db_close_vm(lua_State *L) { |
| 1819 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1820 | /* cleanup temporary only tables? */ | |
| 1821 | int temp = lua_toboolean(L, 2); | |
| 1819 | sdb *db = lsqlite_checkdb(L, 1); | |
| 1820 | /* cleanup temporary only tables? */ | |
| 1821 | int temp = lua_toboolean(L, 2); | |
| 1822 | 1822 | |
| 1823 | /* free associated virtual machines */ | |
| 1824 | lua_pushlightuserdata(L, db); | |
| 1825 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 1823 | /* free associated virtual machines */ | |
| 1824 | lua_pushlightuserdata(L, db); | |
| 1825 | lua_rawget(L, LUA_REGISTRYINDEX); | |
| 1826 | 1826 | |
| 1827 | /* close all used handles */ | |
| 1828 | lua_pushnil(L); | |
| 1829 | while (lua_next(L, -2)) { | |
| 1830 | sdb_vm *svm = (sdb_vm *)lua_touserdata(L, -2); /* key: vm; val: sql text */ | |
| 1827 | /* close all used handles */ | |
| 1828 | lua_pushnil(L); | |
| 1829 | while (lua_next(L, -2)) { | |
| 1830 | sdb_vm *svm = (sdb_vm *)lua_touserdata(L, -2); /* key: vm; val: sql text */ | |
| 1831 | 1831 | |
| 1832 | if ((!temp || svm->temp) && svm->vm) | |
| 1833 | { | |
| 1834 | sqlite3_finalize(svm->vm); | |
| 1835 | svm->vm = NULL; | |
| 1836 | } | |
| 1832 | if ((!temp || svm->temp) && svm->vm) | |
| 1833 | { | |
| 1834 | sqlite3_finalize(svm->vm); | |
| 1835 | svm->vm = NULL; | |
| 1836 | } | |
| 1837 | 1837 | |
| 1838 | /* leave key in the stack */ | |
| 1839 | lua_pop(L, 1); | |
| 1840 | } | |
| 1841 | return 0; | |
| 1838 | /* leave key in the stack */ | |
| 1839 | lua_pop(L, 1); | |
| 1840 | } | |
| 1841 | return 0; | |
| 1842 | 1842 | } |
| 1843 | 1843 | |
| 1844 | 1844 | static int db_gc(lua_State *L) { |
| 1845 | sdb *db = lsqlite_getdb(L, 1); | |
| 1846 | if (db->db != NULL) /* ignore closed databases */ | |
| 1847 | cleanupdb(L, db); | |
| 1848 | return 0; | |
| 1845 | sdb *db = lsqlite_getdb(L, 1); | |
| 1846 | if (db->db != NULL) /* ignore closed databases */ | |
| 1847 | cleanupdb(L, db); | |
| 1848 | return 0; | |
| 1849 | 1849 | } |
| 1850 | 1850 | |
| 1851 | 1851 | /* |
| r31373 | r31374 | |
| 1855 | 1855 | */ |
| 1856 | 1856 | |
| 1857 | 1857 | static int lsqlite_version(lua_State *L) { |
| 1858 | lua_pushstring(L, sqlite3_libversion()); | |
| 1859 | return 1; | |
| 1858 | lua_pushstring(L, sqlite3_libversion()); | |
| 1859 | return 1; | |
| 1860 | 1860 | } |
| 1861 | 1861 | |
| 1862 | 1862 | static int lsqlite_complete(lua_State *L) { |
| 1863 | const char *sql = luaL_checkstring(L, 1); | |
| 1864 | lua_pushboolean(L, sqlite3_complete(sql)); | |
| 1865 | return 1; | |
| 1863 | const char *sql = luaL_checkstring(L, 1); | |
| 1864 | lua_pushboolean(L, sqlite3_complete(sql)); | |
| 1865 | return 1; | |
| 1866 | 1866 | } |
| 1867 | 1867 | |
| 1868 | 1868 | #ifndef WIN32 |
| 1869 | 1869 | static int lsqlite_temp_directory(lua_State *L) { |
| 1870 | ||
| 1870 | const char *oldtemp = sqlite3_temp_directory; | |
| 1871 | 1871 | |
| 1872 | if (!lua_isnone(L, 1)) { | |
| 1873 | const char *temp = luaL_optstring(L, 1, NULL); | |
| 1874 | if (sqlite3_temp_directory) { | |
| 1875 | sqlite3_free((char*)sqlite3_temp_directory); | |
| 1876 | } | |
| 1877 | if (temp) { | |
| 1878 | sqlite3_temp_directory = sqlite3_mprintf("%s", temp); | |
| 1879 | } | |
| 1880 | else { | |
| 1881 | sqlite3_temp_directory = NULL; | |
| 1882 | } | |
| 1883 | } | |
| 1884 | lua_pushstring(L, oldtemp); | |
| 1885 | return 1; | |
| 1872 | if (!lua_isnone(L, 1)) { | |
| 1873 | const char *temp = luaL_optstring(L, 1, NULL); | |
| 1874 | if (sqlite3_temp_directory) { | |
| 1875 | sqlite3_free((char*)sqlite3_temp_directory); | |
| 1876 | } | |
| 1877 | if (temp) { | |
| 1878 | sqlite3_temp_directory = sqlite3_mprintf("%s", temp); | |
| 1879 | } | |
| 1880 | else { | |
| 1881 | sqlite3_temp_directory = NULL; | |
| 1882 | } | |
| 1883 | } | |
| 1884 | lua_pushstring(L, oldtemp); | |
| 1885 | return 1; | |
| 1886 | 1886 | } |
| 1887 | 1887 | #endif |
| 1888 | 1888 | |
| 1889 | 1889 | static int lsqlite_do_open(lua_State *L, const char *filename) { |
| 1890 | ||
| 1890 | sdb *db = newdb(L); /* create and leave in stack */ | |
| 1891 | 1891 | |
| 1892 | if (sqlite3_open(filename, &db->db) == SQLITE_OK) { | |
| 1893 | /* database handle already in the stack - return it */ | |
| 1894 | return 1; | |
| 1895 | } | |
| 1892 | if (sqlite3_open(filename, &db->db) == SQLITE_OK) { | |
| 1893 | /* database handle already in the stack - return it */ | |
| 1894 | return 1; | |
| 1895 | } | |
| 1896 | 1896 | |
| 1897 | /* failed to open database */ | |
| 1898 | lua_pushnil(L); /* push nil */ | |
| 1899 | lua_pushnumber(L, sqlite3_errcode(db->db)); | |
| 1900 | lua_pushstring(L, sqlite3_errmsg(db->db)); /* push error message */ | |
| 1897 | /* failed to open database */ | |
| 1898 | lua_pushnil(L); /* push nil */ | |
| 1899 | lua_pushnumber(L, sqlite3_errcode(db->db)); | |
| 1900 | lua_pushstring(L, sqlite3_errmsg(db->db)); /* push error message */ | |
| 1901 | 1901 | |
| 1902 | /* clean things up */ | |
| 1903 | cleanupdb(L, db); | |
| 1902 | /* clean things up */ | |
| 1903 | cleanupdb(L, db); | |
| 1904 | 1904 | |
| 1905 | /* return */ | |
| 1906 | return 3; | |
| 1905 | /* return */ | |
| 1906 | return 3; | |
| 1907 | 1907 | } |
| 1908 | 1908 | |
| 1909 | 1909 | static int lsqlite_open(lua_State *L) { |
| 1910 | const char *filename = luaL_checkstring(L, 1); | |
| 1911 | return lsqlite_do_open(L, filename); | |
| 1910 | const char *filename = luaL_checkstring(L, 1); | |
| 1911 | return lsqlite_do_open(L, filename); | |
| 1912 | 1912 | } |
| 1913 | 1913 | |
| 1914 | 1914 | static int lsqlite_open_memory(lua_State *L) { |
| 1915 | ||
| 1915 | return lsqlite_do_open(L, ":memory:"); | |
| 1916 | 1916 | } |
| 1917 | 1917 | |
| 1918 | 1918 | static int lsqlite_newindex(lua_State *L) { |
| 1919 | lua_pushliteral(L, "attempt to change readonly table"); | |
| 1920 | lua_error(L); | |
| 1921 | return 0; | |
| 1919 | lua_pushliteral(L, "attempt to change readonly table"); | |
| 1920 | lua_error(L); | |
| 1921 | return 0; | |
| 1922 | 1922 | } |
| 1923 | 1923 | |
| 1924 | 1924 | /* |
| r31373 | r31374 | |
| 1931 | 1931 | #define LSC(s) { #s, LSQLITE_ ## s }, |
| 1932 | 1932 | |
| 1933 | 1933 | static const struct { |
| 1934 | const char* name; | |
| 1935 | int value; | |
| 1934 | const char* name; | |
| 1935 | int value; | |
| 1936 | 1936 | } sqlite_constants[] = { |
| 1937 | /* error codes */ | |
| 1938 | SC(OK) SC(ERROR) SC(INTERNAL) SC(PERM) | |
| 1939 | SC(ABORT) SC(BUSY) SC(LOCKED) SC(NOMEM) | |
| 1940 | SC(READONLY) SC(INTERRUPT) SC(IOERR) SC(CORRUPT) | |
| 1941 | SC(NOTFOUND) SC(FULL) SC(CANTOPEN) SC(PROTOCOL) | |
| 1942 | SC(EMPTY) SC(SCHEMA) SC(TOOBIG) SC(CONSTRAINT) | |
| 1943 | SC(MISMATCH) SC(MISUSE) SC(NOLFS) | |
| 1944 | SC(FORMAT) SC(NOTADB) | |
| 1937 | /* error codes */ | |
| 1938 | SC(OK) SC(ERROR) SC(INTERNAL) SC(PERM) | |
| 1939 | SC(ABORT) SC(BUSY) SC(LOCKED) SC(NOMEM) | |
| 1940 | SC(READONLY) SC(INTERRUPT) SC(IOERR) SC(CORRUPT) | |
| 1941 | SC(NOTFOUND) SC(FULL) SC(CANTOPEN) SC(PROTOCOL) | |
| 1942 | SC(EMPTY) SC(SCHEMA) SC(TOOBIG) SC(CONSTRAINT) | |
| 1943 | SC(MISMATCH) SC(MISUSE) SC(NOLFS) | |
| 1944 | SC(FORMAT) SC(NOTADB) | |
| 1945 | 1945 | |
| 1946 | /* sqlite_step specific return values */ | |
| 1947 | SC(RANGE) SC(ROW) SC(DONE) | |
| 1946 | /* sqlite_step specific return values */ | |
| 1947 | SC(RANGE) SC(ROW) SC(DONE) | |
| 1948 | 1948 | |
| 1949 | /* column types */ | |
| 1950 | SC(INTEGER) SC(FLOAT) SC(TEXT) SC(BLOB) | |
| 1951 | SC(NULL) | |
| 1949 | /* column types */ | |
| 1950 | SC(INTEGER) SC(FLOAT) SC(TEXT) SC(BLOB) | |
| 1951 | SC(NULL) | |
| 1952 | 1952 | |
| 1953 | /* Authorizer Action Codes */ | |
| 1954 | SC(CREATE_INDEX ) | |
| 1955 | SC(CREATE_TABLE ) | |
| 1956 | SC(CREATE_TEMP_INDEX ) | |
| 1957 | SC(CREATE_TEMP_TABLE ) | |
| 1958 | SC(CREATE_TEMP_TRIGGER) | |
| 1959 | SC(CREATE_TEMP_VIEW ) | |
| 1960 | SC(CREATE_TRIGGER ) | |
| 1961 | SC(CREATE_VIEW ) | |
| 1962 | SC(DELETE ) | |
| 1963 | SC(DROP_INDEX ) | |
| 1964 | SC(DROP_TABLE ) | |
| 1965 | SC(DROP_TEMP_INDEX ) | |
| 1966 | SC(DROP_TEMP_TABLE ) | |
| 1967 | SC(DROP_TEMP_TRIGGER ) | |
| 1968 | SC(DROP_TEMP_VIEW ) | |
| 1969 | SC(DROP_TRIGGER ) | |
| 1970 | SC(DROP_VIEW ) | |
| 1971 | SC(INSERT ) | |
| 1972 | SC(PRAGMA ) | |
| 1973 | SC(READ ) | |
| 1974 | SC(SELECT ) | |
| 1975 | SC(TRANSACTION ) | |
| 1976 | SC(UPDATE ) | |
| 1977 | SC(ATTACH ) | |
| 1978 | SC(DETACH ) | |
| 1979 | SC(ALTER_TABLE ) | |
| 1980 | SC(REINDEX ) | |
| 1981 | SC(ANALYZE ) | |
| 1982 | SC(CREATE_VTABLE ) | |
| 1983 | SC(DROP_VTABLE ) | |
| 1984 | SC(FUNCTION ) | |
| 1985 | SC(SAVEPOINT ) | |
| 1953 | /* Authorizer Action Codes */ | |
| 1954 | SC(CREATE_INDEX ) | |
| 1955 | SC(CREATE_TABLE ) | |
| 1956 | SC(CREATE_TEMP_INDEX ) | |
| 1957 | SC(CREATE_TEMP_TABLE ) | |
| 1958 | SC(CREATE_TEMP_TRIGGER) | |
| 1959 | SC(CREATE_TEMP_VIEW ) | |
| 1960 | SC(CREATE_TRIGGER ) | |
| 1961 | SC(CREATE_VIEW ) | |
| 1962 | SC(DELETE ) | |
| 1963 | SC(DROP_INDEX ) | |
| 1964 | SC(DROP_TABLE ) | |
| 1965 | SC(DROP_TEMP_INDEX ) | |
| 1966 | SC(DROP_TEMP_TABLE ) | |
| 1967 | SC(DROP_TEMP_TRIGGER ) | |
| 1968 | SC(DROP_TEMP_VIEW ) | |
| 1969 | SC(DROP_TRIGGER ) | |
| 1970 | SC(DROP_VIEW ) | |
| 1971 | SC(INSERT ) | |
| 1972 | SC(PRAGMA ) | |
| 1973 | SC(READ ) | |
| 1974 | SC(SELECT ) | |
| 1975 | SC(TRANSACTION ) | |
| 1976 | SC(UPDATE ) | |
| 1977 | SC(ATTACH ) | |
| 1978 | SC(DETACH ) | |
| 1979 | SC(ALTER_TABLE ) | |
| 1980 | SC(REINDEX ) | |
| 1981 | SC(ANALYZE ) | |
| 1982 | SC(CREATE_VTABLE ) | |
| 1983 | SC(DROP_VTABLE ) | |
| 1984 | SC(FUNCTION ) | |
| 1985 | SC(SAVEPOINT ) | |
| 1986 | 1986 | |
| 1987 | /* terminator */ | |
| 1988 | { NULL, 0 } | |
| 1987 | /* terminator */ | |
| 1988 | { NULL, 0 } | |
| 1989 | 1989 | }; |
| 1990 | 1990 | |
| 1991 | 1991 | /* ======================================================= */ |
| 1992 | 1992 | |
| 1993 | 1993 | static const luaL_Reg dblib[] = { |
| 1994 | {"isopen", db_isopen }, | |
| 1995 | {"last_insert_rowid", db_last_insert_rowid }, | |
| 1996 | {"changes", db_changes }, | |
| 1997 | {"total_changes", db_total_changes }, | |
| 1998 | {"errcode", db_errcode }, | |
| 1999 | {"error_code", db_errcode }, | |
| 2000 | {"errmsg", db_errmsg }, | |
| 2001 | {"error_message", db_errmsg }, | |
| 2002 | {"interrupt", db_interrupt }, | |
| 1994 | {"isopen", db_isopen }, | |
| 1995 | {"last_insert_rowid", db_last_insert_rowid }, | |
| 1996 | {"changes", db_changes }, | |
| 1997 | {"total_changes", db_total_changes }, | |
| 1998 | {"errcode", db_errcode }, | |
| 1999 | {"error_code", db_errcode }, | |
| 2000 | {"errmsg", db_errmsg }, | |
| 2001 | {"error_message", db_errmsg }, | |
| 2002 | {"interrupt", db_interrupt }, | |
| 2003 | 2003 | |
| 2004 | {"create_function", db_create_function }, | |
| 2005 | {"create_aggregate", db_create_aggregate }, | |
| 2006 | {"create_collation", db_create_collation }, | |
| 2004 | {"create_function", db_create_function }, | |
| 2005 | {"create_aggregate", db_create_aggregate }, | |
| 2006 | {"create_collation", db_create_collation }, | |
| 2007 | 2007 | |
| 2008 | {"trace", db_trace }, | |
| 2009 | {"progress_handler", db_progress_handler }, | |
| 2010 | {"busy_timeout", db_busy_timeout }, | |
| 2011 | {"busy_handler", db_busy_handler }, | |
| 2008 | {"trace", db_trace }, | |
| 2009 | {"progress_handler", db_progress_handler }, | |
| 2010 | {"busy_timeout", db_busy_timeout }, | |
| 2011 | {"busy_handler", db_busy_handler }, | |
| 2012 | 2012 | #if !defined(LSQLITE_OMIT_UPDATE_HOOK) || !LSQLITE_OMIT_UPDATE_HOOK |
| 2013 | {"update_hook", db_update_hook }, | |
| 2014 | {"commit_hook", db_commit_hook }, | |
| 2015 | {"rollback_hook", db_rollback_hook }, | |
| 2013 | {"update_hook", db_update_hook }, | |
| 2014 | {"commit_hook", db_commit_hook }, | |
| 2015 | {"rollback_hook", db_rollback_hook }, | |
| 2016 | 2016 | #endif |
| 2017 | 2017 | |
| 2018 | {"prepare", db_prepare }, | |
| 2019 | {"rows", db_rows }, | |
| 2020 | {"urows", db_urows }, | |
| 2021 | {"nrows", db_nrows }, | |
| 2018 | {"prepare", db_prepare }, | |
| 2019 | {"rows", db_rows }, | |
| 2020 | {"urows", db_urows }, | |
| 2021 | {"nrows", db_nrows }, | |
| 2022 | 2022 | |
| 2023 | {"exec", db_exec }, | |
| 2024 | {"execute", db_exec }, | |
| 2025 | {"close", db_close }, | |
| 2026 | {"close_vm", db_close_vm }, | |
| 2023 | {"exec", db_exec }, | |
| 2024 | {"execute", db_exec }, | |
| 2025 | {"close", db_close }, | |
| 2026 | {"close_vm", db_close_vm }, | |
| 2027 | 2027 | |
| 2028 | {"__tostring", db_tostring }, | |
| 2029 | {"__gc", db_gc }, | |
| 2028 | {"__tostring", db_tostring }, | |
| 2029 | {"__gc", db_gc }, | |
| 2030 | 2030 | |
| 2031 | ||
| 2031 | {NULL, NULL} | |
| 2032 | 2032 | }; |
| 2033 | 2033 | |
| 2034 | 2034 | static const luaL_Reg vmlib[] = { |
| 2035 | ||
| 2035 | {"isopen", dbvm_isopen }, | |
| 2036 | 2036 | |
| 2037 | {"step", dbvm_step }, | |
| 2038 | {"reset", dbvm_reset }, | |
| 2039 | {"finalize", dbvm_finalize }, | |
| 2037 | {"step", dbvm_step }, | |
| 2038 | {"reset", dbvm_reset }, | |
| 2039 | {"finalize", dbvm_finalize }, | |
| 2040 | 2040 | |
| 2041 | ||
| 2041 | {"columns", dbvm_columns }, | |
| 2042 | 2042 | |
| 2043 | {"bind", dbvm_bind }, | |
| 2044 | {"bind_values", dbvm_bind_values }, | |
| 2045 | {"bind_names", dbvm_bind_names }, | |
| 2046 | {"bind_blob", dbvm_bind_blob }, | |
| 2047 | {"bind_parameter_count",dbvm_bind_parameter_count}, | |
| 2048 | {"bind_parameter_name", dbvm_bind_parameter_name}, | |
| 2043 | {"bind", dbvm_bind }, | |
| 2044 | {"bind_values", dbvm_bind_values }, | |
| 2045 | {"bind_names", dbvm_bind_names }, | |
| 2046 | {"bind_blob", dbvm_bind_blob }, | |
| 2047 | {"bind_parameter_count",dbvm_bind_parameter_count}, | |
| 2048 | {"bind_parameter_name", dbvm_bind_parameter_name}, | |
| 2049 | 2049 | |
| 2050 | {"get_value", dbvm_get_value }, | |
| 2051 | {"get_values", dbvm_get_values }, | |
| 2052 | {"get_name", dbvm_get_name }, | |
| 2053 | {"get_names", dbvm_get_names }, | |
| 2054 | {"get_type", dbvm_get_type }, | |
| 2055 | {"get_types", dbvm_get_types }, | |
| 2056 | {"get_uvalues", dbvm_get_uvalues }, | |
| 2057 | {"get_unames", dbvm_get_unames }, | |
| 2058 | {"get_utypes", dbvm_get_utypes }, | |
| 2050 | {"get_value", dbvm_get_value }, | |
| 2051 | {"get_values", dbvm_get_values }, | |
| 2052 | {"get_name", dbvm_get_name }, | |
| 2053 | {"get_names", dbvm_get_names }, | |
| 2054 | {"get_type", dbvm_get_type }, | |
| 2055 | {"get_types", dbvm_get_types }, | |
| 2056 | {"get_uvalues", dbvm_get_uvalues }, | |
| 2057 | {"get_unames", dbvm_get_unames }, | |
| 2058 | {"get_utypes", dbvm_get_utypes }, | |
| 2059 | 2059 | |
| 2060 | {"get_named_values", dbvm_get_named_values }, | |
| 2061 | {"get_named_types", dbvm_get_named_types }, | |
| 2060 | {"get_named_values", dbvm_get_named_values }, | |
| 2061 | {"get_named_types", dbvm_get_named_types }, | |
| 2062 | 2062 | |
| 2063 | {"rows", dbvm_rows }, | |
| 2064 | {"urows", dbvm_urows }, | |
| 2065 | {"nrows", dbvm_nrows }, | |
| 2063 | {"rows", dbvm_rows }, | |
| 2064 | {"urows", dbvm_urows }, | |
| 2065 | {"nrows", dbvm_nrows }, | |
| 2066 | 2066 | |
| 2067 | /* compatibility names (added by request) */ | |
| 2068 | {"idata", dbvm_get_values }, | |
| 2069 | {"inames", dbvm_get_names }, | |
| 2070 | {"itypes", dbvm_get_types }, | |
| 2071 | {"data", dbvm_get_named_values }, | |
| 2072 | {"type", dbvm_get_named_types }, | |
| 2067 | /* compatibility names (added by request) */ | |
| 2068 | {"idata", dbvm_get_values }, | |
| 2069 | {"inames", dbvm_get_names }, | |
| 2070 | {"itypes", dbvm_get_types }, | |
| 2071 | {"data", dbvm_get_named_values }, | |
| 2072 | {"type", dbvm_get_named_types }, | |
| 2073 | 2073 | |
| 2074 | {"__tostring", dbvm_tostring }, | |
| 2075 | {"__gc", dbvm_gc }, | |
| 2074 | {"__tostring", dbvm_tostring }, | |
| 2075 | {"__gc", dbvm_gc }, | |
| 2076 | 2076 | |
| 2077 | ||
| 2077 | { NULL, NULL } | |
| 2078 | 2078 | }; |
| 2079 | 2079 | |
| 2080 | 2080 | static const luaL_Reg ctxlib[] = { |
| 2081 | ||
| 2081 | {"user_data", lcontext_user_data }, | |
| 2082 | 2082 | |
| 2083 | {"get_aggregate_data", lcontext_get_aggregate_context }, | |
| 2084 | {"set_aggregate_data", lcontext_set_aggregate_context }, | |
| 2085 | {"aggregate_count", lcontext_aggregate_count }, | |
| 2083 | {"get_aggregate_data", lcontext_get_aggregate_context }, | |
| 2084 | {"set_aggregate_data", lcontext_set_aggregate_context }, | |
| 2085 | {"aggregate_count", lcontext_aggregate_count }, | |
| 2086 | 2086 | |
| 2087 | {"result", lcontext_result }, | |
| 2088 | {"result_null", lcontext_result_null }, | |
| 2089 | {"result_number", lcontext_result_double }, | |
| 2090 | {"result_double", lcontext_result_double }, | |
| 2091 | {"result_int", lcontext_result_int }, | |
| 2092 | {"result_text", lcontext_result_text }, | |
| 2093 | {"result_blob", lcontext_result_blob }, | |
| 2094 | {"result_error", lcontext_result_error }, | |
| 2087 | {"result", lcontext_result }, | |
| 2088 | {"result_null", lcontext_result_null }, | |
| 2089 | {"result_number", lcontext_result_double }, | |
| 2090 | {"result_double", lcontext_result_double }, | |
| 2091 | {"result_int", lcontext_result_int }, | |
| 2092 | {"result_text", lcontext_result_text }, | |
| 2093 | {"result_blob", lcontext_result_blob }, | |
| 2094 | {"result_error", lcontext_result_error }, | |
| 2095 | 2095 | |
| 2096 | {"__tostring", lcontext_tostring }, | |
| 2097 | {NULL, NULL} | |
| 2096 | {"__tostring", lcontext_tostring }, | |
| 2097 | {NULL, NULL} | |
| 2098 | 2098 | }; |
| 2099 | 2099 | |
| 2100 | 2100 | static const luaL_Reg sqlitelib[] = { |
| 2101 | {"version", lsqlite_version }, | |
| 2102 | {"complete", lsqlite_complete }, | |
| 2101 | {"version", lsqlite_version }, | |
| 2102 | {"complete", lsqlite_complete }, | |
| 2103 | 2103 | #ifndef WIN32 |
| 2104 | ||
| 2104 | {"temp_directory", lsqlite_temp_directory }, | |
| 2105 | 2105 | #endif |
| 2106 | {"open", lsqlite_open }, | |
| 2107 | {"open_memory", lsqlite_open_memory }, | |
| 2106 | {"open", lsqlite_open }, | |
| 2107 | {"open_memory", lsqlite_open_memory }, | |
| 2108 | 2108 | |
| 2109 | {"__newindex", lsqlite_newindex }, | |
| 2110 | {NULL, NULL} | |
| 2109 | {"__newindex", lsqlite_newindex }, | |
| 2110 | {NULL, NULL} | |
| 2111 | 2111 | }; |
| 2112 | 2112 | |
| 2113 | 2113 | static void create_meta(lua_State *L, const char *name, const luaL_Reg *lib) { |
| 2114 | luaL_newmetatable(L, name); | |
| 2115 | lua_pushstring(L, "__index"); | |
| 2116 | lua_pushvalue(L, -2); /* push metatable */ | |
| 2117 | lua_rawset(L, -3); /* metatable.__index = metatable */ | |
| 2114 | luaL_newmetatable(L, name); | |
| 2115 | lua_pushstring(L, "__index"); | |
| 2116 | lua_pushvalue(L, -2); /* push metatable */ | |
| 2117 | lua_rawset(L, -3); /* metatable.__index = metatable */ | |
| 2118 | 2118 | |
| 2119 | /* register metatable functions */ | |
| 2120 | luaL_openlib(L, NULL, lib, 0); | |
| 2119 | /* register metatable functions */ | |
| 2120 | luaL_openlib(L, NULL, lib, 0); | |
| 2121 | 2121 | |
| 2122 | /* remove metatable from stack */ | |
| 2123 | lua_pop(L, 1); | |
| 2122 | /* remove metatable from stack */ | |
| 2123 | lua_pop(L, 1); | |
| 2124 | 2124 | } |
| 2125 | 2125 | |
| 2126 | 2126 | static int luaopen_sqlite3 ( lua_State * L ) |
| r31373 | r31374 | |
| 2130 | 2130 | } |
| 2131 | 2131 | |
| 2132 | 2132 | LUALIB_API int luaopen_lsqlite3(lua_State *L) { |
| 2133 | create_meta(L, sqlite_meta, dblib); | |
| 2134 | create_meta(L, sqlite_vm_meta, vmlib); | |
| 2135 | create_meta(L, sqlite_ctx_meta, ctxlib); | |
| 2133 | create_meta(L, sqlite_meta, dblib); | |
| 2134 | create_meta(L, sqlite_vm_meta, vmlib); | |
| 2135 | create_meta(L, sqlite_ctx_meta, ctxlib); | |
| 2136 | 2136 | |
| 2137 | luaL_getmetatable(L, sqlite_ctx_meta); | |
| 2138 | sqlite_ctx_meta_ref = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 2139 | /* register (local) sqlite metatable */ | |
| 2140 | //luaL_register(L, "sqlite3", sqlitelib); | |
| 2137 | luaL_getmetatable(L, sqlite_ctx_meta); | |
| 2138 | sqlite_ctx_meta_ref = luaL_ref(L, LUA_REGISTRYINDEX); | |
| 2139 | /* register (local) sqlite metatable */ | |
| 2140 | //luaL_register(L, "sqlite3", sqlitelib); | |
| 2141 | 2141 | luaL_requiref(L, "sqlite3", luaopen_sqlite3, 1); |
| 2142 | { | |
| 2143 | int i = 0; | |
| 2144 | /* add constants to global table */ | |
| 2145 | while (sqlite_constants[i].name) { | |
| 2146 | lua_pushstring(L, sqlite_constants[i].name); | |
| 2147 | lua_pushnumber(L, sqlite_constants[i].value); | |
| 2148 | lua_rawset(L, -3); | |
| 2149 | ++i; | |
| 2150 | } | |
| 2151 | } | |
| 2152 | /* set sqlite's metatable to itself - set as readonly (__newindex) */ | |
| 2153 | lua_pushvalue(L, -1); | |
| 2154 | lua_setmetatable(L, -2); | |
| 2142 | { | |
| 2143 | int i = 0; | |
| 2144 | /* add constants to global table */ | |
| 2145 | while (sqlite_constants[i].name) { | |
| 2146 | lua_pushstring(L, sqlite_constants[i].name); | |
| 2147 | lua_pushnumber(L, sqlite_constants[i].value); | |
| 2148 | lua_rawset(L, -3); | |
| 2149 | ++i; | |
| 2150 | } | |
| 2151 | } | |
| 2152 | /* set sqlite's metatable to itself - set as readonly (__newindex) */ | |
| 2153 | lua_pushvalue(L, -1); | |
| 2154 | lua_setmetatable(L, -2); | |
| 2155 | 2155 | |
| 2156 | ||
| 2156 | return 1; | |
| 2157 | 2157 | } |
| r31373 | r31374 | |
|---|---|---|
| 18 | 18 | #include "lualib.h" |
| 19 | 19 | |
| 20 | 20 | |
| 21 | #define HOOKKEY | |
| 21 | #define HOOKKEY "_HKEY" | |
| 22 | 22 | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | static int db_getregistry (lua_State *L) { |
| 26 | lua_pushvalue(L, LUA_REGISTRYINDEX); | |
| 27 | return 1; | |
| 26 | lua_pushvalue(L, LUA_REGISTRYINDEX); | |
| 27 | return 1; | |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | static int db_getmetatable (lua_State *L) { |
| 32 | luaL_checkany(L, 1); | |
| 33 | if (!lua_getmetatable(L, 1)) { | |
| 34 | lua_pushnil(L); /* no metatable */ | |
| 35 | } | |
| 36 | return 1; | |
| 32 | luaL_checkany(L, 1); | |
| 33 | if (!lua_getmetatable(L, 1)) { | |
| 34 | lua_pushnil(L); /* no metatable */ | |
| 35 | } | |
| 36 | return 1; | |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | static int db_setmetatable (lua_State *L) { |
| 41 | int t = lua_type(L, 2); | |
| 42 | luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, | |
| 43 | "nil or table expected"); | |
| 44 | lua_settop(L, 2); | |
| 45 | lua_setmetatable(L, 1); | |
| 46 | return 1; /* return 1st argument */ | |
| 41 | int t = lua_type(L, 2); | |
| 42 | luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, | |
| 43 | "nil or table expected"); | |
| 44 | lua_settop(L, 2); | |
| 45 | lua_setmetatable(L, 1); | |
| 46 | return 1; /* return 1st argument */ | |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | |
| 50 | 50 | static int db_getuservalue (lua_State *L) { |
| 51 | if (lua_type(L, 1) != LUA_TUSERDATA) | |
| 52 | lua_pushnil(L); | |
| 53 | else | |
| 54 | lua_getuservalue(L, 1); | |
| 55 | return 1; | |
| 51 | if (lua_type(L, 1) != LUA_TUSERDATA) | |
| 52 | lua_pushnil(L); | |
| 53 | else | |
| 54 | lua_getuservalue(L, 1); | |
| 55 | return 1; | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | static int db_setuservalue (lua_State *L) { |
| 60 | if (lua_type(L, 1) == LUA_TLIGHTUSERDATA) | |
| 61 | luaL_argerror(L, 1, "full userdata expected, got light userdata"); | |
| 62 | luaL_checktype(L, 1, LUA_TUSERDATA); | |
| 63 | if (!lua_isnoneornil(L, 2)) | |
| 64 | luaL_checktype(L, 2, LUA_TTABLE); | |
| 65 | lua_settop(L, 2); | |
| 66 | lua_setuservalue(L, 1); | |
| 67 | return 1; | |
| 60 | if (lua_type(L, 1) == LUA_TLIGHTUSERDATA) | |
| 61 | luaL_argerror(L, 1, "full userdata expected, got light userdata"); | |
| 62 | luaL_checktype(L, 1, LUA_TUSERDATA); | |
| 63 | if (!lua_isnoneornil(L, 2)) | |
| 64 | luaL_checktype(L, 2, LUA_TTABLE); | |
| 65 | lua_settop(L, 2); | |
| 66 | lua_setuservalue(L, 1); | |
| 67 | return 1; | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | static void settabss (lua_State *L, const char *i, const char *v) { |
| 72 | lua_pushstring(L, v); | |
| 73 | lua_setfield(L, -2, i); | |
| 72 | lua_pushstring(L, v); | |
| 73 | lua_setfield(L, -2, i); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | static void settabsi (lua_State *L, const char *i, int v) { |
| 78 | lua_pushinteger(L, v); | |
| 79 | lua_setfield(L, -2, i); | |
| 78 | lua_pushinteger(L, v); | |
| 79 | lua_setfield(L, -2, i); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | static void settabsb (lua_State *L, const char *i, int v) { |
| 84 | lua_pushboolean(L, v); | |
| 85 | lua_setfield(L, -2, i); | |
| 84 | lua_pushboolean(L, v); | |
| 85 | lua_setfield(L, -2, i); | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | static lua_State *getthread (lua_State *L, int *arg) { |
| 90 | if (lua_isthread(L, 1)) { | |
| 91 | *arg = 1; | |
| 92 | return lua_tothread(L, 1); | |
| 93 | } | |
| 94 | else { | |
| 95 | *arg = 0; | |
| 96 | return L; | |
| 97 | } | |
| 90 | if (lua_isthread(L, 1)) { | |
| 91 | *arg = 1; | |
| 92 | return lua_tothread(L, 1); | |
| 93 | } | |
| 94 | else { | |
| 95 | *arg = 0; | |
| 96 | return L; | |
| 97 | } | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | static void treatstackoption (lua_State *L, lua_State *L1, const char *fname) { |
| 102 | if (L == L1) { | |
| 103 | lua_pushvalue(L, -2); | |
| 104 | lua_remove(L, -3); | |
| 105 | } | |
| 106 | else | |
| 107 | lua_xmove(L1, L, 1); | |
| 108 | lua_setfield(L, -2, fname); | |
| 102 | if (L == L1) { | |
| 103 | lua_pushvalue(L, -2); | |
| 104 | lua_remove(L, -3); | |
| 105 | } | |
| 106 | else | |
| 107 | lua_xmove(L1, L, 1); | |
| 108 | lua_setfield(L, -2, fname); | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | static int db_getinfo (lua_State *L) { |
| 113 | lua_Debug ar; | |
| 114 | int arg; | |
| 115 | lua_State *L1 = getthread(L, &arg); | |
| 116 | const char *options = luaL_optstring(L, arg+2, "flnStu"); | |
| 117 | if (lua_isnumber(L, arg+1)) { | |
| 118 | if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) { | |
| 119 | lua_pushnil(L); /* level out of range */ | |
| 120 | return 1; | |
| 121 | } | |
| 122 | } | |
| 123 | else if (lua_isfunction(L, arg+1)) { | |
| 124 | lua_pushfstring(L, ">%s", options); | |
| 125 | options = lua_tostring(L, -1); | |
| 126 | lua_pushvalue(L, arg+1); | |
| 127 | lua_xmove(L, L1, 1); | |
| 128 | } | |
| 129 | else | |
| 130 | return luaL_argerror(L, arg+1, "function or level expected"); | |
| 131 | if (!lua_getinfo(L1, options, &ar)) | |
| 132 | return luaL_argerror(L, arg+2, "invalid option"); | |
| 133 | lua_createtable(L, 0, 2); | |
| 134 | if (strchr(options, 'S')) { | |
| 135 | settabss(L, "source", ar.source); | |
| 136 | settabss(L, "short_src", ar.short_src); | |
| 137 | settabsi(L, "linedefined", ar.linedefined); | |
| 138 | settabsi(L, "lastlinedefined", ar.lastlinedefined); | |
| 139 | settabss(L, "what", ar.what); | |
| 140 | } | |
| 141 | if (strchr(options, 'l')) | |
| 142 | settabsi(L, "currentline", ar.currentline); | |
| 143 | if (strchr(options, 'u')) { | |
| 144 | settabsi(L, "nups", ar.nups); | |
| 145 | settabsi(L, "nparams", ar.nparams); | |
| 146 | settabsb(L, "isvararg", ar.isvararg); | |
| 147 | } | |
| 148 | if (strchr(options, 'n')) { | |
| 149 | settabss(L, "name", ar.name); | |
| 150 | settabss(L, "namewhat", ar.namewhat); | |
| 151 | } | |
| 152 | if (strchr(options, 't')) | |
| 153 | settabsb(L, "istailcall", ar.istailcall); | |
| 154 | if (strchr(options, 'L')) | |
| 155 | treatstackoption(L, L1, "activelines"); | |
| 156 | if (strchr(options, 'f')) | |
| 157 | treatstackoption(L, L1, "func"); | |
| 158 | return 1; /* return table */ | |
| 113 | lua_Debug ar; | |
| 114 | int arg; | |
| 115 | lua_State *L1 = getthread(L, &arg); | |
| 116 | const char *options = luaL_optstring(L, arg+2, "flnStu"); | |
| 117 | if (lua_isnumber(L, arg+1)) { | |
| 118 | if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) { | |
| 119 | lua_pushnil(L); /* level out of range */ | |
| 120 | return 1; | |
| 121 | } | |
| 122 | } | |
| 123 | else if (lua_isfunction(L, arg+1)) { | |
| 124 | lua_pushfstring(L, ">%s", options); | |
| 125 | options = lua_tostring(L, -1); | |
| 126 | lua_pushvalue(L, arg+1); | |
| 127 | lua_xmove(L, L1, 1); | |
| 128 | } | |
| 129 | else | |
| 130 | return luaL_argerror(L, arg+1, "function or level expected"); | |
| 131 | if (!lua_getinfo(L1, options, &ar)) | |
| 132 | return luaL_argerror(L, arg+2, "invalid option"); | |
| 133 | lua_createtable(L, 0, 2); | |
| 134 | if (strchr(options, 'S')) { | |
| 135 | settabss(L, "source", ar.source); | |
| 136 | settabss(L, "short_src", ar.short_src); | |
| 137 | settabsi(L, "linedefined", ar.linedefined); | |
| 138 | settabsi(L, "lastlinedefined", ar.lastlinedefined); | |
| 139 | settabss(L, "what", ar.what); | |
| 140 | } | |
| 141 | if (strchr(options, 'l')) | |
| 142 | settabsi(L, "currentline", ar.currentline); | |
| 143 | if (strchr(options, 'u')) { | |
| 144 | settabsi(L, "nups", ar.nups); | |
| 145 | settabsi(L, "nparams", ar.nparams); | |
| 146 | settabsb(L, "isvararg", ar.isvararg); | |
| 147 | } | |
| 148 | if (strchr(options, 'n')) { | |
| 149 | settabss(L, "name", ar.name); | |
| 150 | settabss(L, "namewhat", ar.namewhat); | |
| 151 | } | |
| 152 | if (strchr(options, 't')) | |
| 153 | settabsb(L, "istailcall", ar.istailcall); | |
| 154 | if (strchr(options, 'L')) | |
| 155 | treatstackoption(L, L1, "activelines"); | |
| 156 | if (strchr(options, 'f')) | |
| 157 | treatstackoption(L, L1, "func"); | |
| 158 | return 1; /* return table */ | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| 162 | 162 | static int db_getlocal (lua_State *L) { |
| 163 | int arg; | |
| 164 | lua_State *L1 = getthread(L, &arg); | |
| 165 | lua_Debug ar; | |
| 166 | const char *name; | |
| 167 | int nvar = luaL_checkint(L, arg+2); /* local-variable index */ | |
| 168 | if (lua_isfunction(L, arg + 1)) { /* function argument? */ | |
| 169 | lua_pushvalue(L, arg + 1); /* push function */ | |
| 170 | lua_pushstring(L, lua_getlocal(L, NULL, nvar)); /* push local name */ | |
| 171 | return 1; | |
| 172 | } | |
| 173 | else { /* stack-level argument */ | |
| 174 | if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ | |
| 175 | return luaL_argerror(L, arg+1, "level out of range"); | |
| 176 | name = lua_getlocal(L1, &ar, nvar); | |
| 177 | if (name) { | |
| 178 | lua_xmove(L1, L, 1); /* push local value */ | |
| 179 | lua_pushstring(L, name); /* push name */ | |
| 180 | lua_pushvalue(L, -2); /* re-order */ | |
| 181 | return 2; | |
| 182 | } | |
| 183 | else { | |
| 184 | lua_pushnil(L); /* no name (nor value) */ | |
| 185 | return 1; | |
| 186 | } | |
| 187 | } | |
| 163 | int arg; | |
| 164 | lua_State *L1 = getthread(L, &arg); | |
| 165 | lua_Debug ar; | |
| 166 | const char *name; | |
| 167 | int nvar = luaL_checkint(L, arg+2); /* local-variable index */ | |
| 168 | if (lua_isfunction(L, arg + 1)) { /* function argument? */ | |
| 169 | lua_pushvalue(L, arg + 1); /* push function */ | |
| 170 | lua_pushstring(L, lua_getlocal(L, NULL, nvar)); /* push local name */ | |
| 171 | return 1; | |
| 172 | } | |
| 173 | else { /* stack-level argument */ | |
| 174 | if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ | |
| 175 | return luaL_argerror(L, arg+1, "level out of range"); | |
| 176 | name = lua_getlocal(L1, &ar, nvar); | |
| 177 | if (name) { | |
| 178 | lua_xmove(L1, L, 1); /* push local value */ | |
| 179 | lua_pushstring(L, name); /* push name */ | |
| 180 | lua_pushvalue(L, -2); /* re-order */ | |
| 181 | return 2; | |
| 182 | } | |
| 183 | else { | |
| 184 | lua_pushnil(L); /* no name (nor value) */ | |
| 185 | return 1; | |
| 186 | } | |
| 187 | } | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | |
| 191 | 191 | static int db_setlocal (lua_State *L) { |
| 192 | int arg; | |
| 193 | lua_State *L1 = getthread(L, &arg); | |
| 194 | lua_Debug ar; | |
| 195 | if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ | |
| 196 | return luaL_argerror(L, arg+1, "level out of range"); | |
| 197 | luaL_checkany(L, arg+3); | |
| 198 | lua_settop(L, arg+3); | |
| 199 | lua_xmove(L, L1, 1); | |
| 200 | lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2))); | |
| 201 | return 1; | |
| 192 | int arg; | |
| 193 | lua_State *L1 = getthread(L, &arg); | |
| 194 | lua_Debug ar; | |
| 195 | if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ | |
| 196 | return luaL_argerror(L, arg+1, "level out of range"); | |
| 197 | luaL_checkany(L, arg+3); | |
| 198 | lua_settop(L, arg+3); | |
| 199 | lua_xmove(L, L1, 1); | |
| 200 | lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2))); | |
| 201 | return 1; | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | 205 | static int auxupvalue (lua_State *L, int get) { |
| 206 | const char *name; | |
| 207 | int n = luaL_checkint(L, 2); | |
| 208 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 209 | name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); | |
| 210 | if (name == NULL) return 0; | |
| 211 | lua_pushstring(L, name); | |
| 212 | lua_insert(L, -(get+1)); | |
| 213 | return get + 1; | |
| 206 | const char *name; | |
| 207 | int n = luaL_checkint(L, 2); | |
| 208 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 209 | name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); | |
| 210 | if (name == NULL) return 0; | |
| 211 | lua_pushstring(L, name); | |
| 212 | lua_insert(L, -(get+1)); | |
| 213 | return get + 1; | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | static int db_getupvalue (lua_State *L) { |
| 218 | ||
| 218 | return auxupvalue(L, 1); | |
| 219 | 219 | } |
| 220 | 220 | |
| 221 | 221 | |
| 222 | 222 | static int db_setupvalue (lua_State *L) { |
| 223 | luaL_checkany(L, 3); | |
| 224 | return auxupvalue(L, 0); | |
| 223 | luaL_checkany(L, 3); | |
| 224 | return auxupvalue(L, 0); | |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | |
| 228 | 228 | static int checkupval (lua_State *L, int argf, int argnup) { |
| 229 | lua_Debug ar; | |
| 230 | int nup = luaL_checkint(L, argnup); | |
| 231 | luaL_checktype(L, argf, LUA_TFUNCTION); | |
| 232 | lua_pushvalue(L, argf); | |
| 233 | lua_getinfo(L, ">u", &ar); | |
| 234 | luaL_argcheck(L, 1 <= nup && nup <= ar.nups, argnup, "invalid upvalue index"); | |
| 235 | return nup; | |
| 229 | lua_Debug ar; | |
| 230 | int nup = luaL_checkint(L, argnup); | |
| 231 | luaL_checktype(L, argf, LUA_TFUNCTION); | |
| 232 | lua_pushvalue(L, argf); | |
| 233 | lua_getinfo(L, ">u", &ar); | |
| 234 | luaL_argcheck(L, 1 <= nup && nup <= ar.nups, argnup, "invalid upvalue index"); | |
| 235 | return nup; | |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | 238 | |
| 239 | 239 | static int db_upvalueid (lua_State *L) { |
| 240 | int n = checkupval(L, 1, 2); | |
| 241 | lua_pushlightuserdata(L, lua_upvalueid(L, 1, n)); | |
| 242 | return 1; | |
| 240 | int n = checkupval(L, 1, 2); | |
| 241 | lua_pushlightuserdata(L, lua_upvalueid(L, 1, n)); | |
| 242 | return 1; | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
| 246 | 246 | static int db_upvaluejoin (lua_State *L) { |
| 247 | int n1 = checkupval(L, 1, 2); | |
| 248 | int n2 = checkupval(L, 3, 4); | |
| 249 | luaL_argcheck(L, !lua_iscfunction(L, 1), 1, "Lua function expected"); | |
| 250 | luaL_argcheck(L, !lua_iscfunction(L, 3), 3, "Lua function expected"); | |
| 251 | lua_upvaluejoin(L, 1, n1, 3, n2); | |
| 252 | return 0; | |
| 247 | int n1 = checkupval(L, 1, 2); | |
| 248 | int n2 = checkupval(L, 3, 4); | |
| 249 | luaL_argcheck(L, !lua_iscfunction(L, 1), 1, "Lua function expected"); | |
| 250 | luaL_argcheck(L, !lua_iscfunction(L, 3), 3, "Lua function expected"); | |
| 251 | lua_upvaluejoin(L, 1, n1, 3, n2); | |
| 252 | return 0; | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| 256 | #define gethooktable(L) | |
| 256 | #define gethooktable(L) luaL_getsubtable(L, LUA_REGISTRYINDEX, HOOKKEY) | |
| 257 | 257 | |
| 258 | 258 | |
| 259 | 259 | static void hookf (lua_State *L, lua_Debug *ar) { |
| 260 | static const char *const hooknames[] = | |
| 261 | {"call", "return", "line", "count", "tail call"}; | |
| 262 | gethooktable(L); | |
| 263 | lua_pushthread(L); | |
| 264 | lua_rawget(L, -2); | |
| 265 | if (lua_isfunction(L, -1)) { | |
| 266 | lua_pushstring(L, hooknames[(int)ar->event]); | |
| 267 | if (ar->currentline >= 0) | |
| 268 | lua_pushinteger(L, ar->currentline); | |
| 269 | else lua_pushnil(L); | |
| 270 | lua_assert(lua_getinfo(L, "lS", ar)); | |
| 271 | lua_call(L, 2, 0); | |
| 272 | } | |
| 260 | static const char *const hooknames[] = | |
| 261 | {"call", "return", "line", "count", "tail call"}; | |
| 262 | gethooktable(L); | |
| 263 | lua_pushthread(L); | |
| 264 | lua_rawget(L, -2); | |
| 265 | if (lua_isfunction(L, -1)) { | |
| 266 | lua_pushstring(L, hooknames[(int)ar->event]); | |
| 267 | if (ar->currentline >= 0) | |
| 268 | lua_pushinteger(L, ar->currentline); | |
| 269 | else lua_pushnil(L); | |
| 270 | lua_assert(lua_getinfo(L, "lS", ar)); | |
| 271 | lua_call(L, 2, 0); | |
| 272 | } | |
| 273 | 273 | } |
| 274 | 274 | |
| 275 | 275 | |
| 276 | 276 | static int makemask (const char *smask, int count) { |
| 277 | int mask = 0; | |
| 278 | if (strchr(smask, 'c')) mask |= LUA_MASKCALL; | |
| 279 | if (strchr(smask, 'r')) mask |= LUA_MASKRET; | |
| 280 | if (strchr(smask, 'l')) mask |= LUA_MASKLINE; | |
| 281 | if (count > 0) mask |= LUA_MASKCOUNT; | |
| 282 | return mask; | |
| 277 | int mask = 0; | |
| 278 | if (strchr(smask, 'c')) mask |= LUA_MASKCALL; | |
| 279 | if (strchr(smask, 'r')) mask |= LUA_MASKRET; | |
| 280 | if (strchr(smask, 'l')) mask |= LUA_MASKLINE; | |
| 281 | if (count > 0) mask |= LUA_MASKCOUNT; | |
| 282 | return mask; | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | static char *unmakemask (int mask, char *smask) { |
| 287 | int i = 0; | |
| 288 | if (mask & LUA_MASKCALL) smask[i++] = 'c'; | |
| 289 | if (mask & LUA_MASKRET) smask[i++] = 'r'; | |
| 290 | if (mask & LUA_MASKLINE) smask[i++] = 'l'; | |
| 291 | smask[i] = '\0'; | |
| 292 | return smask; | |
| 287 | int i = 0; | |
| 288 | if (mask & LUA_MASKCALL) smask[i++] = 'c'; | |
| 289 | if (mask & LUA_MASKRET) smask[i++] = 'r'; | |
| 290 | if (mask & LUA_MASKLINE) smask[i++] = 'l'; | |
| 291 | smask[i] = '\0'; | |
| 292 | return smask; | |
| 293 | 293 | } |
| 294 | 294 | |
| 295 | 295 | |
| 296 | 296 | static int db_sethook (lua_State *L) { |
| 297 | int arg, mask, count; | |
| 298 | lua_Hook func; | |
| 299 | lua_State *L1 = getthread(L, &arg); | |
| 300 | if (lua_isnoneornil(L, arg+1)) { | |
| 301 | lua_settop(L, arg+1); | |
| 302 | func = NULL; mask = 0; count = 0; /* turn off hooks */ | |
| 303 | } | |
| 304 | else { | |
| 305 | const char *smask = luaL_checkstring(L, arg+2); | |
| 306 | luaL_checktype(L, arg+1, LUA_TFUNCTION); | |
| 307 | count = luaL_optint(L, arg+3, 0); | |
| 308 | func = hookf; mask = makemask(smask, count); | |
| 309 | } | |
| 310 | if (gethooktable(L) == 0) { /* creating hook table? */ | |
| 311 | lua_pushstring(L, "k"); | |
| 312 | lua_setfield(L, -2, "__mode"); /** hooktable.__mode = "k" */ | |
| 313 | lua_pushvalue(L, -1); | |
| 314 | lua_setmetatable(L, -2); /* setmetatable(hooktable) = hooktable */ | |
| 315 | } | |
| 316 | lua_pushthread(L1); lua_xmove(L1, L, 1); | |
| 317 | lua_pushvalue(L, arg+1); | |
| 318 | lua_rawset(L, -3); /* set new hook */ | |
| 319 | lua_sethook(L1, func, mask, count); /* set hooks */ | |
| 320 | return 0; | |
| 297 | int arg, mask, count; | |
| 298 | lua_Hook func; | |
| 299 | lua_State *L1 = getthread(L, &arg); | |
| 300 | if (lua_isnoneornil(L, arg+1)) { | |
| 301 | lua_settop(L, arg+1); | |
| 302 | func = NULL; mask = 0; count = 0; /* turn off hooks */ | |
| 303 | } | |
| 304 | else { | |
| 305 | const char *smask = luaL_checkstring(L, arg+2); | |
| 306 | luaL_checktype(L, arg+1, LUA_TFUNCTION); | |
| 307 | count = luaL_optint(L, arg+3, 0); | |
| 308 | func = hookf; mask = makemask(smask, count); | |
| 309 | } | |
| 310 | if (gethooktable(L) == 0) { /* creating hook table? */ | |
| 311 | lua_pushstring(L, "k"); | |
| 312 | lua_setfield(L, -2, "__mode"); /** hooktable.__mode = "k" */ | |
| 313 | lua_pushvalue(L, -1); | |
| 314 | lua_setmetatable(L, -2); /* setmetatable(hooktable) = hooktable */ | |
| 315 | } | |
| 316 | lua_pushthread(L1); lua_xmove(L1, L, 1); | |
| 317 | lua_pushvalue(L, arg+1); | |
| 318 | lua_rawset(L, -3); /* set new hook */ | |
| 319 | lua_sethook(L1, func, mask, count); /* set hooks */ | |
| 320 | return 0; | |
| 321 | 321 | } |
| 322 | 322 | |
| 323 | 323 | |
| 324 | 324 | static int db_gethook (lua_State *L) { |
| 325 | int arg; | |
| 326 | lua_State *L1 = getthread(L, &arg); | |
| 327 | char buff[5]; | |
| 328 | int mask = lua_gethookmask(L1); | |
| 329 | lua_Hook hook = lua_gethook(L1); | |
| 330 | if (hook != NULL && hook != hookf) /* external hook? */ | |
| 331 | lua_pushliteral(L, "external hook"); | |
| 332 | else { | |
| 333 | gethooktable(L); | |
| 334 | lua_pushthread(L1); lua_xmove(L1, L, 1); | |
| 335 | lua_rawget(L, -2); /* get hook */ | |
| 336 | lua_remove(L, -2); /* remove hook table */ | |
| 337 | } | |
| 338 | lua_pushstring(L, unmakemask(mask, buff)); | |
| 339 | lua_pushinteger(L, lua_gethookcount(L1)); | |
| 340 | return 3; | |
| 325 | int arg; | |
| 326 | lua_State *L1 = getthread(L, &arg); | |
| 327 | char buff[5]; | |
| 328 | int mask = lua_gethookmask(L1); | |
| 329 | lua_Hook hook = lua_gethook(L1); | |
| 330 | if (hook != NULL && hook != hookf) /* external hook? */ | |
| 331 | lua_pushliteral(L, "external hook"); | |
| 332 | else { | |
| 333 | gethooktable(L); | |
| 334 | lua_pushthread(L1); lua_xmove(L1, L, 1); | |
| 335 | lua_rawget(L, -2); /* get hook */ | |
| 336 | lua_remove(L, -2); /* remove hook table */ | |
| 337 | } | |
| 338 | lua_pushstring(L, unmakemask(mask, buff)); | |
| 339 | lua_pushinteger(L, lua_gethookcount(L1)); | |
| 340 | return 3; | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
| 344 | 344 | static int db_debug (lua_State *L) { |
| 345 | for (;;) { | |
| 346 | char buffer[250]; | |
| 347 | luai_writestringerror("%s", "lua_debug> "); | |
| 348 | if (fgets(buffer, sizeof(buffer), stdin) == 0 || | |
| 349 | strcmp(buffer, "cont\n") == 0) | |
| 350 | return 0; | |
| 351 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || | |
| 352 | lua_pcall(L, 0, 0, 0)) | |
| 353 | luai_writestringerror("%s\n", lua_tostring(L, -1)); | |
| 354 | lua_settop(L, 0); /* remove eventual returns */ | |
| 355 | } | |
| 345 | for (;;) { | |
| 346 | char buffer[250]; | |
| 347 | luai_writestringerror("%s", "lua_debug> "); | |
| 348 | if (fgets(buffer, sizeof(buffer), stdin) == 0 || | |
| 349 | strcmp(buffer, "cont\n") == 0) | |
| 350 | return 0; | |
| 351 | if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || | |
| 352 | lua_pcall(L, 0, 0, 0)) | |
| 353 | luai_writestringerror("%s\n", lua_tostring(L, -1)); | |
| 354 | lua_settop(L, 0); /* remove eventual returns */ | |
| 355 | } | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | |
| 359 | 359 | static int db_traceback (lua_State *L) { |
| 360 | int arg; | |
| 361 | lua_State *L1 = getthread(L, &arg); | |
| 362 | const char *msg = lua_tostring(L, arg + 1); | |
| 363 | if (msg == NULL && !lua_isnoneornil(L, arg + 1)) /* non-string 'msg'? */ | |
| 364 | lua_pushvalue(L, arg + 1); /* return it untouched */ | |
| 365 | else { | |
| 366 | int level = luaL_optint(L, arg + 2, (L == L1) ? 1 : 0); | |
| 367 | luaL_traceback(L, L1, msg, level); | |
| 368 | } | |
| 369 | return 1; | |
| 360 | int arg; | |
| 361 | lua_State *L1 = getthread(L, &arg); | |
| 362 | const char *msg = lua_tostring(L, arg + 1); | |
| 363 | if (msg == NULL && !lua_isnoneornil(L, arg + 1)) /* non-string 'msg'? */ | |
| 364 | lua_pushvalue(L, arg + 1); /* return it untouched */ | |
| 365 | else { | |
| 366 | int level = luaL_optint(L, arg + 2, (L == L1) ? 1 : 0); | |
| 367 | luaL_traceback(L, L1, msg, level); | |
| 368 | } | |
| 369 | return 1; | |
| 370 | 370 | } |
| 371 | 371 | |
| 372 | 372 | |
| 373 | 373 | static const luaL_Reg dblib[] = { |
| 374 | {"debug", db_debug}, | |
| 375 | {"getuservalue", db_getuservalue}, | |
| 376 | {"gethook", db_gethook}, | |
| 377 | {"getinfo", db_getinfo}, | |
| 378 | {"getlocal", db_getlocal}, | |
| 379 | {"getregistry", db_getregistry}, | |
| 380 | {"getmetatable", db_getmetatable}, | |
| 381 | {"getupvalue", db_getupvalue}, | |
| 382 | {"upvaluejoin", db_upvaluejoin}, | |
| 383 | {"upvalueid", db_upvalueid}, | |
| 384 | {"setuservalue", db_setuservalue}, | |
| 385 | {"sethook", db_sethook}, | |
| 386 | {"setlocal", db_setlocal}, | |
| 387 | {"setmetatable", db_setmetatable}, | |
| 388 | {"setupvalue", db_setupvalue}, | |
| 389 | {"traceback", db_traceback}, | |
| 390 | {NULL, NULL} | |
| 374 | {"debug", db_debug}, | |
| 375 | {"getuservalue", db_getuservalue}, | |
| 376 | {"gethook", db_gethook}, | |
| 377 | {"getinfo", db_getinfo}, | |
| 378 | {"getlocal", db_getlocal}, | |
| 379 | {"getregistry", db_getregistry}, | |
| 380 | {"getmetatable", db_getmetatable}, | |
| 381 | {"getupvalue", db_getupvalue}, | |
| 382 | {"upvaluejoin", db_upvaluejoin}, | |
| 383 | {"upvalueid", db_upvalueid}, | |
| 384 | {"setuservalue", db_setuservalue}, | |
| 385 | {"sethook", db_sethook}, | |
| 386 | {"setlocal", db_setlocal}, | |
| 387 | {"setmetatable", db_setmetatable}, | |
| 388 | {"setupvalue", db_setupvalue}, | |
| 389 | {"traceback", db_traceback}, | |
| 390 | {NULL, NULL} | |
| 391 | 391 | }; |
| 392 | 392 | |
| 393 | 393 | |
| 394 | 394 | LUAMOD_API int luaopen_debug (lua_State *L) { |
| 395 | luaL_newlib(L, dblib); | |
| 396 | return 1; | |
| 395 | luaL_newlib(L, dblib); | |
| 396 | return 1; | |
| 397 | 397 | } |
| 398 |
| r31373 | r31374 | |
|---|---|---|
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | |
| 43 | #define MINSIZEARRAY | |
| 43 | #define MINSIZEARRAY 4 | |
| 44 | 44 | |
| 45 | 45 | |
| 46 | 46 | void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, |
| 47 | int limit, const char *what) { | |
| 48 | void *newblock; | |
| 49 | int newsize; | |
| 50 | if (*size >= limit/2) { /* cannot double it? */ | |
| 51 | if (*size >= limit) /* cannot grow even a little? */ | |
| 52 | luaG_runerror(L, "too many %s (limit is %d)", what, limit); | |
| 53 | newsize = limit; /* still have at least one free place */ | |
| 54 | } | |
| 55 | else { | |
| 56 | newsize = (*size)*2; | |
| 57 | if (newsize < MINSIZEARRAY) | |
| 58 | newsize = MINSIZEARRAY; /* minimum size */ | |
| 59 | } | |
| 60 | newblock = luaM_reallocv(L, block, *size, newsize, size_elems); | |
| 61 | *size = newsize; /* update only when everything else is OK */ | |
| 62 | return newblock; | |
| 47 | int limit, const char *what) { | |
| 48 | void *newblock; | |
| 49 | int newsize; | |
| 50 | if (*size >= limit/2) { /* cannot double it? */ | |
| 51 | if (*size >= limit) /* cannot grow even a little? */ | |
| 52 | luaG_runerror(L, "too many %s (limit is %d)", what, limit); | |
| 53 | newsize = limit; /* still have at least one free place */ | |
| 54 | } | |
| 55 | else { | |
| 56 | newsize = (*size)*2; | |
| 57 | if (newsize < MINSIZEARRAY) | |
| 58 | newsize = MINSIZEARRAY; /* minimum size */ | |
| 59 | } | |
| 60 | newblock = luaM_reallocv(L, block, *size, newsize, size_elems); | |
| 61 | *size = newsize; /* update only when everything else is OK */ | |
| 62 | return newblock; | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | l_noret luaM_toobig (lua_State *L) { |
| 67 | ||
| 67 | luaG_runerror(L, "memory allocation error: block too big"); | |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
| r31373 | r31374 | |
| 73 | 73 | ** generic allocation routine. |
| 74 | 74 | */ |
| 75 | 75 | void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { |
| 76 | void *newblock; | |
| 77 | global_State *g = G(L); | |
| 78 | size_t realosize = (block) ? osize : 0; | |
| 79 | lua_assert((realosize == 0) == (block == NULL)); | |
| 76 | void *newblock; | |
| 77 | global_State *g = G(L); | |
| 78 | size_t realosize = (block) ? osize : 0; | |
| 79 | lua_assert((realosize == 0) == (block == NULL)); | |
| 80 | 80 | #if defined(HARDMEMTESTS) |
| 81 | if (nsize > realosize && g->gcrunning) | |
| 82 | luaC_fullgc(L, 1); /* force a GC whenever possible */ | |
| 81 | if (nsize > realosize && g->gcrunning) | |
| 82 | luaC_fullgc(L, 1); /* force a GC whenever possible */ | |
| 83 | 83 | #endif |
| 84 | newblock = (*g->frealloc)(g->ud, block, osize, nsize); | |
| 85 | if (newblock == NULL && nsize > 0) { | |
| 86 | api_check(L, nsize > realosize, | |
| 87 | "realloc cannot fail when shrinking a block"); | |
| 88 | if (g->gcrunning) { | |
| 89 | luaC_fullgc(L, 1); /* try to free some memory... */ | |
| 90 | newblock = (*g->frealloc)(g->ud, block, osize, nsize); /* try again */ | |
| 91 | } | |
| 92 | if (newblock == NULL) | |
| 93 | luaD_throw(L, LUA_ERRMEM); | |
| 94 | } | |
| 95 | lua_assert((nsize == 0) == (newblock == NULL)); | |
| 96 | g->GCdebt = (g->GCdebt + nsize) - realosize; | |
| 97 | return newblock; | |
| 84 | newblock = (*g->frealloc)(g->ud, block, osize, nsize); | |
| 85 | if (newblock == NULL && nsize > 0) { | |
| 86 | api_check(L, nsize > realosize, | |
| 87 | "realloc cannot fail when shrinking a block"); | |
| 88 | if (g->gcrunning) { | |
| 89 | luaC_fullgc(L, 1); /* try to free some memory... */ | |
| 90 | newblock = (*g->frealloc)(g->ud, block, osize, nsize); /* try again */ | |
| 91 | } | |
| 92 | if (newblock == NULL) | |
| 93 | luaD_throw(L, LUA_ERRMEM); | |
| 94 | } | |
| 95 | lua_assert((nsize == 0) == (newblock == NULL)); | |
| 96 | g->GCdebt = (g->GCdebt + nsize) - realosize; | |
| 97 | return newblock; | |
| 98 | 98 | } |
| 99 |
| r31373 | r31374 | |
|---|---|---|
| 27 | 27 | |
| 28 | 28 | |
| 29 | 29 | #if !defined(LUAI_GCPAUSE) |
| 30 | #define LUAI_GCPAUSE | |
| 30 | #define LUAI_GCPAUSE 200 /* 200% */ | |
| 31 | 31 | #endif |
| 32 | 32 | |
| 33 | 33 | #if !defined(LUAI_GCMAJOR) |
| 34 | #define LUAI_GCMAJOR | |
| 34 | #define LUAI_GCMAJOR 200 /* 200% */ | |
| 35 | 35 | #endif |
| 36 | 36 | |
| 37 | 37 | #if !defined(LUAI_GCMUL) |
| 38 | #define LUAI_GCMUL | |
| 38 | #define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ | |
| 39 | 39 | #endif |
| 40 | 40 | |
| 41 | 41 | |
| 42 | #define MEMERRMSG | |
| 42 | #define MEMERRMSG "not enough memory" | |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | /* |
| r31373 | r31374 | |
| 48 | 48 | */ |
| 49 | 49 | #if !defined(luai_makeseed) |
| 50 | 50 | #include <time.h> |
| 51 | #define luai_makeseed() | |
| 51 | #define luai_makeseed() cast(unsigned int, time(NULL)) | |
| 52 | 52 | #endif |
| 53 | 53 | |
| 54 | 54 | |
| r31373 | r31374 | |
| 58 | 58 | */ |
| 59 | 59 | typedef struct LX { |
| 60 | 60 | #if defined(LUAI_EXTRASPACE) |
| 61 | ||
| 61 | char buff[LUAI_EXTRASPACE]; | |
| 62 | 62 | #endif |
| 63 | ||
| 63 | lua_State l; | |
| 64 | 64 | } LX; |
| 65 | 65 | |
| 66 | 66 | |
| r31373 | r31374 | |
| 68 | 68 | ** Main thread combines a thread state and the global state |
| 69 | 69 | */ |
| 70 | 70 | typedef struct LG { |
| 71 | LX l; | |
| 72 | global_State g; | |
| 71 | LX l; | |
| 72 | global_State g; | |
| 73 | 73 | } LG; |
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | |
| 77 | #define fromstate(L) | |
| 77 | #define fromstate(L) (cast(LX *, cast(lu_byte *, (L)) - offsetof(LX, l))) | |
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | /* |
| r31373 | r31374 | |
| 83 | 83 | ** randomness.. |
| 84 | 84 | */ |
| 85 | 85 | #define addbuff(b,p,e) \ |
| 86 | { size_t t = cast(size_t, e); \ | |
| 87 | memcpy(buff + p, &t, sizeof(t)); p += sizeof(t); } | |
| 86 | { size_t t = cast(size_t, e); \ | |
| 87 | memcpy(buff + p, &t, sizeof(t)); p += sizeof(t); } | |
| 88 | 88 | |
| 89 | 89 | static unsigned int makeseed (lua_State *L) { |
| 90 | char buff[4 * sizeof(size_t)]; | |
| 91 | unsigned int h = luai_makeseed(); | |
| 92 | int p = 0; | |
| 93 | addbuff(buff, p, L); /* heap variable */ | |
| 94 | addbuff(buff, p, &h); /* local variable */ | |
| 95 | addbuff(buff, p, luaO_nilobject); /* global variable */ | |
| 96 | addbuff(buff, p, &lua_newstate); /* public function */ | |
| 97 | lua_assert(p == sizeof(buff)); | |
| 98 | return luaS_hash(buff, p, h); | |
| 90 | char buff[4 * sizeof(size_t)]; | |
| 91 | unsigned int h = luai_makeseed(); | |
| 92 | int p = 0; | |
| 93 | addbuff(buff, p, L); /* heap variable */ | |
| 94 | addbuff(buff, p, &h); /* local variable */ | |
| 95 | addbuff(buff, p, luaO_nilobject); /* global variable */ | |
| 96 | addbuff(buff, p, &lua_newstate); /* public function */ | |
| 97 | lua_assert(p == sizeof(buff)); | |
| 98 | return luaS_hash(buff, p, h); | |
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | |
| r31373 | r31374 | |
| 104 | 104 | ** invariant |
| 105 | 105 | */ |
| 106 | 106 | void luaE_setdebt (global_State *g, l_mem debt) { |
| 107 | g->totalbytes -= (debt - g->GCdebt); | |
| 108 | g->GCdebt = debt; | |
| 107 | g->totalbytes -= (debt - g->GCdebt); | |
| 108 | g->GCdebt = debt; | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | CallInfo *luaE_extendCI (lua_State *L) { |
| 113 | CallInfo *ci = luaM_new(L, CallInfo); | |
| 114 | lua_assert(L->ci->next == NULL); | |
| 115 | L->ci->next = ci; | |
| 116 | ci->previous = L->ci; | |
| 117 | ci->next = NULL; | |
| 118 | return ci; | |
| 113 | CallInfo *ci = luaM_new(L, CallInfo); | |
| 114 | lua_assert(L->ci->next == NULL); | |
| 115 | L->ci->next = ci; | |
| 116 | ci->previous = L->ci; | |
| 117 | ci->next = NULL; | |
| 118 | return ci; | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| 122 | 122 | void luaE_freeCI (lua_State *L) { |
| 123 | CallInfo *ci = L->ci; | |
| 124 | CallInfo *next = ci->next; | |
| 125 | ci->next = NULL; | |
| 126 | while ((ci = next) != NULL) { | |
| 127 | next = ci->next; | |
| 128 | luaM_free(L, ci); | |
| 129 | } | |
| 123 | CallInfo *ci = L->ci; | |
| 124 | CallInfo *next = ci->next; | |
| 125 | ci->next = NULL; | |
| 126 | while ((ci = next) != NULL) { | |
| 127 | next = ci->next; | |
| 128 | luaM_free(L, ci); | |
| 129 | } | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | static void stack_init (lua_State *L1, lua_State *L) { |
| 134 | int i; CallInfo *ci; | |
| 135 | /* initialize stack array */ | |
| 136 | L1->stack = luaM_newvector(L, BASIC_STACK_SIZE, TValue); | |
| 137 | L1->stacksize = BASIC_STACK_SIZE; | |
| 138 | for (i = 0; i < BASIC_STACK_SIZE; i++) | |
| 139 | setnilvalue(L1->stack + i); /* erase new stack */ | |
| 140 | L1->top = L1->stack; | |
| 141 | L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK; | |
| 142 | /* initialize first ci */ | |
| 143 | ci = &L1->base_ci; | |
| 144 | ci->next = ci->previous = NULL; | |
| 145 | ci->callstatus = 0; | |
| 146 | ci->func = L1->top; | |
| 147 | setnilvalue(L1->top++); /* 'function' entry for this 'ci' */ | |
| 148 | ci->top = L1->top + LUA_MINSTACK; | |
| 149 | L1->ci = ci; | |
| 134 | int i; CallInfo *ci; | |
| 135 | /* initialize stack array */ | |
| 136 | L1->stack = luaM_newvector(L, BASIC_STACK_SIZE, TValue); | |
| 137 | L1->stacksize = BASIC_STACK_SIZE; | |
| 138 | for (i = 0; i < BASIC_STACK_SIZE; i++) | |
| 139 | setnilvalue(L1->stack + i); /* erase new stack */ | |
| 140 | L1->top = L1->stack; | |
| 141 | L1->stack_last = L1->stack + L1->stacksize - EXTRA_STACK; | |
| 142 | /* initialize first ci */ | |
| 143 | ci = &L1->base_ci; | |
| 144 | ci->next = ci->previous = NULL; | |
| 145 | ci->callstatus = 0; | |
| 146 | ci->func = L1->top; | |
| 147 | setnilvalue(L1->top++); /* 'function' entry for this 'ci' */ | |
| 148 | ci->top = L1->top + LUA_MINSTACK; | |
| 149 | L1->ci = ci; | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | static void freestack (lua_State *L) { |
| 154 | if (L->stack == NULL) | |
| 155 | return; /* stack not completely built yet */ | |
| 156 | L->ci = &L->base_ci; /* free the entire 'ci' list */ | |
| 157 | luaE_freeCI(L); | |
| 158 | luaM_freearray(L, L->stack, L->stacksize); /* free stack array */ | |
| 154 | if (L->stack == NULL) | |
| 155 | return; /* stack not completely built yet */ | |
| 156 | L->ci = &L->base_ci; /* free the entire 'ci' list */ | |
| 157 | luaE_freeCI(L); | |
| 158 | luaM_freearray(L, L->stack, L->stacksize); /* free stack array */ | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
| r31373 | r31374 | |
| 163 | 163 | ** Create registry table and its predefined values |
| 164 | 164 | */ |
| 165 | 165 | static void init_registry (lua_State *L, global_State *g) { |
| 166 | TValue mt; | |
| 167 | /* create registry */ | |
| 168 | Table *registry = luaH_new(L); | |
| 169 | sethvalue(L, &g->l_registry, registry); | |
| 170 | luaH_resize(L, registry, LUA_RIDX_LAST, 0); | |
| 171 | /* registry[LUA_RIDX_MAINTHREAD] = L */ | |
| 172 | setthvalue(L, &mt, L); | |
| 173 | luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &mt); | |
| 174 | /* registry[LUA_RIDX_GLOBALS] = table of globals */ | |
| 175 | sethvalue(L, &mt, luaH_new(L)); | |
| 176 | luaH_setint(L, registry, LUA_RIDX_GLOBALS, &mt); | |
| 166 | TValue mt; | |
| 167 | /* create registry */ | |
| 168 | Table *registry = luaH_new(L); | |
| 169 | sethvalue(L, &g->l_registry, registry); | |
| 170 | luaH_resize(L, registry, LUA_RIDX_LAST, 0); | |
| 171 | /* registry[LUA_RIDX_MAINTHREAD] = L */ | |
| 172 | setthvalue(L, &mt, L); | |
| 173 | luaH_setint(L, registry, LUA_RIDX_MAINTHREAD, &mt); | |
| 174 | /* registry[LUA_RIDX_GLOBALS] = table of globals */ | |
| 175 | sethvalue(L, &mt, luaH_new(L)); | |
| 176 | luaH_setint(L, registry, LUA_RIDX_GLOBALS, &mt); | |
| 177 | 177 | } |
| 178 | 178 | |
| 179 | 179 | |
| r31373 | r31374 | |
| 181 | 181 | ** open parts of the state that may cause memory-allocation errors |
| 182 | 182 | */ |
| 183 | 183 | static void f_luaopen (lua_State *L, void *ud) { |
| 184 | global_State *g = G(L); | |
| 185 | UNUSED(ud); | |
| 186 | stack_init(L, L); /* init stack */ | |
| 187 | init_registry(L, g); | |
| 188 | luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ | |
| 189 | luaT_init(L); | |
| 190 | luaX_init(L); | |
| 191 | /* pre-create memory-error message */ | |
| 192 | g->memerrmsg = luaS_newliteral(L, MEMERRMSG); | |
| 193 | luaS_fix(g->memerrmsg); /* it should never be collected */ | |
| 194 | g->gcrunning = 1; /* allow gc */ | |
| 195 | g->version = lua_version(NULL); | |
| 196 | luai_userstateopen(L); | |
| 184 | global_State *g = G(L); | |
| 185 | UNUSED(ud); | |
| 186 | stack_init(L, L); /* init stack */ | |
| 187 | init_registry(L, g); | |
| 188 | luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ | |
| 189 | luaT_init(L); | |
| 190 | luaX_init(L); | |
| 191 | /* pre-create memory-error message */ | |
| 192 | g->memerrmsg = luaS_newliteral(L, MEMERRMSG); | |
| 193 | luaS_fix(g->memerrmsg); /* it should never be collected */ | |
| 194 | g->gcrunning = 1; /* allow gc */ | |
| 195 | g->version = lua_version(NULL); | |
| 196 | luai_userstateopen(L); | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| r31373 | r31374 | |
| 202 | 202 | ** any memory (to avoid errors) |
| 203 | 203 | */ |
| 204 | 204 | static void preinit_state (lua_State *L, global_State *g) { |
| 205 | G(L) = g; | |
| 206 | L->stack = NULL; | |
| 207 | L->ci = NULL; | |
| 208 | L->stacksize = 0; | |
| 209 | L->errorJmp = NULL; | |
| 210 | L->nCcalls = 0; | |
| 211 | L->hook = NULL; | |
| 212 | L->hookmask = 0; | |
| 213 | L->basehookcount = 0; | |
| 214 | L->allowhook = 1; | |
| 215 | resethookcount(L); | |
| 216 | L->openupval = NULL; | |
| 217 | L->nny = 1; | |
| 218 | L->status = LUA_OK; | |
| 219 | L->errfunc = 0; | |
| 205 | G(L) = g; | |
| 206 | L->stack = NULL; | |
| 207 | L->ci = NULL; | |
| 208 | L->stacksize = 0; | |
| 209 | L->errorJmp = NULL; | |
| 210 | L->nCcalls = 0; | |
| 211 | L->hook = NULL; | |
| 212 | L->hookmask = 0; | |
| 213 | L->basehookcount = 0; | |
| 214 | L->allowhook = 1; | |
| 215 | resethookcount(L); | |
| 216 | L->openupval = NULL; | |
| 217 | L->nny = 1; | |
| 218 | L->status = LUA_OK; | |
| 219 | L->errfunc = 0; | |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | |
| 223 | 223 | static void close_state (lua_State *L) { |
| 224 | global_State *g = G(L); | |
| 225 | luaF_close(L, L->stack); /* close all upvalues for this thread */ | |
| 226 | luaC_freeallobjects(L); /* collect all objects */ | |
| 227 | if (g->version) /* closing a fully built state? */ | |
| 228 | luai_userstateclose(L); | |
| 229 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); | |
| 230 | luaZ_freebuffer(L, &g->buff); | |
| 231 | freestack(L); | |
| 232 | lua_assert(gettotalbytes(g) == sizeof(LG)); | |
| 233 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ | |
| 224 | global_State *g = G(L); | |
| 225 | luaF_close(L, L->stack); /* close all upvalues for this thread */ | |
| 226 | luaC_freeallobjects(L); /* collect all objects */ | |
| 227 | if (g->version) /* closing a fully built state? */ | |
| 228 | luai_userstateclose(L); | |
| 229 | luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size); | |
| 230 | luaZ_freebuffer(L, &g->buff); | |
| 231 | freestack(L); | |
| 232 | lua_assert(gettotalbytes(g) == sizeof(LG)); | |
| 233 | (*g->frealloc)(g->ud, fromstate(L), sizeof(LG), 0); /* free main block */ | |
| 234 | 234 | } |
| 235 | 235 | |
| 236 | 236 | |
| 237 | 237 | LUA_API lua_State *lua_newthread (lua_State *L) { |
| 238 | lua_State *L1; | |
| 239 | lua_lock(L); | |
| 240 | luaC_checkGC(L); | |
| 241 | L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), NULL, offsetof(LX, l))->th; | |
| 242 | setthvalue(L, L->top, L1); | |
| 243 | api_incr_top(L); | |
| 244 | preinit_state(L1, G(L)); | |
| 245 | L1->hookmask = L->hookmask; | |
| 246 | L1->basehookcount = L->basehookcount; | |
| 247 | L1->hook = L->hook; | |
| 248 | resethookcount(L1); | |
| 249 | luai_userstatethread(L, L1); | |
| 250 | stack_init(L1, L); /* init stack */ | |
| 251 | lua_unlock(L); | |
| 252 | return L1; | |
| 238 | lua_State *L1; | |
| 239 | lua_lock(L); | |
| 240 | luaC_checkGC(L); | |
| 241 | L1 = &luaC_newobj(L, LUA_TTHREAD, sizeof(LX), NULL, offsetof(LX, l))->th; | |
| 242 | setthvalue(L, L->top, L1); | |
| 243 | api_incr_top(L); | |
| 244 | preinit_state(L1, G(L)); | |
| 245 | L1->hookmask = L->hookmask; | |
| 246 | L1->basehookcount = L->basehookcount; | |
| 247 | L1->hook = L->hook; | |
| 248 | resethookcount(L1); | |
| 249 | luai_userstatethread(L, L1); | |
| 250 | stack_init(L1, L); /* init stack */ | |
| 251 | lua_unlock(L); | |
| 252 | return L1; | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| 256 | 256 | void luaE_freethread (lua_State *L, lua_State *L1) { |
| 257 | LX *l = fromstate(L1); | |
| 258 | luaF_close(L1, L1->stack); /* close all upvalues for this thread */ | |
| 259 | lua_assert(L1->openupval == NULL); | |
| 260 | luai_userstatefree(L, L1); | |
| 261 | freestack(L1); | |
| 262 | luaM_free(L, l); | |
| 257 | LX *l = fromstate(L1); | |
| 258 | luaF_close(L1, L1->stack); /* close all upvalues for this thread */ | |
| 259 | lua_assert(L1->openupval == NULL); | |
| 260 | luai_userstatefree(L, L1); | |
| 261 | freestack(L1); | |
| 262 | luaM_free(L, l); | |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | |
| 266 | 266 | LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { |
| 267 | int i; | |
| 268 | lua_State *L; | |
| 269 | global_State *g; | |
| 270 | LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG))); | |
| 271 | if (l == NULL) return NULL; | |
| 272 | L = &l->l.l; | |
| 273 | g = &l->g; | |
| 274 | L->next = NULL; | |
| 275 | L->tt = LUA_TTHREAD; | |
| 276 | g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); | |
| 277 | L->marked = luaC_white(g); | |
| 278 | g->gckind = KGC_NORMAL; | |
| 279 | preinit_state(L, g); | |
| 280 | g->frealloc = f; | |
| 281 | g->ud = ud; | |
| 282 | g->mainthread = L; | |
| 283 | g->seed = makeseed(L); | |
| 284 | g->uvhead.u.l.prev = &g->uvhead; | |
| 285 | g->uvhead.u.l.next = &g->uvhead; | |
| 286 | g->gcrunning = 0; /* no GC while building state */ | |
| 287 | g->GCestimate = 0; | |
| 288 | g->strt.size = 0; | |
| 289 | g->strt.nuse = 0; | |
| 290 | g->strt.hash = NULL; | |
| 291 | setnilvalue(&g->l_registry); | |
| 292 | luaZ_initbuffer(L, &g->buff); | |
| 293 | g->panic = NULL; | |
| 294 | g->version = NULL; | |
| 295 | g->gcstate = GCSpause; | |
| 296 | g->allgc = NULL; | |
| 297 | g->finobj = NULL; | |
| 298 | g->tobefnz = NULL; | |
| 299 | g->sweepgc = g->sweepfin = NULL; | |
| 300 | g->gray = g->grayagain = NULL; | |
| 301 | g->weak = g->ephemeron = g->allweak = NULL; | |
| 302 | g->totalbytes = sizeof(LG); | |
| 303 | g->GCdebt = 0; | |
| 304 | g->gcpause = LUAI_GCPAUSE; | |
| 305 | g->gcmajorinc = LUAI_GCMAJOR; | |
| 306 | g->gcstepmul = LUAI_GCMUL; | |
| 307 | for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; | |
| 308 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { | |
| 309 | /* memory allocation error: free partial state */ | |
| 310 | close_state(L); | |
| 311 | L = NULL; | |
| 312 | } | |
| 313 | return L; | |
| 267 | int i; | |
| 268 | lua_State *L; | |
| 269 | global_State *g; | |
| 270 | LG *l = cast(LG *, (*f)(ud, NULL, LUA_TTHREAD, sizeof(LG))); | |
| 271 | if (l == NULL) return NULL; | |
| 272 | L = &l->l.l; | |
| 273 | g = &l->g; | |
| 274 | L->next = NULL; | |
| 275 | L->tt = LUA_TTHREAD; | |
| 276 | g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); | |
| 277 | L->marked = luaC_white(g); | |
| 278 | g->gckind = KGC_NORMAL; | |
| 279 | preinit_state(L, g); | |
| 280 | g->frealloc = f; | |
| 281 | g->ud = ud; | |
| 282 | g->mainthread = L; | |
| 283 | g->seed = makeseed(L); | |
| 284 | g->uvhead.u.l.prev = &g->uvhead; | |
| 285 | g->uvhead.u.l.next = &g->uvhead; | |
| 286 | g->gcrunning = 0; /* no GC while building state */ | |
| 287 | g->GCestimate = 0; | |
| 288 | g->strt.size = 0; | |
| 289 | g->strt.nuse = 0; | |
| 290 | g->strt.hash = NULL; | |
| 291 | setnilvalue(&g->l_registry); | |
| 292 | luaZ_initbuffer(L, &g->buff); | |
| 293 | g->panic = NULL; | |
| 294 | g->version = NULL; | |
| 295 | g->gcstate = GCSpause; | |
| 296 | g->allgc = NULL; | |
| 297 | g->finobj = NULL; | |
| 298 | g->tobefnz = NULL; | |
| 299 | g->sweepgc = g->sweepfin = NULL; | |
| 300 | g->gray = g->grayagain = NULL; | |
| 301 | g->weak = g->ephemeron = g->allweak = NULL; | |
| 302 | g->totalbytes = sizeof(LG); | |
| 303 | g->GCdebt = 0; | |
| 304 | g->gcpause = LUAI_GCPAUSE; | |
| 305 | g->gcmajorinc = LUAI_GCMAJOR; | |
| 306 | g->gcstepmul = LUAI_GCMUL; | |
| 307 | for (i=0; i < LUA_NUMTAGS; i++) g->mt[i] = NULL; | |
| 308 | if (luaD_rawrunprotected(L, f_luaopen, NULL) != LUA_OK) { | |
| 309 | /* memory allocation error: free partial state */ | |
| 310 | close_state(L); | |
| 311 | L = NULL; | |
| 312 | } | |
| 313 | return L; | |
| 314 | 314 | } |
| 315 | 315 | |
| 316 | 316 | |
| 317 | 317 | LUA_API void lua_close (lua_State *L) { |
| 318 | L = G(L)->mainthread; /* only the main thread can be closed */ | |
| 319 | lua_lock(L); | |
| 320 | close_state(L); | |
| 318 | L = G(L)->mainthread; /* only the main thread can be closed */ | |
| 319 | lua_lock(L); | |
| 320 | close_state(L); | |
| 321 | 321 | } |
| 322 | ||
| 323 |
| r31373 | r31374 | |
|---|---|---|
| 18 | 18 | |
| 19 | 19 | |
| 20 | 20 | #undef PI |
| 21 | #define PI ((lua_Number)(3.1415926535897932384626433832795)) | |
| 22 | #define RADIANS_PER_DEGREE ((lua_Number)(PI/180.0)) | |
| 21 | #define PI ((lua_Number)(3.1415926535897932384626433832795)) | |
| 22 | #define RADIANS_PER_DEGREE ((lua_Number)(PI/180.0)) | |
| 23 | 23 | |
| 24 | 24 | |
| 25 | 25 | |
| 26 | 26 | static int math_abs (lua_State *L) { |
| 27 | lua_pushnumber(L, l_mathop(fabs)(luaL_checknumber(L, 1))); | |
| 28 | return 1; | |
| 27 | lua_pushnumber(L, l_mathop(fabs)(luaL_checknumber(L, 1))); | |
| 28 | return 1; | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | static int math_sin (lua_State *L) { |
| 32 | lua_pushnumber(L, l_mathop(sin)(luaL_checknumber(L, 1))); | |
| 33 | return 1; | |
| 32 | lua_pushnumber(L, l_mathop(sin)(luaL_checknumber(L, 1))); | |
| 33 | return 1; | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | static int math_sinh (lua_State *L) { |
| 37 | lua_pushnumber(L, l_mathop(sinh)(luaL_checknumber(L, 1))); | |
| 38 | return 1; | |
| 37 | lua_pushnumber(L, l_mathop(sinh)(luaL_checknumber(L, 1))); | |
| 38 | return 1; | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | static int math_cos (lua_State *L) { |
| 42 | lua_pushnumber(L, l_mathop(cos)(luaL_checknumber(L, 1))); | |
| 43 | return 1; | |
| 42 | lua_pushnumber(L, l_mathop(cos)(luaL_checknumber(L, 1))); | |
| 43 | return 1; | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | static int math_cosh (lua_State *L) { |
| 47 | lua_pushnumber(L, l_mathop(cosh)(luaL_checknumber(L, 1))); | |
| 48 | return 1; | |
| 47 | lua_pushnumber(L, l_mathop(cosh)(luaL_checknumber(L, 1))); | |
| 48 | return 1; | |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | static int math_tan (lua_State *L) { |
| 52 | lua_pushnumber(L, l_mathop(tan)(luaL_checknumber(L, 1))); | |
| 53 | return 1; | |
| 52 | lua_pushnumber(L, l_mathop(tan)(luaL_checknumber(L, 1))); | |
| 53 | return 1; | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static int math_tanh (lua_State *L) { |
| 57 | lua_pushnumber(L, l_mathop(tanh)(luaL_checknumber(L, 1))); | |
| 58 | return 1; | |
| 57 | lua_pushnumber(L, l_mathop(tanh)(luaL_checknumber(L, 1))); | |
| 58 | return 1; | |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | static int math_asin (lua_State *L) { |
| 62 | lua_pushnumber(L, l_mathop(asin)(luaL_checknumber(L, 1))); | |
| 63 | return 1; | |
| 62 | lua_pushnumber(L, l_mathop(asin)(luaL_checknumber(L, 1))); | |
| 63 | return 1; | |
| 64 | 64 | } |
| 65 | 65 | |
| 66 | 66 | static int math_acos (lua_State *L) { |
| 67 | lua_pushnumber(L, l_mathop(acos)(luaL_checknumber(L, 1))); | |
| 68 | return 1; | |
| 67 | lua_pushnumber(L, l_mathop(acos)(luaL_checknumber(L, 1))); | |
| 68 | return 1; | |
| 69 | 69 | } |
| 70 | 70 | |
| 71 | 71 | static int math_atan (lua_State *L) { |
| 72 | lua_pushnumber(L, l_mathop(atan)(luaL_checknumber(L, 1))); | |
| 73 | return 1; | |
| 72 | lua_pushnumber(L, l_mathop(atan)(luaL_checknumber(L, 1))); | |
| 73 | return 1; | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | static int math_atan2 (lua_State *L) { |
| 77 | lua_pushnumber(L, l_mathop(atan2)(luaL_checknumber(L, 1), | |
| 78 | luaL_checknumber(L, 2))); | |
| 79 | return 1; | |
| 77 | lua_pushnumber(L, l_mathop(atan2)(luaL_checknumber(L, 1), | |
| 78 | luaL_checknumber(L, 2))); | |
| 79 | return 1; | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | static int math_ceil (lua_State *L) { |
| 83 | lua_pushnumber(L, l_mathop(ceil)(luaL_checknumber(L, 1))); | |
| 84 | return 1; | |
| 83 | lua_pushnumber(L, l_mathop(ceil)(luaL_checknumber(L, 1))); | |
| 84 | return 1; | |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | static int math_floor (lua_State *L) { |
| 88 | lua_pushnumber(L, l_mathop(floor)(luaL_checknumber(L, 1))); | |
| 89 | return 1; | |
| 88 | lua_pushnumber(L, l_mathop(floor)(luaL_checknumber(L, 1))); | |
| 89 | return 1; | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | static int math_fmod (lua_State *L) { |
| 93 | lua_pushnumber(L, l_mathop(fmod)(luaL_checknumber(L, 1), | |
| 94 | luaL_checknumber(L, 2))); | |
| 95 | return 1; | |
| 93 | lua_pushnumber(L, l_mathop(fmod)(luaL_checknumber(L, 1), | |
| 94 | luaL_checknumber(L, 2))); | |
| 95 | return 1; | |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | static int math_modf (lua_State *L) { |
| 99 | lua_Number ip; | |
| 100 | lua_Number fp = l_mathop(modf)(luaL_checknumber(L, 1), &ip); | |
| 101 | lua_pushnumber(L, ip); | |
| 102 | lua_pushnumber(L, fp); | |
| 103 | return 2; | |
| 99 | lua_Number ip; | |
| 100 | lua_Number fp = l_mathop(modf)(luaL_checknumber(L, 1), &ip); | |
| 101 | lua_pushnumber(L, ip); | |
| 102 | lua_pushnumber(L, fp); | |
| 103 | return 2; | |
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | static int math_sqrt (lua_State *L) { |
| 107 | lua_pushnumber(L, l_mathop(sqrt)(luaL_checknumber(L, 1))); | |
| 108 | return 1; | |
| 107 | lua_pushnumber(L, l_mathop(sqrt)(luaL_checknumber(L, 1))); | |
| 108 | return 1; | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | static int math_pow (lua_State *L) { |
| 112 | lua_Number x = luaL_checknumber(L, 1); | |
| 113 | lua_Number y = luaL_checknumber(L, 2); | |
| 114 | lua_pushnumber(L, l_mathop(pow)(x, y)); | |
| 115 | return 1; | |
| 112 | lua_Number x = luaL_checknumber(L, 1); | |
| 113 | lua_Number y = luaL_checknumber(L, 2); | |
| 114 | lua_pushnumber(L, l_mathop(pow)(x, y)); | |
| 115 | return 1; | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | static int math_log (lua_State *L) { |
| 119 | lua_Number x = luaL_checknumber(L, 1); | |
| 120 | lua_Number res; | |
| 121 | if (lua_isnoneornil(L, 2)) | |
| 122 | res = l_mathop(log)(x); | |
| 123 | else { | |
| 124 | lua_Number base = luaL_checknumber(L, 2); | |
| 125 | if (base == (lua_Number)10.0) res = l_mathop(log10)(x); | |
| 126 | else res = l_mathop(log)(x)/l_mathop(log)(base); | |
| 127 | } | |
| 128 | lua_pushnumber(L, res); | |
| 129 | return 1; | |
| 119 | lua_Number x = luaL_checknumber(L, 1); | |
| 120 | lua_Number res; | |
| 121 | if (lua_isnoneornil(L, 2)) | |
| 122 | res = l_mathop(log)(x); | |
| 123 | else { | |
| 124 | lua_Number base = luaL_checknumber(L, 2); | |
| 125 | if (base == (lua_Number)10.0) res = l_mathop(log10)(x); | |
| 126 | else res = l_mathop(log)(x)/l_mathop(log)(base); | |
| 127 | } | |
| 128 | lua_pushnumber(L, res); | |
| 129 | return 1; | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | #if defined(LUA_COMPAT_LOG10) |
| 133 | 133 | static int math_log10 (lua_State *L) { |
| 134 | lua_pushnumber(L, l_mathop(log10)(luaL_checknumber(L, 1))); | |
| 135 | return 1; | |
| 134 | lua_pushnumber(L, l_mathop(log10)(luaL_checknumber(L, 1))); | |
| 135 | return 1; | |
| 136 | 136 | } |
| 137 | 137 | #endif |
| 138 | 138 | |
| 139 | 139 | static int math_exp (lua_State *L) { |
| 140 | lua_pushnumber(L, l_mathop(exp)(luaL_checknumber(L, 1))); | |
| 141 | return 1; | |
| 140 | lua_pushnumber(L, l_mathop(exp)(luaL_checknumber(L, 1))); | |
| 141 | return 1; | |
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | static int math_deg (lua_State *L) { |
| 145 | lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); | |
| 146 | return 1; | |
| 145 | lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); | |
| 146 | return 1; | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | static int math_rad (lua_State *L) { |
| 150 | lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); | |
| 151 | return 1; | |
| 150 | lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); | |
| 151 | return 1; | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | static int math_frexp (lua_State *L) { |
| 155 | int e; | |
| 156 | lua_pushnumber(L, l_mathop(frexp)(luaL_checknumber(L, 1), &e)); | |
| 157 | lua_pushinteger(L, e); | |
| 158 | return 2; | |
| 155 | int e; | |
| 156 | lua_pushnumber(L, l_mathop(frexp)(luaL_checknumber(L, 1), &e)); | |
| 157 | lua_pushinteger(L, e); | |
| 158 | return 2; | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | static int math_ldexp (lua_State *L) { |
| 162 | lua_Number x = luaL_checknumber(L, 1); | |
| 163 | int ep = luaL_checkint(L, 2); | |
| 164 | lua_pushnumber(L, l_mathop(ldexp)(x, ep)); | |
| 165 | return 1; | |
| 162 | lua_Number x = luaL_checknumber(L, 1); | |
| 163 | int ep = luaL_checkint(L, 2); | |
| 164 | lua_pushnumber(L, l_mathop(ldexp)(x, ep)); | |
| 165 | return 1; | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | |
| 170 | 170 | static int math_min (lua_State *L) { |
| 171 | int n = lua_gettop(L); /* number of arguments */ | |
| 172 | lua_Number dmin = luaL_checknumber(L, 1); | |
| 173 | int i; | |
| 174 | for (i=2; i<=n; i++) { | |
| 175 | lua_Number d = luaL_checknumber(L, i); | |
| 176 | if (d < dmin) | |
| 177 | dmin = d; | |
| 178 | } | |
| 179 | lua_pushnumber(L, dmin); | |
| 180 | return 1; | |
| 171 | int n = lua_gettop(L); /* number of arguments */ | |
| 172 | lua_Number dmin = luaL_checknumber(L, 1); | |
| 173 | int i; | |
| 174 | for (i=2; i<=n; i++) { | |
| 175 | lua_Number d = luaL_checknumber(L, i); | |
| 176 | if (d < dmin) | |
| 177 | dmin = d; | |
| 178 | } | |
| 179 | lua_pushnumber(L, dmin); | |
| 180 | return 1; | |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | |
| 184 | 184 | static int math_max (lua_State *L) { |
| 185 | int n = lua_gettop(L); /* number of arguments */ | |
| 186 | lua_Number dmax = luaL_checknumber(L, 1); | |
| 187 | int i; | |
| 188 | for (i=2; i<=n; i++) { | |
| 189 | lua_Number d = luaL_checknumber(L, i); | |
| 190 | if (d > dmax) | |
| 191 | dmax = d; | |
| 192 | } | |
| 193 | lua_pushnumber(L, dmax); | |
| 194 | return 1; | |
| 185 | int n = lua_gettop(L); /* number of arguments */ | |
| 186 | lua_Number dmax = luaL_checknumber(L, 1); | |
| 187 | int i; | |
| 188 | for (i=2; i<=n; i++) { | |
| 189 | lua_Number d = luaL_checknumber(L, i); | |
| 190 | if (d > dmax) | |
| 191 | dmax = d; | |
| 192 | } | |
| 193 | lua_pushnumber(L, dmax); | |
| 194 | return 1; | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | static int math_random (lua_State *L) { |
| 199 | /* the `%' avoids the (rare) case of r==1, and is needed also because on | |
| 200 | some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ | |
| 201 | lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; | |
| 202 | switch (lua_gettop(L)) { /* check number of arguments */ | |
| 203 | case 0: { /* no arguments */ | |
| 204 | lua_pushnumber(L, r); /* Number between 0 and 1 */ | |
| 205 | break; | |
| 206 | } | |
| 207 | case 1: { /* only upper limit */ | |
| 208 | lua_Number u = luaL_checknumber(L, 1); | |
| 209 | luaL_argcheck(L, (lua_Number)1.0 <= u, 1, "interval is empty"); | |
| 210 | lua_pushnumber(L, l_mathop(floor)(r*u) + (lua_Number)(1.0)); /* [1, u] */ | |
| 211 | break; | |
| 212 | } | |
| 213 | case 2: { /* lower and upper limits */ | |
| 214 | lua_Number l = luaL_checknumber(L, 1); | |
| 215 | lua_Number u = luaL_checknumber(L, 2); | |
| 216 | luaL_argcheck(L, l <= u, 2, "interval is empty"); | |
| 217 | lua_pushnumber(L, l_mathop(floor)(r*(u-l+1)) + l); /* [l, u] */ | |
| 218 | break; | |
| 219 | } | |
| 220 | default: return luaL_error(L, "wrong number of arguments"); | |
| 221 | } | |
| 222 | return 1; | |
| 199 | /* the `%' avoids the (rare) case of r==1, and is needed also because on | |
| 200 | some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ | |
| 201 | lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; | |
| 202 | switch (lua_gettop(L)) { /* check number of arguments */ | |
| 203 | case 0: { /* no arguments */ | |
| 204 | lua_pushnumber(L, r); /* Number between 0 and 1 */ | |
| 205 | break; | |
| 206 | } | |
| 207 | case 1: { /* only upper limit */ | |
| 208 | lua_Number u = luaL_checknumber(L, 1); | |
| 209 | luaL_argcheck(L, (lua_Number)1.0 <= u, 1, "interval is empty"); | |
| 210 | lua_pushnumber(L, l_mathop(floor)(r*u) + (lua_Number)(1.0)); /* [1, u] */ | |
| 211 | break; | |
| 212 | } | |
| 213 | case 2: { /* lower and upper limits */ | |
| 214 | lua_Number l = luaL_checknumber(L, 1); | |
| 215 | lua_Number u = luaL_checknumber(L, 2); | |
| 216 | luaL_argcheck(L, l <= u, 2, "interval is empty"); | |
| 217 | lua_pushnumber(L, l_mathop(floor)(r*(u-l+1)) + l); /* [l, u] */ | |
| 218 | break; | |
| 219 | } | |
| 220 | default: return luaL_error(L, "wrong number of arguments"); | |
| 221 | } | |
| 222 | return 1; | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | |
| 226 | 226 | static int math_randomseed (lua_State *L) { |
| 227 | srand(luaL_checkunsigned(L, 1)); | |
| 228 | (void)rand(); /* discard first value to avoid undesirable correlations */ | |
| 229 | return 0; | |
| 227 | srand(luaL_checkunsigned(L, 1)); | |
| 228 | (void)rand(); /* discard first value to avoid undesirable correlations */ | |
| 229 | return 0; | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | |
| 233 | 233 | static const luaL_Reg mathlib[] = { |
| 234 | {"abs", math_abs}, | |
| 235 | {"acos", math_acos}, | |
| 236 | {"asin", math_asin}, | |
| 237 | {"atan2", math_atan2}, | |
| 238 | {"atan", math_atan}, | |
| 239 | {"ceil", math_ceil}, | |
| 240 | {"cosh", math_cosh}, | |
| 241 | {"cos", math_cos}, | |
| 242 | {"deg", math_deg}, | |
| 243 | {"exp", math_exp}, | |
| 244 | {"floor", math_floor}, | |
| 245 | {"fmod", math_fmod}, | |
| 246 | {"frexp", math_frexp}, | |
| 247 | {"ldexp", math_ldexp}, | |
| 234 | {"abs", math_abs}, | |
| 235 | {"acos", math_acos}, | |
| 236 | {"asin", math_asin}, | |
| 237 | {"atan2", math_atan2}, | |
| 238 | {"atan", math_atan}, | |
| 239 | {"ceil", math_ceil}, | |
| 240 | {"cosh", math_cosh}, | |
| 241 | {"cos", math_cos}, | |
| 242 | {"deg", math_deg}, | |
| 243 | {"exp", math_exp}, | |
| 244 | {"floor", math_floor}, | |
| 245 | {"fmod", math_fmod}, | |
| 246 | {"frexp", math_frexp}, | |
| 247 | {"ldexp", math_ldexp}, | |
| 248 | 248 | #if defined(LUA_COMPAT_LOG10) |
| 249 | ||
| 249 | {"log10", math_log10}, | |
| 250 | 250 | #endif |
| 251 | {"log", math_log}, | |
| 252 | {"max", math_max}, | |
| 253 | {"min", math_min}, | |
| 254 | {"modf", math_modf}, | |
| 255 | {"pow", math_pow}, | |
| 256 | {"rad", math_rad}, | |
| 257 | {"random", math_random}, | |
| 258 | {"randomseed", math_randomseed}, | |
| 259 | {"sinh", math_sinh}, | |
| 260 | {"sin", math_sin}, | |
| 261 | {"sqrt", math_sqrt}, | |
| 262 | {"tanh", math_tanh}, | |
| 263 | {"tan", math_tan}, | |
| 264 | {NULL, NULL} | |
| 251 | {"log", math_log}, | |
| 252 | {"max", math_max}, | |
| 253 | {"min", math_min}, | |
| 254 | {"modf", math_modf}, | |
| 255 | {"pow", math_pow}, | |
| 256 | {"rad", math_rad}, | |
| 257 | {"random", math_random}, | |
| 258 | {"randomseed", math_randomseed}, | |
| 259 | {"sinh", math_sinh}, | |
| 260 | {"sin", math_sin}, | |
| 261 | {"sqrt", math_sqrt}, | |
| 262 | {"tanh", math_tanh}, | |
| 263 | {"tan", math_tan}, | |
| 264 | {NULL, NULL} | |
| 265 | 265 | }; |
| 266 | 266 | |
| 267 | 267 | |
| r31373 | r31374 | |
| 269 | 269 | ** Open math library |
| 270 | 270 | */ |
| 271 | 271 | LUAMOD_API int luaopen_math (lua_State *L) { |
| 272 | luaL_newlib(L, mathlib); | |
| 273 | lua_pushnumber(L, PI); | |
| 274 | lua_setfield(L, -2, "pi"); | |
| 275 | lua_pushnumber(L, HUGE_VAL); | |
| 276 | lua_setfield(L, -2, "huge"); | |
| 277 | return 1; | |
| 272 | luaL_newlib(L, mathlib); | |
| 273 | lua_pushnumber(L, PI); | |
| 274 | lua_setfield(L, -2, "pi"); | |
| 275 | lua_pushnumber(L, HUGE_VAL); | |
| 276 | lua_setfield(L, -2, "huge"); | |
| 277 | return 1; | |
| 278 | 278 | } |
| 279 |
| r31373 | r31374 | |
|---|---|---|
| 22 | 22 | static const char udatatypename[] = "userdata"; |
| 23 | 23 | |
| 24 | 24 | LUAI_DDEF const char *const luaT_typenames_[LUA_TOTALTAGS] = { |
| 25 | "no value", | |
| 26 | "nil", "boolean", udatatypename, "number", | |
| 27 | "string", "table", "function", udatatypename, "thread", | |
| 28 | "proto", "upval" /* these last two cases are used for tests only */ | |
| 25 | "no value", | |
| 26 | "nil", "boolean", udatatypename, "number", | |
| 27 | "string", "table", "function", udatatypename, "thread", | |
| 28 | "proto", "upval" /* these last two cases are used for tests only */ | |
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | void luaT_init (lua_State *L) { |
| 33 | static const char *const luaT_eventname[] = { /* ORDER TM */ | |
| 34 | "__index", "__newindex", | |
| 35 | "__gc", "__mode", "__len", "__eq", | |
| 36 | "__add", "__sub", "__mul", "__div", "__mod", | |
| 37 | "__pow", "__unm", "__lt", "__le", | |
| 38 | "__concat", "__call" | |
| 39 | }; | |
| 40 | int i; | |
| 41 | for (i=0; i<TM_N; i++) { | |
| 42 | G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]); | |
| 43 | luaS_fix(G(L)->tmname[i]); /* never collect these names */ | |
| 44 | } | |
| 33 | static const char *const luaT_eventname[] = { /* ORDER TM */ | |
| 34 | "__index", "__newindex", | |
| 35 | "__gc", "__mode", "__len", "__eq", | |
| 36 | "__add", "__sub", "__mul", "__div", "__mod", | |
| 37 | "__pow", "__unm", "__lt", "__le", | |
| 38 | "__concat", "__call" | |
| 39 | }; | |
| 40 | int i; | |
| 41 | for (i=0; i<TM_N; i++) { | |
| 42 | G(L)->tmname[i] = luaS_new(L, luaT_eventname[i]); | |
| 43 | luaS_fix(G(L)->tmname[i]); /* never collect these names */ | |
| 44 | } | |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | |
| r31373 | r31374 | |
| 50 | 50 | ** tag methods |
| 51 | 51 | */ |
| 52 | 52 | const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { |
| 53 | const TValue *tm = luaH_getstr(events, ename); | |
| 54 | lua_assert(event <= TM_EQ); | |
| 55 | if (ttisnil(tm)) { /* no tag method? */ | |
| 56 | events->flags |= cast_byte(1u<<event); /* cache this fact */ | |
| 57 | return NULL; | |
| 58 | } | |
| 59 | else return tm; | |
| 53 | const TValue *tm = luaH_getstr(events, ename); | |
| 54 | lua_assert(event <= TM_EQ); | |
| 55 | if (ttisnil(tm)) { /* no tag method? */ | |
| 56 | events->flags |= cast_byte(1u<<event); /* cache this fact */ | |
| 57 | return NULL; | |
| 58 | } | |
| 59 | else return tm; | |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | 62 | |
| 63 | 63 | const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, TMS event) { |
| 64 | Table *mt; | |
| 65 | switch (ttypenv(o)) { | |
| 66 | case LUA_TTABLE: | |
| 67 | mt = hvalue(o)->metatable; | |
| 68 | break; | |
| 69 | case LUA_TUSERDATA: | |
| 70 | mt = uvalue(o)->metatable; | |
| 71 | break; | |
| 72 | default: | |
| 73 | mt = G(L)->mt[ttypenv(o)]; | |
| 74 | } | |
| 75 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); | |
| 64 | Table *mt; | |
| 65 | switch (ttypenv(o)) { | |
| 66 | case LUA_TTABLE: | |
| 67 | mt = hvalue(o)->metatable; | |
| 68 | break; | |
| 69 | case LUA_TUSERDATA: | |
| 70 | mt = uvalue(o)->metatable; | |
| 71 | break; | |
| 72 | default: | |
| 73 | mt = G(L)->mt[ttypenv(o)]; | |
| 74 | } | |
| 75 | return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); | |
| 76 | 76 | } |
| 77 |
| r31373 | r31374 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | /* limit for table tag-method chains (to avoid loops) */ |
| 32 | #define MAXTAGLOOP | |
| 32 | #define MAXTAGLOOP 100 | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | const TValue *luaV_tonumber (const TValue *obj, TValue *n) { |
| 36 | lua_Number num; | |
| 37 | if (ttisnumber(obj)) return obj; | |
| 38 | if (ttisstring(obj) && luaO_str2d(svalue(obj), tsvalue(obj)->len, &num)) { | |
| 39 | setnvalue(n, num); | |
| 40 | return n; | |
| 41 | } | |
| 42 | else | |
| 43 | return NULL; | |
| 36 | lua_Number num; | |
| 37 | if (ttisnumber(obj)) return obj; | |
| 38 | if (ttisstring(obj) && luaO_str2d(svalue(obj), tsvalue(obj)->len, &num)) { | |
| 39 | setnvalue(n, num); | |
| 40 | return n; | |
| 41 | } | |
| 42 | else | |
| 43 | return NULL; | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | int luaV_tostring (lua_State *L, StkId obj) { |
| 48 | if (!ttisnumber(obj)) | |
| 49 | return 0; | |
| 50 | else { | |
| 51 | char s[LUAI_MAXNUMBER2STR]; | |
| 52 | lua_Number n = nvalue(obj); | |
| 53 | int l = lua_number2str(s, n); | |
| 54 | setsvalue2s(L, obj, luaS_newlstr(L, s, l)); | |
| 55 | return 1; | |
| 56 | } | |
| 48 | if (!ttisnumber(obj)) | |
| 49 | return 0; | |
| 50 | else { | |
| 51 | char s[LUAI_MAXNUMBER2STR]; | |
| 52 | lua_Number n = nvalue(obj); | |
| 53 | int l = lua_number2str(s, n); | |
| 54 | setsvalue2s(L, obj, luaS_newlstr(L, s, l)); | |
| 55 | return 1; | |
| 56 | } | |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | static void traceexec (lua_State *L) { |
| 61 | CallInfo *ci = L->ci; | |
| 62 | lu_byte mask = L->hookmask; | |
| 63 | int counthook = ((mask & LUA_MASKCOUNT) && L->hookcount == 0); | |
| 64 | if (counthook) | |
| 65 | resethookcount(L); /* reset count */ | |
| 66 | if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ | |
| 67 | ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ | |
| 68 | return; /* do not call hook again (VM yielded, so it did not move) */ | |
| 69 | } | |
| 70 | if (counthook) | |
| 71 | luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ | |
| 72 | if (mask & LUA_MASKLINE) { | |
| 73 | Proto *p = ci_func(ci)->p; | |
| 74 | int npc = pcRel(ci->u.l.savedpc, p); | |
| 75 | int newline = getfuncline(p, npc); | |
| 76 | if (npc == 0 || /* call linehook when enter a new function, */ | |
| 77 | ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */ | |
| 78 | newline != getfuncline(p, pcRel(L->oldpc, p))) /* enter a new line */ | |
| 79 | luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */ | |
| 80 | } | |
| 81 | L->oldpc = ci->u.l.savedpc; | |
| 82 | if (L->status == LUA_YIELD) { /* did hook yield? */ | |
| 83 | if (counthook) | |
| 84 | L->hookcount = 1; /* undo decrement to zero */ | |
| 85 | ci->u.l.savedpc--; /* undo increment (resume will increment it again) */ | |
| 86 | ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ | |
| 87 | ci->func = L->top - 1; /* protect stack below results */ | |
| 88 | luaD_throw(L, LUA_YIELD); | |
| 89 | } | |
| 61 | CallInfo *ci = L->ci; | |
| 62 | lu_byte mask = L->hookmask; | |
| 63 | int counthook = ((mask & LUA_MASKCOUNT) && L->hookcount == 0); | |
| 64 | if (counthook) | |
| 65 | resethookcount(L); /* reset count */ | |
| 66 | if (ci->callstatus & CIST_HOOKYIELD) { /* called hook last time? */ | |
| 67 | ci->callstatus &= ~CIST_HOOKYIELD; /* erase mark */ | |
| 68 | return; /* do not call hook again (VM yielded, so it did not move) */ | |
| 69 | } | |
| 70 | if (counthook) | |
| 71 | luaD_hook(L, LUA_HOOKCOUNT, -1); /* call count hook */ | |
| 72 | if (mask & LUA_MASKLINE) { | |
| 73 | Proto *p = ci_func(ci)->p; | |
| 74 | int npc = pcRel(ci->u.l.savedpc, p); | |
| 75 | int newline = getfuncline(p, npc); | |
| 76 | if (npc == 0 || /* call linehook when enter a new function, */ | |
| 77 | ci->u.l.savedpc <= L->oldpc || /* when jump back (loop), or when */ | |
| 78 | newline != getfuncline(p, pcRel(L->oldpc, p))) /* enter a new line */ | |
| 79 | luaD_hook(L, LUA_HOOKLINE, newline); /* call line hook */ | |
| 80 | } | |
| 81 | L->oldpc = ci->u.l.savedpc; | |
| 82 | if (L->status == LUA_YIELD) { /* did hook yield? */ | |
| 83 | if (counthook) | |
| 84 | L->hookcount = 1; /* undo decrement to zero */ | |
| 85 | ci->u.l.savedpc--; /* undo increment (resume will increment it again) */ | |
| 86 | ci->callstatus |= CIST_HOOKYIELD; /* mark that it yielded */ | |
| 87 | ci->func = L->top - 1; /* protect stack below results */ | |
| 88 | luaD_throw(L, LUA_YIELD); | |
| 89 | } | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | static void callTM (lua_State *L, const TValue *f, const TValue *p1, |
| 94 | const TValue *p2, TValue *p3, int hasres) { | |
| 95 | ptrdiff_t result = savestack(L, p3); | |
| 96 | setobj2s(L, L->top++, f); /* push function */ | |
| 97 | setobj2s(L, L->top++, p1); /* 1st argument */ | |
| 98 | setobj2s(L, L->top++, p2); /* 2nd argument */ | |
| 99 | if (!hasres) /* no result? 'p3' is third argument */ | |
| 100 | setobj2s(L, L->top++, p3); /* 3rd argument */ | |
| 101 | /* metamethod may yield only when called from Lua code */ | |
| 102 | luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci)); | |
| 103 | if (hasres) { /* if has result, move it to its place */ | |
| 104 | p3 = restorestack(L, result); | |
| 105 | setobjs2s(L, p3, --L->top); | |
| 106 | } | |
| 94 | const TValue *p2, TValue *p3, int hasres) { | |
| 95 | ptrdiff_t result = savestack(L, p3); | |
| 96 | setobj2s(L, L->top++, f); /* push function */ | |
| 97 | setobj2s(L, L->top++, p1); /* 1st argument */ | |
| 98 | setobj2s(L, L->top++, p2); /* 2nd argument */ | |
| 99 | if (!hasres) /* no result? 'p3' is third argument */ | |
| 100 | setobj2s(L, L->top++, p3); /* 3rd argument */ | |
| 101 | /* metamethod may yield only when called from Lua code */ | |
| 102 | luaD_call(L, L->top - (4 - hasres), hasres, isLua(L->ci)); | |
| 103 | if (hasres) { /* if has result, move it to its place */ | |
| 104 | p3 = restorestack(L, result); | |
| 105 | setobjs2s(L, p3, --L->top); | |
| 106 | } | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { |
| 111 | int loop; | |
| 112 | for (loop = 0; loop < MAXTAGLOOP; loop++) { | |
| 113 | const TValue *tm; | |
| 114 | if (ttistable(t)) { /* `t' is a table? */ | |
| 115 | Table *h = hvalue(t); | |
| 116 | const TValue *res = luaH_get(h, key); /* do a primitive get */ | |
| 117 | if (!ttisnil(res) || /* result is not nil? */ | |
| 118 | (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ | |
| 119 | setobj2s(L, val, res); | |
| 120 | return; | |
| 121 | } | |
| 122 | /* else will try the tag method */ | |
| 123 | } | |
| 124 | else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) | |
| 125 | luaG_typeerror(L, t, "index"); | |
| 126 | if (ttisfunction(tm)) { | |
| 127 | callTM(L, tm, t, key, val, 1); | |
| 128 | return; | |
| 129 | } | |
| 130 | t = tm; /* else repeat with 'tm' */ | |
| 131 | } | |
| 132 | luaG_runerror(L, "loop in gettable"); | |
| 111 | int loop; | |
| 112 | for (loop = 0; loop < MAXTAGLOOP; loop++) { | |
| 113 | const TValue *tm; | |
| 114 | if (ttistable(t)) { /* `t' is a table? */ | |
| 115 | Table *h = hvalue(t); | |
| 116 | const TValue *res = luaH_get(h, key); /* do a primitive get */ | |
| 117 | if (!ttisnil(res) || /* result is not nil? */ | |
| 118 | (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ | |
| 119 | setobj2s(L, val, res); | |
| 120 | return; | |
| 121 | } | |
| 122 | /* else will try the tag method */ | |
| 123 | } | |
| 124 | else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) | |
| 125 | luaG_typeerror(L, t, "index"); | |
| 126 | if (ttisfunction(tm)) { | |
| 127 | callTM(L, tm, t, key, val, 1); | |
| 128 | return; | |
| 129 | } | |
| 130 | t = tm; /* else repeat with 'tm' */ | |
| 131 | } | |
| 132 | luaG_runerror(L, "loop in gettable"); | |
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | |
| 136 | 136 | void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { |
| 137 | int loop; | |
| 138 | for (loop = 0; loop < MAXTAGLOOP; loop++) { | |
| 139 | const TValue *tm; | |
| 140 | if (ttistable(t)) { /* `t' is a table? */ | |
| 141 | Table *h = hvalue(t); | |
| 142 | TValue *oldval = cast(TValue *, luaH_get(h, key)); | |
| 143 | /* if previous value is not nil, there must be a previous entry | |
| 144 | in the table; moreover, a metamethod has no relevance */ | |
| 145 | if (!ttisnil(oldval) || | |
| 146 | /* previous value is nil; must check the metamethod */ | |
| 147 | ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL && | |
| 148 | /* no metamethod; is there a previous entry in the table? */ | |
| 149 | (oldval != luaO_nilobject || | |
| 150 | /* no previous entry; must create one. (The next test is | |
| 151 | always true; we only need the assignment.) */ | |
| 152 | (oldval = luaH_newkey(L, h, key), 1)))) { | |
| 153 | /* no metamethod and (now) there is an entry with given key */ | |
| 154 | setobj2t(L, oldval, val); /* assign new value to that entry */ | |
| 155 | invalidateTMcache(h); | |
| 156 | luaC_barrierback(L, obj2gco(h), val); | |
| 157 | return; | |
| 158 | } | |
| 159 | /* else will try the metamethod */ | |
| 160 | } | |
| 161 | else /* not a table; check metamethod */ | |
| 162 | if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) | |
| 163 | luaG_typeerror(L, t, "index"); | |
| 164 | /* there is a metamethod */ | |
| 165 | if (ttisfunction(tm)) { | |
| 166 | callTM(L, tm, t, key, val, 0); | |
| 167 | return; | |
| 168 | } | |
| 169 | t = tm; /* else repeat with 'tm' */ | |
| 170 | } | |
| 171 | luaG_runerror(L, "loop in settable"); | |
| 137 | int loop; | |
| 138 | for (loop = 0; loop < MAXTAGLOOP; loop++) { | |
| 139 | const TValue *tm; | |
| 140 | if (ttistable(t)) { /* `t' is a table? */ | |
| 141 | Table *h = hvalue(t); | |
| 142 | TValue *oldval = cast(TValue *, luaH_get(h, key)); | |
| 143 | /* if previous value is not nil, there must be a previous entry | |
| 144 | in the table; moreover, a metamethod has no relevance */ | |
| 145 | if (!ttisnil(oldval) || | |
| 146 | /* previous value is nil; must check the metamethod */ | |
| 147 | ((tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL && | |
| 148 | /* no metamethod; is there a previous entry in the table? */ | |
| 149 | (oldval != luaO_nilobject || | |
| 150 | /* no previous entry; must create one. (The next test is | |
| 151 | always true; we only need the assignment.) */ | |
| 152 | (oldval = luaH_newkey(L, h, key), 1)))) { | |
| 153 | /* no metamethod and (now) there is an entry with given key */ | |
| 154 | setobj2t(L, oldval, val); /* assign new value to that entry */ | |
| 155 | invalidateTMcache(h); | |
| 156 | luaC_barrierback(L, obj2gco(h), val); | |
| 157 | return; | |
| 158 | } | |
| 159 | /* else will try the metamethod */ | |
| 160 | } | |
| 161 | else /* not a table; check metamethod */ | |
| 162 | if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) | |
| 163 | luaG_typeerror(L, t, "index"); | |
| 164 | /* there is a metamethod */ | |
| 165 | if (ttisfunction(tm)) { | |
| 166 | callTM(L, tm, t, key, val, 0); | |
| 167 | return; | |
| 168 | } | |
| 169 | t = tm; /* else repeat with 'tm' */ | |
| 170 | } | |
| 171 | luaG_runerror(L, "loop in settable"); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, |
| 176 | StkId res, TMS event) { | |
| 177 | const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ | |
| 178 | if (ttisnil(tm)) | |
| 179 | tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ | |
| 180 | if (ttisnil(tm)) return 0; | |
| 181 | callTM(L, tm, p1, p2, res, 1); | |
| 182 | return 1; | |
| 176 | StkId res, TMS event) { | |
| 177 | const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ | |
| 178 | if (ttisnil(tm)) | |
| 179 | tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ | |
| 180 | if (ttisnil(tm)) return 0; | |
| 181 | callTM(L, tm, p1, p2, res, 1); | |
| 182 | return 1; | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | static const TValue *get_equalTM (lua_State *L, Table *mt1, Table *mt2, |
| 187 | TMS event) { | |
| 188 | const TValue *tm1 = fasttm(L, mt1, event); | |
| 189 | const TValue *tm2; | |
| 190 | if (tm1 == NULL) return NULL; /* no metamethod */ | |
| 191 | if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ | |
| 192 | tm2 = fasttm(L, mt2, event); | |
| 193 | if (tm2 == NULL) return NULL; /* no metamethod */ | |
| 194 | if (luaV_rawequalobj(tm1, tm2)) /* same metamethods? */ | |
| 195 | return tm1; | |
| 196 | return NULL; | |
| 187 | TMS event) { | |
| 188 | const TValue *tm1 = fasttm(L, mt1, event); | |
| 189 | const TValue *tm2; | |
| 190 | if (tm1 == NULL) return NULL; /* no metamethod */ | |
| 191 | if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ | |
| 192 | tm2 = fasttm(L, mt2, event); | |
| 193 | if (tm2 == NULL) return NULL; /* no metamethod */ | |
| 194 | if (luaV_rawequalobj(tm1, tm2)) /* same metamethods? */ | |
| 195 | return tm1; | |
| 196 | return NULL; | |
| 197 | 197 | } |
| 198 | 198 | |
| 199 | 199 | |
| 200 | 200 | static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, |
| 201 | TMS event) { | |
| 202 | if (!call_binTM(L, p1, p2, L->top, event)) | |
| 203 | return -1; /* no metamethod */ | |
| 204 | else | |
| 205 | return !l_isfalse(L->top); | |
| 201 | TMS event) { | |
| 202 | if (!call_binTM(L, p1, p2, L->top, event)) | |
| 203 | return -1; /* no metamethod */ | |
| 204 | else | |
| 205 | return !l_isfalse(L->top); | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | static int l_strcmp (const TString *ls, const TString *rs) { |
| 210 | const char *l = getstr(ls); | |
| 211 | size_t ll = ls->tsv.len; | |
| 212 | const char *r = getstr(rs); | |
| 213 | size_t lr = rs->tsv.len; | |
| 214 | for (;;) { | |
| 215 | int temp = strcoll(l, r); | |
| 216 | if (temp != 0) return temp; | |
| 217 | else { /* strings are equal up to a `\0' */ | |
| 218 | size_t len = strlen(l); /* index of first `\0' in both strings */ | |
| 219 | if (len == lr) /* r is finished? */ | |
| 220 | return (len == ll) ? 0 : 1; | |
| 221 | else if (len == ll) /* l is finished? */ | |
| 222 | return -1; /* l is smaller than r (because r is not finished) */ | |
| 223 | /* both strings longer than `len'; go on comparing (after the `\0') */ | |
| 224 | len++; | |
| 225 | l += len; ll -= len; r += len; lr -= len; | |
| 226 | } | |
| 227 | } | |
| 210 | const char *l = getstr(ls); | |
| 211 | size_t ll = ls->tsv.len; | |
| 212 | const char *r = getstr(rs); | |
| 213 | size_t lr = rs->tsv.len; | |
| 214 | for (;;) { | |
| 215 | int temp = strcoll(l, r); | |
| 216 | if (temp != 0) return temp; | |
| 217 | else { /* strings are equal up to a `\0' */ | |
| 218 | size_t len = strlen(l); /* index of first `\0' in both strings */ | |
| 219 | if (len == lr) /* r is finished? */ | |
| 220 | return (len == ll) ? 0 : 1; | |
| 221 | else if (len == ll) /* l is finished? */ | |
| 222 | return -1; /* l is smaller than r (because r is not finished) */ | |
| 223 | /* both strings longer than `len'; go on comparing (after the `\0') */ | |
| 224 | len++; | |
| 225 | l += len; ll -= len; r += len; lr -= len; | |
| 226 | } | |
| 227 | } | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { |
| 232 | int res; | |
| 233 | if (ttisnumber(l) && ttisnumber(r)) | |
| 234 | return luai_numlt(L, nvalue(l), nvalue(r)); | |
| 235 | else if (ttisstring(l) && ttisstring(r)) | |
| 236 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; | |
| 237 | else if ((res = call_orderTM(L, l, r, TM_LT)) < 0) | |
| 238 | luaG_ordererror(L, l, r); | |
| 239 | return res; | |
| 232 | int res; | |
| 233 | if (ttisnumber(l) && ttisnumber(r)) | |
| 234 | return luai_numlt(L, nvalue(l), nvalue(r)); | |
| 235 | else if (ttisstring(l) && ttisstring(r)) | |
| 236 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; | |
| 237 | else if ((res = call_orderTM(L, l, r, TM_LT)) < 0) | |
| 238 | luaG_ordererror(L, l, r); | |
| 239 | return res; | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| 243 | 243 | int luaV_lessequal (lua_State *L, const TValue *l, const TValue *r) { |
| 244 | int res; | |
| 245 | if (ttisnumber(l) && ttisnumber(r)) | |
| 246 | return luai_numle(L, nvalue(l), nvalue(r)); | |
| 247 | else if (ttisstring(l) && ttisstring(r)) | |
| 248 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; | |
| 249 | else if ((res = call_orderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ | |
| 250 | return res; | |
| 251 | else if ((res = call_orderTM(L, r, l, TM_LT)) < 0) /* else try `lt' */ | |
| 252 | luaG_ordererror(L, l, r); | |
| 253 | return !res; | |
| 244 | int res; | |
| 245 | if (ttisnumber(l) && ttisnumber(r)) | |
| 246 | return luai_numle(L, nvalue(l), nvalue(r)); | |
| 247 | else if (ttisstring(l) && ttisstring(r)) | |
| 248 | return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; | |
| 249 | else if ((res = call_orderTM(L, l, r, TM_LE)) >= 0) /* first try `le' */ | |
| 250 | return res; | |
| 251 | else if ((res = call_orderTM(L, r, l, TM_LT)) < 0) /* else try `lt' */ | |
| 252 | luaG_ordererror(L, l, r); | |
| 253 | return !res; | |
| 254 | 254 | } |
| 255 | 255 | |
| 256 | 256 | |
| r31373 | r31374 | |
| 258 | 258 | ** equality of Lua values. L == NULL means raw equality (no metamethods) |
| 259 | 259 | */ |
| 260 | 260 | int luaV_equalobj_ (lua_State *L, const TValue *t1, const TValue *t2) { |
| 261 | const TValue *tm; | |
| 262 | lua_assert(ttisequal(t1, t2)); | |
| 263 | switch (ttype(t1)) { | |
| 264 | case LUA_TNIL: return 1; | |
| 265 | case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); | |
| 266 | case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ | |
| 267 | case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); | |
| 268 | case LUA_TLCF: return fvalue(t1) == fvalue(t2); | |
| 269 | case LUA_TSHRSTR: return eqshrstr(rawtsvalue(t1), rawtsvalue(t2)); | |
| 270 | case LUA_TLNGSTR: return luaS_eqlngstr(rawtsvalue(t1), rawtsvalue(t2)); | |
| 271 | case LUA_TUSERDATA: { | |
| 272 | if (uvalue(t1) == uvalue(t2)) return 1; | |
| 273 | else if (L == NULL) return 0; | |
| 274 | tm = get_equalTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, TM_EQ); | |
| 275 | break; /* will try TM */ | |
| 276 | } | |
| 277 | case LUA_TTABLE: { | |
| 278 | if (hvalue(t1) == hvalue(t2)) return 1; | |
| 279 | else if (L == NULL) return 0; | |
| 280 | tm = get_equalTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); | |
| 281 | break; /* will try TM */ | |
| 282 | } | |
| 283 | default: | |
| 284 | lua_assert(iscollectable(t1)); | |
| 285 | return gcvalue(t1) == gcvalue(t2); | |
| 286 | } | |
| 287 | if (tm == NULL) return 0; /* no TM? */ | |
| 288 | callTM(L, tm, t1, t2, L->top, 1); /* call TM */ | |
| 289 | return !l_isfalse(L->top); | |
| 261 | const TValue *tm; | |
| 262 | lua_assert(ttisequal(t1, t2)); | |
| 263 | switch (ttype(t1)) { | |
| 264 | case LUA_TNIL: return 1; | |
| 265 | case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); | |
| 266 | case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ | |
| 267 | case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); | |
| 268 | case LUA_TLCF: return fvalue(t1) == fvalue(t2); | |
| 269 | case LUA_TSHRSTR: return eqshrstr(rawtsvalue(t1), rawtsvalue(t2)); | |
| 270 | case LUA_TLNGSTR: return luaS_eqlngstr(rawtsvalue(t1), rawtsvalue(t2)); | |
| 271 | case LUA_TUSERDATA: { | |
| 272 | if (uvalue(t1) == uvalue(t2)) return 1; | |
| 273 | else if (L == NULL) return 0; | |
| 274 | tm = get_equalTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, TM_EQ); | |
| 275 | break; /* will try TM */ | |
| 276 | } | |
| 277 | case LUA_TTABLE: { | |
| 278 | if (hvalue(t1) == hvalue(t2)) return 1; | |
| 279 | else if (L == NULL) return 0; | |
| 280 | tm = get_equalTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); | |
| 281 | break; /* will try TM */ | |
| 282 | } | |
| 283 | default: | |
| 284 | lua_assert(iscollectable(t1)); | |
| 285 | return gcvalue(t1) == gcvalue(t2); | |
| 286 | } | |
| 287 | if (tm == NULL) return 0; /* no TM? */ | |
| 288 | callTM(L, tm, t1, t2, L->top, 1); /* call TM */ | |
| 289 | return !l_isfalse(L->top); | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | |
| 293 | 293 | void luaV_concat (lua_State *L, int total) { |
| 294 | lua_assert(total >= 2); | |
| 295 | do { | |
| 296 | StkId top = L->top; | |
| 297 | int n = 2; /* number of elements handled in this pass (at least 2) */ | |
| 298 | if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { | |
| 299 | if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) | |
| 300 | luaG_concaterror(L, top-2, top-1); | |
| 301 | } | |
| 302 | else if (tsvalue(top-1)->len == 0) /* second operand is empty? */ | |
| 303 | (void)tostring(L, top - 2); /* result is first operand */ | |
| 304 | else if (ttisstring(top-2) && tsvalue(top-2)->len == 0) { | |
| 305 | setobjs2s(L, top - 2, top - 1); /* result is second op. */ | |
| 306 | } | |
| 307 | else { | |
| 308 | /* at least two non-empty string values; get as many as possible */ | |
| 309 | size_t tl = tsvalue(top-1)->len; | |
| 310 | char *buffer; | |
| 311 | int i; | |
| 312 | /* collect total length */ | |
| 313 | for (i = 1; i < total && tostring(L, top-i-1); i++) { | |
| 314 | size_t l = tsvalue(top-i-1)->len; | |
| 315 | if (l >= (MAX_SIZET/sizeof(char)) - tl) | |
| 316 | luaG_runerror(L, "string length overflow"); | |
| 317 | tl += l; | |
| 318 | } | |
| 319 | buffer = luaZ_openspace(L, &G(L)->buff, tl); | |
| 320 | tl = 0; | |
| 321 | n = i; | |
| 322 | do { /* concat all strings */ | |
| 323 | size_t l = tsvalue(top-i)->len; | |
| 324 | memcpy(buffer+tl, svalue(top-i), l * sizeof(char)); | |
| 325 | tl += l; | |
| 326 | } while (--i > 0); | |
| 327 | setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); | |
| 328 | } | |
| 329 | total -= n-1; /* got 'n' strings to create 1 new */ | |
| 330 | L->top -= n-1; /* popped 'n' strings and pushed one */ | |
| 331 | } while (total > 1); /* repeat until only 1 result left */ | |
| 294 | lua_assert(total >= 2); | |
| 295 | do { | |
| 296 | StkId top = L->top; | |
| 297 | int n = 2; /* number of elements handled in this pass (at least 2) */ | |
| 298 | if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { | |
| 299 | if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) | |
| 300 | luaG_concaterror(L, top-2, top-1); | |
| 301 | } | |
| 302 | else if (tsvalue(top-1)->len == 0) /* second operand is empty? */ | |
| 303 | (void)tostring(L, top - 2); /* result is first operand */ | |
| 304 | else if (ttisstring(top-2) && tsvalue(top-2)->len == 0) { | |
| 305 | setobjs2s(L, top - 2, top - 1); /* result is second op. */ | |
| 306 | } | |
| 307 | else { | |
| 308 | /* at least two non-empty string values; get as many as possible */ | |
| 309 | size_t tl = tsvalue(top-1)->len; | |
| 310 | char *buffer; | |
| 311 | int i; | |
| 312 | /* collect total length */ | |
| 313 | for (i = 1; i < total && tostring(L, top-i-1); i++) { | |
| 314 | size_t l = tsvalue(top-i-1)->len; | |
| 315 | if (l >= (MAX_SIZET/sizeof(char)) - tl) | |
| 316 | luaG_runerror(L, "string length overflow"); | |
| 317 | tl += l; | |
| 318 | } | |
| 319 | buffer = luaZ_openspace(L, &G(L)->buff, tl); | |
| 320 | tl = 0; | |
| 321 | n = i; | |
| 322 | do { /* concat all strings */ | |
| 323 | size_t l = tsvalue(top-i)->len; | |
| 324 | memcpy(buffer+tl, svalue(top-i), l * sizeof(char)); | |
| 325 | tl += l; | |
| 326 | } while (--i > 0); | |
| 327 | setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); | |
| 328 | } | |
| 329 | total -= n-1; /* got 'n' strings to create 1 new */ | |
| 330 | L->top -= n-1; /* popped 'n' strings and pushed one */ | |
| 331 | } while (total > 1); /* repeat until only 1 result left */ | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | |
| 335 | 335 | void luaV_objlen (lua_State *L, StkId ra, const TValue *rb) { |
| 336 | const TValue *tm; | |
| 337 | switch (ttypenv(rb)) { | |
| 338 | case LUA_TTABLE: { | |
| 339 | Table *h = hvalue(rb); | |
| 340 | tm = fasttm(L, h->metatable, TM_LEN); | |
| 341 | if (tm) break; /* metamethod? break switch to call it */ | |
| 342 | setnvalue(ra, cast_num(1.0*luaH_getn(h))); /* else primitive len */ | |
| 343 | return; | |
| 344 | } | |
| 345 | case LUA_TSTRING: { | |
| 346 | setnvalue(ra, cast_num(tsvalue(rb)->len)); | |
| 347 | return; | |
| 348 | } | |
| 349 | default: { /* try metamethod */ | |
| 350 | tm = luaT_gettmbyobj(L, rb, TM_LEN); | |
| 351 | if (ttisnil(tm)) /* no metamethod? */ | |
| 352 | luaG_typeerror(L, rb, "get length of"); | |
| 353 | break; | |
| 354 | } | |
| 355 | } | |
| 356 | callTM(L, tm, rb, rb, ra, 1); | |
| 336 | const TValue *tm; | |
| 337 | switch (ttypenv(rb)) { | |
| 338 | case LUA_TTABLE: { | |
| 339 | Table *h = hvalue(rb); | |
| 340 | tm = fasttm(L, h->metatable, TM_LEN); | |
| 341 | if (tm) break; /* metamethod? break switch to call it */ | |
| 342 | setnvalue(ra, cast_num(1.0*luaH_getn(h))); /* else primitive len */ | |
| 343 | return; | |
| 344 | } | |
| 345 | case LUA_TSTRING: { | |
| 346 | setnvalue(ra, cast_num(tsvalue(rb)->len)); | |
| 347 | return; | |
| 348 | } | |
| 349 | default: { /* try metamethod */ | |
| 350 | tm = luaT_gettmbyobj(L, rb, TM_LEN); | |
| 351 | if (ttisnil(tm)) /* no metamethod? */ | |
| 352 | luaG_typeerror(L, rb, "get length of"); | |
| 353 | break; | |
| 354 | } | |
| 355 | } | |
| 356 | callTM(L, tm, rb, rb, ra, 1); | |
| 357 | 357 | } |
| 358 | 358 | |
| 359 | 359 | |
| 360 | 360 | void luaV_arith (lua_State *L, StkId ra, const TValue *rb, |
| 361 | const TValue *rc, TMS op) { | |
| 362 | TValue tempb, tempc; | |
| 363 | const TValue *b, *c; | |
| 364 | if ((b = luaV_tonumber(rb, &tempb)) != NULL && | |
| 365 | (c = luaV_tonumber(rc, &tempc)) != NULL) { | |
| 366 | lua_Number res = luaO_arith(op - TM_ADD + LUA_OPADD, nvalue(b), nvalue(c)); | |
| 367 | setnvalue(ra, res); | |
| 368 | } | |
| 369 | else if (!call_binTM(L, rb, rc, ra, op)) | |
| 370 | luaG_aritherror(L, rb, rc); | |
| 361 | const TValue *rc, TMS op) { | |
| 362 | TValue tempb, tempc; | |
| 363 | const TValue *b, *c; | |
| 364 | if ((b = luaV_tonumber(rb, &tempb)) != NULL && | |
| 365 | (c = luaV_tonumber(rc, &tempc)) != NULL) { | |
| 366 | lua_Number res = luaO_arith(op - TM_ADD + LUA_OPADD, nvalue(b), nvalue(c)); | |
| 367 | setnvalue(ra, res); | |
| 368 | } | |
| 369 | else if (!call_binTM(L, rb, rc, ra, op)) | |
| 370 | luaG_aritherror(L, rb, rc); | |
| 371 | 371 | } |
| 372 | 372 | |
| 373 | 373 | |
| r31373 | r31374 | |
| 377 | 377 | ** new closure to be created. |
| 378 | 378 | */ |
| 379 | 379 | static Closure *getcached (Proto *p, UpVal **encup, StkId base) { |
| 380 | Closure *c = p->cache; | |
| 381 | if (c != NULL) { /* is there a cached closure? */ | |
| 382 | int nup = p->sizeupvalues; | |
| 383 | Upvaldesc *uv = p->upvalues; | |
| 384 | int i; | |
| 385 | for (i = 0; i < nup; i++) { /* check whether it has right upvalues */ | |
| 386 | TValue *v = uv[i].instack ? base + uv[i].idx : encup[uv[i].idx]->v; | |
| 387 | if (c->l.upvals[i]->v != v) | |
| 388 | return NULL; /* wrong upvalue; cannot reuse closure */ | |
| 389 | } | |
| 390 | } | |
| 391 | return c; /* return cached closure (or NULL if no cached closure) */ | |
| 380 | Closure *c = p->cache; | |
| 381 | if (c != NULL) { /* is there a cached closure? */ | |
| 382 | int nup = p->sizeupvalues; | |
| 383 | Upvaldesc *uv = p->upvalues; | |
| 384 | int i; | |
| 385 | for (i = 0; i < nup; i++) { /* check whether it has right upvalues */ | |
| 386 | TValue *v = uv[i].instack ? base + uv[i].idx : encup[uv[i].idx]->v; | |
| 387 | if (c->l.upvals[i]->v != v) | |
| 388 | return NULL; /* wrong upvalue; cannot reuse closure */ | |
| 389 | } | |
| 390 | } | |
| 391 | return c; /* return cached closure (or NULL if no cached closure) */ | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
| r31373 | r31374 | |
| 399 | 399 | ** original value of that field. |
| 400 | 400 | */ |
| 401 | 401 | static void pushclosure (lua_State *L, Proto *p, UpVal **encup, StkId base, |
| 402 | StkId ra) { | |
| 403 | int nup = p->sizeupvalues; | |
| 404 | Upvaldesc *uv = p->upvalues; | |
| 405 | int i; | |
| 406 | Closure *ncl = luaF_newLclosure(L, nup); | |
| 407 | ncl->l.p = p; | |
| 408 | setclLvalue(L, ra, ncl); /* anchor new closure in stack */ | |
| 409 | for (i = 0; i < nup; i++) { /* fill in its upvalues */ | |
| 410 | if (uv[i].instack) /* upvalue refers to local variable? */ | |
| 411 | ncl->l.upvals[i] = luaF_findupval(L, base + uv[i].idx); | |
| 412 | else /* get upvalue from enclosing function */ | |
| 413 | ncl->l.upvals[i] = encup[uv[i].idx]; | |
| 414 | } | |
| 415 | luaC_barrierproto(L, p, ncl); | |
| 416 | p->cache = ncl; /* save it on cache for reuse */ | |
| 402 | StkId ra) { | |
| 403 | int nup = p->sizeupvalues; | |
| 404 | Upvaldesc *uv = p->upvalues; | |
| 405 | int i; | |
| 406 | Closure *ncl = luaF_newLclosure(L, nup); | |
| 407 | ncl->l.p = p; | |
| 408 | setclLvalue(L, ra, ncl); /* anchor new closure in stack */ | |
| 409 | for (i = 0; i < nup; i++) { /* fill in its upvalues */ | |
| 410 | if (uv[i].instack) /* upvalue refers to local variable? */ | |
| 411 | ncl->l.upvals[i] = luaF_findupval(L, base + uv[i].idx); | |
| 412 | else /* get upvalue from enclosing function */ | |
| 413 | ncl->l.upvals[i] = encup[uv[i].idx]; | |
| 414 | } | |
| 415 | luaC_barrierproto(L, p, ncl); | |
| 416 | p->cache = ncl; /* save it on cache for reuse */ | |
| 417 | 417 | } |
| 418 | 418 | |
| 419 | 419 | |
| r31373 | r31374 | |
| 421 | 421 | ** finish execution of an opcode interrupted by an yield |
| 422 | 422 | */ |
| 423 | 423 | void luaV_finishOp (lua_State *L) { |
| 424 | CallInfo *ci = L->ci; | |
| 425 | StkId base = ci->u.l.base; | |
| 426 | Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */ | |
| 427 | OpCode op = GET_OPCODE(inst); | |
| 428 | switch (op) { /* finish its execution */ | |
| 429 | case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: | |
| 430 | case OP_MOD: case OP_POW: case OP_UNM: case OP_LEN: | |
| 431 | case OP_GETTABUP: case OP_GETTABLE: case OP_SELF: { | |
| 432 | setobjs2s(L, base + GETARG_A(inst), --L->top); | |
| 433 | break; | |
| 434 | } | |
| 435 | case OP_LE: case OP_LT: case OP_EQ: { | |
| 436 | int res = !l_isfalse(L->top - 1); | |
| 437 | L->top--; | |
| 438 | /* metamethod should not be called when operand is K */ | |
| 439 | lua_assert(!ISK(GETARG_B(inst))); | |
| 440 | if (op == OP_LE && /* "<=" using "<" instead? */ | |
| 441 | ttisnil(luaT_gettmbyobj(L, base + GETARG_B(inst), TM_LE))) | |
| 442 | res = !res; /* invert result */ | |
| 443 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP); | |
| 444 | if (res != GETARG_A(inst)) /* condition failed? */ | |
| 445 | ci->u.l.savedpc++; /* skip jump instruction */ | |
| 446 | break; | |
| 447 | } | |
| 448 | case OP_CONCAT: { | |
| 449 | StkId top = L->top - 1; /* top when 'call_binTM' was called */ | |
| 450 | int b = GETARG_B(inst); /* first element to concatenate */ | |
| 451 | int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ | |
| 452 | setobj2s(L, top - 2, top); /* put TM result in proper position */ | |
| 453 | if (total > 1) { /* are there elements to concat? */ | |
| 454 | L->top = top - 1; /* top is one after last element (at top-2) */ | |
| 455 | luaV_concat(L, total); /* concat them (may yield again) */ | |
| 456 | } | |
| 457 | /* move final result to final position */ | |
| 458 | setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1); | |
| 459 | L->top = ci->top; /* restore top */ | |
| 460 | break; | |
| 461 | } | |
| 462 | case OP_TFORCALL: { | |
| 463 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_TFORLOOP); | |
| 464 | L->top = ci->top; /* correct top */ | |
| 465 | break; | |
| 466 | } | |
| 467 | case OP_CALL: { | |
| 468 | if (GETARG_C(inst) - 1 >= 0) /* nresults >= 0? */ | |
| 469 | L->top = ci->top; /* adjust results */ | |
| 470 | break; | |
| 471 | } | |
| 472 | case OP_TAILCALL: case OP_SETTABUP: case OP_SETTABLE: | |
| 473 | break; | |
| 474 | default: lua_assert(0); | |
| 475 | } | |
| 424 | CallInfo *ci = L->ci; | |
| 425 | StkId base = ci->u.l.base; | |
| 426 | Instruction inst = *(ci->u.l.savedpc - 1); /* interrupted instruction */ | |
| 427 | OpCode op = GET_OPCODE(inst); | |
| 428 | switch (op) { /* finish its execution */ | |
| 429 | case OP_ADD: case OP_SUB: case OP_MUL: case OP_DIV: | |
| 430 | case OP_MOD: case OP_POW: case OP_UNM: case OP_LEN: | |
| 431 | case OP_GETTABUP: case OP_GETTABLE: case OP_SELF: { | |
| 432 | setobjs2s(L, base + GETARG_A(inst), --L->top); | |
| 433 | break; | |
| 434 | } | |
| 435 | case OP_LE: case OP_LT: case OP_EQ: { | |
| 436 | int res = !l_isfalse(L->top - 1); | |
| 437 | L->top--; | |
| 438 | /* metamethod should not be called when operand is K */ | |
| 439 | lua_assert(!ISK(GETARG_B(inst))); | |
| 440 | if (op == OP_LE && /* "<=" using "<" instead? */ | |
| 441 | ttisnil(luaT_gettmbyobj(L, base + GETARG_B(inst), TM_LE))) | |
| 442 | res = !res; /* invert result */ | |
| 443 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_JMP); | |
| 444 | if (res != GETARG_A(inst)) /* condition failed? */ | |
| 445 | ci->u.l.savedpc++; /* skip jump instruction */ | |
| 446 | break; | |
| 447 | } | |
| 448 | case OP_CONCAT: { | |
| 449 | StkId top = L->top - 1; /* top when 'call_binTM' was called */ | |
| 450 | int b = GETARG_B(inst); /* first element to concatenate */ | |
| 451 | int total = cast_int(top - 1 - (base + b)); /* yet to concatenate */ | |
| 452 | setobj2s(L, top - 2, top); /* put TM result in proper position */ | |
| 453 | if (total > 1) { /* are there elements to concat? */ | |
| 454 | L->top = top - 1; /* top is one after last element (at top-2) */ | |
| 455 | luaV_concat(L, total); /* concat them (may yield again) */ | |
| 456 | } | |
| 457 | /* move final result to final position */ | |
| 458 | setobj2s(L, ci->u.l.base + GETARG_A(inst), L->top - 1); | |
| 459 | L->top = ci->top; /* restore top */ | |
| 460 | break; | |
| 461 | } | |
| 462 | case OP_TFORCALL: { | |
| 463 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_TFORLOOP); | |
| 464 | L->top = ci->top; /* correct top */ | |
| 465 | break; | |
| 466 | } | |
| 467 | case OP_CALL: { | |
| 468 | if (GETARG_C(inst) - 1 >= 0) /* nresults >= 0? */ | |
| 469 | L->top = ci->top; /* adjust results */ | |
| 470 | break; | |
| 471 | } | |
| 472 | case OP_TAILCALL: case OP_SETTABUP: case OP_SETTABLE: | |
| 473 | break; | |
| 474 | default: lua_assert(0); | |
| 475 | } | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | |
| r31373 | r31374 | |
| 482 | 482 | */ |
| 483 | 483 | |
| 484 | 484 | #if !defined luai_runtimecheck |
| 485 | #define luai_runtimecheck(L, c) | |
| 485 | #define luai_runtimecheck(L, c) /* void */ | |
| 486 | 486 | #endif |
| 487 | 487 | |
| 488 | 488 | |
| 489 | #define RA(i) | |
| 489 | #define RA(i) (base+GETARG_A(i)) | |
| 490 | 490 | /* to be used after possible stack reallocation */ |
| 491 | #define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) | |
| 492 | #define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) | |
| 493 | #define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ | |
| 491 | #define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) | |
| 492 | #define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) | |
| 493 | #define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ | |
| 494 | 494 | ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) |
| 495 | #define RKC(i) | |
| 495 | #define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ | |
| 496 | 496 | ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) |
| 497 | 497 | #define KBx(i) \ |
| 498 | ||
| 498 | (k + (GETARG_Bx(i) != 0 ? GETARG_Bx(i) - 1 : GETARG_Ax(*ci->u.l.savedpc++))) | |
| 499 | 499 | |
| 500 | 500 | |
| 501 | 501 | /* execute a jump instruction */ |
| 502 | 502 | #define dojump(ci,i,e) \ |
| 503 | { int a = GETARG_A(i); \ | |
| 504 | if (a > 0) luaF_close(L, ci->u.l.base + a - 1); \ | |
| 505 | ci->u.l.savedpc += GETARG_sBx(i) + e; } | |
| 503 | { int a = GETARG_A(i); \ | |
| 504 | if (a > 0) luaF_close(L, ci->u.l.base + a - 1); \ | |
| 505 | ci->u.l.savedpc += GETARG_sBx(i) + e; } | |
| 506 | 506 | |
| 507 | 507 | /* for test instructions, execute the jump instruction that follows it */ |
| 508 | #define donextjump(ci) | |
| 508 | #define donextjump(ci) { i = *ci->u.l.savedpc; dojump(ci, i, 1); } | |
| 509 | 509 | |
| 510 | 510 | |
| 511 | #define Protect(x) | |
| 511 | #define Protect(x) { {x;}; base = ci->u.l.base; } | |
| 512 | 512 | |
| 513 | 513 | #define checkGC(L,c) \ |
| 514 | Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \ | |
| 515 | luaC_step(L); \ | |
| 516 | L->top = ci->top;}) /* restore top */ \ | |
| 517 | luai_threadyield(L); ) | |
| 514 | Protect( luaC_condGC(L,{L->top = (c); /* limit of live values */ \ | |
| 515 | luaC_step(L); \ | |
| 516 | L->top = ci->top;}) /* restore top */ \ | |
| 517 | luai_threadyield(L); ) | |
| 518 | 518 | |
| 519 | 519 | |
| 520 | 520 | #define arith_op(op,tm) { \ |
| 521 | TValue *rb = RKB(i); \ | |
| 522 | TValue *rc = RKC(i); \ | |
| 523 | if (ttisnumber(rb) && ttisnumber(rc)) { \ | |
| 524 | lua_Number nb = nvalue(rb), nc = nvalue(rc); \ | |
| 525 | setnvalue(ra, op(L, nb, nc)); \ | |
| 526 | } \ | |
| 527 | else { Protect(luaV_arith(L, ra, rb, rc, tm)); } } | |
| 521 | TValue *rb = RKB(i); \ | |
| 522 | TValue *rc = RKC(i); \ | |
| 523 | if (ttisnumber(rb) && ttisnumber(rc)) { \ | |
| 524 | lua_Number nb = nvalue(rb), nc = nvalue(rc); \ | |
| 525 | setnvalue(ra, op(L, nb, nc)); \ | |
| 526 | } \ | |
| 527 | else { Protect(luaV_arith(L, ra, rb, rc, tm)); } } | |
| 528 | 528 | |
| 529 | 529 | |
| 530 | #define vmdispatch(o) switch(o) | |
| 531 | #define vmcase(l,b) case l: {b} break; | |
| 532 | #define vmcasenb(l,b) case l: {b} /* nb = no break */ | |
| 530 | #define vmdispatch(o) switch(o) | |
| 531 | #define vmcase(l,b) case l: {b} break; | |
| 532 | #define vmcasenb(l,b) case l: {b} /* nb = no break */ | |
| 533 | 533 | |
| 534 | 534 | void luaV_execute (lua_State *L) { |
| 535 | CallInfo *ci = L->ci; | |
| 536 | LClosure *cl; | |
| 537 | TValue *k; | |
| 538 | StkId base; | |
| 539 | newframe: /* reentry point when frame changes (call/return) */ | |
| 540 | lua_assert(ci == L->ci); | |
| 541 | cl = clLvalue(ci->func); | |
| 542 | k = cl->p->k; | |
| 543 | base = ci->u.l.base; | |
| 544 | /* main loop of interpreter */ | |
| 545 | for (;;) { | |
| 546 | Instruction i = *(ci->u.l.savedpc++); | |
| 547 | StkId ra; | |
| 548 | if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && | |
| 549 | (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { | |
| 550 | Protect(traceexec(L)); | |
| 551 | } | |
| 552 | /* WARNING: several calls may realloc the stack and invalidate `ra' */ | |
| 553 | ra = RA(i); | |
| 554 | lua_assert(base == ci->u.l.base); | |
| 555 | lua_assert(base <= L->top && L->top < L->stack + L->stacksize); | |
| 556 | vmdispatch (GET_OPCODE(i)) { | |
| 557 | vmcase(OP_MOVE, | |
| 558 | setobjs2s(L, ra, RB(i)); | |
| 559 | ) | |
| 560 | vmcase(OP_LOADK, | |
| 561 | TValue *rb = k + GETARG_Bx(i); | |
| 562 | setobj2s(L, ra, rb); | |
| 563 | ) | |
| 564 | vmcase(OP_LOADKX, | |
| 565 | TValue *rb; | |
| 566 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); | |
| 567 | rb = k + GETARG_Ax(*ci->u.l.savedpc++); | |
| 568 | setobj2s(L, ra, rb); | |
| 569 | ) | |
| 570 | vmcase(OP_LOADBOOL, | |
| 571 | setbvalue(ra, GETARG_B(i)); | |
| 572 | if (GETARG_C(i)) ci->u.l.savedpc++; /* skip next instruction (if C) */ | |
| 573 | ) | |
| 574 | vmcase(OP_LOADNIL, | |
| 575 | int b = GETARG_B(i); | |
| 576 | do { | |
| 577 | setnilvalue(ra++); | |
| 578 | } while (b--); | |
| 579 | ) | |
| 580 | vmcase(OP_GETUPVAL, | |
| 581 | int b = GETARG_B(i); | |
| 582 | setobj2s(L, ra, cl->upvals[b]->v); | |
| 583 | ) | |
| 584 | vmcase(OP_GETTABUP, | |
| 585 | int b = GETARG_B(i); | |
| 586 | Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra)); | |
| 587 | ) | |
| 588 | vmcase(OP_GETTABLE, | |
| 589 | Protect(luaV_gettable(L, RB(i), RKC(i), ra)); | |
| 590 | ) | |
| 591 | vmcase(OP_SETTABUP, | |
| 592 | int a = GETARG_A(i); | |
| 593 | Protect(luaV_settable(L, cl->upvals[a]->v, RKB(i), RKC(i))); | |
| 594 | ) | |
| 595 | vmcase(OP_SETUPVAL, | |
| 596 | UpVal *uv = cl->upvals[GETARG_B(i)]; | |
| 597 | setobj(L, uv->v, ra); | |
| 598 | luaC_barrier(L, uv, ra); | |
| 599 | ) | |
| 600 | vmcase(OP_SETTABLE, | |
| 601 | Protect(luaV_settable(L, ra, RKB(i), RKC(i))); | |
| 602 | ) | |
| 603 | vmcase(OP_NEWTABLE, | |
| 604 | int b = GETARG_B(i); | |
| 605 | int c = GETARG_C(i); | |
| 606 | Table *t = luaH_new(L); | |
| 607 | sethvalue(L, ra, t); | |
| 608 | if (b != 0 || c != 0) | |
| 609 | luaH_resize(L, t, luaO_fb2int(b), luaO_fb2int(c)); | |
| 610 | checkGC(L, ra + 1); | |
| 611 | ) | |
| 612 | vmcase(OP_SELF, | |
| 613 | StkId rb = RB(i); | |
| 614 | setobjs2s(L, ra+1, rb); | |
| 615 | Protect(luaV_gettable(L, rb, RKC(i), ra)); | |
| 616 | ) | |
| 617 | vmcase(OP_ADD, | |
| 618 | arith_op(luai_numadd, TM_ADD); | |
| 619 | ) | |
| 620 | vmcase(OP_SUB, | |
| 621 | arith_op(luai_numsub, TM_SUB); | |
| 622 | ) | |
| 623 | vmcase(OP_MUL, | |
| 624 | arith_op(luai_nummul, TM_MUL); | |
| 625 | ) | |
| 626 | vmcase(OP_DIV, | |
| 627 | arith_op(luai_numdiv, TM_DIV); | |
| 628 | ) | |
| 629 | vmcase(OP_MOD, | |
| 630 | arith_op(luai_nummod, TM_MOD); | |
| 631 | ) | |
| 632 | vmcase(OP_POW, | |
| 633 | arith_op(luai_numpow, TM_POW); | |
| 634 | ) | |
| 635 | vmcase(OP_UNM, | |
| 636 | TValue *rb = RB(i); | |
| 637 | if (ttisnumber(rb)) { | |
| 638 | lua_Number nb = nvalue(rb); | |
| 639 | setnvalue(ra, luai_numunm(L, nb)); | |
| 640 | } | |
| 641 | else { | |
| 642 | Protect(luaV_arith(L, ra, rb, rb, TM_UNM)); | |
| 643 | } | |
| 644 | ) | |
| 645 | vmcase(OP_NOT, | |
| 646 | TValue *rb = RB(i); | |
| 647 | int res = l_isfalse(rb); /* next assignment may change this value */ | |
| 648 | setbvalue(ra, res); | |
| 649 | ) | |
| 650 | vmcase(OP_LEN, | |
| 651 | Protect(luaV_objlen(L, ra, RB(i))); | |
| 652 | ) | |
| 653 | vmcase(OP_CONCAT, | |
| 654 | int b = GETARG_B(i); | |
| 655 | int c = GETARG_C(i); | |
| 656 | StkId rb; | |
| 657 | L->top = base + c + 1; /* mark the end of concat operands */ | |
| 658 | Protect(luaV_concat(L, c - b + 1)); | |
| 659 | ra = RA(i); /* 'luav_concat' may invoke TMs and move the stack */ | |
| 660 | rb = b + base; | |
| 661 | setobjs2s(L, ra, rb); | |
| 662 | checkGC(L, (ra >= rb ? ra + 1 : rb)); | |
| 663 | L->top = ci->top; /* restore top */ | |
| 664 | ) | |
| 665 | vmcase(OP_JMP, | |
| 666 | dojump(ci, i, 0); | |
| 667 | ) | |
| 668 | vmcase(OP_EQ, | |
| 669 | TValue *rb = RKB(i); | |
| 670 | TValue *rc = RKC(i); | |
| 671 | Protect( | |
| 672 | if (cast_int(equalobj(L, rb, rc)) != GETARG_A(i)) | |
| 673 | ci->u.l.savedpc++; | |
| 674 | else | |
| 675 | donextjump(ci); | |
| 676 | ) | |
| 677 | ) | |
| 678 | vmcase(OP_LT, | |
| 679 | Protect( | |
| 680 | if (luaV_lessthan(L, RKB(i), RKC(i)) != GETARG_A(i)) | |
| 681 | ci->u.l.savedpc++; | |
| 682 | else | |
| 683 | donextjump(ci); | |
| 684 | ) | |
| 685 | ) | |
| 686 | vmcase(OP_LE, | |
| 687 | Protect( | |
| 688 | if (luaV_lessequal(L, RKB(i), RKC(i)) != GETARG_A(i)) | |
| 689 | ci->u.l.savedpc++; | |
| 690 | else | |
| 691 | donextjump(ci); | |
| 692 | ) | |
| 693 | ) | |
| 694 | vmcase(OP_TEST, | |
| 695 | if (GETARG_C(i) ? l_isfalse(ra) : !l_isfalse(ra)) | |
| 696 | ci->u.l.savedpc++; | |
| 697 | else | |
| 698 | donextjump(ci); | |
| 699 | ) | |
| 700 | vmcase(OP_TESTSET, | |
| 701 | TValue *rb = RB(i); | |
| 702 | if (GETARG_C(i) ? l_isfalse(rb) : !l_isfalse(rb)) | |
| 703 | ci->u.l.savedpc++; | |
| 704 | else { | |
| 705 | setobjs2s(L, ra, rb); | |
| 706 | donextjump(ci); | |
| 707 | } | |
| 708 | ) | |
| 709 | vmcase(OP_CALL, | |
| 710 | int b = GETARG_B(i); | |
| 711 | int nresults = GETARG_C(i) - 1; | |
| 712 | if (b != 0) L->top = ra+b; /* else previous instruction set top */ | |
| 713 | if (luaD_precall(L, ra, nresults)) { /* C function? */ | |
| 714 | if (nresults >= 0) L->top = ci->top; /* adjust results */ | |
| 715 | base = ci->u.l.base; | |
| 716 | } | |
| 717 | else { /* Lua function */ | |
| 718 | ci = L->ci; | |
| 719 | ci->callstatus |= CIST_REENTRY; | |
| 720 | goto newframe; /* restart luaV_execute over new Lua function */ | |
| 721 | } | |
| 722 | ) | |
| 723 | vmcase(OP_TAILCALL, | |
| 724 | int b = GETARG_B(i); | |
| 725 | if (b != 0) L->top = ra+b; /* else previous instruction set top */ | |
| 726 | lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); | |
| 727 | if (luaD_precall(L, ra, LUA_MULTRET)) /* C function? */ | |
| 728 | base = ci->u.l.base; | |
| 729 | else { | |
| 730 | /* tail call: put called frame (n) in place of caller one (o) */ | |
| 731 | CallInfo *nci = L->ci; /* called frame */ | |
| 732 | CallInfo *oci = nci->previous; /* caller frame */ | |
| 733 | StkId nfunc = nci->func; /* called function */ | |
| 734 | StkId ofunc = oci->func; /* caller function */ | |
| 735 | /* last stack slot filled by 'precall' */ | |
| 736 | StkId lim = nci->u.l.base + getproto(nfunc)->numparams; | |
| 737 | int aux; | |
| 738 | /* close all upvalues from previous call */ | |
| 739 | if (cl->p->sizep > 0) luaF_close(L, oci->u.l.base); | |
| 740 | /* move new frame into old one */ | |
| 741 | for (aux = 0; nfunc + aux < lim; aux++) | |
| 742 | setobjs2s(L, ofunc + aux, nfunc + aux); | |
| 743 | oci->u.l.base = ofunc + (nci->u.l.base - nfunc); /* correct base */ | |
| 744 | oci->top = L->top = ofunc + (L->top - nfunc); /* correct top */ | |
| 745 | oci->u.l.savedpc = nci->u.l.savedpc; | |
| 746 | oci->callstatus |= CIST_TAIL; /* function was tail called */ | |
| 747 | ci = L->ci = oci; /* remove new frame */ | |
| 748 | lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize); | |
| 749 | goto newframe; /* restart luaV_execute over new Lua function */ | |
| 750 | } | |
| 751 | ) | |
| 752 | vmcasenb(OP_RETURN, | |
| 753 | int b = GETARG_B(i); | |
| 754 | if (b != 0) L->top = ra+b-1; | |
| 755 | if (cl->p->sizep > 0) luaF_close(L, base); | |
| 756 | b = luaD_poscall(L, ra); | |
| 757 | if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ | |
| 758 | return; /* external invocation: return */ | |
| 759 | else { /* invocation via reentry: continue execution */ | |
| 760 | ci = L->ci; | |
| 761 | if (b) L->top = ci->top; | |
| 762 | lua_assert(isLua(ci)); | |
| 763 | lua_assert(GET_OPCODE(*((ci)->u.l.savedpc - 1)) == OP_CALL); | |
| 764 | goto newframe; /* restart luaV_execute over new Lua function */ | |
| 765 | } | |
| 766 | ) | |
| 767 | vmcase(OP_FORLOOP, | |
| 768 | lua_Number step = nvalue(ra+2); | |
| 769 | lua_Number idx = luai_numadd(L, nvalue(ra), step); /* increment index */ | |
| 770 | lua_Number limit = nvalue(ra+1); | |
| 771 | if (luai_numlt(L, 0, step) ? luai_numle(L, idx, limit) | |
| 772 | : luai_numle(L, limit, idx)) { | |
| 773 | ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ | |
| 774 | setnvalue(ra, idx); /* update internal index... */ | |
| 775 | setnvalue(ra+3, idx); /* ...and external index */ | |
| 776 | } | |
| 777 | ) | |
| 778 | vmcase(OP_FORPREP, | |
| 779 | const TValue *init = ra; | |
| 780 | const TValue *plimit = ra+1; | |
| 781 | const TValue *pstep = ra+2; | |
| 782 | if (!tonumber(init, ra)) | |
| 783 | luaG_runerror(L, LUA_QL("for") " initial value must be a number"); | |
| 784 | else if (!tonumber(plimit, ra+1)) | |
| 785 | luaG_runerror(L, LUA_QL("for") " limit must be a number"); | |
| 786 | else if (!tonumber(pstep, ra+2)) | |
| 787 | luaG_runerror(L, LUA_QL("for") " step must be a number"); | |
| 788 | setnvalue(ra, luai_numsub(L, nvalue(ra), nvalue(pstep))); | |
| 789 | ci->u.l.savedpc += GETARG_sBx(i); | |
| 790 | ) | |
| 791 | vmcasenb(OP_TFORCALL, | |
| 792 | StkId cb = ra + 3; /* call base */ | |
| 793 | setobjs2s(L, cb+2, ra+2); | |
| 794 | setobjs2s(L, cb+1, ra+1); | |
| 795 | setobjs2s(L, cb, ra); | |
| 796 | L->top = cb + 3; /* func. + 2 args (state and index) */ | |
| 797 | Protect(luaD_call(L, cb, GETARG_C(i), 1)); | |
| 798 | L->top = ci->top; | |
| 799 | i = *(ci->u.l.savedpc++); /* go to next instruction */ | |
| 800 | ra = RA(i); | |
| 801 | lua_assert(GET_OPCODE(i) == OP_TFORLOOP); | |
| 802 | goto l_tforloop; | |
| 803 | ) | |
| 804 | vmcase(OP_TFORLOOP, | |
| 805 | l_tforloop: | |
| 806 | if (!ttisnil(ra + 1)) { /* continue loop? */ | |
| 807 | setobjs2s(L, ra, ra + 1); /* save control variable */ | |
| 808 | ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ | |
| 809 | } | |
| 810 | ) | |
| 811 | vmcase(OP_SETLIST, | |
| 812 | int n = GETARG_B(i); | |
| 813 | int c = GETARG_C(i); | |
| 814 | int last; | |
| 815 | Table *h; | |
| 816 | if (n == 0) n = cast_int(L->top - ra) - 1; | |
| 817 | if (c == 0) { | |
| 818 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); | |
| 819 | c = GETARG_Ax(*ci->u.l.savedpc++); | |
| 820 | } | |
| 821 | luai_runtimecheck(L, ttistable(ra)); | |
| 822 | h = hvalue(ra); | |
| 823 | last = ((c-1)*LFIELDS_PER_FLUSH) + n; | |
| 824 | if (last > h->sizearray) /* needs more space? */ | |
| 825 | luaH_resizearray(L, h, last); /* pre-allocate it at once */ | |
| 826 | for (; n > 0; n--) { | |
| 827 | TValue *val = ra+n; | |
| 828 | luaH_setint(L, h, last--, val); | |
| 829 | luaC_barrierback(L, obj2gco(h), val); | |
| 830 | } | |
| 831 | L->top = ci->top; /* correct top (in case of previous open call) */ | |
| 832 | ) | |
| 833 | vmcase(OP_CLOSURE, | |
| 834 | Proto *p = cl->p->p[GETARG_Bx(i)]; | |
| 835 | Closure *ncl = getcached(p, cl->upvals, base); /* cached closure */ | |
| 836 | if (ncl == NULL) /* no match? */ | |
| 837 | pushclosure(L, p, cl->upvals, base, ra); /* create a new one */ | |
| 838 | else | |
| 839 | setclLvalue(L, ra, ncl); /* push cashed closure */ | |
| 840 | checkGC(L, ra + 1); | |
| 841 | ) | |
| 842 | vmcase(OP_VARARG, | |
| 843 | int b = GETARG_B(i) - 1; | |
| 844 | int j; | |
| 845 | int n = cast_int(base - ci->func) - cl->p->numparams - 1; | |
| 846 | if (b < 0) { /* B == 0? */ | |
| 847 | b = n; /* get all var. arguments */ | |
| 848 | Protect(luaD_checkstack(L, n)); | |
| 849 | ra = RA(i); /* previous call may change the stack */ | |
| 850 | L->top = ra + n; | |
| 851 | } | |
| 852 | for (j = 0; j < b; j++) { | |
| 853 | if (j < n) { | |
| 854 | setobjs2s(L, ra + j, base - n + j); | |
| 855 | } | |
| 856 | else { | |
| 857 | setnilvalue(ra + j); | |
| 858 | } | |
| 859 | } | |
| 860 | ) | |
| 861 | vmcase(OP_EXTRAARG, | |
| 862 | lua_assert(0); | |
| 863 | ) | |
| 864 | } | |
| 865 | } | |
| 535 | CallInfo *ci = L->ci; | |
| 536 | LClosure *cl; | |
| 537 | TValue *k; | |
| 538 | StkId base; | |
| 539 | newframe: /* reentry point when frame changes (call/return) */ | |
| 540 | lua_assert(ci == L->ci); | |
| 541 | cl = clLvalue(ci->func); | |
| 542 | k = cl->p->k; | |
| 543 | base = ci->u.l.base; | |
| 544 | /* main loop of interpreter */ | |
| 545 | for (;;) { | |
| 546 | Instruction i = *(ci->u.l.savedpc++); | |
| 547 | StkId ra; | |
| 548 | if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && | |
| 549 | (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { | |
| 550 | Protect(traceexec(L)); | |
| 551 | } | |
| 552 | /* WARNING: several calls may realloc the stack and invalidate `ra' */ | |
| 553 | ra = RA(i); | |
| 554 | lua_assert(base == ci->u.l.base); | |
| 555 | lua_assert(base <= L->top && L->top < L->stack + L->stacksize); | |
| 556 | vmdispatch (GET_OPCODE(i)) { | |
| 557 | vmcase(OP_MOVE, | |
| 558 | setobjs2s(L, ra, RB(i)); | |
| 559 | ) | |
| 560 | vmcase(OP_LOADK, | |
| 561 | TValue *rb = k + GETARG_Bx(i); | |
| 562 | setobj2s(L, ra, rb); | |
| 563 | ) | |
| 564 | vmcase(OP_LOADKX, | |
| 565 | TValue *rb; | |
| 566 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); | |
| 567 | rb = k + GETARG_Ax(*ci->u.l.savedpc++); | |
| 568 | setobj2s(L, ra, rb); | |
| 569 | ) | |
| 570 | vmcase(OP_LOADBOOL, | |
| 571 | setbvalue(ra, GETARG_B(i)); | |
| 572 | if (GETARG_C(i)) ci->u.l.savedpc++; /* skip next instruction (if C) */ | |
| 573 | ) | |
| 574 | vmcase(OP_LOADNIL, | |
| 575 | int b = GETARG_B(i); | |
| 576 | do { | |
| 577 | setnilvalue(ra++); | |
| 578 | } while (b--); | |
| 579 | ) | |
| 580 | vmcase(OP_GETUPVAL, | |
| 581 | int b = GETARG_B(i); | |
| 582 | setobj2s(L, ra, cl->upvals[b]->v); | |
| 583 | ) | |
| 584 | vmcase(OP_GETTABUP, | |
| 585 | int b = GETARG_B(i); | |
| 586 | Protect(luaV_gettable(L, cl->upvals[b]->v, RKC(i), ra)); | |
| 587 | ) | |
| 588 | vmcase(OP_GETTABLE, | |
| 589 | Protect(luaV_gettable(L, RB(i), RKC(i), ra)); | |
| 590 | ) | |
| 591 | vmcase(OP_SETTABUP, | |
| 592 | int a = GETARG_A(i); | |
| 593 | Protect(luaV_settable(L, cl->upvals[a]->v, RKB(i), RKC(i))); | |
| 594 | ) | |
| 595 | vmcase(OP_SETUPVAL, | |
| 596 | UpVal *uv = cl->upvals[GETARG_B(i)]; | |
| 597 | setobj(L, uv->v, ra); | |
| 598 | luaC_barrier(L, uv, ra); | |
| 599 | ) | |
| 600 | vmcase(OP_SETTABLE, | |
| 601 | Protect(luaV_settable(L, ra, RKB(i), RKC(i))); | |
| 602 | ) | |
| 603 | vmcase(OP_NEWTABLE, | |
| 604 | int b = GETARG_B(i); | |
| 605 | int c = GETARG_C(i); | |
| 606 | Table *t = luaH_new(L); | |
| 607 | sethvalue(L, ra, t); | |
| 608 | if (b != 0 || c != 0) | |
| 609 | luaH_resize(L, t, luaO_fb2int(b), luaO_fb2int(c)); | |
| 610 | checkGC(L, ra + 1); | |
| 611 | ) | |
| 612 | vmcase(OP_SELF, | |
| 613 | StkId rb = RB(i); | |
| 614 | setobjs2s(L, ra+1, rb); | |
| 615 | Protect(luaV_gettable(L, rb, RKC(i), ra)); | |
| 616 | ) | |
| 617 | vmcase(OP_ADD, | |
| 618 | arith_op(luai_numadd, TM_ADD); | |
| 619 | ) | |
| 620 | vmcase(OP_SUB, | |
| 621 | arith_op(luai_numsub, TM_SUB); | |
| 622 | ) | |
| 623 | vmcase(OP_MUL, | |
| 624 | arith_op(luai_nummul, TM_MUL); | |
| 625 | ) | |
| 626 | vmcase(OP_DIV, | |
| 627 | arith_op(luai_numdiv, TM_DIV); | |
| 628 | ) | |
| 629 | vmcase(OP_MOD, | |
| 630 | arith_op(luai_nummod, TM_MOD); | |
| 631 | ) | |
| 632 | vmcase(OP_POW, | |
| 633 | arith_op(luai_numpow, TM_POW); | |
| 634 | ) | |
| 635 | vmcase(OP_UNM, | |
| 636 | TValue *rb = RB(i); | |
| 637 | if (ttisnumber(rb)) { | |
| 638 | lua_Number nb = nvalue(rb); | |
| 639 | setnvalue(ra, luai_numunm(L, nb)); | |
| 640 | } | |
| 641 | else { | |
| 642 | Protect(luaV_arith(L, ra, rb, rb, TM_UNM)); | |
| 643 | } | |
| 644 | ) | |
| 645 | vmcase(OP_NOT, | |
| 646 | TValue *rb = RB(i); | |
| 647 | int res = l_isfalse(rb); /* next assignment may change this value */ | |
| 648 | setbvalue(ra, res); | |
| 649 | ) | |
| 650 | vmcase(OP_LEN, | |
| 651 | Protect(luaV_objlen(L, ra, RB(i))); | |
| 652 | ) | |
| 653 | vmcase(OP_CONCAT, | |
| 654 | int b = GETARG_B(i); | |
| 655 | int c = GETARG_C(i); | |
| 656 | StkId rb; | |
| 657 | L->top = base + c + 1; /* mark the end of concat operands */ | |
| 658 | Protect(luaV_concat(L, c - b + 1)); | |
| 659 | ra = RA(i); /* 'luav_concat' may invoke TMs and move the stack */ | |
| 660 | rb = b + base; | |
| 661 | setobjs2s(L, ra, rb); | |
| 662 | checkGC(L, (ra >= rb ? ra + 1 : rb)); | |
| 663 | L->top = ci->top; /* restore top */ | |
| 664 | ) | |
| 665 | vmcase(OP_JMP, | |
| 666 | dojump(ci, i, 0); | |
| 667 | ) | |
| 668 | vmcase(OP_EQ, | |
| 669 | TValue *rb = RKB(i); | |
| 670 | TValue *rc = RKC(i); | |
| 671 | Protect( | |
| 672 | if (cast_int(equalobj(L, rb, rc)) != GETARG_A(i)) | |
| 673 | ci->u.l.savedpc++; | |
| 674 | else | |
| 675 | donextjump(ci); | |
| 676 | ) | |
| 677 | ) | |
| 678 | vmcase(OP_LT, | |
| 679 | Protect( | |
| 680 | if (luaV_lessthan(L, RKB(i), RKC(i)) != GETARG_A(i)) | |
| 681 | ci->u.l.savedpc++; | |
| 682 | else | |
| 683 | donextjump(ci); | |
| 684 | ) | |
| 685 | ) | |
| 686 | vmcase(OP_LE, | |
| 687 | Protect( | |
| 688 | if (luaV_lessequal(L, RKB(i), RKC(i)) != GETARG_A(i)) | |
| 689 | ci->u.l.savedpc++; | |
| 690 | else | |
| 691 | donextjump(ci); | |
| 692 | ) | |
| 693 | ) | |
| 694 | vmcase(OP_TEST, | |
| 695 | if (GETARG_C(i) ? l_isfalse(ra) : !l_isfalse(ra)) | |
| 696 | ci->u.l.savedpc++; | |
| 697 | else | |
| 698 | donextjump(ci); | |
| 699 | ) | |
| 700 | vmcase(OP_TESTSET, | |
| 701 | TValue *rb = RB(i); | |
| 702 | if (GETARG_C(i) ? l_isfalse(rb) : !l_isfalse(rb)) | |
| 703 | ci->u.l.savedpc++; | |
| 704 | else { | |
| 705 | setobjs2s(L, ra, rb); | |
| 706 | donextjump(ci); | |
| 707 | } | |
| 708 | ) | |
| 709 | vmcase(OP_CALL, | |
| 710 | int b = GETARG_B(i); | |
| 711 | int nresults = GETARG_C(i) - 1; | |
| 712 | if (b != 0) L->top = ra+b; /* else previous instruction set top */ | |
| 713 | if (luaD_precall(L, ra, nresults)) { /* C function? */ | |
| 714 | if (nresults >= 0) L->top = ci->top; /* adjust results */ | |
| 715 | base = ci->u.l.base; | |
| 716 | } | |
| 717 | else { /* Lua function */ | |
| 718 | ci = L->ci; | |
| 719 | ci->callstatus |= CIST_REENTRY; | |
| 720 | goto newframe; /* restart luaV_execute over new Lua function */ | |
| 721 | } | |
| 722 | ) | |
| 723 | vmcase(OP_TAILCALL, | |
| 724 | int b = GETARG_B(i); | |
| 725 | if (b != 0) L->top = ra+b; /* else previous instruction set top */ | |
| 726 | lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); | |
| 727 | if (luaD_precall(L, ra, LUA_MULTRET)) /* C function? */ | |
| 728 | base = ci->u.l.base; | |
| 729 | else { | |
| 730 | /* tail call: put called frame (n) in place of caller one (o) */ | |
| 731 | CallInfo *nci = L->ci; /* called frame */ | |
| 732 | CallInfo *oci = nci->previous; /* caller frame */ | |
| 733 | StkId nfunc = nci->func; /* called function */ | |
| 734 | StkId ofunc = oci->func; /* caller function */ | |
| 735 | /* last stack slot filled by 'precall' */ | |
| 736 | StkId lim = nci->u.l.base + getproto(nfunc)->numparams; | |
| 737 | int aux; | |
| 738 | /* close all upvalues from previous call */ | |
| 739 | if (cl->p->sizep > 0) luaF_close(L, oci->u.l.base); | |
| 740 | /* move new frame into old one */ | |
| 741 | for (aux = 0; nfunc + aux < lim; aux++) | |
| 742 | setobjs2s(L, ofunc + aux, nfunc + aux); | |
| 743 | oci->u.l.base = ofunc + (nci->u.l.base - nfunc); /* correct base */ | |
| 744 | oci->top = L->top = ofunc + (L->top - nfunc); /* correct top */ | |
| 745 | oci->u.l.savedpc = nci->u.l.savedpc; | |
| 746 | oci->callstatus |= CIST_TAIL; /* function was tail called */ | |
| 747 | ci = L->ci = oci; /* remove new frame */ | |
| 748 | lua_assert(L->top == oci->u.l.base + getproto(ofunc)->maxstacksize); | |
| 749 | goto newframe; /* restart luaV_execute over new Lua function */ | |
| 750 | } | |
| 751 | ) | |
| 752 | vmcasenb(OP_RETURN, | |
| 753 | int b = GETARG_B(i); | |
| 754 | if (b != 0) L->top = ra+b-1; | |
| 755 | if (cl->p->sizep > 0) luaF_close(L, base); | |
| 756 | b = luaD_poscall(L, ra); | |
| 757 | if (!(ci->callstatus & CIST_REENTRY)) /* 'ci' still the called one */ | |
| 758 | return; /* external invocation: return */ | |
| 759 | else { /* invocation via reentry: continue execution */ | |
| 760 | ci = L->ci; | |
| 761 | if (b) L->top = ci->top; | |
| 762 | lua_assert(isLua(ci)); | |
| 763 | lua_assert(GET_OPCODE(*((ci)->u.l.savedpc - 1)) == OP_CALL); | |
| 764 | goto newframe; /* restart luaV_execute over new Lua function */ | |
| 765 | } | |
| 766 | ) | |
| 767 | vmcase(OP_FORLOOP, | |
| 768 | lua_Number step = nvalue(ra+2); | |
| 769 | lua_Number idx = luai_numadd(L, nvalue(ra), step); /* increment index */ | |
| 770 | lua_Number limit = nvalue(ra+1); | |
| 771 | if (luai_numlt(L, 0, step) ? luai_numle(L, idx, limit) | |
| 772 | : luai_numle(L, limit, idx)) { | |
| 773 | ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ | |
| 774 | setnvalue(ra, idx); /* update internal index... */ | |
| 775 | setnvalue(ra+3, idx); /* ...and external index */ | |
| 776 | } | |
| 777 | ) | |
| 778 | vmcase(OP_FORPREP, | |
| 779 | const TValue *init = ra; | |
| 780 | const TValue *plimit = ra+1; | |
| 781 | const TValue *pstep = ra+2; | |
| 782 | if (!tonumber(init, ra)) | |
| 783 | luaG_runerror(L, LUA_QL("for") " initial value must be a number"); | |
| 784 | else if (!tonumber(plimit, ra+1)) | |
| 785 | luaG_runerror(L, LUA_QL("for") " limit must be a number"); | |
| 786 | else if (!tonumber(pstep, ra+2)) | |
| 787 | luaG_runerror(L, LUA_QL("for") " step must be a number"); | |
| 788 | setnvalue(ra, luai_numsub(L, nvalue(ra), nvalue(pstep))); | |
| 789 | ci->u.l.savedpc += GETARG_sBx(i); | |
| 790 | ) | |
| 791 | vmcasenb(OP_TFORCALL, | |
| 792 | StkId cb = ra + 3; /* call base */ | |
| 793 | setobjs2s(L, cb+2, ra+2); | |
| 794 | setobjs2s(L, cb+1, ra+1); | |
| 795 | setobjs2s(L, cb, ra); | |
| 796 | L->top = cb + 3; /* func. + 2 args (state and index) */ | |
| 797 | Protect(luaD_call(L, cb, GETARG_C(i), 1)); | |
| 798 | L->top = ci->top; | |
| 799 | i = *(ci->u.l.savedpc++); /* go to next instruction */ | |
| 800 | ra = RA(i); | |
| 801 | lua_assert(GET_OPCODE(i) == OP_TFORLOOP); | |
| 802 | goto l_tforloop; | |
| 803 | ) | |
| 804 | vmcase(OP_TFORLOOP, | |
| 805 | l_tforloop: | |
| 806 | if (!ttisnil(ra + 1)) { /* continue loop? */ | |
| 807 | setobjs2s(L, ra, ra + 1); /* save control variable */ | |
| 808 | ci->u.l.savedpc += GETARG_sBx(i); /* jump back */ | |
| 809 | } | |
| 810 | ) | |
| 811 | vmcase(OP_SETLIST, | |
| 812 | int n = GETARG_B(i); | |
| 813 | int c = GETARG_C(i); | |
| 814 | int last; | |
| 815 | Table *h; | |
| 816 | if (n == 0) n = cast_int(L->top - ra) - 1; | |
| 817 | if (c == 0) { | |
| 818 | lua_assert(GET_OPCODE(*ci->u.l.savedpc) == OP_EXTRAARG); | |
| 819 | c = GETARG_Ax(*ci->u.l.savedpc++); | |
| 820 | } | |
| 821 | luai_runtimecheck(L, ttistable(ra)); | |
| 822 | h = hvalue(ra); | |
| 823 | last = ((c-1)*LFIELDS_PER_FLUSH) + n; | |
| 824 | if (last > h->sizearray) /* needs more space? */ | |
| 825 | luaH_resizearray(L, h, last); /* pre-allocate it at once */ | |
| 826 | for (; n > 0; n--) { | |
| 827 | TValue *val = ra+n; | |
| 828 | luaH_setint(L, h, last--, val); | |
| 829 | luaC_barrierback(L, obj2gco(h), val); | |
| 830 | } | |
| 831 | L->top = ci->top; /* correct top (in case of previous open call) */ | |
| 832 | ) | |
| 833 | vmcase(OP_CLOSURE, | |
| 834 | Proto *p = cl->p->p[GETARG_Bx(i)]; | |
| 835 | Closure *ncl = getcached(p, cl->upvals, base); /* cached closure */ | |
| 836 | if (ncl == NULL) /* no match? */ | |
| 837 | pushclosure(L, p, cl->upvals, base, ra); /* create a new one */ | |
| 838 | else | |
| 839 | setclLvalue(L, ra, ncl); /* push cashed closure */ | |
| 840 | checkGC(L, ra + 1); | |
| 841 | ) | |
| 842 | vmcase(OP_VARARG, | |
| 843 | int b = GETARG_B(i) - 1; | |
| 844 | int j; | |
| 845 | int n = cast_int(base - ci->func) - cl->p->numparams - 1; | |
| 846 | if (b < 0) { /* B == 0? */ | |
| 847 | b = n; /* get all var. arguments */ | |
| 848 | Protect(luaD_checkstack(L, n)); | |
| 849 | ra = RA(i); /* previous call may change the stack */ | |
| 850 | L->top = ra + n; | |
| 851 | } | |
| 852 | for (j = 0; j < b; j++) { | |
| 853 | if (j < n) { | |
| 854 | setobjs2s(L, ra + j, base - n + j); | |
| 855 | } | |
| 856 | else { | |
| 857 | setnilvalue(ra + j); | |
| 858 | } | |
| 859 | } | |
| 860 | ) | |
| 861 | vmcase(OP_EXTRAARG, | |
| 862 | lua_assert(0); | |
| 863 | ) | |
| 864 | } | |
| 865 | } | |
| 866 | 866 | } |
| 867 |
| r31373 | r31374 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | #include "lctype.h" |
| 11 | 11 | |
| 12 | #if !LUA_USE_CTYPE | |
| 12 | #if !LUA_USE_CTYPE /* { */ | |
| 13 | 13 | |
| 14 | 14 | #include <limits.h> |
| 15 | 15 | |
| 16 | 16 | LUAI_DDEF const lu_byte luai_ctype_[UCHAR_MAX + 2] = { |
| 17 | 0x00, /* EOZ */ | |
| 18 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0. */ | |
| 19 | 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, | |
| 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1. */ | |
| 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 22 | 0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* 2. */ | |
| 23 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | |
| 24 | 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, /* 3. */ | |
| 25 | 0x16, 0x16, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | |
| 26 | 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 4. */ | |
| 27 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | |
| 28 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 5. */ | |
| 29 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x05, | |
| 30 | 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 6. */ | |
| 31 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | |
| 32 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 7. */ | |
| 33 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, | |
| 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8. */ | |
| 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9. */ | |
| 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a. */ | |
| 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b. */ | |
| 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c. */ | |
| 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d. */ | |
| 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e. */ | |
| 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* f. */ | |
| 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 17 | 0x00, /* EOZ */ | |
| 18 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 0. */ | |
| 19 | 0x00, 0x08, 0x08, 0x08, 0x08, 0x08, 0x00, 0x00, | |
| 20 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 1. */ | |
| 21 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 22 | 0x0c, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, /* 2. */ | |
| 23 | 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | |
| 24 | 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, 0x16, /* 3. */ | |
| 25 | 0x16, 0x16, 0x04, 0x04, 0x04, 0x04, 0x04, 0x04, | |
| 26 | 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 4. */ | |
| 27 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | |
| 28 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 5. */ | |
| 29 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x05, | |
| 30 | 0x04, 0x15, 0x15, 0x15, 0x15, 0x15, 0x15, 0x05, /* 6. */ | |
| 31 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, | |
| 32 | 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, 0x05, /* 7. */ | |
| 33 | 0x05, 0x05, 0x05, 0x04, 0x04, 0x04, 0x04, 0x00, | |
| 34 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 8. */ | |
| 35 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 36 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* 9. */ | |
| 37 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 38 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* a. */ | |
| 39 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 40 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* b. */ | |
| 41 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 42 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* c. */ | |
| 43 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 44 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* d. */ | |
| 45 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 46 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* e. */ | |
| 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 48 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, /* f. */ | |
| 49 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, | |
| 50 | 50 | }; |
| 51 | 51 | |
| 52 | #endif | |
| 52 | #endif /* } */ |
| r31373 | r31374 | |
|---|---|---|
| 40 | 40 | ** max size of array part is 2^MAXBITS |
| 41 | 41 | */ |
| 42 | 42 | #if LUAI_BITSINT >= 32 |
| 43 | #define MAXBITS | |
| 43 | #define MAXBITS 30 | |
| 44 | 44 | #else |
| 45 | #define MAXBITS | |
| 45 | #define MAXBITS (LUAI_BITSINT-2) | |
| 46 | 46 | #endif |
| 47 | 47 | |
| 48 | #define MAXASIZE | |
| 48 | #define MAXASIZE (1 << MAXBITS) | |
| 49 | 49 | |
| 50 | 50 | |
| 51 | #define hashpow2(t,n) | |
| 51 | #define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) | |
| 52 | 52 | |
| 53 | #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) | |
| 54 | #define hashboolean(t,p) hashpow2(t, p) | |
| 53 | #define hashstr(t,str) hashpow2(t, (str)->tsv.hash) | |
| 54 | #define hashboolean(t,p) hashpow2(t, p) | |
| 55 | 55 | |
| 56 | 56 | |
| 57 | 57 | /* |
| 58 | 58 | ** for some types, it is better to avoid modulus by power of 2, as |
| 59 | 59 | ** they tend to have many 2 factors. |
| 60 | 60 | */ |
| 61 | #define hashmod(t,n) | |
| 61 | #define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) | |
| 62 | 62 | |
| 63 | 63 | |
| 64 | #define hashpointer(t,p) | |
| 64 | #define hashpointer(t,p) hashmod(t, IntPoint(p)) | |
| 65 | 65 | |
| 66 | 66 | |
| 67 | #define dummynode | |
| 67 | #define dummynode (&dummynode_) | |
| 68 | 68 | |
| 69 | #define isdummy(n) | |
| 69 | #define isdummy(n) ((n) == dummynode) | |
| 70 | 70 | |
| 71 | 71 | static const Node dummynode_ = { |
| 72 | {NILCONSTANT}, /* value */ | |
| 73 | {{NILCONSTANT, NULL}} /* key */ | |
| 72 | {NILCONSTANT}, /* value */ | |
| 73 | {{NILCONSTANT, NULL}} /* key */ | |
| 74 | 74 | }; |
| 75 | 75 | |
| 76 | 76 | |
| r31373 | r31374 | |
| 78 | 78 | ** hash for lua_Numbers |
| 79 | 79 | */ |
| 80 | 80 | static Node *hashnum (const Table *t, lua_Number n) { |
| 81 | int i; | |
| 82 | luai_hashnum(i, n); | |
| 83 | if (i < 0) { | |
| 84 | if (cast(unsigned int, i) == 0u - i) /* use unsigned to avoid overflows */ | |
| 85 | i = 0; /* handle INT_MIN */ | |
| 86 | i = -i; /* must be a positive value */ | |
| 87 | } | |
| 88 | return hashmod(t, i); | |
| 81 | int i; | |
| 82 | luai_hashnum(i, n); | |
| 83 | if (i < 0) { | |
| 84 | if (cast(unsigned int, i) == 0u - i) /* use unsigned to avoid overflows */ | |
| 85 | i = 0; /* handle INT_MIN */ | |
| 86 | i = -i; /* must be a positive value */ | |
| 87 | } | |
| 88 | return hashmod(t, i); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| r31373 | r31374 | |
| 95 | 95 | ** of its hash value) |
| 96 | 96 | */ |
| 97 | 97 | static Node *mainposition (const Table *t, const TValue *key) { |
| 98 | switch (ttype(key)) { | |
| 99 | case LUA_TNUMBER: | |
| 100 | return hashnum(t, nvalue(key)); | |
| 101 | case LUA_TLNGSTR: { | |
| 102 | TString *s = rawtsvalue(key); | |
| 103 | if (s->tsv.extra == 0) { /* no hash? */ | |
| 104 | s->tsv.hash = luaS_hash(getstr(s), s->tsv.len, s->tsv.hash); | |
| 105 | s->tsv.extra = 1; /* now it has its hash */ | |
| 106 | } | |
| 107 | return hashstr(t, rawtsvalue(key)); | |
| 108 | } | |
| 109 | case LUA_TSHRSTR: | |
| 110 | return hashstr(t, rawtsvalue(key)); | |
| 111 | case LUA_TBOOLEAN: | |
| 112 | return hashboolean(t, bvalue(key)); | |
| 113 | case LUA_TLIGHTUSERDATA: | |
| 114 | return hashpointer(t, pvalue(key)); | |
| 115 | case LUA_TLCF: | |
| 116 | return hashpointer(t, fvalue(key)); | |
| 117 | default: | |
| 118 | return hashpointer(t, gcvalue(key)); | |
| 119 | } | |
| 98 | switch (ttype(key)) { | |
| 99 | case LUA_TNUMBER: | |
| 100 | return hashnum(t, nvalue(key)); | |
| 101 | case LUA_TLNGSTR: { | |
| 102 | TString *s = rawtsvalue(key); | |
| 103 | if (s->tsv.extra == 0) { /* no hash? */ | |
| 104 | s->tsv.hash = luaS_hash(getstr(s), s->tsv.len, s->tsv.hash); | |
| 105 | s->tsv.extra = 1; /* now it has its hash */ | |
| 106 | } | |
| 107 | return hashstr(t, rawtsvalue(key)); | |
| 108 | } | |
| 109 | case LUA_TSHRSTR: | |
| 110 | return hashstr(t, rawtsvalue(key)); | |
| 111 | case LUA_TBOOLEAN: | |
| 112 | return hashboolean(t, bvalue(key)); | |
| 113 | case LUA_TLIGHTUSERDATA: | |
| 114 | return hashpointer(t, pvalue(key)); | |
| 115 | case LUA_TLCF: | |
| 116 | return hashpointer(t, fvalue(key)); | |
| 117 | default: | |
| 118 | return hashpointer(t, gcvalue(key)); | |
| 119 | } | |
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | |
| r31373 | r31374 | |
| 125 | 125 | ** the array part of the table, -1 otherwise. |
| 126 | 126 | */ |
| 127 | 127 | static int arrayindex (const TValue *key) { |
| 128 | if (ttisnumber(key)) { | |
| 129 | lua_Number n = nvalue(key); | |
| 130 | int k; | |
| 131 | lua_number2int(k, n); | |
| 132 | if (luai_numeq(cast_num(k), n)) | |
| 133 | return k; | |
| 134 | } | |
| 135 | return -1; /* `key' did not match some condition */ | |
| 128 | if (ttisnumber(key)) { | |
| 129 | lua_Number n = nvalue(key); | |
| 130 | int k; | |
| 131 | lua_number2int(k, n); | |
| 132 | if (luai_numeq(cast_num(k), n)) | |
| 133 | return k; | |
| 134 | } | |
| 135 | return -1; /* `key' did not match some condition */ | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| r31373 | r31374 | |
| 142 | 142 | ** beginning of a traversal is signaled by -1. |
| 143 | 143 | */ |
| 144 | 144 | static int findindex (lua_State *L, Table *t, StkId key) { |
| 145 | int i; | |
| 146 | if (ttisnil(key)) return -1; /* first iteration */ | |
| 147 | i = arrayindex(key); | |
| 148 | if (0 < i && i <= t->sizearray) /* is `key' inside array part? */ | |
| 149 | return i-1; /* yes; that's the index (corrected to C) */ | |
| 150 | else { | |
| 151 | Node *n = mainposition(t, key); | |
| 152 | for (;;) { /* check whether `key' is somewhere in the chain */ | |
| 153 | /* key may be dead already, but it is ok to use it in `next' */ | |
| 154 | if (luaV_rawequalobj(gkey(n), key) || | |
| 155 | (ttisdeadkey(gkey(n)) && iscollectable(key) && | |
| 156 | deadvalue(gkey(n)) == gcvalue(key))) { | |
| 157 | i = cast_int(n - gnode(t, 0)); /* key index in hash table */ | |
| 158 | /* hash elements are numbered after array ones */ | |
| 159 | return i + t->sizearray; | |
| 160 | } | |
| 161 | else n = gnext(n); | |
| 162 | if (n == NULL) | |
| 163 | luaG_runerror(L, "invalid key to " LUA_QL("next")); /* key not found */ | |
| 164 | } | |
| 165 | } | |
| 145 | int i; | |
| 146 | if (ttisnil(key)) return -1; /* first iteration */ | |
| 147 | i = arrayindex(key); | |
| 148 | if (0 < i && i <= t->sizearray) /* is `key' inside array part? */ | |
| 149 | return i-1; /* yes; that's the index (corrected to C) */ | |
| 150 | else { | |
| 151 | Node *n = mainposition(t, key); | |
| 152 | for (;;) { /* check whether `key' is somewhere in the chain */ | |
| 153 | /* key may be dead already, but it is ok to use it in `next' */ | |
| 154 | if (luaV_rawequalobj(gkey(n), key) || | |
| 155 | (ttisdeadkey(gkey(n)) && iscollectable(key) && | |
| 156 | deadvalue(gkey(n)) == gcvalue(key))) { | |
| 157 | i = cast_int(n - gnode(t, 0)); /* key index in hash table */ | |
| 158 | /* hash elements are numbered after array ones */ | |
| 159 | return i + t->sizearray; | |
| 160 | } | |
| 161 | else n = gnext(n); | |
| 162 | if (n == NULL) | |
| 163 | luaG_runerror(L, "invalid key to " LUA_QL("next")); /* key not found */ | |
| 164 | } | |
| 165 | } | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | int luaH_next (lua_State *L, Table *t, StkId key) { |
| 170 | int i = findindex(L, t, key); /* find original element */ | |
| 171 | for (i++; i < t->sizearray; i++) { /* try first array part */ | |
| 172 | if (!ttisnil(&t->array[i])) { /* a non-nil value? */ | |
| 173 | setnvalue(key, cast_num(i+1)); | |
| 174 | setobj2s(L, key+1, &t->array[i]); | |
| 175 | return 1; | |
| 176 | } | |
| 177 | } | |
| 178 | for (i -= t->sizearray; i < sizenode(t); i++) { /* then hash part */ | |
| 179 | if (!ttisnil(gval(gnode(t, i)))) { /* a non-nil value? */ | |
| 180 | setobj2s(L, key, gkey(gnode(t, i))); | |
| 181 | setobj2s(L, key+1, gval(gnode(t, i))); | |
| 182 | return 1; | |
| 183 | } | |
| 184 | } | |
| 185 | return 0; /* no more elements */ | |
| 170 | int i = findindex(L, t, key); /* find original element */ | |
| 171 | for (i++; i < t->sizearray; i++) { /* try first array part */ | |
| 172 | if (!ttisnil(&t->array[i])) { /* a non-nil value? */ | |
| 173 | setnvalue(key, cast_num(i+1)); | |
| 174 | setobj2s(L, key+1, &t->array[i]); | |
| 175 | return 1; | |
| 176 | } | |
| 177 | } | |
| 178 | for (i -= t->sizearray; i < sizenode(t); i++) { /* then hash part */ | |
| 179 | if (!ttisnil(gval(gnode(t, i)))) { /* a non-nil value? */ | |
| 180 | setobj2s(L, key, gkey(gnode(t, i))); | |
| 181 | setobj2s(L, key+1, gval(gnode(t, i))); | |
| 182 | return 1; | |
| 183 | } | |
| 184 | } | |
| 185 | return 0; /* no more elements */ | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | |
| r31373 | r31374 | |
| 194 | 194 | |
| 195 | 195 | |
| 196 | 196 | static int computesizes (int nums[], int *narray) { |
| 197 | int i; | |
| 198 | int twotoi; /* 2^i */ | |
| 199 | int a = 0; /* number of elements smaller than 2^i */ | |
| 200 | int na = 0; /* number of elements to go to array part */ | |
| 201 | int n = 0; /* optimal size for array part */ | |
| 202 | for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) { | |
| 203 | if (nums[i] > 0) { | |
| 204 | a += nums[i]; | |
| 205 | if (a > twotoi/2) { /* more than half elements present? */ | |
| 206 | n = twotoi; /* optimal size (till now) */ | |
| 207 | na = a; /* all elements smaller than n will go to array part */ | |
| 208 | } | |
| 209 | } | |
| 210 | if (a == *narray) break; /* all elements already counted */ | |
| 211 | } | |
| 212 | *narray = n; | |
| 213 | lua_assert(*narray/2 <= na && na <= *narray); | |
| 214 | return na; | |
| 197 | int i; | |
| 198 | int twotoi; /* 2^i */ | |
| 199 | int a = 0; /* number of elements smaller than 2^i */ | |
| 200 | int na = 0; /* number of elements to go to array part */ | |
| 201 | int n = 0; /* optimal size for array part */ | |
| 202 | for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) { | |
| 203 | if (nums[i] > 0) { | |
| 204 | a += nums[i]; | |
| 205 | if (a > twotoi/2) { /* more than half elements present? */ | |
| 206 | n = twotoi; /* optimal size (till now) */ | |
| 207 | na = a; /* all elements smaller than n will go to array part */ | |
| 208 | } | |
| 209 | } | |
| 210 | if (a == *narray) break; /* all elements already counted */ | |
| 211 | } | |
| 212 | *narray = n; | |
| 213 | lua_assert(*narray/2 <= na && na <= *narray); | |
| 214 | return na; | |
| 215 | 215 | } |
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | static int countint (const TValue *key, int *nums) { |
| 219 | int k = arrayindex(key); | |
| 220 | if (0 < k && k <= MAXASIZE) { /* is `key' an appropriate array index? */ | |
| 221 | nums[luaO_ceillog2(k)]++; /* count as such */ | |
| 222 | return 1; | |
| 223 | } | |
| 224 | else | |
| 225 | return 0; | |
| 219 | int k = arrayindex(key); | |
| 220 | if (0 < k && k <= MAXASIZE) { /* is `key' an appropriate array index? */ | |
| 221 | nums[luaO_ceillog2(k)]++; /* count as such */ | |
| 222 | return 1; | |
| 223 | } | |
| 224 | else | |
| 225 | return 0; | |
| 226 | 226 | } |
| 227 | 227 | |
| 228 | 228 | |
| 229 | 229 | static int numusearray (const Table *t, int *nums) { |
| 230 | int lg; | |
| 231 | int ttlg; /* 2^lg */ | |
| 232 | int ause = 0; /* summation of `nums' */ | |
| 233 | int i = 1; /* count to traverse all array keys */ | |
| 234 | for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) { /* for each slice */ | |
| 235 | int lc = 0; /* counter */ | |
| 236 | int lim = ttlg; | |
| 237 | if (lim > t->sizearray) { | |
| 238 | lim = t->sizearray; /* adjust upper limit */ | |
| 239 | if (i > lim) | |
| 240 | break; /* no more elements to count */ | |
| 241 | } | |
| 242 | /* count elements in range (2^(lg-1), 2^lg] */ | |
| 243 | for (; i <= lim; i++) { | |
| 244 | if (!ttisnil(&t->array[i-1])) | |
| 245 | lc++; | |
| 246 | } | |
| 247 | nums[lg] += lc; | |
| 248 | ause += lc; | |
| 249 | } | |
| 250 | return ause; | |
| 230 | int lg; | |
| 231 | int ttlg; /* 2^lg */ | |
| 232 | int ause = 0; /* summation of `nums' */ | |
| 233 | int i = 1; /* count to traverse all array keys */ | |
| 234 | for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) { /* for each slice */ | |
| 235 | int lc = 0; /* counter */ | |
| 236 | int lim = ttlg; | |
| 237 | if (lim > t->sizearray) { | |
| 238 | lim = t->sizearray; /* adjust upper limit */ | |
| 239 | if (i > lim) | |
| 240 | break; /* no more elements to count */ | |
| 241 | } | |
| 242 | /* count elements in range (2^(lg-1), 2^lg] */ | |
| 243 | for (; i <= lim; i++) { | |
| 244 | if (!ttisnil(&t->array[i-1])) | |
| 245 | lc++; | |
| 246 | } | |
| 247 | nums[lg] += lc; | |
| 248 | ause += lc; | |
| 249 | } | |
| 250 | return ause; | |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | 253 | |
| 254 | 254 | static int numusehash (const Table *t, int *nums, int *pnasize) { |
| 255 | int totaluse = 0; /* total number of elements */ | |
| 256 | int ause = 0; /* summation of `nums' */ | |
| 257 | int i = sizenode(t); | |
| 258 | while (i--) { | |
| 259 | Node *n = &t->node[i]; | |
| 260 | if (!ttisnil(gval(n))) { | |
| 261 | ause += countint(gkey(n), nums); | |
| 262 | totaluse++; | |
| 263 | } | |
| 264 | } | |
| 265 | *pnasize += ause; | |
| 266 | return totaluse; | |
| 255 | int totaluse = 0; /* total number of elements */ | |
| 256 | int ause = 0; /* summation of `nums' */ | |
| 257 | int i = sizenode(t); | |
| 258 | while (i--) { | |
| 259 | Node *n = &t->node[i]; | |
| 260 | if (!ttisnil(gval(n))) { | |
| 261 | ause += countint(gkey(n), nums); | |
| 262 | totaluse++; | |
| 263 | } | |
| 264 | } | |
| 265 | *pnasize += ause; | |
| 266 | return totaluse; | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
| 270 | 270 | static void setarrayvector (lua_State *L, Table *t, int size) { |
| 271 | int i; | |
| 272 | luaM_reallocvector(L, t->array, t->sizearray, size, TValue); | |
| 273 | for (i=t->sizearray; i<size; i++) | |
| 274 | setnilvalue(&t->array[i]); | |
| 275 | t->sizearray = size; | |
| 271 | int i; | |
| 272 | luaM_reallocvector(L, t->array, t->sizearray, size, TValue); | |
| 273 | for (i=t->sizearray; i<size; i++) | |
| 274 | setnilvalue(&t->array[i]); | |
| 275 | t->sizearray = size; | |
| 276 | 276 | } |
| 277 | 277 | |
| 278 | 278 | |
| 279 | 279 | static void setnodevector (lua_State *L, Table *t, int size) { |
| 280 | int lsize; | |
| 281 | if (size == 0) { /* no elements to hash part? */ | |
| 282 | t->node = cast(Node *, dummynode); /* use common `dummynode' */ | |
| 283 | lsize = 0; | |
| 284 | } | |
| 285 | else { | |
| 286 | int i; | |
| 287 | lsize = luaO_ceillog2(size); | |
| 288 | if (lsize > MAXBITS) | |
| 289 | luaG_runerror(L, "table overflow"); | |
| 290 | size = twoto(lsize); | |
| 291 | t->node = luaM_newvector(L, size, Node); | |
| 292 | for (i=0; i<size; i++) { | |
| 293 | Node *n = gnode(t, i); | |
| 294 | gnext(n) = NULL; | |
| 295 | setnilvalue(gkey(n)); | |
| 296 | setnilvalue(gval(n)); | |
| 297 | } | |
| 298 | } | |
| 299 | t->lsizenode = cast_byte(lsize); | |
| 300 | t->lastfree = gnode(t, size); /* all positions are free */ | |
| 280 | int lsize; | |
| 281 | if (size == 0) { /* no elements to hash part? */ | |
| 282 | t->node = cast(Node *, dummynode); /* use common `dummynode' */ | |
| 283 | lsize = 0; | |
| 284 | } | |
| 285 | else { | |
| 286 | int i; | |
| 287 | lsize = luaO_ceillog2(size); | |
| 288 | if (lsize > MAXBITS) | |
| 289 | luaG_runerror(L, "table overflow"); | |
| 290 | size = twoto(lsize); | |
| 291 | t->node = luaM_newvector(L, size, Node); | |
| 292 | for (i=0; i<size; i++) { | |
| 293 | Node *n = gnode(t, i); | |
| 294 | gnext(n) = NULL; | |
| 295 | setnilvalue(gkey(n)); | |
| 296 | setnilvalue(gval(n)); | |
| 297 | } | |
| 298 | } | |
| 299 | t->lsizenode = cast_byte(lsize); | |
| 300 | t->lastfree = gnode(t, size); /* all positions are free */ | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| 304 | 304 | void luaH_resize (lua_State *L, Table *t, int nasize, int nhsize) { |
| 305 | int i; | |
| 306 | int oldasize = t->sizearray; | |
| 307 | int oldhsize = t->lsizenode; | |
| 308 | Node *nold = t->node; /* save old hash ... */ | |
| 309 | if (nasize > oldasize) /* array part must grow? */ | |
| 310 | setarrayvector(L, t, nasize); | |
| 311 | /* create new hash part with appropriate size */ | |
| 312 | setnodevector(L, t, nhsize); | |
| 313 | if (nasize < oldasize) { /* array part must shrink? */ | |
| 314 | t->sizearray = nasize; | |
| 315 | /* re-insert elements from vanishing slice */ | |
| 316 | for (i=nasize; i<oldasize; i++) { | |
| 317 | if (!ttisnil(&t->array[i])) | |
| 318 | luaH_setint(L, t, i + 1, &t->array[i]); | |
| 319 | } | |
| 320 | /* shrink array */ | |
| 321 | luaM_reallocvector(L, t->array, oldasize, nasize, TValue); | |
| 322 | } | |
| 323 | /* re-insert elements from hash part */ | |
| 324 | for (i = twoto(oldhsize) - 1; i >= 0; i--) { | |
| 325 | Node *old = nold+i; | |
| 326 | if (!ttisnil(gval(old))) { | |
| 327 | /* doesn't need barrier/invalidate cache, as entry was | |
| 328 | already present in the table */ | |
| 329 | setobjt2t(L, luaH_set(L, t, gkey(old)), gval(old)); | |
| 330 | } | |
| 331 | } | |
| 332 | if (!isdummy(nold)) | |
| 333 | luaM_freearray(L, nold, cast(size_t, twoto(oldhsize))); /* free old array */ | |
| 305 | int i; | |
| 306 | int oldasize = t->sizearray; | |
| 307 | int oldhsize = t->lsizenode; | |
| 308 | Node *nold = t->node; /* save old hash ... */ | |
| 309 | if (nasize > oldasize) /* array part must grow? */ | |
| 310 | setarrayvector(L, t, nasize); | |
| 311 | /* create new hash part with appropriate size */ | |
| 312 | setnodevector(L, t, nhsize); | |
| 313 | if (nasize < oldasize) { /* array part must shrink? */ | |
| 314 | t->sizearray = nasize; | |
| 315 | /* re-insert elements from vanishing slice */ | |
| 316 | for (i=nasize; i<oldasize; i++) { | |
| 317 | if (!ttisnil(&t->array[i])) | |
| 318 | luaH_setint(L, t, i + 1, &t->array[i]); | |
| 319 | } | |
| 320 | /* shrink array */ | |
| 321 | luaM_reallocvector(L, t->array, oldasize, nasize, TValue); | |
| 322 | } | |
| 323 | /* re-insert elements from hash part */ | |
| 324 | for (i = twoto(oldhsize) - 1; i >= 0; i--) { | |
| 325 | Node *old = nold+i; | |
| 326 | if (!ttisnil(gval(old))) { | |
| 327 | /* doesn't need barrier/invalidate cache, as entry was | |
| 328 | already present in the table */ | |
| 329 | setobjt2t(L, luaH_set(L, t, gkey(old)), gval(old)); | |
| 330 | } | |
| 331 | } | |
| 332 | if (!isdummy(nold)) | |
| 333 | luaM_freearray(L, nold, cast(size_t, twoto(oldhsize))); /* free old array */ | |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | |
| 337 | 337 | void luaH_resizearray (lua_State *L, Table *t, int nasize) { |
| 338 | int nsize = isdummy(t->node) ? 0 : sizenode(t); | |
| 339 | luaH_resize(L, t, nasize, nsize); | |
| 338 | int nsize = isdummy(t->node) ? 0 : sizenode(t); | |
| 339 | luaH_resize(L, t, nasize, nsize); | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | static void rehash (lua_State *L, Table *t, const TValue *ek) { |
| 344 | int nasize, na; | |
| 345 | int nums[MAXBITS+1]; /* nums[i] = number of keys with 2^(i-1) < k <= 2^i */ | |
| 346 | int i; | |
| 347 | int totaluse; | |
| 348 | for (i=0; i<=MAXBITS; i++) nums[i] = 0; /* reset counts */ | |
| 349 | nasize = numusearray(t, nums); /* count keys in array part */ | |
| 350 | totaluse = nasize; /* all those keys are integer keys */ | |
| 351 | totaluse += numusehash(t, nums, &nasize); /* count keys in hash part */ | |
| 352 | /* count extra key */ | |
| 353 | nasize += countint(ek, nums); | |
| 354 | totaluse++; | |
| 355 | /* compute new size for array part */ | |
| 356 | na = computesizes(nums, &nasize); | |
| 357 | /* resize the table to new computed sizes */ | |
| 358 | luaH_resize(L, t, nasize, totaluse - na); | |
| 344 | int nasize, na; | |
| 345 | int nums[MAXBITS+1]; /* nums[i] = number of keys with 2^(i-1) < k <= 2^i */ | |
| 346 | int i; | |
| 347 | int totaluse; | |
| 348 | for (i=0; i<=MAXBITS; i++) nums[i] = 0; /* reset counts */ | |
| 349 | nasize = numusearray(t, nums); /* count keys in array part */ | |
| 350 | totaluse = nasize; /* all those keys are integer keys */ | |
| 351 | totaluse += numusehash(t, nums, &nasize); /* count keys in hash part */ | |
| 352 | /* count extra key */ | |
| 353 | nasize += countint(ek, nums); | |
| 354 | totaluse++; | |
| 355 | /* compute new size for array part */ | |
| 356 | na = computesizes(nums, &nasize); | |
| 357 | /* resize the table to new computed sizes */ | |
| 358 | luaH_resize(L, t, nasize, totaluse - na); | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| r31373 | r31374 | |
| 366 | 366 | |
| 367 | 367 | |
| 368 | 368 | Table *luaH_new (lua_State *L) { |
| 369 | Table *t = &luaC_newobj(L, LUA_TTABLE, sizeof(Table), NULL, 0)->h; | |
| 370 | t->metatable = NULL; | |
| 371 | t->flags = cast_byte(~0); | |
| 372 | t->array = NULL; | |
| 373 | t->sizearray = 0; | |
| 374 | setnodevector(L, t, 0); | |
| 375 | return t; | |
| 369 | Table *t = &luaC_newobj(L, LUA_TTABLE, sizeof(Table), NULL, 0)->h; | |
| 370 | t->metatable = NULL; | |
| 371 | t->flags = cast_byte(~0); | |
| 372 | t->array = NULL; | |
| 373 | t->sizearray = 0; | |
| 374 | setnodevector(L, t, 0); | |
| 375 | return t; | |
| 376 | 376 | } |
| 377 | 377 | |
| 378 | 378 | |
| 379 | 379 | void luaH_free (lua_State *L, Table *t) { |
| 380 | if (!isdummy(t->node)) | |
| 381 | luaM_freearray(L, t->node, cast(size_t, sizenode(t))); | |
| 382 | luaM_freearray(L, t->array, t->sizearray); | |
| 383 | luaM_free(L, t); | |
| 380 | if (!isdummy(t->node)) | |
| 381 | luaM_freearray(L, t->node, cast(size_t, sizenode(t))); | |
| 382 | luaM_freearray(L, t->array, t->sizearray); | |
| 383 | luaM_free(L, t); | |
| 384 | 384 | } |
| 385 | 385 | |
| 386 | 386 | |
| 387 | 387 | static Node *getfreepos (Table *t) { |
| 388 | while (t->lastfree > t->node) { | |
| 389 | t->lastfree--; | |
| 390 | if (ttisnil(gkey(t->lastfree))) | |
| 391 | return t->lastfree; | |
| 392 | } | |
| 393 | return NULL; /* could not find a free place */ | |
| 388 | while (t->lastfree > t->node) { | |
| 389 | t->lastfree--; | |
| 390 | if (ttisnil(gkey(t->lastfree))) | |
| 391 | return t->lastfree; | |
| 392 | } | |
| 393 | return NULL; /* could not find a free place */ | |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | 396 | |
| r31373 | r31374 | |
| 403 | 403 | ** position), new key goes to an empty position. |
| 404 | 404 | */ |
| 405 | 405 | TValue *luaH_newkey (lua_State *L, Table *t, const TValue *key) { |
| 406 | Node *mp; | |
| 407 | if (ttisnil(key)) luaG_runerror(L, "table index is nil"); | |
| 408 | else if (ttisnumber(key) && luai_numisnan(L, nvalue(key))) | |
| 409 | luaG_runerror(L, "table index is NaN"); | |
| 410 | mp = mainposition(t, key); | |
| 411 | if (!ttisnil(gval(mp)) || isdummy(mp)) { /* main position is taken? */ | |
| 412 | Node *othern; | |
| 413 | Node *n = getfreepos(t); /* get a free place */ | |
| 414 | if (n == NULL) { /* cannot find a free place? */ | |
| 415 | rehash(L, t, key); /* grow table */ | |
| 416 | /* whatever called 'newkey' take care of TM cache and GC barrier */ | |
| 417 | return luaH_set(L, t, key); /* insert key into grown table */ | |
| 418 | } | |
| 419 | lua_assert(!isdummy(n)); | |
| 420 | othern = mainposition(t, gkey(mp)); | |
| 421 | if (othern != mp) { /* is colliding node out of its main position? */ | |
| 422 | /* yes; move colliding node into free position */ | |
| 423 | while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ | |
| 424 | gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ | |
| 425 | *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ | |
| 426 | gnext(mp) = NULL; /* now `mp' is free */ | |
| 427 | setnilvalue(gval(mp)); | |
| 428 | } | |
| 429 | else { /* colliding node is in its own main position */ | |
| 430 | /* new node will go into free position */ | |
| 431 | gnext(n) = gnext(mp); /* chain new position */ | |
| 432 | gnext(mp) = n; | |
| 433 | mp = n; | |
| 434 | } | |
| 435 | } | |
| 436 | setobj2t(L, gkey(mp), key); | |
| 437 | luaC_barrierback(L, obj2gco(t), key); | |
| 438 | lua_assert(ttisnil(gval(mp))); | |
| 439 | return gval(mp); | |
| 406 | Node *mp; | |
| 407 | if (ttisnil(key)) luaG_runerror(L, "table index is nil"); | |
| 408 | else if (ttisnumber(key) && luai_numisnan(L, nvalue(key))) | |
| 409 | luaG_runerror(L, "table index is NaN"); | |
| 410 | mp = mainposition(t, key); | |
| 411 | if (!ttisnil(gval(mp)) || isdummy(mp)) { /* main position is taken? */ | |
| 412 | Node *othern; | |
| 413 | Node *n = getfreepos(t); /* get a free place */ | |
| 414 | if (n == NULL) { /* cannot find a free place? */ | |
| 415 | rehash(L, t, key); /* grow table */ | |
| 416 | /* whatever called 'newkey' take care of TM cache and GC barrier */ | |
| 417 | return luaH_set(L, t, key); /* insert key into grown table */ | |
| 418 | } | |
| 419 | lua_assert(!isdummy(n)); | |
| 420 | othern = mainposition(t, gkey(mp)); | |
| 421 | if (othern != mp) { /* is colliding node out of its main position? */ | |
| 422 | /* yes; move colliding node into free position */ | |
| 423 | while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ | |
| 424 | gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ | |
| 425 | *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ | |
| 426 | gnext(mp) = NULL; /* now `mp' is free */ | |
| 427 | setnilvalue(gval(mp)); | |
| 428 | } | |
| 429 | else { /* colliding node is in its own main position */ | |
| 430 | /* new node will go into free position */ | |
| 431 | gnext(n) = gnext(mp); /* chain new position */ | |
| 432 | gnext(mp) = n; | |
| 433 | mp = n; | |
| 434 | } | |
| 435 | } | |
| 436 | setobj2t(L, gkey(mp), key); | |
| 437 | luaC_barrierback(L, obj2gco(t), key); | |
| 438 | lua_assert(ttisnil(gval(mp))); | |
| 439 | return gval(mp); | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| r31373 | r31374 | |
| 444 | 444 | ** search function for integers |
| 445 | 445 | */ |
| 446 | 446 | const TValue *luaH_getint (Table *t, int key) { |
| 447 | /* (1 <= key && key <= t->sizearray) */ | |
| 448 | if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray)) | |
| 449 | return &t->array[key-1]; | |
| 450 | else { | |
| 451 | lua_Number nk = cast_num(key); | |
| 452 | Node *n = hashnum(t, nk); | |
| 453 | do { /* check whether `key' is somewhere in the chain */ | |
| 454 | if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) | |
| 455 | return gval(n); /* that's it */ | |
| 456 | else n = gnext(n); | |
| 457 | } while (n); | |
| 458 | return luaO_nilobject; | |
| 459 | } | |
| 447 | /* (1 <= key && key <= t->sizearray) */ | |
| 448 | if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray)) | |
| 449 | return &t->array[key-1]; | |
| 450 | else { | |
| 451 | lua_Number nk = cast_num(key); | |
| 452 | Node *n = hashnum(t, nk); | |
| 453 | do { /* check whether `key' is somewhere in the chain */ | |
| 454 | if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) | |
| 455 | return gval(n); /* that's it */ | |
| 456 | else n = gnext(n); | |
| 457 | } while (n); | |
| 458 | return luaO_nilobject; | |
| 459 | } | |
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | |
| r31373 | r31374 | |
| 464 | 464 | ** search function for short strings |
| 465 | 465 | */ |
| 466 | 466 | const TValue *luaH_getstr (Table *t, TString *key) { |
| 467 | Node *n = hashstr(t, key); | |
| 468 | lua_assert(key->tsv.tt == LUA_TSHRSTR); | |
| 469 | do { /* check whether `key' is somewhere in the chain */ | |
| 470 | if (ttisshrstring(gkey(n)) && eqshrstr(rawtsvalue(gkey(n)), key)) | |
| 471 | return gval(n); /* that's it */ | |
| 472 | else n = gnext(n); | |
| 473 | } while (n); | |
| 474 | return luaO_nilobject; | |
| 467 | Node *n = hashstr(t, key); | |
| 468 | lua_assert(key->tsv.tt == LUA_TSHRSTR); | |
| 469 | do { /* check whether `key' is somewhere in the chain */ | |
| 470 | if (ttisshrstring(gkey(n)) && eqshrstr(rawtsvalue(gkey(n)), key)) | |
| 471 | return gval(n); /* that's it */ | |
| 472 | else n = gnext(n); | |
| 473 | } while (n); | |
| 474 | return luaO_nilobject; | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | |
| r31373 | r31374 | |
| 479 | 479 | ** main search function |
| 480 | 480 | */ |
| 481 | 481 | const TValue *luaH_get (Table *t, const TValue *key) { |
| 482 | switch (ttype(key)) { | |
| 483 | case LUA_TSHRSTR: return luaH_getstr(t, rawtsvalue(key)); | |
| 484 | case LUA_TNIL: return luaO_nilobject; | |
| 485 | case LUA_TNUMBER: { | |
| 486 | int k; | |
| 487 | lua_Number n = nvalue(key); | |
| 488 | lua_number2int(k, n); | |
| 489 | if (luai_numeq(cast_num(k), n)) /* index is int? */ | |
| 490 | return luaH_getint(t, k); /* use specialized version */ | |
| 491 | /* else go through */ | |
| 492 | } | |
| 493 | default: { | |
| 494 | Node *n = mainposition(t, key); | |
| 495 | do { /* check whether `key' is somewhere in the chain */ | |
| 496 | if (luaV_rawequalobj(gkey(n), key)) | |
| 497 | return gval(n); /* that's it */ | |
| 498 | else n = gnext(n); | |
| 499 | } while (n); | |
| 500 | return luaO_nilobject; | |
| 501 | } | |
| 502 | } | |
| 482 | switch (ttype(key)) { | |
| 483 | case LUA_TSHRSTR: return luaH_getstr(t, rawtsvalue(key)); | |
| 484 | case LUA_TNIL: return luaO_nilobject; | |
| 485 | case LUA_TNUMBER: { | |
| 486 | int k; | |
| 487 | lua_Number n = nvalue(key); | |
| 488 | lua_number2int(k, n); | |
| 489 | if (luai_numeq(cast_num(k), n)) /* index is int? */ | |
| 490 | return luaH_getint(t, k); /* use specialized version */ | |
| 491 | /* else go through */ | |
| 492 | } | |
| 493 | default: { | |
| 494 | Node *n = mainposition(t, key); | |
| 495 | do { /* check whether `key' is somewhere in the chain */ | |
| 496 | if (luaV_rawequalobj(gkey(n), key)) | |
| 497 | return gval(n); /* that's it */ | |
| 498 | else n = gnext(n); | |
| 499 | } while (n); | |
| 500 | return luaO_nilobject; | |
| 501 | } | |
| 502 | } | |
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | |
| r31373 | r31374 | |
| 508 | 508 | ** barrier and invalidate the TM cache. |
| 509 | 509 | */ |
| 510 | 510 | TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { |
| 511 | const TValue *p = luaH_get(t, key); | |
| 512 | if (p != luaO_nilobject) | |
| 513 | return cast(TValue *, p); | |
| 514 | else return luaH_newkey(L, t, key); | |
| 511 | const TValue *p = luaH_get(t, key); | |
| 512 | if (p != luaO_nilobject) | |
| 513 | return cast(TValue *, p); | |
| 514 | else return luaH_newkey(L, t, key); | |
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | |
| 518 | 518 | void luaH_setint (lua_State *L, Table *t, int key, TValue *value) { |
| 519 | const TValue *p = luaH_getint(t, key); | |
| 520 | TValue *cell; | |
| 521 | if (p != luaO_nilobject) | |
| 522 | cell = cast(TValue *, p); | |
| 523 | else { | |
| 524 | TValue k; | |
| 525 | setnvalue(&k, cast_num(key)); | |
| 526 | cell = luaH_newkey(L, t, &k); | |
| 527 | } | |
| 528 | setobj2t(L, cell, value); | |
| 519 | const TValue *p = luaH_getint(t, key); | |
| 520 | TValue *cell; | |
| 521 | if (p != luaO_nilobject) | |
| 522 | cell = cast(TValue *, p); | |
| 523 | else { | |
| 524 | TValue k; | |
| 525 | setnvalue(&k, cast_num(key)); | |
| 526 | cell = luaH_newkey(L, t, &k); | |
| 527 | } | |
| 528 | setobj2t(L, cell, value); | |
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | |
| 532 | 532 | static int unbound_search (Table *t, unsigned int j) { |
| 533 | unsigned int i = j; /* i is zero or a present index */ | |
| 534 | j++; | |
| 535 | /* find `i' and `j' such that i is present and j is not */ | |
| 536 | while (!ttisnil(luaH_getint(t, j))) { | |
| 537 | i = j; | |
| 538 | j *= 2; | |
| 539 | if (j > cast(unsigned int, MAX_INT)) { /* overflow? */ | |
| 540 | /* table was built with bad purposes: resort to linear search */ | |
| 541 | i = 1; | |
| 542 | while (!ttisnil(luaH_getint(t, i))) i++; | |
| 543 | return i - 1; | |
| 544 | } | |
| 545 | } | |
| 546 | /* now do a binary search between them */ | |
| 547 | while (j - i > 1) { | |
| 548 | unsigned int m = (i+j)/2; | |
| 549 | if (ttisnil(luaH_getint(t, m))) j = m; | |
| 550 | else i = m; | |
| 551 | } | |
| 552 | return i; | |
| 533 | unsigned int i = j; /* i is zero or a present index */ | |
| 534 | j++; | |
| 535 | /* find `i' and `j' such that i is present and j is not */ | |
| 536 | while (!ttisnil(luaH_getint(t, j))) { | |
| 537 | i = j; | |
| 538 | j *= 2; | |
| 539 | if (j > cast(unsigned int, MAX_INT)) { /* overflow? */ | |
| 540 | /* table was built with bad purposes: resort to linear search */ | |
| 541 | i = 1; | |
| 542 | while (!ttisnil(luaH_getint(t, i))) i++; | |
| 543 | return i - 1; | |
| 544 | } | |
| 545 | } | |
| 546 | /* now do a binary search between them */ | |
| 547 | while (j - i > 1) { | |
| 548 | unsigned int m = (i+j)/2; | |
| 549 | if (ttisnil(luaH_getint(t, m))) j = m; | |
| 550 | else i = m; | |
| 551 | } | |
| 552 | return i; | |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | |
| r31373 | r31374 | |
| 558 | 558 | ** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). |
| 559 | 559 | */ |
| 560 | 560 | int luaH_getn (Table *t) { |
| 561 | unsigned int j = t->sizearray; | |
| 562 | if (j > 0 && ttisnil(&t->array[j - 1])) { | |
| 563 | /* there is a boundary in the array part: (binary) search for it */ | |
| 564 | unsigned int i = 0; | |
| 565 | while (j - i > 1) { | |
| 566 | unsigned int m = (i+j)/2; | |
| 567 | if (ttisnil(&t->array[m - 1])) j = m; | |
| 568 | else i = m; | |
| 569 | } | |
| 570 | return i; | |
| 571 | } | |
| 572 | /* else must find a boundary in hash part */ | |
| 573 | else if (isdummy(t->node)) /* hash part is empty? */ | |
| 574 | return j; /* that is easy... */ | |
| 575 | else return unbound_search(t, j); | |
| 561 | unsigned int j = t->sizearray; | |
| 562 | if (j > 0 && ttisnil(&t->array[j - 1])) { | |
| 563 | /* there is a boundary in the array part: (binary) search for it */ | |
| 564 | unsigned int i = 0; | |
| 565 | while (j - i > 1) { | |
| 566 | unsigned int m = (i+j)/2; | |
| 567 | if (ttisnil(&t->array[m - 1])) j = m; | |
| 568 | else i = m; | |
| 569 | } | |
| 570 | return i; | |
| 571 | } | |
| 572 | /* else must find a boundary in hash part */ | |
| 573 | else if (isdummy(t->node)) /* hash part is empty? */ | |
| 574 | return j; /* that is easy... */ | |
| 575 | else return unbound_search(t, j); | |
| 576 | 576 | } |
| 577 | 577 | |
| 578 | 578 | |
| r31373 | r31374 | |
| 580 | 580 | #if defined(LUA_DEBUG) |
| 581 | 581 | |
| 582 | 582 | Node *luaH_mainposition (const Table *t, const TValue *key) { |
| 583 | ||
| 583 | return mainposition(t, key); | |
| 584 | 584 | } |
| 585 | 585 | |
| 586 | 586 | int luaH_isdummy (Node *n) { return isdummy(n); } |
| r31373 | r31374 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | #define currIsNewline(ls) | |
| 32 | #define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | 35 | /* ORDER RESERVED */ |
| 36 | 36 | static const char *const luaX_tokens [] = { |
| 37 | "and", "break", "do", "else", "elseif", | |
| 38 | "end", "false", "for", "function", "goto", "if", | |
| 39 | "in", "local", "nil", "not", "or", "repeat", | |
| 40 | "return", "then", "true", "until", "while", | |
| 41 | "..", "...", "==", ">=", "<=", "~=", "::", "<eof>", | |
| 42 | "<number>", "<name>", "<string>" | |
| 37 | "and", "break", "do", "else", "elseif", | |
| 38 | "end", "false", "for", "function", "goto", "if", | |
| 39 | "in", "local", "nil", "not", "or", "repeat", | |
| 40 | "return", "then", "true", "until", "while", | |
| 41 | "..", "...", "==", ">=", "<=", "~=", "::", "<eof>", | |
| 42 | "<number>", "<name>", "<string>" | |
| 43 | 43 | }; |
| 44 | 44 | |
| 45 | 45 | |
| r31373 | r31374 | |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | static void save (LexState *ls, int c) { |
| 53 | Mbuffer *b = ls->buff; | |
| 54 | if (luaZ_bufflen(b) + 1 > luaZ_sizebuffer(b)) { | |
| 55 | size_t newsize; | |
| 56 | if (luaZ_sizebuffer(b) >= MAX_SIZET/2) | |
| 57 | lexerror(ls, "lexical element too long", 0); | |
| 58 | newsize = luaZ_sizebuffer(b) * 2; | |
| 59 | luaZ_resizebuffer(ls->L, b, newsize); | |
| 60 | } | |
| 61 | b->buffer[luaZ_bufflen(b)++] = cast(char, c); | |
| 53 | Mbuffer *b = ls->buff; | |
| 54 | if (luaZ_bufflen(b) + 1 > luaZ_sizebuffer(b)) { | |
| 55 | size_t newsize; | |
| 56 | if (luaZ_sizebuffer(b) >= MAX_SIZET/2) | |
| 57 | lexerror(ls, "lexical element too long", 0); | |
| 58 | newsize = luaZ_sizebuffer(b) * 2; | |
| 59 | luaZ_resizebuffer(ls->L, b, newsize); | |
| 60 | } | |
| 61 | b->buffer[luaZ_bufflen(b)++] = cast(char, c); | |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | |
| 65 | 65 | void luaX_init (lua_State *L) { |
| 66 | int i; | |
| 67 | for (i=0; i<NUM_RESERVED; i++) { | |
| 68 | TString *ts = luaS_new(L, luaX_tokens[i]); | |
| 69 | luaS_fix(ts); /* reserved words are never collected */ | |
| 70 | ts->tsv.extra = cast_byte(i+1); /* reserved word */ | |
| 71 | } | |
| 66 | int i; | |
| 67 | for (i=0; i<NUM_RESERVED; i++) { | |
| 68 | TString *ts = luaS_new(L, luaX_tokens[i]); | |
| 69 | luaS_fix(ts); /* reserved words are never collected */ | |
| 70 | ts->tsv.extra = cast_byte(i+1); /* reserved word */ | |
| 71 | } | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | const char *luaX_token2str (LexState *ls, int token) { |
| 76 | if (token < FIRST_RESERVED) { /* single-byte symbols? */ | |
| 77 | lua_assert(token == cast(unsigned char, token)); | |
| 78 | return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) : | |
| 79 | luaO_pushfstring(ls->L, "char(%d)", token); | |
| 80 | } | |
| 81 | else { | |
| 82 | const char *s = luaX_tokens[token - FIRST_RESERVED]; | |
| 83 | if (token < TK_EOS) /* fixed format (symbols and reserved words)? */ | |
| 84 | return luaO_pushfstring(ls->L, LUA_QS, s); | |
| 85 | else /* names, strings, and numerals */ | |
| 86 | return s; | |
| 87 | } | |
| 76 | if (token < FIRST_RESERVED) { /* single-byte symbols? */ | |
| 77 | lua_assert(token == cast(unsigned char, token)); | |
| 78 | return (lisprint(token)) ? luaO_pushfstring(ls->L, LUA_QL("%c"), token) : | |
| 79 | luaO_pushfstring(ls->L, "char(%d)", token); | |
| 80 | } | |
| 81 | else { | |
| 82 | const char *s = luaX_tokens[token - FIRST_RESERVED]; | |
| 83 | if (token < TK_EOS) /* fixed format (symbols and reserved words)? */ | |
| 84 | return luaO_pushfstring(ls->L, LUA_QS, s); | |
| 85 | else /* names, strings, and numerals */ | |
| 86 | return s; | |
| 87 | } | |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | static const char *txtToken (LexState *ls, int token) { |
| 92 | switch (token) { | |
| 93 | case TK_NAME: | |
| 94 | case TK_STRING: | |
| 95 | case TK_NUMBER: | |
| 96 | save(ls, '\0'); | |
| 97 | return luaO_pushfstring(ls->L, LUA_QS, luaZ_buffer(ls->buff)); | |
| 98 | default: | |
| 99 | return luaX_token2str(ls, token); | |
| 100 | } | |
| 92 | switch (token) { | |
| 93 | case TK_NAME: | |
| 94 | case TK_STRING: | |
| 95 | case TK_NUMBER: | |
| 96 | save(ls, '\0'); | |
| 97 | return luaO_pushfstring(ls->L, LUA_QS, luaZ_buffer(ls->buff)); | |
| 98 | default: | |
| 99 | return luaX_token2str(ls, token); | |
| 100 | } | |
| 101 | 101 | } |
| 102 | 102 | |
| 103 | 103 | |
| 104 | 104 | static l_noret lexerror (LexState *ls, const char *msg, int token) { |
| 105 | char buff[LUA_IDSIZE]; | |
| 106 | luaO_chunkid(buff, getstr(ls->source), LUA_IDSIZE); | |
| 107 | msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); | |
| 108 | if (token) | |
| 109 | luaO_pushfstring(ls->L, "%s near %s", msg, txtToken(ls, token)); | |
| 110 | luaD_throw(ls->L, LUA_ERRSYNTAX); | |
| 105 | char buff[LUA_IDSIZE]; | |
| 106 | luaO_chunkid(buff, getstr(ls->source), LUA_IDSIZE); | |
| 107 | msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); | |
| 108 | if (token) | |
| 109 | luaO_pushfstring(ls->L, "%s near %s", msg, txtToken(ls, token)); | |
| 110 | luaD_throw(ls->L, LUA_ERRSYNTAX); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| 114 | 114 | l_noret luaX_syntaxerror (LexState *ls, const char *msg) { |
| 115 | ||
| 115 | lexerror(ls, msg, ls->t.token); | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | |
| r31373 | r31374 | |
| 122 | 122 | ** (by that time it should be anchored in function's prototype) |
| 123 | 123 | */ |
| 124 | 124 | TString *luaX_newstring (LexState *ls, const char *str, size_t l) { |
| 125 | lua_State *L = ls->L; | |
| 126 | TValue *o; /* entry for `str' */ | |
| 127 | TString *ts = luaS_newlstr(L, str, l); /* create new string */ | |
| 128 | setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */ | |
| 129 | o = luaH_set(L, ls->fs->h, L->top - 1); | |
| 130 | if (ttisnil(o)) { /* not in use yet? (see 'addK') */ | |
| 131 | /* boolean value does not need GC barrier; | |
| 132 | table has no metatable, so it does not need to invalidate cache */ | |
| 133 | setbvalue(o, 1); /* t[string] = true */ | |
| 134 | luaC_checkGC(L); | |
| 135 | } | |
| 136 | else { /* string already present */ | |
| 137 | ts = rawtsvalue(keyfromval(o)); /* re-use value previously stored */ | |
| 138 | } | |
| 139 | L->top--; /* remove string from stack */ | |
| 140 | return ts; | |
| 125 | lua_State *L = ls->L; | |
| 126 | TValue *o; /* entry for `str' */ | |
| 127 | TString *ts = luaS_newlstr(L, str, l); /* create new string */ | |
| 128 | setsvalue2s(L, L->top++, ts); /* temporarily anchor it in stack */ | |
| 129 | o = luaH_set(L, ls->fs->h, L->top - 1); | |
| 130 | if (ttisnil(o)) { /* not in use yet? (see 'addK') */ | |
| 131 | /* boolean value does not need GC barrier; | |
| 132 | table has no metatable, so it does not need to invalidate cache */ | |
| 133 | setbvalue(o, 1); /* t[string] = true */ | |
| 134 | luaC_checkGC(L); | |
| 135 | } | |
| 136 | else { /* string already present */ | |
| 137 | ts = rawtsvalue(keyfromval(o)); /* re-use value previously stored */ | |
| 138 | } | |
| 139 | L->top--; /* remove string from stack */ | |
| 140 | return ts; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| r31373 | r31374 | |
| 146 | 146 | ** \n, \r, \n\r, or \r\n) |
| 147 | 147 | */ |
| 148 | 148 | static void inclinenumber (LexState *ls) { |
| 149 | int old = ls->current; | |
| 150 | lua_assert(currIsNewline(ls)); | |
| 151 | next(ls); /* skip `\n' or `\r' */ | |
| 152 | if (currIsNewline(ls) && ls->current != old) | |
| 153 | next(ls); /* skip `\n\r' or `\r\n' */ | |
| 154 | if (++ls->linenumber >= MAX_INT) | |
| 155 | luaX_syntaxerror(ls, "chunk has too many lines"); | |
| 149 | int old = ls->current; | |
| 150 | lua_assert(currIsNewline(ls)); | |
| 151 | next(ls); /* skip `\n' or `\r' */ | |
| 152 | if (currIsNewline(ls) && ls->current != old) | |
| 153 | next(ls); /* skip `\n\r' or `\r\n' */ | |
| 154 | if (++ls->linenumber >= MAX_INT) | |
| 155 | luaX_syntaxerror(ls, "chunk has too many lines"); | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | |
| 159 | 159 | void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source, |
| 160 | int firstchar) { | |
| 161 | ls->decpoint = '.'; | |
| 162 | ls->L = L; | |
| 163 | ls->current = firstchar; | |
| 164 | ls->lookahead.token = TK_EOS; /* no look-ahead token */ | |
| 165 | ls->z = z; | |
| 166 | ls->fs = NULL; | |
| 167 | ls->linenumber = 1; | |
| 168 | ls->lastline = 1; | |
| 169 | ls->source = source; | |
| 170 | ls->envn = luaS_new(L, LUA_ENV); /* create env name */ | |
| 171 | luaS_fix(ls->envn); /* never collect this name */ | |
| 172 | luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ | |
| 160 | int firstchar) { | |
| 161 | ls->decpoint = '.'; | |
| 162 | ls->L = L; | |
| 163 | ls->current = firstchar; | |
| 164 | ls->lookahead.token = TK_EOS; /* no look-ahead token */ | |
| 165 | ls->z = z; | |
| 166 | ls->fs = NULL; | |
| 167 | ls->linenumber = 1; | |
| 168 | ls->lastline = 1; | |
| 169 | ls->source = source; | |
| 170 | ls->envn = luaS_new(L, LUA_ENV); /* create env name */ | |
| 171 | luaS_fix(ls->envn); /* never collect this name */ | |
| 172 | luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ | |
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | |
| r31373 | r31374 | |
| 183 | 183 | |
| 184 | 184 | |
| 185 | 185 | static int check_next (LexState *ls, const char *set) { |
| 186 | if (ls->current == '\0' || !strchr(set, ls->current)) | |
| 187 | return 0; | |
| 188 | save_and_next(ls); | |
| 189 | return 1; | |
| 186 | if (ls->current == '\0' || !strchr(set, ls->current)) | |
| 187 | return 0; | |
| 188 | save_and_next(ls); | |
| 189 | return 1; | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| r31373 | r31374 | |
| 194 | 194 | ** change all characters 'from' in buffer to 'to' |
| 195 | 195 | */ |
| 196 | 196 | static void buffreplace (LexState *ls, char from, char to) { |
| 197 | size_t n = luaZ_bufflen(ls->buff); | |
| 198 | char *p = luaZ_buffer(ls->buff); | |
| 199 | while (n--) | |
| 200 | if (p[n] == from) p[n] = to; | |
| 197 | size_t n = luaZ_bufflen(ls->buff); | |
| 198 | char *p = luaZ_buffer(ls->buff); | |
| 199 | while (n--) | |
| 200 | if (p[n] == from) p[n] = to; | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | |
| 204 | 204 | #if !defined(getlocaledecpoint) |
| 205 | #define getlocaledecpoint() | |
| 205 | #define getlocaledecpoint() (localeconv()->decimal_point[0]) | |
| 206 | 206 | #endif |
| 207 | 207 | |
| 208 | 208 | |
| 209 | #define buff2d(b,e) | |
| 209 | #define buff2d(b,e) luaO_str2d(luaZ_buffer(b), luaZ_bufflen(b) - 1, e) | |
| 210 | 210 | |
| 211 | 211 | /* |
| 212 | 212 | ** in case of format error, try to change decimal point separator to |
| 213 | 213 | ** the one defined in the current locale and check again |
| 214 | 214 | */ |
| 215 | 215 | static void trydecpoint (LexState *ls, SemInfo *seminfo) { |
| 216 | char old = ls->decpoint; | |
| 217 | ls->decpoint = getlocaledecpoint(); | |
| 218 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ | |
| 219 | if (!buff2d(ls->buff, &seminfo->r)) { | |
| 220 | /* format error with correct decimal point: no more options */ | |
| 221 | buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ | |
| 222 | lexerror(ls, "malformed number", TK_NUMBER); | |
| 223 | } | |
| 216 | char old = ls->decpoint; | |
| 217 | ls->decpoint = getlocaledecpoint(); | |
| 218 | buffreplace(ls, old, ls->decpoint); /* try new decimal separator */ | |
| 219 | if (!buff2d(ls->buff, &seminfo->r)) { | |
| 220 | /* format error with correct decimal point: no more options */ | |
| 221 | buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ | |
| 222 | lexerror(ls, "malformed number", TK_NUMBER); | |
| 223 | } | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| r31373 | r31374 | |
| 230 | 230 | ** will reject ill-formed numerals. |
| 231 | 231 | */ |
| 232 | 232 | static void read_numeral (LexState *ls, SemInfo *seminfo) { |
| 233 | const char *expo = "Ee"; | |
| 234 | int first = ls->current; | |
| 235 | lua_assert(lisdigit(ls->current)); | |
| 236 | save_and_next(ls); | |
| 237 | if (first == '0' && check_next(ls, "Xx")) /* hexadecimal? */ | |
| 238 | expo = "Pp"; | |
| 239 | for (;;) { | |
| 240 | if (check_next(ls, expo)) /* exponent part? */ | |
| 241 | check_next(ls, "+-"); /* optional exponent sign */ | |
| 242 | if (lisxdigit(ls->current) || ls->current == '.') | |
| 243 | save_and_next(ls); | |
| 244 | else break; | |
| 245 | } | |
| 246 | save(ls, '\0'); | |
| 247 | buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ | |
| 248 | if (!buff2d(ls->buff, &seminfo->r)) /* format error? */ | |
| 249 | trydecpoint(ls, seminfo); /* try to update decimal point separator */ | |
| 233 | const char *expo = "Ee"; | |
| 234 | int first = ls->current; | |
| 235 | lua_assert(lisdigit(ls->current)); | |
| 236 | save_and_next(ls); | |
| 237 | if (first == '0' && check_next(ls, "Xx")) /* hexadecimal? */ | |
| 238 | expo = "Pp"; | |
| 239 | for (;;) { | |
| 240 | if (check_next(ls, expo)) /* exponent part? */ | |
| 241 | check_next(ls, "+-"); /* optional exponent sign */ | |
| 242 | if (lisxdigit(ls->current) || ls->current == '.') | |
| 243 | save_and_next(ls); | |
| 244 | else break; | |
| 245 | } | |
| 246 | save(ls, '\0'); | |
| 247 | buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ | |
| 248 | if (!buff2d(ls->buff, &seminfo->r)) /* format error? */ | |
| 249 | trydecpoint(ls, seminfo); /* try to update decimal point separator */ | |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | 252 | |
| r31373 | r31374 | |
| 255 | 255 | ** -1 if sequence is malformed |
| 256 | 256 | */ |
| 257 | 257 | static int skip_sep (LexState *ls) { |
| 258 | int count = 0; | |
| 259 | int s = ls->current; | |
| 260 | lua_assert(s == '[' || s == ']'); | |
| 261 | save_and_next(ls); | |
| 262 | while (ls->current == '=') { | |
| 263 | save_and_next(ls); | |
| 264 | count++; | |
| 265 | } | |
| 266 | return (ls->current == s) ? count : (-count) - 1; | |
| 258 | int count = 0; | |
| 259 | int s = ls->current; | |
| 260 | lua_assert(s == '[' || s == ']'); | |
| 261 | save_and_next(ls); | |
| 262 | while (ls->current == '=') { | |
| 263 | save_and_next(ls); | |
| 264 | count++; | |
| 265 | } | |
| 266 | return (ls->current == s) ? count : (-count) - 1; | |
| 267 | 267 | } |
| 268 | 268 | |
| 269 | 269 | |
| 270 | 270 | static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { |
| 271 | save_and_next(ls); /* skip 2nd `[' */ | |
| 272 | if (currIsNewline(ls)) /* string starts with a newline? */ | |
| 273 | inclinenumber(ls); /* skip it */ | |
| 274 | for (;;) { | |
| 275 | switch (ls->current) { | |
| 276 | case EOZ: | |
| 277 | lexerror(ls, (seminfo) ? "unfinished long string" : | |
| 278 | "unfinished long comment", TK_EOS); | |
| 279 | break; /* to avoid warnings */ | |
| 280 | case ']': { | |
| 281 | if (skip_sep(ls) == sep) { | |
| 282 | save_and_next(ls); /* skip 2nd `]' */ | |
| 283 | goto endloop; | |
| 284 | } | |
| 285 | break; | |
| 286 | } | |
| 287 | case '\n': case '\r': { | |
| 288 | save(ls, '\n'); | |
| 289 | inclinenumber(ls); | |
| 290 | if (!seminfo) luaZ_resetbuffer(ls->buff); /* avoid wasting space */ | |
| 291 | break; | |
| 292 | } | |
| 293 | default: { | |
| 294 | if (seminfo) save_and_next(ls); | |
| 295 | else next(ls); | |
| 296 | } | |
| 297 | } | |
| 298 | } endloop: | |
| 299 | if (seminfo) | |
| 300 | seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), | |
| 301 | luaZ_bufflen(ls->buff) - 2*(2 + sep)); | |
| 271 | save_and_next(ls); /* skip 2nd `[' */ | |
| 272 | if (currIsNewline(ls)) /* string starts with a newline? */ | |
| 273 | inclinenumber(ls); /* skip it */ | |
| 274 | for (;;) { | |
| 275 | switch (ls->current) { | |
| 276 | case EOZ: | |
| 277 | lexerror(ls, (seminfo) ? "unfinished long string" : | |
| 278 | "unfinished long comment", TK_EOS); | |
| 279 | break; /* to avoid warnings */ | |
| 280 | case ']': { | |
| 281 | if (skip_sep(ls) == sep) { | |
| 282 | save_and_next(ls); /* skip 2nd `]' */ | |
| 283 | goto endloop; | |
| 284 | } | |
| 285 | break; | |
| 286 | } | |
| 287 | case '\n': case '\r': { | |
| 288 | save(ls, '\n'); | |
| 289 | inclinenumber(ls); | |
| 290 | if (!seminfo) luaZ_resetbuffer(ls->buff); /* avoid wasting space */ | |
| 291 | break; | |
| 292 | } | |
| 293 | default: { | |
| 294 | if (seminfo) save_and_next(ls); | |
| 295 | else next(ls); | |
| 296 | } | |
| 297 | } | |
| 298 | } endloop: | |
| 299 | if (seminfo) | |
| 300 | seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), | |
| 301 | luaZ_bufflen(ls->buff) - 2*(2 + sep)); | |
| 302 | 302 | } |
| 303 | 303 | |
| 304 | 304 | |
| 305 | 305 | static void escerror (LexState *ls, int *c, int n, const char *msg) { |
| 306 | int i; | |
| 307 | luaZ_resetbuffer(ls->buff); /* prepare error message */ | |
| 308 | save(ls, '\\'); | |
| 309 | for (i = 0; i < n && c[i] != EOZ; i++) | |
| 310 | save(ls, c[i]); | |
| 311 | lexerror(ls, msg, TK_STRING); | |
| 306 | int i; | |
| 307 | luaZ_resetbuffer(ls->buff); /* prepare error message */ | |
| 308 | save(ls, '\\'); | |
| 309 | for (i = 0; i < n && c[i] != EOZ; i++) | |
| 310 | save(ls, c[i]); | |
| 311 | lexerror(ls, msg, TK_STRING); | |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | 314 | |
| 315 | 315 | static int readhexaesc (LexState *ls) { |
| 316 | int c[3], i; /* keep input for error message */ | |
| 317 | int r = 0; /* result accumulator */ | |
| 318 | c[0] = 'x'; /* for error message */ | |
| 319 | for (i = 1; i < 3; i++) { /* read two hexadecimal digits */ | |
| 320 | c[i] = next(ls); | |
| 321 | if (!lisxdigit(c[i])) | |
| 322 | escerror(ls, c, i + 1, "hexadecimal digit expected"); | |
| 323 | r = (r << 4) + luaO_hexavalue(c[i]); | |
| 324 | } | |
| 325 | return r; | |
| 316 | int c[3], i; /* keep input for error message */ | |
| 317 | int r = 0; /* result accumulator */ | |
| 318 | c[0] = 'x'; /* for error message */ | |
| 319 | for (i = 1; i < 3; i++) { /* read two hexadecimal digits */ | |
| 320 | c[i] = next(ls); | |
| 321 | if (!lisxdigit(c[i])) | |
| 322 | escerror(ls, c, i + 1, "hexadecimal digit expected"); | |
| 323 | r = (r << 4) + luaO_hexavalue(c[i]); | |
| 324 | } | |
| 325 | return r; | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | |
| 329 | 329 | static int readdecesc (LexState *ls) { |
| 330 | int c[3], i; | |
| 331 | int r = 0; /* result accumulator */ | |
| 332 | for (i = 0; i < 3 && lisdigit(ls->current); i++) { /* read up to 3 digits */ | |
| 333 | c[i] = ls->current; | |
| 334 | r = 10*r + c[i] - '0'; | |
| 335 | next(ls); | |
| 336 | } | |
| 337 | if (r > UCHAR_MAX) | |
| 338 | escerror(ls, c, i, "decimal escape too large"); | |
| 339 | return r; | |
| 330 | int c[3], i; | |
| 331 | int r = 0; /* result accumulator */ | |
| 332 | for (i = 0; i < 3 && lisdigit(ls->current); i++) { /* read up to 3 digits */ | |
| 333 | c[i] = ls->current; | |
| 334 | r = 10*r + c[i] - '0'; | |
| 335 | next(ls); | |
| 336 | } | |
| 337 | if (r > UCHAR_MAX) | |
| 338 | escerror(ls, c, i, "decimal escape too large"); | |
| 339 | return r; | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | static void read_string (LexState *ls, int del, SemInfo *seminfo) { |
| 344 | save_and_next(ls); /* keep delimiter (for error messages) */ | |
| 345 | while (ls->current != del) { | |
| 346 | switch (ls->current) { | |
| 347 | case EOZ: | |
| 348 | lexerror(ls, "unfinished string", TK_EOS); | |
| 349 | break; /* to avoid warnings */ | |
| 350 | case '\n': | |
| 351 | case '\r': | |
| 352 | lexerror(ls, "unfinished string", TK_STRING); | |
| 353 | break; /* to avoid warnings */ | |
| 354 | case '\\': { /* escape sequences */ | |
| 355 | int c; /* final character to be saved */ | |
| 356 | next(ls); /* do not save the `\' */ | |
| 357 | switch (ls->current) { | |
| 358 | case 'a': c = '\a'; goto read_save; | |
| 359 | case 'b': c = '\b'; goto read_save; | |
| 360 | case 'f': c = '\f'; goto read_save; | |
| 361 | case 'n': c = '\n'; goto read_save; | |
| 362 | case 'r': c = '\r'; goto read_save; | |
| 363 | case 't': c = '\t'; goto read_save; | |
| 364 | case 'v': c = '\v'; goto read_save; | |
| 365 | case 'x': c = readhexaesc(ls); goto read_save; | |
| 366 | case '\n': case '\r': | |
| 367 | inclinenumber(ls); c = '\n'; goto only_save; | |
| 368 | case '\\': case '\"': case '\'': | |
| 369 | c = ls->current; goto read_save; | |
| 370 | case EOZ: goto no_save; /* will raise an error next loop */ | |
| 371 | case 'z': { /* zap following span of spaces */ | |
| 372 | next(ls); /* skip the 'z' */ | |
| 373 | while (lisspace(ls->current)) { | |
| 374 | if (currIsNewline(ls)) inclinenumber(ls); | |
| 375 | else next(ls); | |
| 376 | } | |
| 377 | goto no_save; | |
| 378 | } | |
| 379 | default: { | |
| 380 | if (!lisdigit(ls->current)) | |
| 381 | escerror(ls, &ls->current, 1, "invalid escape sequence"); | |
| 382 | /* digital escape \ddd */ | |
| 383 | c = readdecesc(ls); | |
| 384 | goto only_save; | |
| 385 | } | |
| 386 | } | |
| 387 | read_save: next(ls); /* read next character */ | |
| 388 | only_save: save(ls, c); /* save 'c' */ | |
| 389 | no_save: break; | |
| 390 | } | |
| 391 | default: | |
| 392 | save_and_next(ls); | |
| 393 | } | |
| 394 | } | |
| 395 | save_and_next(ls); /* skip delimiter */ | |
| 396 | seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1, | |
| 397 | luaZ_bufflen(ls->buff) - 2); | |
| 344 | save_and_next(ls); /* keep delimiter (for error messages) */ | |
| 345 | while (ls->current != del) { | |
| 346 | switch (ls->current) { | |
| 347 | case EOZ: | |
| 348 | lexerror(ls, "unfinished string", TK_EOS); | |
| 349 | break; /* to avoid warnings */ | |
| 350 | case '\n': | |
| 351 | case '\r': | |
| 352 | lexerror(ls, "unfinished string", TK_STRING); | |
| 353 | break; /* to avoid warnings */ | |
| 354 | case '\\': { /* escape sequences */ | |
| 355 | int c; /* final character to be saved */ | |
| 356 | next(ls); /* do not save the `\' */ | |
| 357 | switch (ls->current) { | |
| 358 | case 'a': c = '\a'; goto read_save; | |
| 359 | case 'b': c = '\b'; goto read_save; | |
| 360 | case 'f': c = '\f'; goto read_save; | |
| 361 | case 'n': c = '\n'; goto read_save; | |
| 362 | case 'r': c = '\r'; goto read_save; | |
| 363 | case 't': c = '\t'; goto read_save; | |
| 364 | case 'v': c = '\v'; goto read_save; | |
| 365 | case 'x': c = readhexaesc(ls); goto read_save; | |
| 366 | case '\n': case '\r': | |
| 367 | inclinenumber(ls); c = '\n'; goto only_save; | |
| 368 | case '\\': case '\"': case '\'': | |
| 369 | c = ls->current; goto read_save; | |
| 370 | case EOZ: goto no_save; /* will raise an error next loop */ | |
| 371 | case 'z': { /* zap following span of spaces */ | |
| 372 | next(ls); /* skip the 'z' */ | |
| 373 | while (lisspace(ls->current)) { | |
| 374 | if (currIsNewline(ls)) inclinenumber(ls); | |
| 375 | else next(ls); | |
| 376 | } | |
| 377 | goto no_save; | |
| 378 | } | |
| 379 | default: { | |
| 380 | if (!lisdigit(ls->current)) | |
| 381 | escerror(ls, &ls->current, 1, "invalid escape sequence"); | |
| 382 | /* digital escape \ddd */ | |
| 383 | c = readdecesc(ls); | |
| 384 | goto only_save; | |
| 385 | } | |
| 386 | } | |
| 387 | read_save: next(ls); /* read next character */ | |
| 388 | only_save: save(ls, c); /* save 'c' */ | |
| 389 | no_save: break; | |
| 390 | } | |
| 391 | default: | |
| 392 | save_and_next(ls); | |
| 393 | } | |
| 394 | } | |
| 395 | save_and_next(ls); /* skip delimiter */ | |
| 396 | seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1, | |
| 397 | luaZ_bufflen(ls->buff) - 2); | |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | |
| 401 | 401 | static int llex (LexState *ls, SemInfo *seminfo) { |
| 402 | luaZ_resetbuffer(ls->buff); | |
| 403 | for (;;) { | |
| 404 | switch (ls->current) { | |
| 405 | case '\n': case '\r': { /* line breaks */ | |
| 406 | inclinenumber(ls); | |
| 407 | break; | |
| 408 | } | |
| 409 | case ' ': case '\f': case '\t': case '\v': { /* spaces */ | |
| 410 | next(ls); | |
| 411 | break; | |
| 412 | } | |
| 413 | case '-': { /* '-' or '--' (comment) */ | |
| 414 | next(ls); | |
| 415 | if (ls->current != '-') return '-'; | |
| 416 | /* else is a comment */ | |
| 417 | next(ls); | |
| 418 | if (ls->current == '[') { /* long comment? */ | |
| 419 | int sep = skip_sep(ls); | |
| 420 | luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */ | |
| 421 | if (sep >= 0) { | |
| 422 | read_long_string(ls, NULL, sep); /* skip long comment */ | |
| 423 | luaZ_resetbuffer(ls->buff); /* previous call may dirty the buff. */ | |
| 424 | break; | |
| 425 | } | |
| 426 | } | |
| 427 | /* else short comment */ | |
| 428 | while (!currIsNewline(ls) && ls->current != EOZ) | |
| 429 | next(ls); /* skip until end of line (or end of file) */ | |
| 430 | break; | |
| 431 | } | |
| 432 | case '[': { /* long string or simply '[' */ | |
| 433 | int sep = skip_sep(ls); | |
| 434 | if (sep >= 0) { | |
| 435 | read_long_string(ls, seminfo, sep); | |
| 436 | return TK_STRING; | |
| 437 | } | |
| 438 | else if (sep == -1) return '['; | |
| 439 | else lexerror(ls, "invalid long string delimiter", TK_STRING); | |
| 440 | } | |
| 441 | case '=': { | |
| 442 | next(ls); | |
| 443 | if (ls->current != '=') return '='; | |
| 444 | else { next(ls); return TK_EQ; } | |
| 445 | } | |
| 446 | case '<': { | |
| 447 | next(ls); | |
| 448 | if (ls->current != '=') return '<'; | |
| 449 | else { next(ls); return TK_LE; } | |
| 450 | } | |
| 451 | case '>': { | |
| 452 | next(ls); | |
| 453 | if (ls->current != '=') return '>'; | |
| 454 | else { next(ls); return TK_GE; } | |
| 455 | } | |
| 456 | case '~': { | |
| 457 | next(ls); | |
| 458 | if (ls->current != '=') return '~'; | |
| 459 | else { next(ls); return TK_NE; } | |
| 460 | } | |
| 461 | case ':': { | |
| 462 | next(ls); | |
| 463 | if (ls->current != ':') return ':'; | |
| 464 | else { next(ls); return TK_DBCOLON; } | |
| 465 | } | |
| 466 | case '"': case '\'': { /* short literal strings */ | |
| 467 | read_string(ls, ls->current, seminfo); | |
| 468 | return TK_STRING; | |
| 469 | } | |
| 470 | case '.': { /* '.', '..', '...', or number */ | |
| 471 | save_and_next(ls); | |
| 472 | if (check_next(ls, ".")) { | |
| 473 | if (check_next(ls, ".")) | |
| 474 | return TK_DOTS; /* '...' */ | |
| 475 | else return TK_CONCAT; /* '..' */ | |
| 476 | } | |
| 477 | else if (!lisdigit(ls->current)) return '.'; | |
| 478 | /* else go through */ | |
| 479 | } | |
| 480 | case '0': case '1': case '2': case '3': case '4': | |
| 481 | case '5': case '6': case '7': case '8': case '9': { | |
| 482 | read_numeral(ls, seminfo); | |
| 483 | return TK_NUMBER; | |
| 484 | } | |
| 485 | case EOZ: { | |
| 486 | return TK_EOS; | |
| 487 | } | |
| 488 | default: { | |
| 489 | if (lislalpha(ls->current)) { /* identifier or reserved word? */ | |
| 490 | TString *ts; | |
| 491 | do { | |
| 492 | save_and_next(ls); | |
| 493 | } while (lislalnum(ls->current)); | |
| 494 | ts = luaX_newstring(ls, luaZ_buffer(ls->buff), | |
| 495 | luaZ_bufflen(ls->buff)); | |
| 496 | seminfo->ts = ts; | |
| 497 | if (isreserved(ts)) /* reserved word? */ | |
| 498 | return ts->tsv.extra - 1 + FIRST_RESERVED; | |
| 499 | else { | |
| 500 | return TK_NAME; | |
| 501 | } | |
| 502 | } | |
| 503 | else { /* single-char tokens (+ - / ...) */ | |
| 504 | int c = ls->current; | |
| 505 | next(ls); | |
| 506 | return c; | |
| 507 | } | |
| 508 | } | |
| 509 | } | |
| 510 | } | |
| 402 | luaZ_resetbuffer(ls->buff); | |
| 403 | for (;;) { | |
| 404 | switch (ls->current) { | |
| 405 | case '\n': case '\r': { /* line breaks */ | |
| 406 | inclinenumber(ls); | |
| 407 | break; | |
| 408 | } | |
| 409 | case ' ': case '\f': case '\t': case '\v': { /* spaces */ | |
| 410 | next(ls); | |
| 411 | break; | |
| 412 | } | |
| 413 | case '-': { /* '-' or '--' (comment) */ | |
| 414 | next(ls); | |
| 415 | if (ls->current != '-') return '-'; | |
| 416 | /* else is a comment */ | |
| 417 | next(ls); | |
| 418 | if (ls->current == '[') { /* long comment? */ | |
| 419 | int sep = skip_sep(ls); | |
| 420 | luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */ | |
| 421 | if (sep >= 0) { | |
| 422 | read_long_string(ls, NULL, sep); /* skip long comment */ | |
| 423 | luaZ_resetbuffer(ls->buff); /* previous call may dirty the buff. */ | |
| 424 | break; | |
| 425 | } | |
| 426 | } | |
| 427 | /* else short comment */ | |
| 428 | while (!currIsNewline(ls) && ls->current != EOZ) | |
| 429 | next(ls); /* skip until end of line (or end of file) */ | |
| 430 | break; | |
| 431 | } | |
| 432 | case '[': { /* long string or simply '[' */ | |
| 433 | int sep = skip_sep(ls); | |
| 434 | if (sep >= 0) { | |
| 435 | read_long_string(ls, seminfo, sep); | |
| 436 | return TK_STRING; | |
| 437 | } | |
| 438 | else if (sep == -1) return '['; | |
| 439 | else lexerror(ls, "invalid long string delimiter", TK_STRING); | |
| 440 | } | |
| 441 | case '=': { | |
| 442 | next(ls); | |
| 443 | if (ls->current != '=') return '='; | |
| 444 | else { next(ls); return TK_EQ; } | |
| 445 | } | |
| 446 | case '<': { | |
| 447 | next(ls); | |
| 448 | if (ls->current != '=') return '<'; | |
| 449 | else { next(ls); return TK_LE; } | |
| 450 | } | |
| 451 | case '>': { | |
| 452 | next(ls); | |
| 453 | if (ls->current != '=') return '>'; | |
| 454 | else { next(ls); return TK_GE; } | |
| 455 | } | |
| 456 | case '~': { | |
| 457 | next(ls); | |
| 458 | if (ls->current != '=') return '~'; | |
| 459 | else { next(ls); return TK_NE; } | |
| 460 | } | |
| 461 | case ':': { | |
| 462 | next(ls); | |
| 463 | if (ls->current != ':') return ':'; | |
| 464 | else { next(ls); return TK_DBCOLON; } | |
| 465 | } | |
| 466 | case '"': case '\'': { /* short literal strings */ | |
| 467 | read_string(ls, ls->current, seminfo); | |
| 468 | return TK_STRING; | |
| 469 | } | |
| 470 | case '.': { /* '.', '..', '...', or number */ | |
| 471 | save_and_next(ls); | |
| 472 | if (check_next(ls, ".")) { | |
| 473 | if (check_next(ls, ".")) | |
| 474 | return TK_DOTS; /* '...' */ | |
| 475 | else return TK_CONCAT; /* '..' */ | |
| 476 | } | |
| 477 | else if (!lisdigit(ls->current)) return '.'; | |
| 478 | /* else go through */ | |
| 479 | } | |
| 480 | case '0': case '1': case '2': case '3': case '4': | |
| 481 | case '5': case '6': case '7': case '8': case '9': { | |
| 482 | read_numeral(ls, seminfo); | |
| 483 | return TK_NUMBER; | |
| 484 | } | |
| 485 | case EOZ: { | |
| 486 | return TK_EOS; | |
| 487 | } | |
| 488 | default: { | |
| 489 | if (lislalpha(ls->current)) { /* identifier or reserved word? */ | |
| 490 | TString *ts; | |
| 491 | do { | |
| 492 | save_and_next(ls); | |
| 493 | } while (lislalnum(ls->current)); | |
| 494 | ts = luaX_newstring(ls, luaZ_buffer(ls->buff), | |
| 495 | luaZ_bufflen(ls->buff)); | |
| 496 | seminfo->ts = ts; | |
| 497 | if (isreserved(ts)) /* reserved word? */ | |
| 498 | return ts->tsv.extra - 1 + FIRST_RESERVED; | |
| 499 | else { | |
| 500 | return TK_NAME; | |
| 501 | } | |
| 502 | } | |
| 503 | else { /* single-char tokens (+ - / ...) */ | |
| 504 | int c = ls->current; | |
| 505 | next(ls); | |
| 506 | return c; | |
| 507 | } | |
| 508 | } | |
| 509 | } | |
| 510 | } | |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | |
| 514 | 514 | void luaX_next (LexState *ls) { |
| 515 | ls->lastline = ls->linenumber; | |
| 516 | if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */ | |
| 517 | ls->t = ls->lookahead; /* use this one */ | |
| 518 | ls->lookahead.token = TK_EOS; /* and discharge it */ | |
| 519 | } | |
| 520 | else | |
| 521 | ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */ | |
| 515 | ls->lastline = ls->linenumber; | |
| 516 | if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */ | |
| 517 | ls->t = ls->lookahead; /* use this one */ | |
| 518 | ls->lookahead.token = TK_EOS; /* and discharge it */ | |
| 519 | } | |
| 520 | else | |
| 521 | ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */ | |
| 522 | 522 | } |
| 523 | 523 | |
| 524 | 524 | |
| 525 | 525 | int luaX_lookahead (LexState *ls) { |
| 526 | lua_assert(ls->lookahead.token == TK_EOS); | |
| 527 | ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); | |
| 528 | return ls->lookahead.token; | |
| 526 | lua_assert(ls->lookahead.token == TK_EOS); | |
| 527 | ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); | |
| 528 | return ls->lookahead.token; | |
| 529 | 529 | } |
| 530 |
| r31373 | r31374 | |
|---|---|---|
| 28 | 28 | ** cost of sweeping one element (the size of a small object divided |
| 29 | 29 | ** by some adjust for the sweep speed) |
| 30 | 30 | */ |
| 31 | #define GCSWEEPCOST | |
| 31 | #define GCSWEEPCOST ((sizeof(TString) + 4) / 4) | |
| 32 | 32 | |
| 33 | 33 | /* maximum number of elements to sweep in each single step */ |
| 34 | #define GCSWEEPMAX | |
| 34 | #define GCSWEEPMAX (cast_int((GCSTEPSIZE / GCSWEEPCOST) / 4)) | |
| 35 | 35 | |
| 36 | 36 | /* maximum number of finalizers to call in each GC step */ |
| 37 | #define GCFINALIZENUM | |
| 37 | #define GCFINALIZENUM 4 | |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | /* |
| 41 | 41 | ** macro to adjust 'stepmul': 'stepmul' is actually used like |
| 42 | 42 | ** 'stepmul / STEPMULADJ' (value chosen by tests) |
| 43 | 43 | */ |
| 44 | #define STEPMULADJ | |
| 44 | #define STEPMULADJ 200 | |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | /* |
| 48 | 48 | ** macro to adjust 'pause': 'pause' is actually used like |
| 49 | 49 | ** 'pause / PAUSEADJ' (value chosen by tests) |
| 50 | 50 | */ |
| 51 | #define PAUSEADJ | |
| 51 | #define PAUSEADJ 100 | |
| 52 | 52 | |
| 53 | 53 | |
| 54 | 54 | /* |
| 55 | 55 | ** 'makewhite' erases all color bits plus the old bit and then |
| 56 | 56 | ** sets only the current white bit |
| 57 | 57 | */ |
| 58 | #define maskcolors (~(bit2mask(BLACKBIT, OLDBIT) | WHITEBITS)) | |
| 59 | #define makewhite(g,x) \ | |
| 60 | (gch(x)->marked = cast_byte((gch(x)->marked & maskcolors) | luaC_white(g))) | |
| 58 | #define maskcolors (~(bit2mask(BLACKBIT, OLDBIT) | WHITEBITS)) | |
| 59 | #define makewhite(g,x) \ | |
| 60 | (gch(x)->marked = cast_byte((gch(x)->marked & maskcolors) | luaC_white(g))) | |
| 61 | 61 | |
| 62 | #define white2gray(x) resetbits(gch(x)->marked, WHITEBITS) | |
| 63 | #define black2gray(x) resetbit(gch(x)->marked, BLACKBIT) | |
| 62 | #define white2gray(x) resetbits(gch(x)->marked, WHITEBITS) | |
| 63 | #define black2gray(x) resetbit(gch(x)->marked, BLACKBIT) | |
| 64 | 64 | |
| 65 | 65 | |
| 66 | #define isfinalized(x) | |
| 66 | #define isfinalized(x) testbit(gch(x)->marked, FINALIZEDBIT) | |
| 67 | 67 | |
| 68 | #define checkdeadkey(n) | |
| 68 | #define checkdeadkey(n) lua_assert(!ttisdeadkey(gkey(n)) || ttisnil(gval(n))) | |
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | #define checkconsistency(obj) \ |
| 72 | ||
| 72 | lua_longassert(!iscollectable(obj) || righttt(obj)) | |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | #define markvalue(g,o) { checkconsistency(o); \ |
| 76 | ||
| 76 | if (valiswhite(o)) reallymarkobject(g,gcvalue(o)); } | |
| 77 | 77 | |
| 78 | 78 | #define markobject(g,t) { if ((t) && iswhite(obj2gco(t))) \ |
| 79 | 79 | reallymarkobject(g, obj2gco(t)); } |
| r31373 | r31374 | |
| 91 | 91 | /* |
| 92 | 92 | ** one after last element in a hash array |
| 93 | 93 | */ |
| 94 | #define gnodelast(h) | |
| 94 | #define gnodelast(h) gnode(h, cast(size_t, sizenode(h))) | |
| 95 | 95 | |
| 96 | 96 | |
| 97 | 97 | /* |
| 98 | 98 | ** link table 'h' into list pointed by 'p' |
| 99 | 99 | */ |
| 100 | #define linktable(h,p) | |
| 100 | #define linktable(h,p) ((h)->gclist = *(p), *(p) = obj2gco(h)) | |
| 101 | 101 | |
| 102 | 102 | |
| 103 | 103 | /* |
| r31373 | r31374 | |
| 105 | 105 | ** from the table) |
| 106 | 106 | */ |
| 107 | 107 | static void removeentry (Node *n) { |
| 108 | lua_assert(ttisnil(gval(n))); | |
| 109 | if (valiswhite(gkey(n))) | |
| 110 | setdeadvalue(gkey(n)); /* unused and unmarked key; remove it */ | |
| 108 | lua_assert(ttisnil(gval(n))); | |
| 109 | if (valiswhite(gkey(n))) | |
| 110 | setdeadvalue(gkey(n)); /* unused and unmarked key; remove it */ | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r31373 | r31374 | |
| 119 | 119 | ** being finalized, keep them in keys, but not in values |
| 120 | 120 | */ |
| 121 | 121 | static int iscleared (global_State *g, const TValue *o) { |
| 122 | if (!iscollectable(o)) return 0; | |
| 123 | else if (ttisstring(o)) { | |
| 124 | markobject(g, rawtsvalue(o)); /* strings are `values', so are never weak */ | |
| 125 | return 0; | |
| 126 | } | |
| 127 | else return iswhite(gcvalue(o)); | |
| 122 | if (!iscollectable(o)) return 0; | |
| 123 | else if (ttisstring(o)) { | |
| 124 | markobject(g, rawtsvalue(o)); /* strings are `values', so are never weak */ | |
| 125 | return 0; | |
| 126 | } | |
| 127 | else return iswhite(gcvalue(o)); | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| r31373 | r31374 | |
| 133 | 133 | ** being pointed by a black object. |
| 134 | 134 | */ |
| 135 | 135 | void luaC_barrier_ (lua_State *L, GCObject *o, GCObject *v) { |
| 136 | global_State *g = G(L); | |
| 137 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); | |
| 138 | lua_assert(g->gcstate != GCSpause); | |
| 139 | lua_assert(gch(o)->tt != LUA_TTABLE); | |
| 140 | if (keepinvariantout(g)) /* must keep invariant? */ | |
| 141 | reallymarkobject(g, v); /* restore invariant */ | |
| 142 | else { /* sweep phase */ | |
| 143 | lua_assert(issweepphase(g)); | |
| 144 | makewhite(g, o); /* mark main obj. as white to avoid other barriers */ | |
| 145 | } | |
| 136 | global_State *g = G(L); | |
| 137 | lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); | |
| 138 | lua_assert(g->gcstate != GCSpause); | |
| 139 | lua_assert(gch(o)->tt != LUA_TTABLE); | |
| 140 | if (keepinvariantout(g)) /* must keep invariant? */ | |
| 141 | reallymarkobject(g, v); /* restore invariant */ | |
| 142 | else { /* sweep phase */ | |
| 143 | lua_assert(issweepphase(g)); | |
| 144 | makewhite(g, o); /* mark main obj. as white to avoid other barriers */ | |
| 145 | } | |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | |
| r31373 | r31374 | |
| 153 | 153 | ** different types.) |
| 154 | 154 | */ |
| 155 | 155 | void luaC_barrierback_ (lua_State *L, GCObject *o) { |
| 156 | global_State *g = G(L); | |
| 157 | lua_assert(isblack(o) && !isdead(g, o) && gch(o)->tt == LUA_TTABLE); | |
| 158 | black2gray(o); /* make object gray (again) */ | |
| 159 | gco2t(o)->gclist = g->grayagain; | |
| 160 | g->grayagain = o; | |
| 156 | global_State *g = G(L); | |
| 157 | lua_assert(isblack(o) && !isdead(g, o) && gch(o)->tt == LUA_TTABLE); | |
| 158 | black2gray(o); /* make object gray (again) */ | |
| 159 | gco2t(o)->gclist = g->grayagain; | |
| 160 | g->grayagain = o; | |
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| r31373 | r31374 | |
| 170 | 170 | ** possible instances. |
| 171 | 171 | */ |
| 172 | 172 | LUAI_FUNC void luaC_barrierproto_ (lua_State *L, Proto *p, Closure *c) { |
| 173 | global_State *g = G(L); | |
| 174 | lua_assert(isblack(obj2gco(p))); | |
| 175 | if (p->cache == NULL) { /* first time? */ | |
| 176 | luaC_objbarrier(L, p, c); | |
| 177 | } | |
| 178 | else { /* use a backward barrier */ | |
| 179 | black2gray(obj2gco(p)); /* make prototype gray (again) */ | |
| 180 | p->gclist = g->grayagain; | |
| 181 | g->grayagain = obj2gco(p); | |
| 182 | } | |
| 173 | global_State *g = G(L); | |
| 174 | lua_assert(isblack(obj2gco(p))); | |
| 175 | if (p->cache == NULL) { /* first time? */ | |
| 176 | luaC_objbarrier(L, p, c); | |
| 177 | } | |
| 178 | else { /* use a backward barrier */ | |
| 179 | black2gray(obj2gco(p)); /* make prototype gray (again) */ | |
| 180 | p->gclist = g->grayagain; | |
| 181 | g->grayagain = obj2gco(p); | |
| 182 | } | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| r31373 | r31374 | |
| 188 | 188 | ** i.e., moved into the 'allgc' list |
| 189 | 189 | */ |
| 190 | 190 | void luaC_checkupvalcolor (global_State *g, UpVal *uv) { |
| 191 | GCObject *o = obj2gco(uv); | |
| 192 | lua_assert(!isblack(o)); /* open upvalues are never black */ | |
| 193 | if (isgray(o)) { | |
| 194 | if (keepinvariant(g)) { | |
| 195 | resetoldbit(o); /* see MOVE OLD rule */ | |
| 196 | gray2black(o); /* it is being visited now */ | |
| 197 | markvalue(g, uv->v); | |
| 198 | } | |
| 199 | else { | |
| 200 | lua_assert(issweepphase(g)); | |
| 201 | makewhite(g, o); | |
| 202 | } | |
| 203 | } | |
| 191 | GCObject *o = obj2gco(uv); | |
| 192 | lua_assert(!isblack(o)); /* open upvalues are never black */ | |
| 193 | if (isgray(o)) { | |
| 194 | if (keepinvariant(g)) { | |
| 195 | resetoldbit(o); /* see MOVE OLD rule */ | |
| 196 | gray2black(o); /* it is being visited now */ | |
| 197 | markvalue(g, uv->v); | |
| 198 | } | |
| 199 | else { | |
| 200 | lua_assert(issweepphase(g)); | |
| 201 | makewhite(g, o); | |
| 202 | } | |
| 203 | } | |
| 204 | 204 | } |
| 205 | 205 | |
| 206 | 206 | |
| r31373 | r31374 | |
| 210 | 210 | ** object itself (used only by states). |
| 211 | 211 | */ |
| 212 | 212 | GCObject *luaC_newobj (lua_State *L, int tt, size_t sz, GCObject **list, |
| 213 | int offset) { | |
| 214 | global_State *g = G(L); | |
| 215 | char *raw = cast(char *, luaM_newobject(L, novariant(tt), sz)); | |
| 216 | GCObject *o = obj2gco(raw + offset); | |
| 217 | if (list == NULL) | |
| 218 | list = &g->allgc; /* standard list for collectable objects */ | |
| 219 | gch(o)->marked = luaC_white(g); | |
| 220 | gch(o)->tt = tt; | |
| 221 | gch(o)->next = *list; | |
| 222 | *list = o; | |
| 223 | return o; | |
| 213 | int offset) { | |
| 214 | global_State *g = G(L); | |
| 215 | char *raw = cast(char *, luaM_newobject(L, novariant(tt), sz)); | |
| 216 | GCObject *o = obj2gco(raw + offset); | |
| 217 | if (list == NULL) | |
| 218 | list = &g->allgc; /* standard list for collectable objects */ | |
| 219 | gch(o)->marked = luaC_white(g); | |
| 220 | gch(o)->tt = tt; | |
| 221 | gch(o)->next = *list; | |
| 222 | *list = o; | |
| 223 | return o; | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | /* }====================================================== */ |
| r31373 | r31374 | |
| 241 | 241 | ** upvalues are already linked in 'headuv' list.) |
| 242 | 242 | */ |
| 243 | 243 | static void reallymarkobject (global_State *g, GCObject *o) { |
| 244 | lu_mem size; | |
| 245 | white2gray(o); | |
| 246 | switch (gch(o)->tt) { | |
| 247 | case LUA_TSHRSTR: | |
| 248 | case LUA_TLNGSTR: { | |
| 249 | size = sizestring(gco2ts(o)); | |
| 250 | break; /* nothing else to mark; make it black */ | |
| 251 | } | |
| 252 | case LUA_TUSERDATA: { | |
| 253 | Table *mt = gco2u(o)->metatable; | |
| 254 | markobject(g, mt); | |
| 255 | markobject(g, gco2u(o)->env); | |
| 256 | size = sizeudata(gco2u(o)); | |
| 257 | break; | |
| 258 | } | |
| 259 | case LUA_TUPVAL: { | |
| 260 | UpVal *uv = gco2uv(o); | |
| 261 | markvalue(g, uv->v); | |
| 262 | if (uv->v != &uv->u.value) /* open? */ | |
| 263 | return; /* open upvalues remain gray */ | |
| 264 | size = sizeof(UpVal); | |
| 265 | break; | |
| 266 | } | |
| 267 | case LUA_TLCL: { | |
| 268 | gco2lcl(o)->gclist = g->gray; | |
| 269 | g->gray = o; | |
| 270 | return; | |
| 271 | } | |
| 272 | case LUA_TCCL: { | |
| 273 | gco2ccl(o)->gclist = g->gray; | |
| 274 | g->gray = o; | |
| 275 | return; | |
| 276 | } | |
| 277 | case LUA_TTABLE: { | |
| 278 | linktable(gco2t(o), &g->gray); | |
| 279 | return; | |
| 280 | } | |
| 281 | case LUA_TTHREAD: { | |
| 282 | gco2th(o)->gclist = g->gray; | |
| 283 | g->gray = o; | |
| 284 | return; | |
| 285 | } | |
| 286 | case LUA_TPROTO: { | |
| 287 | gco2p(o)->gclist = g->gray; | |
| 288 | g->gray = o; | |
| 289 | return; | |
| 290 | } | |
| 291 | default: lua_assert(0); return; | |
| 292 | } | |
| 293 | gray2black(o); | |
| 294 | g->GCmemtrav += size; | |
| 244 | lu_mem size; | |
| 245 | white2gray(o); | |
| 246 | switch (gch(o)->tt) { | |
| 247 | case LUA_TSHRSTR: | |
| 248 | case LUA_TLNGSTR: { | |
| 249 | size = sizestring(gco2ts(o)); | |
| 250 | break; /* nothing else to mark; make it black */ | |
| 251 | } | |
| 252 | case LUA_TUSERDATA: { | |
| 253 | Table *mt = gco2u(o)->metatable; | |
| 254 | markobject(g, mt); | |
| 255 | markobject(g, gco2u(o)->env); | |
| 256 | size = sizeudata(gco2u(o)); | |
| 257 | break; | |
| 258 | } | |
| 259 | case LUA_TUPVAL: { | |
| 260 | UpVal *uv = gco2uv(o); | |
| 261 | markvalue(g, uv->v); | |
| 262 | if (uv->v != &uv->u.value) /* open? */ | |
| 263 | return; /* open upvalues remain gray */ | |
| 264 | size = sizeof(UpVal); | |
| 265 | break; | |
| 266 | } | |
| 267 | case LUA_TLCL: { | |
| 268 | gco2lcl(o)->gclist = g->gray; | |
| 269 | g->gray = o; | |
| 270 | return; | |
| 271 | } | |
| 272 | case LUA_TCCL: { | |
| 273 | gco2ccl(o)->gclist = g->gray; | |
| 274 | g->gray = o; | |
| 275 | return; | |
| 276 | } | |
| 277 | case LUA_TTABLE: { | |
| 278 | linktable(gco2t(o), &g->gray); | |
| 279 | return; | |
| 280 | } | |
| 281 | case LUA_TTHREAD: { | |
| 282 | gco2th(o)->gclist = g->gray; | |
| 283 | g->gray = o; | |
| 284 | return; | |
| 285 | } | |
| 286 | case LUA_TPROTO: { | |
| 287 | gco2p(o)->gclist = g->gray; | |
| 288 | g->gray = o; | |
| 289 | return; | |
| 290 | } | |
| 291 | default: lua_assert(0); return; | |
| 292 | } | |
| 293 | gray2black(o); | |
| 294 | g->GCmemtrav += size; | |
| 295 | 295 | } |
| 296 | 296 | |
| 297 | 297 | |
| r31373 | r31374 | |
| 299 | 299 | ** mark metamethods for basic types |
| 300 | 300 | */ |
| 301 | 301 | static void markmt (global_State *g) { |
| 302 | int i; | |
| 303 | for (i=0; i < LUA_NUMTAGS; i++) | |
| 304 | markobject(g, g->mt[i]); | |
| 302 | int i; | |
| 303 | for (i=0; i < LUA_NUMTAGS; i++) | |
| 304 | markobject(g, g->mt[i]); | |
| 305 | 305 | } |
| 306 | 306 | |
| 307 | 307 | |
| r31373 | r31374 | |
| 309 | 309 | ** mark all objects in list of being-finalized |
| 310 | 310 | */ |
| 311 | 311 | static void markbeingfnz (global_State *g) { |
| 312 | GCObject *o; | |
| 313 | for (o = g->tobefnz; o != NULL; o = gch(o)->next) { | |
| 314 | makewhite(g, o); | |
| 315 | reallymarkobject(g, o); | |
| 316 | } | |
| 312 | GCObject *o; | |
| 313 | for (o = g->tobefnz; o != NULL; o = gch(o)->next) { | |
| 314 | makewhite(g, o); | |
| 315 | reallymarkobject(g, o); | |
| 316 | } | |
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | |
| r31373 | r31374 | |
| 322 | 322 | ** 'lstate.h'.) |
| 323 | 323 | */ |
| 324 | 324 | static void remarkupvals (global_State *g) { |
| 325 | UpVal *uv; | |
| 326 | for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { | |
| 327 | if (isgray(obj2gco(uv))) | |
| 328 | markvalue(g, uv->v); | |
| 329 | } | |
| 325 | UpVal *uv; | |
| 326 | for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { | |
| 327 | if (isgray(obj2gco(uv))) | |
| 328 | markvalue(g, uv->v); | |
| 329 | } | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | |
| r31373 | r31374 | |
| 335 | 335 | ** incremental (or full) collection |
| 336 | 336 | */ |
| 337 | 337 | static void restartcollection (global_State *g) { |
| 338 | g->gray = g->grayagain = NULL; | |
| 339 | g->weak = g->allweak = g->ephemeron = NULL; | |
| 340 | markobject(g, g->mainthread); | |
| 341 | markvalue(g, &g->l_registry); | |
| 342 | markmt(g); | |
| 343 | markbeingfnz(g); /* mark any finalizing object left from previous cycle */ | |
| 338 | g->gray = g->grayagain = NULL; | |
| 339 | g->weak = g->allweak = g->ephemeron = NULL; | |
| 340 | markobject(g, g->mainthread); | |
| 341 | markvalue(g, &g->l_registry); | |
| 342 | markmt(g); | |
| 343 | markbeingfnz(g); /* mark any finalizing object left from previous cycle */ | |
| 344 | 344 | } |
| 345 | 345 | |
| 346 | 346 | /* }====================================================== */ |
| r31373 | r31374 | |
| 353 | 353 | */ |
| 354 | 354 | |
| 355 | 355 | static void traverseweakvalue (global_State *g, Table *h) { |
| 356 | Node *n, *limit = gnodelast(h); | |
| 357 | /* if there is array part, assume it may have white values (do not | |
| 358 | traverse it just to check) */ | |
| 359 | int hasclears = (h->sizearray > 0); | |
| 360 | for (n = gnode(h, 0); n < limit; n++) { | |
| 361 | checkdeadkey(n); | |
| 362 | if (ttisnil(gval(n))) /* entry is empty? */ | |
| 363 | removeentry(n); /* remove it */ | |
| 364 | else { | |
| 365 | lua_assert(!ttisnil(gkey(n))); | |
| 366 | markvalue(g, gkey(n)); /* mark key */ | |
| 367 | if (!hasclears && iscleared(g, gval(n))) /* is there a white value? */ | |
| 368 | hasclears = 1; /* table will have to be cleared */ | |
| 369 | } | |
| 370 | } | |
| 371 | if (hasclears) | |
| 372 | linktable(h, &g->weak); /* has to be cleared later */ | |
| 373 | else /* no white values */ | |
| 374 | linktable(h, &g->grayagain); /* no need to clean */ | |
| 356 | Node *n, *limit = gnodelast(h); | |
| 357 | /* if there is array part, assume it may have white values (do not | |
| 358 | traverse it just to check) */ | |
| 359 | int hasclears = (h->sizearray > 0); | |
| 360 | for (n = gnode(h, 0); n < limit; n++) { | |
| 361 | checkdeadkey(n); | |
| 362 | if (ttisnil(gval(n))) /* entry is empty? */ | |
| 363 | removeentry(n); /* remove it */ | |
| 364 | else { | |
| 365 | lua_assert(!ttisnil(gkey(n))); | |
| 366 | markvalue(g, gkey(n)); /* mark key */ | |
| 367 | if (!hasclears && iscleared(g, gval(n))) /* is there a white value? */ | |
| 368 | hasclears = 1; /* table will have to be cleared */ | |
| 369 | } | |
| 370 | } | |
| 371 | if (hasclears) | |
| 372 | linktable(h, &g->weak); /* has to be cleared later */ | |
| 373 | else /* no white values */ | |
| 374 | linktable(h, &g->grayagain); /* no need to clean */ | |
| 375 | 375 | } |
| 376 | 376 | |
| 377 | 377 | |
| 378 | 378 | static int traverseephemeron (global_State *g, Table *h) { |
| 379 | int marked = 0; /* true if an object is marked in this traversal */ | |
| 380 | int hasclears = 0; /* true if table has white keys */ | |
| 381 | int prop = 0; /* true if table has entry "white-key -> white-value" */ | |
| 382 | Node *n, *limit = gnodelast(h); | |
| 383 | int i; | |
| 384 | /* traverse array part (numeric keys are 'strong') */ | |
| 385 | for (i = 0; i < h->sizearray; i++) { | |
| 386 | if (valiswhite(&h->array[i])) { | |
| 387 | marked = 1; | |
| 388 | reallymarkobject(g, gcvalue(&h->array[i])); | |
| 389 | } | |
| 390 | } | |
| 391 | /* traverse hash part */ | |
| 392 | for (n = gnode(h, 0); n < limit; n++) { | |
| 393 | checkdeadkey(n); | |
| 394 | if (ttisnil(gval(n))) /* entry is empty? */ | |
| 395 | removeentry(n); /* remove it */ | |
| 396 | else if (iscleared(g, gkey(n))) { /* key is not marked (yet)? */ | |
| 397 | hasclears = 1; /* table must be cleared */ | |
| 398 | if (valiswhite(gval(n))) /* value not marked yet? */ | |
| 399 | prop = 1; /* must propagate again */ | |
| 400 | } | |
| 401 | else if (valiswhite(gval(n))) { /* value not marked yet? */ | |
| 402 | marked = 1; | |
| 403 | reallymarkobject(g, gcvalue(gval(n))); /* mark it now */ | |
| 404 | } | |
| 405 | } | |
| 406 | if (prop) | |
| 407 | linktable(h, &g->ephemeron); /* have to propagate again */ | |
| 408 | else if (hasclears) /* does table have white keys? */ | |
| 409 | linktable(h, &g->allweak); /* may have to clean white keys */ | |
| 410 | else /* no white keys */ | |
| 411 | linktable(h, &g->grayagain); /* no need to clean */ | |
| 412 | return marked; | |
| 379 | int marked = 0; /* true if an object is marked in this traversal */ | |
| 380 | int hasclears = 0; /* true if table has white keys */ | |
| 381 | int prop = 0; /* true if table has entry "white-key -> white-value" */ | |
| 382 | Node *n, *limit = gnodelast(h); | |
| 383 | int i; | |
| 384 | /* traverse array part (numeric keys are 'strong') */ | |
| 385 | for (i = 0; i < h->sizearray; i++) { | |
| 386 | if (valiswhite(&h->array[i])) { | |
| 387 | marked = 1; | |
| 388 | reallymarkobject(g, gcvalue(&h->array[i])); | |
| 389 | } | |
| 390 | } | |
| 391 | /* traverse hash part */ | |
| 392 | for (n = gnode(h, 0); n < limit; n++) { | |
| 393 | checkdeadkey(n); | |
| 394 | if (ttisnil(gval(n))) /* entry is empty? */ | |
| 395 | removeentry(n); /* remove it */ | |
| 396 | else if (iscleared(g, gkey(n))) { /* key is not marked (yet)? */ | |
| 397 | hasclears = 1; /* table must be cleared */ | |
| 398 | if (valiswhite(gval(n))) /* value not marked yet? */ | |
| 399 | prop = 1; /* must propagate again */ | |
| 400 | } | |
| 401 | else if (valiswhite(gval(n))) { /* value not marked yet? */ | |
| 402 | marked = 1; | |
| 403 | reallymarkobject(g, gcvalue(gval(n))); /* mark it now */ | |
| 404 | } | |
| 405 | } | |
| 406 | if (prop) | |
| 407 | linktable(h, &g->ephemeron); /* have to propagate again */ | |
| 408 | else if (hasclears) /* does table have white keys? */ | |
| 409 | linktable(h, &g->allweak); /* may have to clean white keys */ | |
| 410 | else /* no white keys */ | |
| 411 | linktable(h, &g->grayagain); /* no need to clean */ | |
| 412 | return marked; | |
| 413 | 413 | } |
| 414 | 414 | |
| 415 | 415 | |
| 416 | 416 | static void traversestrongtable (global_State *g, Table *h) { |
| 417 | Node *n, *limit = gnodelast(h); | |
| 418 | int i; | |
| 419 | for (i = 0; i < h->sizearray; i++) /* traverse array part */ | |
| 420 | markvalue(g, &h->array[i]); | |
| 421 | for (n = gnode(h, 0); n < limit; n++) { /* traverse hash part */ | |
| 422 | checkdeadkey(n); | |
| 423 | if (ttisnil(gval(n))) /* entry is empty? */ | |
| 424 | removeentry(n); /* remove it */ | |
| 425 | else { | |
| 426 | lua_assert(!ttisnil(gkey(n))); | |
| 427 | markvalue(g, gkey(n)); /* mark key */ | |
| 428 | markvalue(g, gval(n)); /* mark value */ | |
| 429 | } | |
| 430 | } | |
| 417 | Node *n, *limit = gnodelast(h); | |
| 418 | int i; | |
| 419 | for (i = 0; i < h->sizearray; i++) /* traverse array part */ | |
| 420 | markvalue(g, &h->array[i]); | |
| 421 | for (n = gnode(h, 0); n < limit; n++) { /* traverse hash part */ | |
| 422 | checkdeadkey(n); | |
| 423 | if (ttisnil(gval(n))) /* entry is empty? */ | |
| 424 | removeentry(n); /* remove it */ | |
| 425 | else { | |
| 426 | lua_assert(!ttisnil(gkey(n))); | |
| 427 | markvalue(g, gkey(n)); /* mark key */ | |
| 428 | markvalue(g, gval(n)); /* mark value */ | |
| 429 | } | |
| 430 | } | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | |
| 434 | 434 | static lu_mem traversetable (global_State *g, Table *h) { |
| 435 | const char *weakkey, *weakvalue; | |
| 436 | const TValue *mode = gfasttm(g, h->metatable, TM_MODE); | |
| 437 | markobject(g, h->metatable); | |
| 438 | if (mode && ttisstring(mode) && /* is there a weak mode? */ | |
| 439 | ((weakkey = strchr(svalue(mode), 'k')), | |
| 440 | (weakvalue = strchr(svalue(mode), 'v')), | |
| 441 | (weakkey || weakvalue))) { /* is really weak? */ | |
| 442 | black2gray(obj2gco(h)); /* keep table gray */ | |
| 443 | if (!weakkey) /* strong keys? */ | |
| 444 | traverseweakvalue(g, h); | |
| 445 | else if (!weakvalue) /* strong values? */ | |
| 446 | traverseephemeron(g, h); | |
| 447 | else /* all weak */ | |
| 448 | linktable(h, &g->allweak); /* nothing to traverse now */ | |
| 449 | } | |
| 450 | else /* not weak */ | |
| 451 | traversestrongtable(g, h); | |
| 452 | return sizeof(Table) + sizeof(TValue) * h->sizearray + | |
| 453 | sizeof(Node) * cast(size_t, sizenode(h)); | |
| 435 | const char *weakkey, *weakvalue; | |
| 436 | const TValue *mode = gfasttm(g, h->metatable, TM_MODE); | |
| 437 | markobject(g, h->metatable); | |
| 438 | if (mode && ttisstring(mode) && /* is there a weak mode? */ | |
| 439 | ((weakkey = strchr(svalue(mode), 'k')), | |
| 440 | (weakvalue = strchr(svalue(mode), 'v')), | |
| 441 | (weakkey || weakvalue))) { /* is really weak? */ | |
| 442 | black2gray(obj2gco(h)); /* keep table gray */ | |
| 443 | if (!weakkey) /* strong keys? */ | |
| 444 | traverseweakvalue(g, h); | |
| 445 | else if (!weakvalue) /* strong values? */ | |
| 446 | traverseephemeron(g, h); | |
| 447 | else /* all weak */ | |
| 448 | linktable(h, &g->allweak); /* nothing to traverse now */ | |
| 449 | } | |
| 450 | else /* not weak */ | |
| 451 | traversestrongtable(g, h); | |
| 452 | return sizeof(Table) + sizeof(TValue) * h->sizearray + | |
| 453 | sizeof(Node) * cast(size_t, sizenode(h)); | |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | |
| 457 | 457 | static int traverseproto (global_State *g, Proto *f) { |
| 458 | int i; | |
| 459 | if (f->cache && iswhite(obj2gco(f->cache))) | |
| 460 | f->cache = NULL; /* allow cache to be collected */ | |
| 461 | markobject(g, f->source); | |
| 462 | for (i = 0; i < f->sizek; i++) /* mark literals */ | |
| 463 | markvalue(g, &f->k[i]); | |
| 464 | for (i = 0; i < f->sizeupvalues; i++) /* mark upvalue names */ | |
| 465 | markobject(g, f->upvalues[i].name); | |
| 466 | for (i = 0; i < f->sizep; i++) /* mark nested protos */ | |
| 467 | markobject(g, f->p[i]); | |
| 468 | for (i = 0; i < f->sizelocvars; i++) /* mark local-variable names */ | |
| 469 | markobject(g, f->locvars[i].varname); | |
| 470 | return sizeof(Proto) + sizeof(Instruction) * f->sizecode + | |
| 471 | sizeof(Proto *) * f->sizep + | |
| 472 | sizeof(TValue) * f->sizek + | |
| 473 | sizeof(int) * f->sizelineinfo + | |
| 474 | sizeof(LocVar) * f->sizelocvars + | |
| 475 | sizeof(Upvaldesc) * f->sizeupvalues; | |
| 458 | int i; | |
| 459 | if (f->cache && iswhite(obj2gco(f->cache))) | |
| 460 | f->cache = NULL; /* allow cache to be collected */ | |
| 461 | markobject(g, f->source); | |
| 462 | for (i = 0; i < f->sizek; i++) /* mark literals */ | |
| 463 | markvalue(g, &f->k[i]); | |
| 464 | for (i = 0; i < f->sizeupvalues; i++) /* mark upvalue names */ | |
| 465 | markobject(g, f->upvalues[i].name); | |
| 466 | for (i = 0; i < f->sizep; i++) /* mark nested protos */ | |
| 467 | markobject(g, f->p[i]); | |
| 468 | for (i = 0; i < f->sizelocvars; i++) /* mark local-variable names */ | |
| 469 | markobject(g, f->locvars[i].varname); | |
| 470 | return sizeof(Proto) + sizeof(Instruction) * f->sizecode + | |
| 471 | sizeof(Proto *) * f->sizep + | |
| 472 | sizeof(TValue) * f->sizek + | |
| 473 | sizeof(int) * f->sizelineinfo + | |
| 474 | sizeof(LocVar) * f->sizelocvars + | |
| 475 | sizeof(Upvaldesc) * f->sizeupvalues; | |
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | |
| 479 | 479 | static lu_mem traverseCclosure (global_State *g, CClosure *cl) { |
| 480 | int i; | |
| 481 | for (i = 0; i < cl->nupvalues; i++) /* mark its upvalues */ | |
| 482 | markvalue(g, &cl->upvalue[i]); | |
| 483 | return sizeCclosure(cl->nupvalues); | |
| 480 | int i; | |
| 481 | for (i = 0; i < cl->nupvalues; i++) /* mark its upvalues */ | |
| 482 | markvalue(g, &cl->upvalue[i]); | |
| 483 | return sizeCclosure(cl->nupvalues); | |
| 484 | 484 | } |
| 485 | 485 | |
| 486 | 486 | static lu_mem traverseLclosure (global_State *g, LClosure *cl) { |
| 487 | int i; | |
| 488 | markobject(g, cl->p); /* mark its prototype */ | |
| 489 | for (i = 0; i < cl->nupvalues; i++) /* mark its upvalues */ | |
| 490 | markobject(g, cl->upvals[i]); | |
| 491 | return sizeLclosure(cl->nupvalues); | |
| 487 | int i; | |
| 488 | markobject(g, cl->p); /* mark its prototype */ | |
| 489 | for (i = 0; i < cl->nupvalues; i++) /* mark its upvalues */ | |
| 490 | markobject(g, cl->upvals[i]); | |
| 491 | return sizeLclosure(cl->nupvalues); | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | |
| 495 | 495 | static lu_mem traversestack (global_State *g, lua_State *th) { |
| 496 | int n = 0; | |
| 497 | StkId o = th->stack; | |
| 498 | if (o == NULL) | |
| 499 | return 1; /* stack not completely built yet */ | |
| 500 | for (; o < th->top; o++) /* mark live elements in the stack */ | |
| 501 | markvalue(g, o); | |
| 502 | if (g->gcstate == GCSatomic) { /* final traversal? */ | |
| 503 | StkId lim = th->stack + th->stacksize; /* real end of stack */ | |
| 504 | for (; o < lim; o++) /* clear not-marked stack slice */ | |
| 505 | setnilvalue(o); | |
| 506 | } | |
| 507 | else { /* count call infos to compute size */ | |
| 508 | CallInfo *ci; | |
| 509 | for (ci = &th->base_ci; ci != th->ci; ci = ci->next) | |
| 510 | n++; | |
| 511 | } | |
| 512 | return sizeof(lua_State) + sizeof(TValue) * th->stacksize + | |
| 513 | sizeof(CallInfo) * n; | |
| 496 | int n = 0; | |
| 497 | StkId o = th->stack; | |
| 498 | if (o == NULL) | |
| 499 | return 1; /* stack not completely built yet */ | |
| 500 | for (; o < th->top; o++) /* mark live elements in the stack */ | |
| 501 | markvalue(g, o); | |
| 502 | if (g->gcstate == GCSatomic) { /* final traversal? */ | |
| 503 | StkId lim = th->stack + th->stacksize; /* real end of stack */ | |
| 504 | for (; o < lim; o++) /* clear not-marked stack slice */ | |
| 505 | setnilvalue(o); | |
| 506 | } | |
| 507 | else { /* count call infos to compute size */ | |
| 508 | CallInfo *ci; | |
| 509 | for (ci = &th->base_ci; ci != th->ci; ci = ci->next) | |
| 510 | n++; | |
| 511 | } | |
| 512 | return sizeof(lua_State) + sizeof(TValue) * th->stacksize + | |
| 513 | sizeof(CallInfo) * n; | |
| 514 | 514 | } |
| 515 | 515 | |
| 516 | 516 | |
| r31373 | r31374 | |
| 519 | 519 | ** which are always gray). |
| 520 | 520 | */ |
| 521 | 521 | static void propagatemark (global_State *g) { |
| 522 | lu_mem size; | |
| 523 | GCObject *o = g->gray; | |
| 524 | lua_assert(isgray(o)); | |
| 525 | gray2black(o); | |
| 526 | switch (gch(o)->tt) { | |
| 527 | case LUA_TTABLE: { | |
| 528 | Table *h = gco2t(o); | |
| 529 | g->gray = h->gclist; /* remove from 'gray' list */ | |
| 530 | size = traversetable(g, h); | |
| 531 | break; | |
| 532 | } | |
| 533 | case LUA_TLCL: { | |
| 534 | LClosure *cl = gco2lcl(o); | |
| 535 | g->gray = cl->gclist; /* remove from 'gray' list */ | |
| 536 | size = traverseLclosure(g, cl); | |
| 537 | break; | |
| 538 | } | |
| 539 | case LUA_TCCL: { | |
| 540 | CClosure *cl = gco2ccl(o); | |
| 541 | g->gray = cl->gclist; /* remove from 'gray' list */ | |
| 542 | size = traverseCclosure(g, cl); | |
| 543 | break; | |
| 544 | } | |
| 545 | case LUA_TTHREAD: { | |
| 546 | lua_State *th = gco2th(o); | |
| 547 | g->gray = th->gclist; /* remove from 'gray' list */ | |
| 548 | th->gclist = g->grayagain; | |
| 549 | g->grayagain = o; /* insert into 'grayagain' list */ | |
| 550 | black2gray(o); | |
| 551 | size = traversestack(g, th); | |
| 552 | break; | |
| 553 | } | |
| 554 | case LUA_TPROTO: { | |
| 555 | Proto *p = gco2p(o); | |
| 556 | g->gray = p->gclist; /* remove from 'gray' list */ | |
| 557 | size = traverseproto(g, p); | |
| 558 | break; | |
| 559 | } | |
| 560 | default: lua_assert(0); return; | |
| 561 | } | |
| 562 | g->GCmemtrav += size; | |
| 522 | lu_mem size; | |
| 523 | GCObject *o = g->gray; | |
| 524 | lua_assert(isgray(o)); | |
| 525 | gray2black(o); | |
| 526 | switch (gch(o)->tt) { | |
| 527 | case LUA_TTABLE: { | |
| 528 | Table *h = gco2t(o); | |
| 529 | g->gray = h->gclist; /* remove from 'gray' list */ | |
| 530 | size = traversetable(g, h); | |
| 531 | break; | |
| 532 | } | |
| 533 | case LUA_TLCL: { | |
| 534 | LClosure *cl = gco2lcl(o); | |
| 535 | g->gray = cl->gclist; /* remove from 'gray' list */ | |
| 536 | size = traverseLclosure(g, cl); | |
| 537 | break; | |
| 538 | } | |
| 539 | case LUA_TCCL: { | |
| 540 | CClosure *cl = gco2ccl(o); | |
| 541 | g->gray = cl->gclist; /* remove from 'gray' list */ | |
| 542 | size = traverseCclosure(g, cl); | |
| 543 | break; | |
| 544 | } | |
| 545 | case LUA_TTHREAD: { | |
| 546 | lua_State *th = gco2th(o); | |
| 547 | g->gray = th->gclist; /* remove from 'gray' list */ | |
| 548 | th->gclist = g->grayagain; | |
| 549 | g->grayagain = o; /* insert into 'grayagain' list */ | |
| 550 | black2gray(o); | |
| 551 | size = traversestack(g, th); | |
| 552 | break; | |
| 553 | } | |
| 554 | case LUA_TPROTO: { | |
| 555 | Proto *p = gco2p(o); | |
| 556 | g->gray = p->gclist; /* remove from 'gray' list */ | |
| 557 | size = traverseproto(g, p); | |
| 558 | break; | |
| 559 | } | |
| 560 | default: lua_assert(0); return; | |
| 561 | } | |
| 562 | g->GCmemtrav += size; | |
| 563 | 563 | } |
| 564 | 564 | |
| 565 | 565 | |
| 566 | 566 | static void propagateall (global_State *g) { |
| 567 | ||
| 567 | while (g->gray) propagatemark(g); | |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | 570 | |
| 571 | 571 | static void propagatelist (global_State *g, GCObject *l) { |
| 572 | lua_assert(g->gray == NULL); /* no grays left */ | |
| 573 | g->gray = l; | |
| 574 | propagateall(g); /* traverse all elements from 'l' */ | |
| 572 | lua_assert(g->gray == NULL); /* no grays left */ | |
| 573 | g->gray = l; | |
| 574 | propagateall(g); /* traverse all elements from 'l' */ | |
| 575 | 575 | } |
| 576 | 576 | |
| 577 | 577 | /* |
| r31373 | r31374 | |
| 580 | 580 | ** twice the same table (which is not wrong, but inefficient) |
| 581 | 581 | */ |
| 582 | 582 | static void retraversegrays (global_State *g) { |
| 583 | GCObject *weak = g->weak; /* save original lists */ | |
| 584 | GCObject *grayagain = g->grayagain; | |
| 585 | GCObject *ephemeron = g->ephemeron; | |
| 586 | g->weak = g->grayagain = g->ephemeron = NULL; | |
| 587 | propagateall(g); /* traverse main gray list */ | |
| 588 | propagatelist(g, grayagain); | |
| 589 | propagatelist(g, weak); | |
| 590 | propagatelist(g, ephemeron); | |
| 583 | GCObject *weak = g->weak; /* save original lists */ | |
| 584 | GCObject *grayagain = g->grayagain; | |
| 585 | GCObject *ephemeron = g->ephemeron; | |
| 586 | g->weak = g->grayagain = g->ephemeron = NULL; | |
| 587 | propagateall(g); /* traverse main gray list */ | |
| 588 | propagatelist(g, grayagain); | |
| 589 | propagatelist(g, weak); | |
| 590 | propagatelist(g, ephemeron); | |
| 591 | 591 | } |
| 592 | 592 | |
| 593 | 593 | |
| 594 | 594 | static void convergeephemerons (global_State *g) { |
| 595 | int changed; | |
| 596 | do { | |
| 597 | GCObject *w; | |
| 598 | GCObject *next = g->ephemeron; /* get ephemeron list */ | |
| 599 | g->ephemeron = NULL; /* tables will return to this list when traversed */ | |
| 600 | changed = 0; | |
| 601 | while ((w = next) != NULL) { | |
| 602 | next = gco2t(w)->gclist; | |
| 603 | if (traverseephemeron(g, gco2t(w))) { /* traverse marked some value? */ | |
| 604 | propagateall(g); /* propagate changes */ | |
| 605 | changed = 1; /* will have to revisit all ephemeron tables */ | |
| 606 | } | |
| 607 | } | |
| 608 | } while (changed); | |
| 595 | int changed; | |
| 596 | do { | |
| 597 | GCObject *w; | |
| 598 | GCObject *next = g->ephemeron; /* get ephemeron list */ | |
| 599 | g->ephemeron = NULL; /* tables will return to this list when traversed */ | |
| 600 | changed = 0; | |
| 601 | while ((w = next) != NULL) { | |
| 602 | next = gco2t(w)->gclist; | |
| 603 | if (traverseephemeron(g, gco2t(w))) { /* traverse marked some value? */ | |
| 604 | propagateall(g); /* propagate changes */ | |
| 605 | changed = 1; /* will have to revisit all ephemeron tables */ | |
| 606 | } | |
| 607 | } | |
| 608 | } while (changed); | |
| 609 | 609 | } |
| 610 | 610 | |
| 611 | 611 | /* }====================================================== */ |
| r31373 | r31374 | |
| 623 | 623 | ** to element 'f' |
| 624 | 624 | */ |
| 625 | 625 | static void clearkeys (global_State *g, GCObject *l, GCObject *f) { |
| 626 | for (; l != f; l = gco2t(l)->gclist) { | |
| 627 | Table *h = gco2t(l); | |
| 628 | Node *n, *limit = gnodelast(h); | |
| 629 | for (n = gnode(h, 0); n < limit; n++) { | |
| 630 | if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) { | |
| 631 | setnilvalue(gval(n)); /* remove value ... */ | |
| 632 | removeentry(n); /* and remove entry from table */ | |
| 633 | } | |
| 634 | } | |
| 635 | } | |
| 626 | for (; l != f; l = gco2t(l)->gclist) { | |
| 627 | Table *h = gco2t(l); | |
| 628 | Node *n, *limit = gnodelast(h); | |
| 629 | for (n = gnode(h, 0); n < limit; n++) { | |
| 630 | if (!ttisnil(gval(n)) && (iscleared(g, gkey(n)))) { | |
| 631 | setnilvalue(gval(n)); /* remove value ... */ | |
| 632 | removeentry(n); /* and remove entry from table */ | |
| 633 | } | |
| 634 | } | |
| 635 | } | |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | |
| r31373 | r31374 | |
| 641 | 641 | ** to element 'f' |
| 642 | 642 | */ |
| 643 | 643 | static void clearvalues (global_State *g, GCObject *l, GCObject *f) { |
| 644 | for (; l != f; l = gco2t(l)->gclist) { | |
| 645 | Table *h = gco2t(l); | |
| 646 | Node *n, *limit = gnodelast(h); | |
| 647 | int i; | |
| 648 | for (i = 0; i < h->sizearray; i++) { | |
| 649 | TValue *o = &h->array[i]; | |
| 650 | if (iscleared(g, o)) /* value was collected? */ | |
| 651 | setnilvalue(o); /* remove value */ | |
| 652 | } | |
| 653 | for (n = gnode(h, 0); n < limit; n++) { | |
| 654 | if (!ttisnil(gval(n)) && iscleared(g, gval(n))) { | |
| 655 | setnilvalue(gval(n)); /* remove value ... */ | |
| 656 | removeentry(n); /* and remove entry from table */ | |
| 657 | } | |
| 658 | } | |
| 659 | } | |
| 644 | for (; l != f; l = gco2t(l)->gclist) { | |
| 645 | Table *h = gco2t(l); | |
| 646 | Node *n, *limit = gnodelast(h); | |
| 647 | int i; | |
| 648 | for (i = 0; i < h->sizearray; i++) { | |
| 649 | TValue *o = &h->array[i]; | |
| 650 | if (iscleared(g, o)) /* value was collected? */ | |
| 651 | setnilvalue(o); /* remove value */ | |
| 652 | } | |
| 653 | for (n = gnode(h, 0); n < limit; n++) { | |
| 654 | if (!ttisnil(gval(n)) && iscleared(g, gval(n))) { | |
| 655 | setnilvalue(gval(n)); /* remove value ... */ | |
| 656 | removeentry(n); /* and remove entry from table */ | |
| 657 | } | |
| 658 | } | |
| 659 | } | |
| 660 | 660 | } |
| 661 | 661 | |
| 662 | 662 | |
| 663 | 663 | static void freeobj (lua_State *L, GCObject *o) { |
| 664 | switch (gch(o)->tt) { | |
| 665 | case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break; | |
| 666 | case LUA_TLCL: { | |
| 667 | luaM_freemem(L, o, sizeLclosure(gco2lcl(o)->nupvalues)); | |
| 668 | break; | |
| 669 | } | |
| 670 | case LUA_TCCL: { | |
| 671 | luaM_freemem(L, o, sizeCclosure(gco2ccl(o)->nupvalues)); | |
| 672 | break; | |
| 673 | } | |
| 674 | case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break; | |
| 675 | case LUA_TTABLE: luaH_free(L, gco2t(o)); break; | |
| 676 | case LUA_TTHREAD: luaE_freethread(L, gco2th(o)); break; | |
| 677 | case LUA_TUSERDATA: luaM_freemem(L, o, sizeudata(gco2u(o))); break; | |
| 678 | case LUA_TSHRSTR: | |
| 679 | G(L)->strt.nuse--; | |
| 680 | /* go through */ | |
| 681 | case LUA_TLNGSTR: { | |
| 682 | luaM_freemem(L, o, sizestring(gco2ts(o))); | |
| 683 | break; | |
| 684 | } | |
| 685 | default: lua_assert(0); | |
| 686 | } | |
| 664 | switch (gch(o)->tt) { | |
| 665 | case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break; | |
| 666 | case LUA_TLCL: { | |
| 667 | luaM_freemem(L, o, sizeLclosure(gco2lcl(o)->nupvalues)); | |
| 668 | break; | |
| 669 | } | |
| 670 | case LUA_TCCL: { | |
| 671 | luaM_freemem(L, o, sizeCclosure(gco2ccl(o)->nupvalues)); | |
| 672 | break; | |
| 673 | } | |
| 674 | case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break; | |
| 675 | case LUA_TTABLE: luaH_free(L, gco2t(o)); break; | |
| 676 | case LUA_TTHREAD: luaE_freethread(L, gco2th(o)); break; | |
| 677 | case LUA_TUSERDATA: luaM_freemem(L, o, sizeudata(gco2u(o))); break; | |
| 678 | case LUA_TSHRSTR: | |
| 679 | G(L)->strt.nuse--; | |
| 680 | /* go through */ | |
| 681 | case LUA_TLNGSTR: { | |
| 682 | luaM_freemem(L, o, sizestring(gco2ts(o))); | |
| 683 | break; | |
| 684 | } | |
| 685 | default: lua_assert(0); | |
| 686 | } | |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | |
| 690 | #define sweepwholelist(L,p) | |
| 690 | #define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM) | |
| 691 | 691 | static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count); |
| 692 | 692 | |
| 693 | 693 | |
| r31373 | r31374 | |
| 696 | 696 | ** list of call-info structures. |
| 697 | 697 | */ |
| 698 | 698 | static void sweepthread (lua_State *L, lua_State *L1) { |
| 699 | if (L1->stack == NULL) return; /* stack not completely built yet */ | |
| 700 | sweepwholelist(L, &L1->openupval); /* sweep open upvalues */ | |
| 701 | luaE_freeCI(L1); /* free extra CallInfo slots */ | |
| 702 | /* should not change the stack during an emergency gc cycle */ | |
| 703 | if (G(L)->gckind != KGC_EMERGENCY) | |
| 704 | luaD_shrinkstack(L1); | |
| 699 | if (L1->stack == NULL) return; /* stack not completely built yet */ | |
| 700 | sweepwholelist(L, &L1->openupval); /* sweep open upvalues */ | |
| 701 | luaE_freeCI(L1); /* free extra CallInfo slots */ | |
| 702 | /* should not change the stack during an emergency gc cycle */ | |
| 703 | if (G(L)->gckind != KGC_EMERGENCY) | |
| 704 | luaD_shrinkstack(L1); | |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | |
| r31373 | r31374 | |
| 717 | 717 | ** When object is a thread, sweep its list of open upvalues too. |
| 718 | 718 | */ |
| 719 | 719 | static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { |
| 720 | global_State *g = G(L); | |
| 721 | int ow = otherwhite(g); | |
| 722 | int toclear, toset; /* bits to clear and to set in all live objects */ | |
| 723 | int tostop; /* stop sweep when this is true */ | |
| 724 | if (isgenerational(g)) { /* generational mode? */ | |
| 725 | toclear = ~0; /* clear nothing */ | |
| 726 | toset = bitmask(OLDBIT); /* set the old bit of all surviving objects */ | |
| 727 | tostop = bitmask(OLDBIT); /* do not sweep old generation */ | |
| 728 | } | |
| 729 | else { /* normal mode */ | |
| 730 | toclear = maskcolors; /* clear all color bits + old bit */ | |
| 731 | toset = luaC_white(g); /* make object white */ | |
| 732 | tostop = 0; /* do not stop */ | |
| 733 | } | |
| 734 | while (*p != NULL && count-- > 0) { | |
| 735 | GCObject *curr = *p; | |
| 736 | int marked = gch(curr)->marked; | |
| 737 | if (isdeadm(ow, marked)) { /* is 'curr' dead? */ | |
| 738 | *p = gch(curr)->next; /* remove 'curr' from list */ | |
| 739 | freeobj(L, curr); /* erase 'curr' */ | |
| 740 | } | |
| 741 | else { | |
| 742 | if (testbits(marked, tostop)) | |
| 743 | return NULL; /* stop sweeping this list */ | |
| 744 | if (gch(curr)->tt == LUA_TTHREAD) | |
| 745 | sweepthread(L, gco2th(curr)); /* sweep thread's upvalues */ | |
| 746 | /* update marks */ | |
| 747 | gch(curr)->marked = cast_byte((marked & toclear) | toset); | |
| 748 | p = &gch(curr)->next; /* go to next element */ | |
| 749 | } | |
| 750 | } | |
| 751 | return (*p == NULL) ? NULL : p; | |
| 720 | global_State *g = G(L); | |
| 721 | int ow = otherwhite(g); | |
| 722 | int toclear, toset; /* bits to clear and to set in all live objects */ | |
| 723 | int tostop; /* stop sweep when this is true */ | |
| 724 | if (isgenerational(g)) { /* generational mode? */ | |
| 725 | toclear = ~0; /* clear nothing */ | |
| 726 | toset = bitmask(OLDBIT); /* set the old bit of all surviving objects */ | |
| 727 | tostop = bitmask(OLDBIT); /* do not sweep old generation */ | |
| 728 | } | |
| 729 | else { /* normal mode */ | |
| 730 | toclear = maskcolors; /* clear all color bits + old bit */ | |
| 731 | toset = luaC_white(g); /* make object white */ | |
| 732 | tostop = 0; /* do not stop */ | |
| 733 | } | |
| 734 | while (*p != NULL && count-- > 0) { | |
| 735 | GCObject *curr = *p; | |
| 736 | int marked = gch(curr)->marked; | |
| 737 | if (isdeadm(ow, marked)) { /* is 'curr' dead? */ | |
| 738 | *p = gch(curr)->next; /* remove 'curr' from list */ | |
| 739 | freeobj(L, curr); /* erase 'curr' */ | |
| 740 | } | |
| 741 | else { | |
| 742 | if (testbits(marked, tostop)) | |
| 743 | return NULL; /* stop sweeping this list */ | |
| 744 | if (gch(curr)->tt == LUA_TTHREAD) | |
| 745 | sweepthread(L, gco2th(curr)); /* sweep thread's upvalues */ | |
| 746 | /* update marks */ | |
| 747 | gch(curr)->marked = cast_byte((marked & toclear) | toset); | |
| 748 | p = &gch(curr)->next; /* go to next element */ | |
| 749 | } | |
| 750 | } | |
| 751 | return (*p == NULL) ? NULL : p; | |
| 752 | 752 | } |
| 753 | 753 | |
| 754 | 754 | |
| r31373 | r31374 | |
| 756 | 756 | ** sweep a list until a live object (or end of list) |
| 757 | 757 | */ |
| 758 | 758 | static GCObject **sweeptolive (lua_State *L, GCObject **p, int *n) { |
| 759 | GCObject ** old = p; | |
| 760 | int i = 0; | |
| 761 | do { | |
| 762 | i++; | |
| 763 | p = sweeplist(L, p, 1); | |
| 764 | } while (p == old); | |
| 765 | if (n) *n += i; | |
| 766 | return p; | |
| 759 | GCObject ** old = p; | |
| 760 | int i = 0; | |
| 761 | do { | |
| 762 | i++; | |
| 763 | p = sweeplist(L, p, 1); | |
| 764 | } while (p == old); | |
| 765 | if (n) *n += i; | |
| 766 | return p; | |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | 769 | /* }====================================================== */ |
| r31373 | r31374 | |
| 776 | 776 | */ |
| 777 | 777 | |
| 778 | 778 | static void checkSizes (lua_State *L) { |
| 779 | global_State *g = G(L); | |
| 780 | if (g->gckind != KGC_EMERGENCY) { /* do not change sizes in emergency */ | |
| 781 | int hs = g->strt.size / 2; /* half the size of the string table */ | |
| 782 | if (g->strt.nuse < cast(lu_int32, hs)) /* using less than that half? */ | |
| 783 | luaS_resize(L, hs); /* halve its size */ | |
| 784 | luaZ_freebuffer(L, &g->buff); /* free concatenation buffer */ | |
| 785 | } | |
| 779 | global_State *g = G(L); | |
| 780 | if (g->gckind != KGC_EMERGENCY) { /* do not change sizes in emergency */ | |
| 781 | int hs = g->strt.size / 2; /* half the size of the string table */ | |
| 782 | if (g->strt.nuse < cast(lu_int32, hs)) /* using less than that half? */ | |
| 783 | luaS_resize(L, hs); /* halve its size */ | |
| 784 | luaZ_freebuffer(L, &g->buff); /* free concatenation buffer */ | |
| 785 | } | |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | |
| 789 | 789 | static GCObject *udata2finalize (global_State *g) { |
| 790 | GCObject *o = g->tobefnz; /* get first element */ | |
| 791 | lua_assert(isfinalized(o)); | |
| 792 | g->tobefnz = gch(o)->next; /* remove it from 'tobefnz' list */ | |
| 793 | gch(o)->next = g->allgc; /* return it to 'allgc' list */ | |
| 794 | g->allgc = o; | |
| 795 | resetbit(gch(o)->marked, SEPARATED); /* mark that it is not in 'tobefnz' */ | |
| 796 | lua_assert(!isold(o)); /* see MOVE OLD rule */ | |
| 797 | if (!keepinvariantout(g)) /* not keeping invariant? */ | |
| 798 | makewhite(g, o); /* "sweep" object */ | |
| 799 | return o; | |
| 790 | GCObject *o = g->tobefnz; /* get first element */ | |
| 791 | lua_assert(isfinalized(o)); | |
| 792 | g->tobefnz = gch(o)->next; /* remove it from 'tobefnz' list */ | |
| 793 | gch(o)->next = g->allgc; /* return it to 'allgc' list */ | |
| 794 | g->allgc = o; | |
| 795 | resetbit(gch(o)->marked, SEPARATED); /* mark that it is not in 'tobefnz' */ | |
| 796 | lua_assert(!isold(o)); /* see MOVE OLD rule */ | |
| 797 | if (!keepinvariantout(g)) /* not keeping invariant? */ | |
| 798 | makewhite(g, o); /* "sweep" object */ | |
| 799 | return o; | |
| 800 | 800 | } |
| 801 | 801 | |
| 802 | 802 | |
| 803 | 803 | static void dothecall (lua_State *L, void *ud) { |
| 804 | UNUSED(ud); | |
| 805 | luaD_call(L, L->top - 2, 0, 0); | |
| 804 | UNUSED(ud); | |
| 805 | luaD_call(L, L->top - 2, 0, 0); | |
| 806 | 806 | } |
| 807 | 807 | |
| 808 | 808 | |
| 809 | 809 | static void GCTM (lua_State *L, int propagateerrors) { |
| 810 | global_State *g = G(L); | |
| 811 | const TValue *tm; | |
| 812 | TValue v; | |
| 813 | setgcovalue(L, &v, udata2finalize(g)); | |
| 814 | tm = luaT_gettmbyobj(L, &v, TM_GC); | |
| 815 | if (tm != NULL && ttisfunction(tm)) { /* is there a finalizer? */ | |
| 816 | int status; | |
| 817 | lu_byte oldah = L->allowhook; | |
| 818 | int running = g->gcrunning; | |
| 819 | L->allowhook = 0; /* stop debug hooks during GC metamethod */ | |
| 820 | g->gcrunning = 0; /* avoid GC steps */ | |
| 821 | setobj2s(L, L->top, tm); /* push finalizer... */ | |
| 822 | setobj2s(L, L->top + 1, &v); /* ... and its argument */ | |
| 823 | L->top += 2; /* and (next line) call the finalizer */ | |
| 824 | status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top - 2), 0); | |
| 825 | L->allowhook = oldah; /* restore hooks */ | |
| 826 | g->gcrunning = running; /* restore state */ | |
| 827 | if (status != LUA_OK && propagateerrors) { /* error while running __gc? */ | |
| 828 | if (status == LUA_ERRRUN) { /* is there an error object? */ | |
| 829 | const char *msg = (ttisstring(L->top - 1)) | |
| 830 | ? svalue(L->top - 1) | |
| 831 | : "no message"; | |
| 832 | luaO_pushfstring(L, "error in __gc metamethod (%s)", msg); | |
| 833 | status = LUA_ERRGCMM; /* error in __gc metamethod */ | |
| 834 | } | |
| 835 | luaD_throw(L, status); /* re-throw error */ | |
| 836 | } | |
| 837 | } | |
| 810 | global_State *g = G(L); | |
| 811 | const TValue *tm; | |
| 812 | TValue v; | |
| 813 | setgcovalue(L, &v, udata2finalize(g)); | |
| 814 | tm = luaT_gettmbyobj(L, &v, TM_GC); | |
| 815 | if (tm != NULL && ttisfunction(tm)) { /* is there a finalizer? */ | |
| 816 | int status; | |
| 817 | lu_byte oldah = L->allowhook; | |
| 818 | int running = g->gcrunning; | |
| 819 | L->allowhook = 0; /* stop debug hooks during GC metamethod */ | |
| 820 | g->gcrunning = 0; /* avoid GC steps */ | |
| 821 | setobj2s(L, L->top, tm); /* push finalizer... */ | |
| 822 | setobj2s(L, L->top + 1, &v); /* ... and its argument */ | |
| 823 | L->top += 2; /* and (next line) call the finalizer */ | |
| 824 | status = luaD_pcall(L, dothecall, NULL, savestack(L, L->top - 2), 0); | |
| 825 | L->allowhook = oldah; /* restore hooks */ | |
| 826 | g->gcrunning = running; /* restore state */ | |
| 827 | if (status != LUA_OK && propagateerrors) { /* error while running __gc? */ | |
| 828 | if (status == LUA_ERRRUN) { /* is there an error object? */ | |
| 829 | const char *msg = (ttisstring(L->top - 1)) | |
| 830 | ? svalue(L->top - 1) | |
| 831 | : "no message"; | |
| 832 | luaO_pushfstring(L, "error in __gc metamethod (%s)", msg); | |
| 833 | status = LUA_ERRGCMM; /* error in __gc metamethod */ | |
| 834 | } | |
| 835 | luaD_throw(L, status); /* re-throw error */ | |
| 836 | } | |
| 837 | } | |
| 838 | 838 | } |
| 839 | 839 | |
| 840 | 840 | |
| r31373 | r31374 | |
| 843 | 843 | ** finalization from list 'finobj' to list 'tobefnz' (to be finalized) |
| 844 | 844 | */ |
| 845 | 845 | static void separatetobefnz (lua_State *L, int all) { |
| 846 | global_State *g = G(L); | |
| 847 | GCObject **p = &g->finobj; | |
| 848 | GCObject *curr; | |
| 849 | GCObject **lastnext = &g->tobefnz; | |
| 850 | /* find last 'next' field in 'tobefnz' list (to add elements in its end) */ | |
| 851 | while (*lastnext != NULL) | |
| 852 | lastnext = &gch(*lastnext)->next; | |
| 853 | while ((curr = *p) != NULL) { /* traverse all finalizable objects */ | |
| 854 | lua_assert(!isfinalized(curr)); | |
| 855 | lua_assert(testbit(gch(curr)->marked, SEPARATED)); | |
| 856 | if (!(iswhite(curr) || all)) /* not being collected? */ | |
| 857 | p = &gch(curr)->next; /* don't bother with it */ | |
| 858 | else { | |
| 859 | l_setbit(gch(curr)->marked, FINALIZEDBIT); /* won't be finalized again */ | |
| 860 | *p = gch(curr)->next; /* remove 'curr' from 'finobj' list */ | |
| 861 | gch(curr)->next = *lastnext; /* link at the end of 'tobefnz' list */ | |
| 862 | *lastnext = curr; | |
| 863 | lastnext = &gch(curr)->next; | |
| 864 | } | |
| 865 | } | |
| 846 | global_State *g = G(L); | |
| 847 | GCObject **p = &g->finobj; | |
| 848 | GCObject *curr; | |
| 849 | GCObject **lastnext = &g->tobefnz; | |
| 850 | /* find last 'next' field in 'tobefnz' list (to add elements in its end) */ | |
| 851 | while (*lastnext != NULL) | |
| 852 | lastnext = &gch(*lastnext)->next; | |
| 853 | while ((curr = *p) != NULL) { /* traverse all finalizable objects */ | |
| 854 | lua_assert(!isfinalized(curr)); | |
| 855 | lua_assert(testbit(gch(curr)->marked, SEPARATED)); | |
| 856 | if (!(iswhite(curr) || all)) /* not being collected? */ | |
| 857 | p = &gch(curr)->next; /* don't bother with it */ | |
| 858 | else { | |
| 859 | l_setbit(gch(curr)->marked, FINALIZEDBIT); /* won't be finalized again */ | |
| 860 | *p = gch(curr)->next; /* remove 'curr' from 'finobj' list */ | |
| 861 | gch(curr)->next = *lastnext; /* link at the end of 'tobefnz' list */ | |
| 862 | *lastnext = curr; | |
| 863 | lastnext = &gch(curr)->next; | |
| 864 | } | |
| 865 | } | |
| 866 | 866 | } |
| 867 | 867 | |
| 868 | 868 | |
| r31373 | r31374 | |
| 871 | 871 | ** search the list to find it) and link it in 'finobj' list. |
| 872 | 872 | */ |
| 873 | 873 | void luaC_checkfinalizer (lua_State *L, GCObject *o, Table *mt) { |
| 874 | global_State *g = G(L); | |
| 875 | if (testbit(gch(o)->marked, SEPARATED) || /* obj. is already separated... */ | |
| 876 | isfinalized(o) || /* ... or is finalized... */ | |
| 877 | gfasttm(g, mt, TM_GC) == NULL) /* or has no finalizer? */ | |
| 878 | return; /* nothing to be done */ | |
| 879 | else { /* move 'o' to 'finobj' list */ | |
| 880 | GCObject **p; | |
| 881 | GCheader *ho = gch(o); | |
| 882 | if (g->sweepgc == &ho->next) { /* avoid removing current sweep object */ | |
| 883 | lua_assert(issweepphase(g)); | |
| 884 | g->sweepgc = sweeptolive(L, g->sweepgc, NULL); | |
| 885 | } | |
| 886 | /* search for pointer pointing to 'o' */ | |
| 887 | for (p = &g->allgc; *p != o; p = &gch(*p)->next) { /* empty */ } | |
| 888 | *p = ho->next; /* remove 'o' from root list */ | |
| 889 | ho->next = g->finobj; /* link it in list 'finobj' */ | |
| 890 | g->finobj = o; | |
| 891 | l_setbit(ho->marked, SEPARATED); /* mark it as such */ | |
| 892 | if (!keepinvariantout(g)) /* not keeping invariant? */ | |
| 893 | makewhite(g, o); /* "sweep" object */ | |
| 894 | else | |
| 895 | resetoldbit(o); /* see MOVE OLD rule */ | |
| 896 | } | |
| 874 | global_State *g = G(L); | |
| 875 | if (testbit(gch(o)->marked, SEPARATED) || /* obj. is already separated... */ | |
| 876 | isfinalized(o) || /* ... or is finalized... */ | |
| 877 | gfasttm(g, mt, TM_GC) == NULL) /* or has no finalizer? */ | |
| 878 | return; /* nothing to be done */ | |
| 879 | else { /* move 'o' to 'finobj' list */ | |
| 880 | GCObject **p; | |
| 881 | GCheader *ho = gch(o); | |
| 882 | if (g->sweepgc == &ho->next) { /* avoid removing current sweep object */ | |
| 883 | lua_assert(issweepphase(g)); | |
| 884 | g->sweepgc = sweeptolive(L, g->sweepgc, NULL); | |
| 885 | } | |
| 886 | /* search for pointer pointing to 'o' */ | |
| 887 | for (p = &g->allgc; *p != o; p = &gch(*p)->next) { /* empty */ } | |
| 888 | *p = ho->next; /* remove 'o' from root list */ | |
| 889 | ho->next = g->finobj; /* link it in list 'finobj' */ | |
| 890 | g->finobj = o; | |
| 891 | l_setbit(ho->marked, SEPARATED); /* mark it as such */ | |
| 892 | if (!keepinvariantout(g)) /* not keeping invariant? */ | |
| 893 | makewhite(g, o); /* "sweep" object */ | |
| 894 | else | |
| 895 | resetoldbit(o); /* see MOVE OLD rule */ | |
| 896 | } | |
| 897 | 897 | } |
| 898 | 898 | |
| 899 | 899 | /* }====================================================== */ |
| r31373 | r31374 | |
| 911 | 911 | ** cycle will start when memory use hits threshold |
| 912 | 912 | */ |
| 913 | 913 | static void setpause (global_State *g, l_mem estimate) { |
| 914 | l_mem debt, threshold; | |
| 915 | estimate = estimate / PAUSEADJ; /* adjust 'estimate' */ | |
| 916 | threshold = (g->gcpause < MAX_LMEM / estimate) /* overflow? */ | |
| 917 | ? estimate * g->gcpause /* no overflow */ | |
| 918 | : MAX_LMEM; /* overflow; truncate to maximum */ | |
| 919 | debt = -cast(l_mem, threshold - gettotalbytes(g)); | |
| 920 | luaE_setdebt(g, debt); | |
| 914 | l_mem debt, threshold; | |
| 915 | estimate = estimate / PAUSEADJ; /* adjust 'estimate' */ | |
| 916 | threshold = (g->gcpause < MAX_LMEM / estimate) /* overflow? */ | |
| 917 | ? estimate * g->gcpause /* no overflow */ | |
| 918 | : MAX_LMEM; /* overflow; truncate to maximum */ | |
| 919 | debt = -cast(l_mem, threshold - gettotalbytes(g)); | |
| 920 | luaE_setdebt(g, debt); | |
| 921 | 921 | } |
| 922 | 922 | |
| 923 | 923 | |
| r31373 | r31374 | |
| 934 | 934 | ** Returns how many objects it swept. |
| 935 | 935 | */ |
| 936 | 936 | static int entersweep (lua_State *L) { |
| 937 | global_State *g = G(L); | |
| 938 | int n = 0; | |
| 939 | g->gcstate = GCSsweepstring; | |
| 940 | lua_assert(g->sweepgc == NULL && g->sweepfin == NULL); | |
| 941 | /* prepare to sweep strings, finalizable objects, and regular objects */ | |
| 942 | g->sweepstrgc = 0; | |
| 943 | g->sweepfin = sweeptolive(L, &g->finobj, &n); | |
| 944 | g->sweepgc = sweeptolive(L, &g->allgc, &n); | |
| 945 | return n; | |
| 937 | global_State *g = G(L); | |
| 938 | int n = 0; | |
| 939 | g->gcstate = GCSsweepstring; | |
| 940 | lua_assert(g->sweepgc == NULL && g->sweepfin == NULL); | |
| 941 | /* prepare to sweep strings, finalizable objects, and regular objects */ | |
| 942 | g->sweepstrgc = 0; | |
| 943 | g->sweepfin = sweeptolive(L, &g->finobj, &n); | |
| 944 | g->sweepgc = sweeptolive(L, &g->allgc, &n); | |
| 945 | return n; | |
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | |
| r31373 | r31374 | |
| 950 | 950 | ** change GC mode |
| 951 | 951 | */ |
| 952 | 952 | void luaC_changemode (lua_State *L, int mode) { |
| 953 | global_State *g = G(L); | |
| 954 | if (mode == g->gckind) return; /* nothing to change */ | |
| 955 | if (mode == KGC_GEN) { /* change to generational mode */ | |
| 956 | /* make sure gray lists are consistent */ | |
| 957 | luaC_runtilstate(L, bitmask(GCSpropagate)); | |
| 958 | g->GCestimate = gettotalbytes(g); | |
| 959 | g->gckind = KGC_GEN; | |
| 960 | } | |
| 961 | else { /* change to incremental mode */ | |
| 962 | /* sweep all objects to turn them back to white | |
| 963 | (as white has not changed, nothing extra will be collected) */ | |
| 964 | g->gckind = KGC_NORMAL; | |
| 965 | entersweep(L); | |
| 966 | luaC_runtilstate(L, ~sweepphases); | |
| 967 | } | |
| 953 | global_State *g = G(L); | |
| 954 | if (mode == g->gckind) return; /* nothing to change */ | |
| 955 | if (mode == KGC_GEN) { /* change to generational mode */ | |
| 956 | /* make sure gray lists are consistent */ | |
| 957 | luaC_runtilstate(L, bitmask(GCSpropagate)); | |
| 958 | g->GCestimate = gettotalbytes(g); | |
| 959 | g->gckind = KGC_GEN; | |
| 960 | } | |
| 961 | else { /* change to incremental mode */ | |
| 962 | /* sweep all objects to turn them back to white | |
| 963 | (as white has not changed, nothing extra will be collected) */ | |
| 964 | g->gckind = KGC_NORMAL; | |
| 965 | entersweep(L); | |
| 966 | luaC_runtilstate(L, ~sweepphases); | |
| 967 | } | |
| 968 | 968 | } |
| 969 | 969 | |
| 970 | 970 | |
| r31373 | r31374 | |
| 972 | 972 | ** call all pending finalizers |
| 973 | 973 | */ |
| 974 | 974 | static void callallpendingfinalizers (lua_State *L, int propagateerrors) { |
| 975 | global_State *g = G(L); | |
| 976 | while (g->tobefnz) { | |
| 977 | resetoldbit(g->tobefnz); | |
| 978 | GCTM(L, propagateerrors); | |
| 979 | } | |
| 975 | global_State *g = G(L); | |
| 976 | while (g->tobefnz) { | |
| 977 | resetoldbit(g->tobefnz); | |
| 978 | GCTM(L, propagateerrors); | |
| 979 | } | |
| 980 | 980 | } |
| 981 | 981 | |
| 982 | 982 | |
| 983 | 983 | void luaC_freeallobjects (lua_State *L) { |
| 984 | global_State *g = G(L); | |
| 985 | int i; | |
| 986 | separatetobefnz(L, 1); /* separate all objects with finalizers */ | |
| 987 | lua_assert(g->finobj == NULL); | |
| 988 | callallpendingfinalizers(L, 0); | |
| 989 | g->currentwhite = WHITEBITS; /* this "white" makes all objects look dead */ | |
| 990 | g->gckind = KGC_NORMAL; | |
| 991 | sweepwholelist(L, &g->finobj); /* finalizers can create objs. in 'finobj' */ | |
| 992 | sweepwholelist(L, &g->allgc); | |
| 993 | for (i = 0; i < g->strt.size; i++) /* free all string lists */ | |
| 994 | sweepwholelist(L, &g->strt.hash[i]); | |
| 995 | lua_assert(g->strt.nuse == 0); | |
| 984 | global_State *g = G(L); | |
| 985 | int i; | |
| 986 | separatetobefnz(L, 1); /* separate all objects with finalizers */ | |
| 987 | lua_assert(g->finobj == NULL); | |
| 988 | callallpendingfinalizers(L, 0); | |
| 989 | g->currentwhite = WHITEBITS; /* this "white" makes all objects look dead */ | |
| 990 | g->gckind = KGC_NORMAL; | |
| 991 | sweepwholelist(L, &g->finobj); /* finalizers can create objs. in 'finobj' */ | |
| 992 | sweepwholelist(L, &g->allgc); | |
| 993 | for (i = 0; i < g->strt.size; i++) /* free all string lists */ | |
| 994 | sweepwholelist(L, &g->strt.hash[i]); | |
| 995 | lua_assert(g->strt.nuse == 0); | |
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | |
| 999 | 999 | static l_mem atomic (lua_State *L) { |
| 1000 | global_State *g = G(L); | |
| 1001 | l_mem work = -cast(l_mem, g->GCmemtrav); /* start counting work */ | |
| 1002 | GCObject *origweak, *origall; | |
| 1003 | lua_assert(!iswhite(obj2gco(g->mainthread))); | |
| 1004 | markobject(g, L); /* mark running thread */ | |
| 1005 | /* registry and global metatables may be changed by API */ | |
| 1006 | markvalue(g, &g->l_registry); | |
| 1007 | markmt(g); /* mark basic metatables */ | |
| 1008 | /* remark occasional upvalues of (maybe) dead threads */ | |
| 1009 | remarkupvals(g); | |
| 1010 | propagateall(g); /* propagate changes */ | |
| 1011 | work += g->GCmemtrav; /* stop counting (do not (re)count grays) */ | |
| 1012 | /* traverse objects caught by write barrier and by 'remarkupvals' */ | |
| 1013 | retraversegrays(g); | |
| 1014 | work -= g->GCmemtrav; /* restart counting */ | |
| 1015 | convergeephemerons(g); | |
| 1016 | /* at this point, all strongly accessible objects are marked. */ | |
| 1017 | /* clear values from weak tables, before checking finalizers */ | |
| 1018 | clearvalues(g, g->weak, NULL); | |
| 1019 | clearvalues(g, g->allweak, NULL); | |
| 1020 | origweak = g->weak; origall = g->allweak; | |
| 1021 | work += g->GCmemtrav; /* stop counting (objects being finalized) */ | |
| 1022 | separatetobefnz(L, 0); /* separate objects to be finalized */ | |
| 1023 | markbeingfnz(g); /* mark objects that will be finalized */ | |
| 1024 | propagateall(g); /* remark, to propagate `preserveness' */ | |
| 1025 | work -= g->GCmemtrav; /* restart counting */ | |
| 1026 | convergeephemerons(g); | |
| 1027 | /* at this point, all resurrected objects are marked. */ | |
| 1028 | /* remove dead objects from weak tables */ | |
| 1029 | clearkeys(g, g->ephemeron, NULL); /* clear keys from all ephemeron tables */ | |
| 1030 | clearkeys(g, g->allweak, NULL); /* clear keys from all allweak tables */ | |
| 1031 | /* clear values from resurrected weak tables */ | |
| 1032 | clearvalues(g, g->weak, origweak); | |
| 1033 | clearvalues(g, g->allweak, origall); | |
| 1034 | g->currentwhite = cast_byte(otherwhite(g)); /* flip current white */ | |
| 1035 | work += g->GCmemtrav; /* complete counting */ | |
| 1036 | return work; /* estimate of memory marked by 'atomic' */ | |
| 1000 | global_State *g = G(L); | |
| 1001 | l_mem work = -cast(l_mem, g->GCmemtrav); /* start counting work */ | |
| 1002 | GCObject *origweak, *origall; | |
| 1003 | lua_assert(!iswhite(obj2gco(g->mainthread))); | |
| 1004 | markobject(g, L); /* mark running thread */ | |
| 1005 | /* registry and global metatables may be changed by API */ | |
| 1006 | markvalue(g, &g->l_registry); | |
| 1007 | markmt(g); /* mark basic metatables */ | |
| 1008 | /* remark occasional upvalues of (maybe) dead threads */ | |
| 1009 | remarkupvals(g); | |
| 1010 | propagateall(g); /* propagate changes */ | |
| 1011 | work += g->GCmemtrav; /* stop counting (do not (re)count grays) */ | |
| 1012 | /* traverse objects caught by write barrier and by 'remarkupvals' */ | |
| 1013 | retraversegrays(g); | |
| 1014 | work -= g->GCmemtrav; /* restart counting */ | |
| 1015 | convergeephemerons(g); | |
| 1016 | /* at this point, all strongly accessible objects are marked. */ | |
| 1017 | /* clear values from weak tables, before checking finalizers */ | |
| 1018 | clearvalues(g, g->weak, NULL); | |
| 1019 | clearvalues(g, g->allweak, NULL); | |
| 1020 | origweak = g->weak; origall = g->allweak; | |
| 1021 | work += g->GCmemtrav; /* stop counting (objects being finalized) */ | |
| 1022 | separatetobefnz(L, 0); /* separate objects to be finalized */ | |
| 1023 | markbeingfnz(g); /* mark objects that will be finalized */ | |
| 1024 | propagateall(g); /* remark, to propagate `preserveness' */ | |
| 1025 | work -= g->GCmemtrav; /* restart counting */ | |
| 1026 | convergeephemerons(g); | |
| 1027 | /* at this point, all resurrected objects are marked. */ | |
| 1028 | /* remove dead objects from weak tables */ | |
| 1029 | clearkeys(g, g->ephemeron, NULL); /* clear keys from all ephemeron tables */ | |
| 1030 | clearkeys(g, g->allweak, NULL); /* clear keys from all allweak tables */ | |
| 1031 | /* clear values from resurrected weak tables */ | |
| 1032 | clearvalues(g, g->weak, origweak); | |
| 1033 | clearvalues(g, g->allweak, origall); | |
| 1034 | g->currentwhite = cast_byte(otherwhite(g)); /* flip current white */ | |
| 1035 | work += g->GCmemtrav; /* complete counting */ | |
| 1036 | return work; /* estimate of memory marked by 'atomic' */ | |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | |
| 1040 | 1040 | static lu_mem singlestep (lua_State *L) { |
| 1041 | global_State *g = G(L); | |
| 1042 | switch (g->gcstate) { | |
| 1043 | case GCSpause: { | |
| 1044 | /* start to count memory traversed */ | |
| 1045 | g->GCmemtrav = g->strt.size * sizeof(GCObject*); | |
| 1046 | lua_assert(!isgenerational(g)); | |
| 1047 | restartcollection(g); | |
| 1048 | g->gcstate = GCSpropagate; | |
| 1049 | return g->GCmemtrav; | |
| 1050 | } | |
| 1051 | case GCSpropagate: { | |
| 1052 | if (g->gray) { | |
| 1053 | lu_mem oldtrav = g->GCmemtrav; | |
| 1054 | propagatemark(g); | |
| 1055 | return g->GCmemtrav - oldtrav; /* memory traversed in this step */ | |
| 1056 | } | |
| 1057 | else { /* no more `gray' objects */ | |
| 1058 | lu_mem work; | |
| 1059 | int sw; | |
| 1060 | g->gcstate = GCSatomic; /* finish mark phase */ | |
| 1061 | g->GCestimate = g->GCmemtrav; /* save what was counted */; | |
| 1062 | work = atomic(L); /* add what was traversed by 'atomic' */ | |
| 1063 | g->GCestimate += work; /* estimate of total memory traversed */ | |
| 1064 | sw = entersweep(L); | |
| 1065 | return work + sw * GCSWEEPCOST; | |
| 1066 | } | |
| 1067 | } | |
| 1068 | case GCSsweepstring: { | |
| 1069 | int i; | |
| 1070 | for (i = 0; i < GCSWEEPMAX && g->sweepstrgc + i < g->strt.size; i++) | |
| 1071 | sweepwholelist(L, &g->strt.hash[g->sweepstrgc + i]); | |
| 1072 | g->sweepstrgc += i; | |
| 1073 | if (g->sweepstrgc >= g->strt.size) /* no more strings to sweep? */ | |
| 1074 | g->gcstate = GCSsweepudata; | |
| 1075 | return i * GCSWEEPCOST; | |
| 1076 | } | |
| 1077 | case GCSsweepudata: { | |
| 1078 | if (g->sweepfin) { | |
| 1079 | g->sweepfin = sweeplist(L, g->sweepfin, GCSWEEPMAX); | |
| 1080 | return GCSWEEPMAX*GCSWEEPCOST; | |
| 1081 | } | |
| 1082 | else { | |
| 1083 | g->gcstate = GCSsweep; | |
| 1084 | return 0; | |
| 1085 | } | |
| 1086 | } | |
| 1087 | case GCSsweep: { | |
| 1088 | if (g->sweepgc) { | |
| 1089 | g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); | |
| 1090 | return GCSWEEPMAX*GCSWEEPCOST; | |
| 1091 | } | |
| 1092 | else { | |
| 1093 | /* sweep main thread */ | |
| 1094 | GCObject *mt = obj2gco(g->mainthread); | |
| 1095 | sweeplist(L, &mt, 1); | |
| 1096 | checkSizes(L); | |
| 1097 | g->gcstate = GCSpause; /* finish collection */ | |
| 1098 | return GCSWEEPCOST; | |
| 1099 | } | |
| 1100 | } | |
| 1101 | default: lua_assert(0); return 0; | |
| 1102 | } | |
| 1041 | global_State *g = G(L); | |
| 1042 | switch (g->gcstate) { | |
| 1043 | case GCSpause: { | |
| 1044 | /* start to count memory traversed */ | |
| 1045 | g->GCmemtrav = g->strt.size * sizeof(GCObject*); | |
| 1046 | lua_assert(!isgenerational(g)); | |
| 1047 | restartcollection(g); | |
| 1048 | g->gcstate = GCSpropagate; | |
| 1049 | return g->GCmemtrav; | |
| 1050 | } | |
| 1051 | case GCSpropagate: { | |
| 1052 | if (g->gray) { | |
| 1053 | lu_mem oldtrav = g->GCmemtrav; | |
| 1054 | propagatemark(g); | |
| 1055 | return g->GCmemtrav - oldtrav; /* memory traversed in this step */ | |
| 1056 | } | |
| 1057 | else { /* no more `gray' objects */ | |
| 1058 | lu_mem work; | |
| 1059 | int sw; | |
| 1060 | g->gcstate = GCSatomic; /* finish mark phase */ | |
| 1061 | g->GCestimate = g->GCmemtrav; /* save what was counted */; | |
| 1062 | work = atomic(L); /* add what was traversed by 'atomic' */ | |
| 1063 | g->GCestimate += work; /* estimate of total memory traversed */ | |
| 1064 | sw = entersweep(L); | |
| 1065 | return work + sw * GCSWEEPCOST; | |
| 1066 | } | |
| 1067 | } | |
| 1068 | case GCSsweepstring: { | |
| 1069 | int i; | |
| 1070 | for (i = 0; i < GCSWEEPMAX && g->sweepstrgc + i < g->strt.size; i++) | |
| 1071 | sweepwholelist(L, &g->strt.hash[g->sweepstrgc + i]); | |
| 1072 | g->sweepstrgc += i; | |
| 1073 | if (g->sweepstrgc >= g->strt.size) /* no more strings to sweep? */ | |
| 1074 | g->gcstate = GCSsweepudata; | |
| 1075 | return i * GCSWEEPCOST; | |
| 1076 | } | |
| 1077 | case GCSsweepudata: { | |
| 1078 | if (g->sweepfin) { | |
| 1079 | g->sweepfin = sweeplist(L, g->sweepfin, GCSWEEPMAX); | |
| 1080 | return GCSWEEPMAX*GCSWEEPCOST; | |
| 1081 | } | |
| 1082 | else { | |
| 1083 | g->gcstate = GCSsweep; | |
| 1084 | return 0; | |
| 1085 | } | |
| 1086 | } | |
| 1087 | case GCSsweep: { | |
| 1088 | if (g->sweepgc) { | |
| 1089 | g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); | |
| 1090 | return GCSWEEPMAX*GCSWEEPCOST; | |
| 1091 | } | |
| 1092 | else { | |
| 1093 | /* sweep main thread */ | |
| 1094 | GCObject *mt = obj2gco(g->mainthread); | |
| 1095 | sweeplist(L, &mt, 1); | |
| 1096 | checkSizes(L); | |
| 1097 | g->gcstate = GCSpause; /* finish collection */ | |
| 1098 | return GCSWEEPCOST; | |
| 1099 | } | |
| 1100 | } | |
| 1101 | default: lua_assert(0); return 0; | |
| 1102 | } | |
| 1103 | 1103 | } |
| 1104 | 1104 | |
| 1105 | 1105 | |
| r31373 | r31374 | |
| 1108 | 1108 | ** by 'statemask' |
| 1109 | 1109 | */ |
| 1110 | 1110 | void luaC_runtilstate (lua_State *L, int statesmask) { |
| 1111 | global_State *g = G(L); | |
| 1112 | while (!testbit(statesmask, g->gcstate)) | |
| 1113 | singlestep(L); | |
| 1111 | global_State *g = G(L); | |
| 1112 | while (!testbit(statesmask, g->gcstate)) | |
| 1113 | singlestep(L); | |
| 1114 | 1114 | } |
| 1115 | 1115 | |
| 1116 | 1116 | |
| 1117 | 1117 | static void generationalcollection (lua_State *L) { |
| 1118 | global_State *g = G(L); | |
| 1119 | lua_assert(g->gcstate == GCSpropagate); | |
| 1120 | if (g->GCestimate == 0) { /* signal for another major collection? */ | |
| 1121 | luaC_fullgc(L, 0); /* perform a full regular collection */ | |
| 1122 | g->GCestimate = gettotalbytes(g); /* update control */ | |
| 1123 | } | |
| 1124 | else { | |
| 1125 | lu_mem estimate = g->GCestimate; | |
| 1126 | luaC_runtilstate(L, bitmask(GCSpause)); /* run complete (minor) cycle */ | |
| 1127 | g->gcstate = GCSpropagate; /* skip restart */ | |
| 1128 | if (gettotalbytes(g) > (estimate / 100) * g->gcmajorinc) | |
| 1129 | g->GCestimate = 0; /* signal for a major collection */ | |
| 1130 | else | |
| 1131 | g->GCestimate = estimate; /* keep estimate from last major coll. */ | |
| 1118 | global_State *g = G(L); | |
| 1119 | lua_assert(g->gcstate == GCSpropagate); | |
| 1120 | if (g->GCestimate == 0) { /* signal for another major collection? */ | |
| 1121 | luaC_fullgc(L, 0); /* perform a full regular collection */ | |
| 1122 | g->GCestimate = gettotalbytes(g); /* update control */ | |
| 1123 | } | |
| 1124 | else { | |
| 1125 | lu_mem estimate = g->GCestimate; | |
| 1126 | luaC_runtilstate(L, bitmask(GCSpause)); /* run complete (minor) cycle */ | |
| 1127 | g->gcstate = GCSpropagate; /* skip restart */ | |
| 1128 | if (gettotalbytes(g) > (estimate / 100) * g->gcmajorinc) | |
| 1129 | g->GCestimate = 0; /* signal for a major collection */ | |
| 1130 | else | |
| 1131 | g->GCestimate = estimate; /* keep estimate from last major coll. */ | |
| 1132 | 1132 | |
| 1133 | } | |
| 1134 | setpause(g, gettotalbytes(g)); | |
| 1135 | lua_assert(g->gcstate == GCSpropagate); | |
| 1133 | } | |
| 1134 | setpause(g, gettotalbytes(g)); | |
| 1135 | lua_assert(g->gcstate == GCSpropagate); | |
| 1136 | 1136 | } |
| 1137 | 1137 | |
| 1138 | 1138 | |
| 1139 | 1139 | static void incstep (lua_State *L) { |
| 1140 | global_State *g = G(L); | |
| 1141 | l_mem debt = g->GCdebt; | |
| 1142 | int stepmul = g->gcstepmul; | |
| 1143 | if (stepmul < 40) stepmul = 40; /* avoid ridiculous low values (and 0) */ | |
| 1144 | /* convert debt from Kb to 'work units' (avoid zero debt and overflows) */ | |
| 1145 | debt = (debt / STEPMULADJ) + 1; | |
| 1146 | debt = (debt < MAX_LMEM / stepmul) ? debt * stepmul : MAX_LMEM; | |
| 1147 | do { /* always perform at least one single step */ | |
| 1148 | lu_mem work = singlestep(L); /* do some work */ | |
| 1149 | debt -= work; | |
| 1150 | } while (debt > -GCSTEPSIZE && g->gcstate != GCSpause); | |
| 1151 | if (g->gcstate == GCSpause) | |
| 1152 | setpause(g, g->GCestimate); /* pause until next cycle */ | |
| 1153 | else { | |
| 1154 | debt = (debt / stepmul) * STEPMULADJ; /* convert 'work units' to Kb */ | |
| 1155 | luaE_setdebt(g, debt); | |
| 1156 | } | |
| 1140 | global_State *g = G(L); | |
| 1141 | l_mem debt = g->GCdebt; | |
| 1142 | int stepmul = g->gcstepmul; | |
| 1143 | if (stepmul < 40) stepmul = 40; /* avoid ridiculous low values (and 0) */ | |
| 1144 | /* convert debt from Kb to 'work units' (avoid zero debt and overflows) */ | |
| 1145 | debt = (debt / STEPMULADJ) + 1; | |
| 1146 | debt = (debt < MAX_LMEM / stepmul) ? debt * stepmul : MAX_LMEM; | |
| 1147 | do { /* always perform at least one single step */ | |
| 1148 | lu_mem work = singlestep(L); /* do some work */ | |
| 1149 | debt -= work; | |
| 1150 | } while (debt > -GCSTEPSIZE && g->gcstate != GCSpause); | |
| 1151 | if (g->gcstate == GCSpause) | |
| 1152 | setpause(g, g->GCestimate); /* pause until next cycle */ | |
| 1153 | else { | |
| 1154 | debt = (debt / stepmul) * STEPMULADJ; /* convert 'work units' to Kb */ | |
| 1155 | luaE_setdebt(g, debt); | |
| 1156 | } | |
| 1157 | 1157 | } |
| 1158 | 1158 | |
| 1159 | 1159 | |
| r31373 | r31374 | |
| 1161 | 1161 | ** performs a basic GC step |
| 1162 | 1162 | */ |
| 1163 | 1163 | void luaC_forcestep (lua_State *L) { |
| 1164 | global_State *g = G(L); | |
| 1165 | int i; | |
| 1166 | if (isgenerational(g)) generationalcollection(L); | |
| 1167 | else incstep(L); | |
| 1168 | /* run a few finalizers (or all of them at the end of a collect cycle) */ | |
| 1169 | for (i = 0; g->tobefnz && (i < GCFINALIZENUM || g->gcstate == GCSpause); i++) | |
| 1170 | GCTM(L, 1); /* call one finalizer */ | |
| 1164 | global_State *g = G(L); | |
| 1165 | int i; | |
| 1166 | if (isgenerational(g)) generationalcollection(L); | |
| 1167 | else incstep(L); | |
| 1168 | /* run a few finalizers (or all of them at the end of a collect cycle) */ | |
| 1169 | for (i = 0; g->tobefnz && (i < GCFINALIZENUM || g->gcstate == GCSpause); i++) | |
| 1170 | GCTM(L, 1); /* call one finalizer */ | |
| 1171 | 1171 | } |
| 1172 | 1172 | |
| 1173 | 1173 | |
| r31373 | r31374 | |
| 1175 | 1175 | ** performs a basic GC step only if collector is running |
| 1176 | 1176 | */ |
| 1177 | 1177 | void luaC_step (lua_State *L) { |
| 1178 | global_State *g = G(L); | |
| 1179 | if (g->gcrunning) luaC_forcestep(L); | |
| 1180 | else luaE_setdebt(g, -GCSTEPSIZE); /* avoid being called too often */ | |
| 1178 | global_State *g = G(L); | |
| 1179 | if (g->gcrunning) luaC_forcestep(L); | |
| 1180 | else luaE_setdebt(g, -GCSTEPSIZE); /* avoid being called too often */ | |
| 1181 | 1181 | } |
| 1182 | 1182 | |
| 1183 | 1183 | |
| r31373 | r31374 | |
| 1187 | 1187 | ** finalizers (which could change stack positions) |
| 1188 | 1188 | */ |
| 1189 | 1189 | void luaC_fullgc (lua_State *L, int isemergency) { |
| 1190 | global_State *g = G(L); | |
| 1191 | int origkind = g->gckind; | |
| 1192 | lua_assert(origkind != KGC_EMERGENCY); | |
| 1193 | if (isemergency) /* do not run finalizers during emergency GC */ | |
| 1194 | g->gckind = KGC_EMERGENCY; | |
| 1195 | else { | |
| 1196 | g->gckind = KGC_NORMAL; | |
| 1197 | callallpendingfinalizers(L, 1); | |
| 1198 | } | |
| 1199 | if (keepinvariant(g)) { /* may there be some black objects? */ | |
| 1200 | /* must sweep all objects to turn them back to white | |
| 1201 | (as white has not changed, nothing will be collected) */ | |
| 1202 | entersweep(L); | |
| 1203 | } | |
| 1204 | /* finish any pending sweep phase to start a new cycle */ | |
| 1205 | luaC_runtilstate(L, bitmask(GCSpause)); | |
| 1206 | luaC_runtilstate(L, ~bitmask(GCSpause)); /* start new collection */ | |
| 1207 | luaC_runtilstate(L, bitmask(GCSpause)); /* run entire collection */ | |
| 1208 | if (origkind == KGC_GEN) { /* generational mode? */ | |
| 1209 | /* generational mode must be kept in propagate phase */ | |
| 1210 | luaC_runtilstate(L, bitmask(GCSpropagate)); | |
| 1211 | } | |
| 1212 | g->gckind = origkind; | |
| 1213 | setpause(g, gettotalbytes(g)); | |
| 1214 | if (!isemergency) /* do not run finalizers during emergency GC */ | |
| 1215 | callallpendingfinalizers(L, 1); | |
| 1190 | global_State *g = G(L); | |
| 1191 | int origkind = g->gckind; | |
| 1192 | lua_assert(origkind != KGC_EMERGENCY); | |
| 1193 | if (isemergency) /* do not run finalizers during emergency GC */ | |
| 1194 | g->gckind = KGC_EMERGENCY; | |
| 1195 | else { | |
| 1196 | g->gckind = KGC_NORMAL; | |
| 1197 | callallpendingfinalizers(L, 1); | |
| 1198 | } | |
| 1199 | if (keepinvariant(g)) { /* may there be some black objects? */ | |
| 1200 | /* must sweep all objects to turn them back to white | |
| 1201 | (as white has not changed, nothing will be collected) */ | |
| 1202 | entersweep(L); | |
| 1203 | } | |
| 1204 | /* finish any pending sweep phase to start a new cycle */ | |
| 1205 | luaC_runtilstate(L, bitmask(GCSpause)); | |
| 1206 | luaC_runtilstate(L, ~bitmask(GCSpause)); /* start new collection */ | |
| 1207 | luaC_runtilstate(L, bitmask(GCSpause)); /* run entire collection */ | |
| 1208 | if (origkind == KGC_GEN) { /* generational mode? */ | |
| 1209 | /* generational mode must be kept in propagate phase */ | |
| 1210 | luaC_runtilstate(L, bitmask(GCSpropagate)); | |
| 1211 | } | |
| 1212 | g->gckind = origkind; | |
| 1213 | setpause(g, gettotalbytes(g)); | |
| 1214 | if (!isemergency) /* do not run finalizers during emergency GC */ | |
| 1215 | callallpendingfinalizers(L, 1); | |
| 1216 | 1216 | } |
| 1217 | 1217 | |
| 1218 | 1218 | /* }====================================================== */ |
| 1219 | ||
| 1220 |
| r31373 | r31374 | |
|---|---|---|
| 35 | 35 | ** variables that Lua check to set its paths. |
| 36 | 36 | */ |
| 37 | 37 | #if !defined(LUA_PATH) |
| 38 | #define LUA_PATH | |
| 38 | #define LUA_PATH "LUA_PATH" | |
| 39 | 39 | #endif |
| 40 | 40 | |
| 41 | 41 | #if !defined(LUA_CPATH) |
| 42 | #define LUA_CPATH | |
| 42 | #define LUA_CPATH "LUA_CPATH" | |
| 43 | 43 | #endif |
| 44 | 44 | |
| 45 | #define LUA_PATHSUFFIX | |
| 45 | #define LUA_PATHSUFFIX "_" LUA_VERSION_MAJOR "_" LUA_VERSION_MINOR | |
| 46 | 46 | |
| 47 | #define LUA_PATHVERSION LUA_PATH LUA_PATHSUFFIX | |
| 48 | #define LUA_CPATHVERSION LUA_CPATH LUA_PATHSUFFIX | |
| 47 | #define LUA_PATHVERSION LUA_PATH LUA_PATHSUFFIX | |
| 48 | #define LUA_CPATHVERSION LUA_CPATH LUA_PATHSUFFIX | |
| 49 | 49 | |
| 50 | 50 | /* |
| 51 | 51 | ** LUA_PATH_SEP is the character that separates templates in a path. |
| r31373 | r31374 | |
| 57 | 57 | ** luaopen_ function name. |
| 58 | 58 | */ |
| 59 | 59 | #if !defined (LUA_PATH_SEP) |
| 60 | #define LUA_PATH_SEP | |
| 60 | #define LUA_PATH_SEP ";" | |
| 61 | 61 | #endif |
| 62 | 62 | #if !defined (LUA_PATH_MARK) |
| 63 | #define LUA_PATH_MARK | |
| 63 | #define LUA_PATH_MARK "?" | |
| 64 | 64 | #endif |
| 65 | 65 | #if !defined (LUA_EXEC_DIR) |
| 66 | #define LUA_EXEC_DIR | |
| 66 | #define LUA_EXEC_DIR "!" | |
| 67 | 67 | #endif |
| 68 | 68 | #if !defined (LUA_IGMARK) |
| 69 | #define LUA_IGMARK | |
| 69 | #define LUA_IGMARK "-" | |
| 70 | 70 | #endif |
| 71 | 71 | |
| 72 | 72 | |
| r31373 | r31374 | |
| 77 | 77 | ** when searching for a Lua loader. |
| 78 | 78 | */ |
| 79 | 79 | #if !defined(LUA_CSUBSEP) |
| 80 | #define LUA_CSUBSEP | |
| 80 | #define LUA_CSUBSEP LUA_DIRSEP | |
| 81 | 81 | #endif |
| 82 | 82 | |
| 83 | 83 | #if !defined(LUA_LSUBSEP) |
| 84 | #define LUA_LSUBSEP | |
| 84 | #define LUA_LSUBSEP LUA_DIRSEP | |
| 85 | 85 | #endif |
| 86 | 86 | |
| 87 | 87 | |
| 88 | 88 | /* prefix for open functions in C libraries */ |
| 89 | #define LUA_POF | |
| 89 | #define LUA_POF "luaopen_" | |
| 90 | 90 | |
| 91 | 91 | /* separator for open functions in C libraries */ |
| 92 | #define LUA_OFSEP | |
| 92 | #define LUA_OFSEP "_" | |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | /* table (in the registry) that keeps handles for all loaded C libraries */ |
| 96 | #define CLIBS | |
| 96 | #define CLIBS "_CLIBS" | |
| 97 | 97 | |
| 98 | #define LIB_FAIL | |
| 98 | #define LIB_FAIL "open" | |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | /* error codes for ll_loadfunc */ |
| 102 | #define ERRLIB 1 | |
| 103 | #define ERRFUNC 2 | |
| 102 | #define ERRLIB 1 | |
| 103 | #define ERRFUNC 2 | |
| 104 | 104 | |
| 105 | #define setprogdir(L) | |
| 105 | #define setprogdir(L) ((void)0) | |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | /* |
| r31373 | r31374 | |
| 127 | 127 | #include <dlfcn.h> |
| 128 | 128 | |
| 129 | 129 | static void ll_unloadlib (void *lib) { |
| 130 | ||
| 130 | dlclose(lib); | |
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | |
| 134 | 134 | static void *ll_load (lua_State *L, const char *path, int seeglb) { |
| 135 | void *lib = dlopen(path, RTLD_NOW | (seeglb ? RTLD_GLOBAL : RTLD_LOCAL)); | |
| 136 | if (lib == NULL) lua_pushstring(L, dlerror()); | |
| 137 | return lib; | |
| 135 | void *lib = dlopen(path, RTLD_NOW | (seeglb ? RTLD_GLOBAL : RTLD_LOCAL)); | |
| 136 | if (lib == NULL) lua_pushstring(L, dlerror()); | |
| 137 | return lib; | |
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | |
| 141 | 141 | static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { |
| 142 | lua_CFunction f = (lua_CFunction)dlsym(lib, sym); | |
| 143 | if (f == NULL) lua_pushstring(L, dlerror()); | |
| 144 | return f; | |
| 142 | lua_CFunction f = (lua_CFunction)dlsym(lib, sym); | |
| 143 | if (f == NULL) lua_pushstring(L, dlerror()); | |
| 144 | return f; | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | /* }====================================================== */ |
| r31373 | r31374 | |
| 161 | 161 | ** optional flags for LoadLibraryEx |
| 162 | 162 | */ |
| 163 | 163 | #if !defined(LUA_LLE_FLAGS) |
| 164 | #define LUA_LLE_FLAGS | |
| 164 | #define LUA_LLE_FLAGS 0 | |
| 165 | 165 | #endif |
| 166 | 166 | |
| 167 | 167 | |
| 168 | 168 | static void setprogdir (lua_State *L) { |
| 169 | char buff[MAX_PATH + 1]; | |
| 170 | char *lb; | |
| 171 | DWORD nsize = sizeof(buff)/sizeof(char); | |
| 172 | DWORD n = GetModuleFileNameA(NULL, buff, nsize); | |
| 173 | if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) | |
| 174 | luaL_error(L, "unable to get ModuleFileName"); | |
| 175 | else { | |
| 176 | *lb = '\0'; | |
| 177 | luaL_gsub(L, lua_tostring(L, -1), LUA_EXEC_DIR, buff); | |
| 178 | lua_remove(L, -2); /* remove original string */ | |
| 179 | } | |
| 169 | char buff[MAX_PATH + 1]; | |
| 170 | char *lb; | |
| 171 | DWORD nsize = sizeof(buff)/sizeof(char); | |
| 172 | DWORD n = GetModuleFileNameA(NULL, buff, nsize); | |
| 173 | if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) | |
| 174 | luaL_error(L, "unable to get ModuleFileName"); | |
| 175 | else { | |
| 176 | *lb = '\0'; | |
| 177 | luaL_gsub(L, lua_tostring(L, -1), LUA_EXEC_DIR, buff); | |
| 178 | lua_remove(L, -2); /* remove original string */ | |
| 179 | } | |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
| 183 | 183 | static void pusherror (lua_State *L) { |
| 184 | int error = GetLastError(); | |
| 185 | char buffer[128]; | |
| 186 | if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, | |
| 187 | NULL, error, 0, buffer, sizeof(buffer)/sizeof(char), NULL)) | |
| 188 | lua_pushstring(L, buffer); | |
| 189 | else | |
| 190 | lua_pushfstring(L, "system error %d\n", error); | |
| 184 | int error = GetLastError(); | |
| 185 | char buffer[128]; | |
| 186 | if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, | |
| 187 | NULL, error, 0, buffer, sizeof(buffer)/sizeof(char), NULL)) | |
| 188 | lua_pushstring(L, buffer); | |
| 189 | else | |
| 190 | lua_pushfstring(L, "system error %d\n", error); | |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | static void ll_unloadlib (void *lib) { |
| 194 | ||
| 194 | FreeLibrary((HMODULE)lib); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | static void *ll_load (lua_State *L, const char *path, int seeglb) { |
| 199 | HMODULE lib = LoadLibraryExA(path, NULL, LUA_LLE_FLAGS); | |
| 200 | (void)(seeglb); /* not used: symbols are 'global' by default */ | |
| 201 | if (lib == NULL) pusherror(L); | |
| 202 | return lib; | |
| 199 | HMODULE lib = LoadLibraryExA(path, NULL, LUA_LLE_FLAGS); | |
| 200 | (void)(seeglb); /* not used: symbols are 'global' by default */ | |
| 201 | if (lib == NULL) pusherror(L); | |
| 202 | return lib; | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| 206 | 206 | static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { |
| 207 | lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym); | |
| 208 | if (f == NULL) pusherror(L); | |
| 209 | return f; | |
| 207 | lua_CFunction f = (lua_CFunction)GetProcAddress((HMODULE)lib, sym); | |
| 208 | if (f == NULL) pusherror(L); | |
| 209 | return f; | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /* }====================================================== */ |
| r31373 | r31374 | |
| 220 | 220 | */ |
| 221 | 221 | |
| 222 | 222 | #undef LIB_FAIL |
| 223 | #define LIB_FAIL | |
| 223 | #define LIB_FAIL "absent" | |
| 224 | 224 | |
| 225 | 225 | |
| 226 | #define DLMSG | |
| 226 | #define DLMSG "dynamic libraries not enabled; check your Lua installation" | |
| 227 | 227 | |
| 228 | 228 | |
| 229 | 229 | static void ll_unloadlib (void *lib) { |
| 230 | ||
| 230 | (void)(lib); /* not used */ | |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | 233 | |
| 234 | 234 | static void *ll_load (lua_State *L, const char *path, int seeglb) { |
| 235 | (void)(path); (void)(seeglb); /* not used */ | |
| 236 | lua_pushliteral(L, DLMSG); | |
| 237 | return NULL; | |
| 235 | (void)(path); (void)(seeglb); /* not used */ | |
| 236 | lua_pushliteral(L, DLMSG); | |
| 237 | return NULL; | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | |
| 241 | 241 | static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { |
| 242 | (void)(lib); (void)(sym); /* not used */ | |
| 243 | lua_pushliteral(L, DLMSG); | |
| 244 | return NULL; | |
| 242 | (void)(lib); (void)(sym); /* not used */ | |
| 243 | lua_pushliteral(L, DLMSG); | |
| 244 | return NULL; | |
| 245 | 245 | } |
| 246 | 246 | |
| 247 | 247 | /* }====================================================== */ |
| r31373 | r31374 | |
| 249 | 249 | |
| 250 | 250 | |
| 251 | 251 | static void *ll_checkclib (lua_State *L, const char *path) { |
| 252 | void *plib; | |
| 253 | lua_getfield(L, LUA_REGISTRYINDEX, CLIBS); | |
| 254 | lua_getfield(L, -1, path); | |
| 255 | plib = lua_touserdata(L, -1); /* plib = CLIBS[path] */ | |
| 256 | lua_pop(L, 2); /* pop CLIBS table and 'plib' */ | |
| 257 | return plib; | |
| 252 | void *plib; | |
| 253 | lua_getfield(L, LUA_REGISTRYINDEX, CLIBS); | |
| 254 | lua_getfield(L, -1, path); | |
| 255 | plib = lua_touserdata(L, -1); /* plib = CLIBS[path] */ | |
| 256 | lua_pop(L, 2); /* pop CLIBS table and 'plib' */ | |
| 257 | return plib; | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| 261 | 261 | static void ll_addtoclib (lua_State *L, const char *path, void *plib) { |
| 262 | lua_getfield(L, LUA_REGISTRYINDEX, CLIBS); | |
| 263 | lua_pushlightuserdata(L, plib); | |
| 264 | lua_pushvalue(L, -1); | |
| 265 | lua_setfield(L, -3, path); /* CLIBS[path] = plib */ | |
| 266 | lua_rawseti(L, -2, luaL_len(L, -2) + 1); /* CLIBS[#CLIBS + 1] = plib */ | |
| 267 | lua_pop(L, 1); /* pop CLIBS table */ | |
| 262 | lua_getfield(L, LUA_REGISTRYINDEX, CLIBS); | |
| 263 | lua_pushlightuserdata(L, plib); | |
| 264 | lua_pushvalue(L, -1); | |
| 265 | lua_setfield(L, -3, path); /* CLIBS[path] = plib */ | |
| 266 | lua_rawseti(L, -2, luaL_len(L, -2) + 1); /* CLIBS[#CLIBS + 1] = plib */ | |
| 267 | lua_pop(L, 1); /* pop CLIBS table */ | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
| r31373 | r31374 | |
| 273 | 273 | ** handles in list CLIBS |
| 274 | 274 | */ |
| 275 | 275 | static int gctm (lua_State *L) { |
| 276 | int n = luaL_len(L, 1); | |
| 277 | for (; n >= 1; n--) { /* for each handle, in reverse order */ | |
| 278 | lua_rawgeti(L, 1, n); /* get handle CLIBS[n] */ | |
| 279 | ll_unloadlib(lua_touserdata(L, -1)); | |
| 280 | lua_pop(L, 1); /* pop handle */ | |
| 281 | } | |
| 282 | return 0; | |
| 276 | int n = luaL_len(L, 1); | |
| 277 | for (; n >= 1; n--) { /* for each handle, in reverse order */ | |
| 278 | lua_rawgeti(L, 1, n); /* get handle CLIBS[n] */ | |
| 279 | ll_unloadlib(lua_touserdata(L, -1)); | |
| 280 | lua_pop(L, 1); /* pop handle */ | |
| 281 | } | |
| 282 | return 0; | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { |
| 287 | void *reg = ll_checkclib(L, path); /* check loaded C libraries */ | |
| 288 | if (reg == NULL) { /* must load library? */ | |
| 289 | reg = ll_load(L, path, *sym == '*'); | |
| 290 | if (reg == NULL) return ERRLIB; /* unable to load library */ | |
| 291 | ll_addtoclib(L, path, reg); | |
| 292 | } | |
| 293 | if (*sym == '*') { /* loading only library (no function)? */ | |
| 294 | lua_pushboolean(L, 1); /* return 'true' */ | |
| 295 | return 0; /* no errors */ | |
| 296 | } | |
| 297 | else { | |
| 298 | lua_CFunction f = ll_sym(L, reg, sym); | |
| 299 | if (f == NULL) | |
| 300 | return ERRFUNC; /* unable to find function */ | |
| 301 | lua_pushcfunction(L, f); /* else create new function */ | |
| 302 | return 0; /* no errors */ | |
| 303 | } | |
| 287 | void *reg = ll_checkclib(L, path); /* check loaded C libraries */ | |
| 288 | if (reg == NULL) { /* must load library? */ | |
| 289 | reg = ll_load(L, path, *sym == '*'); | |
| 290 | if (reg == NULL) return ERRLIB; /* unable to load library */ | |
| 291 | ll_addtoclib(L, path, reg); | |
| 292 | } | |
| 293 | if (*sym == '*') { /* loading only library (no function)? */ | |
| 294 | lua_pushboolean(L, 1); /* return 'true' */ | |
| 295 | return 0; /* no errors */ | |
| 296 | } | |
| 297 | else { | |
| 298 | lua_CFunction f = ll_sym(L, reg, sym); | |
| 299 | if (f == NULL) | |
| 300 | return ERRFUNC; /* unable to find function */ | |
| 301 | lua_pushcfunction(L, f); /* else create new function */ | |
| 302 | return 0; /* no errors */ | |
| 303 | } | |
| 304 | 304 | } |
| 305 | 305 | |
| 306 | 306 | |
| 307 | 307 | static int ll_loadlib (lua_State *L) { |
| 308 | const char *path = luaL_checkstring(L, 1); | |
| 309 | const char *init = luaL_checkstring(L, 2); | |
| 310 | int stat = ll_loadfunc(L, path, init); | |
| 311 | if (stat == 0) /* no errors? */ | |
| 312 | return 1; /* return the loaded function */ | |
| 313 | else { /* error; error message is on stack top */ | |
| 314 | lua_pushnil(L); | |
| 315 | lua_insert(L, -2); | |
| 316 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); | |
| 317 | return 3; /* return nil, error message, and where */ | |
| 318 | } | |
| 308 | const char *path = luaL_checkstring(L, 1); | |
| 309 | const char *init = luaL_checkstring(L, 2); | |
| 310 | int stat = ll_loadfunc(L, path, init); | |
| 311 | if (stat == 0) /* no errors? */ | |
| 312 | return 1; /* return the loaded function */ | |
| 313 | else { /* error; error message is on stack top */ | |
| 314 | lua_pushnil(L); | |
| 315 | lua_insert(L, -2); | |
| 316 | lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); | |
| 317 | return 3; /* return nil, error message, and where */ | |
| 318 | } | |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | 321 | |
| r31373 | r31374 | |
| 328 | 328 | |
| 329 | 329 | |
| 330 | 330 | static int readable (const char *filename) { |
| 331 | FILE *f = fopen(filename, "r"); /* try to open file */ | |
| 332 | if (f == NULL) return 0; /* open failed */ | |
| 333 | fclose(f); | |
| 334 | return 1; | |
| 331 | FILE *f = fopen(filename, "r"); /* try to open file */ | |
| 332 | if (f == NULL) return 0; /* open failed */ | |
| 333 | fclose(f); | |
| 334 | return 1; | |
| 335 | 335 | } |
| 336 | 336 | |
| 337 | 337 | |
| 338 | 338 | static const char *pushnexttemplate (lua_State *L, const char *path) { |
| 339 | const char *l; | |
| 340 | while (*path == *LUA_PATH_SEP) path++; /* skip separators */ | |
| 341 | if (*path == '\0') return NULL; /* no more templates */ | |
| 342 | l = strchr(path, *LUA_PATH_SEP); /* find next separator */ | |
| 343 | if (l == NULL) l = path + strlen(path); | |
| 344 | lua_pushlstring(L, path, l - path); /* template */ | |
| 345 | return l; | |
| 339 | const char *l; | |
| 340 | while (*path == *LUA_PATH_SEP) path++; /* skip separators */ | |
| 341 | if (*path == '\0') return NULL; /* no more templates */ | |
| 342 | l = strchr(path, *LUA_PATH_SEP); /* find next separator */ | |
| 343 | if (l == NULL) l = path + strlen(path); | |
| 344 | lua_pushlstring(L, path, l - path); /* template */ | |
| 345 | return l; | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
| 349 | 349 | static const char *searchpath (lua_State *L, const char *name, |
| 350 | const char *path, | |
| 351 | const char *sep, | |
| 352 | const char *dirsep) { | |
| 353 | luaL_Buffer msg; /* to build error message */ | |
| 354 | luaL_buffinit(L, &msg); | |
| 355 | if (*sep != '\0') /* non-empty separator? */ | |
| 356 | name = luaL_gsub(L, name, sep, dirsep); /* replace it by 'dirsep' */ | |
| 357 | while ((path = pushnexttemplate(L, path)) != NULL) { | |
| 358 | const char *filename = luaL_gsub(L, lua_tostring(L, -1), | |
| 359 | LUA_PATH_MARK, name); | |
| 360 | lua_remove(L, -2); /* remove path template */ | |
| 361 | if (readable(filename)) /* does file exist and is readable? */ | |
| 362 | return filename; /* return that file name */ | |
| 363 | lua_pushfstring(L, "\n\tno file " LUA_QS, filename); | |
| 364 | lua_remove(L, -2); /* remove file name */ | |
| 365 | luaL_addvalue(&msg); /* concatenate error msg. entry */ | |
| 366 | } | |
| 367 | luaL_pushresult(&msg); /* create error message */ | |
| 368 | return NULL; /* not found */ | |
| 350 | const char *path, | |
| 351 | const char *sep, | |
| 352 | const char *dirsep) { | |
| 353 | luaL_Buffer msg; /* to build error message */ | |
| 354 | luaL_buffinit(L, &msg); | |
| 355 | if (*sep != '\0') /* non-empty separator? */ | |
| 356 | name = luaL_gsub(L, name, sep, dirsep); /* replace it by 'dirsep' */ | |
| 357 | while ((path = pushnexttemplate(L, path)) != NULL) { | |
| 358 | const char *filename = luaL_gsub(L, lua_tostring(L, -1), | |
| 359 | LUA_PATH_MARK, name); | |
| 360 | lua_remove(L, -2); /* remove path template */ | |
| 361 | if (readable(filename)) /* does file exist and is readable? */ | |
| 362 | return filename; /* return that file name */ | |
| 363 | lua_pushfstring(L, "\n\tno file " LUA_QS, filename); | |
| 364 | lua_remove(L, -2); /* remove file name */ | |
| 365 | luaL_addvalue(&msg); /* concatenate error msg. entry */ | |
| 366 | } | |
| 367 | luaL_pushresult(&msg); /* create error message */ | |
| 368 | return NULL; /* not found */ | |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
| 372 | 372 | static int ll_searchpath (lua_State *L) { |
| 373 | const char *f = searchpath(L, luaL_checkstring(L, 1), | |
| 374 | luaL_checkstring(L, 2), | |
| 375 | luaL_optstring(L, 3, "."), | |
| 376 | luaL_optstring(L, 4, LUA_DIRSEP)); | |
| 377 | if (f != NULL) return 1; | |
| 378 | else { /* error message is on top of the stack */ | |
| 379 | lua_pushnil(L); | |
| 380 | lua_insert(L, -2); | |
| 381 | return 2; /* return nil + error message */ | |
| 382 | } | |
| 373 | const char *f = searchpath(L, luaL_checkstring(L, 1), | |
| 374 | luaL_checkstring(L, 2), | |
| 375 | luaL_optstring(L, 3, "."), | |
| 376 | luaL_optstring(L, 4, LUA_DIRSEP)); | |
| 377 | if (f != NULL) return 1; | |
| 378 | else { /* error message is on top of the stack */ | |
| 379 | lua_pushnil(L); | |
| 380 | lua_insert(L, -2); | |
| 381 | return 2; /* return nil + error message */ | |
| 382 | } | |
| 383 | 383 | } |
| 384 | 384 | |
| 385 | 385 | |
| 386 | 386 | static const char *findfile (lua_State *L, const char *name, |
| 387 | const char *pname, | |
| 388 | const char *dirsep) { | |
| 389 | const char *path; | |
| 390 | lua_getfield(L, lua_upvalueindex(1), pname); | |
| 391 | path = lua_tostring(L, -1); | |
| 392 | if (path == NULL) | |
| 393 | luaL_error(L, LUA_QL("package.%s") " must be a string", pname); | |
| 394 | return searchpath(L, name, path, ".", dirsep); | |
| 387 | const char *pname, | |
| 388 | const char *dirsep) { | |
| 389 | const char *path; | |
| 390 | lua_getfield(L, lua_upvalueindex(1), pname); | |
| 391 | path = lua_tostring(L, -1); | |
| 392 | if (path == NULL) | |
| 393 | luaL_error(L, LUA_QL("package.%s") " must be a string", pname); | |
| 394 | return searchpath(L, name, path, ".", dirsep); | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
| 398 | 398 | static int checkload (lua_State *L, int stat, const char *filename) { |
| 399 | if (stat) { /* module loaded successfully? */ | |
| 400 | lua_pushstring(L, filename); /* will be 2nd argument to module */ | |
| 401 | return 2; /* return open function and file name */ | |
| 402 | } | |
| 403 | else | |
| 404 | return luaL_error(L, "error loading module " LUA_QS | |
| 405 | " from file " LUA_QS ":\n\t%s", | |
| 406 | lua_tostring(L, 1), filename, lua_tostring(L, -1)); | |
| 399 | if (stat) { /* module loaded successfully? */ | |
| 400 | lua_pushstring(L, filename); /* will be 2nd argument to module */ | |
| 401 | return 2; /* return open function and file name */ | |
| 402 | } | |
| 403 | else | |
| 404 | return luaL_error(L, "error loading module " LUA_QS | |
| 405 | " from file " LUA_QS ":\n\t%s", | |
| 406 | lua_tostring(L, 1), filename, lua_tostring(L, -1)); | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | |
| 410 | 410 | static int searcher_Lua (lua_State *L) { |
| 411 | const char *filename; | |
| 412 | const char *name = luaL_checkstring(L, 1); | |
| 413 | filename = findfile(L, name, "path", LUA_LSUBSEP); | |
| 414 | if (filename == NULL) return 1; /* module not found in this path */ | |
| 415 | return checkload(L, (luaL_loadfile(L, filename) == LUA_OK), filename); | |
| 411 | const char *filename; | |
| 412 | const char *name = luaL_checkstring(L, 1); | |
| 413 | filename = findfile(L, name, "path", LUA_LSUBSEP); | |
| 414 | if (filename == NULL) return 1; /* module not found in this path */ | |
| 415 | return checkload(L, (luaL_loadfile(L, filename) == LUA_OK), filename); | |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | |
| 419 | 419 | static int loadfunc (lua_State *L, const char *filename, const char *modname) { |
| 420 | const char *funcname; | |
| 421 | const char *mark; | |
| 422 | modname = luaL_gsub(L, modname, ".", LUA_OFSEP); | |
| 423 | mark = strchr(modname, *LUA_IGMARK); | |
| 424 | if (mark) { | |
| 425 | int stat; | |
| 426 | funcname = lua_pushlstring(L, modname, mark - modname); | |
| 427 | funcname = lua_pushfstring(L, LUA_POF"%s", funcname); | |
| 428 | stat = ll_loadfunc(L, filename, funcname); | |
| 429 | if (stat != ERRFUNC) return stat; | |
| 430 | modname = mark + 1; /* else go ahead and try old-style name */ | |
| 431 | } | |
| 432 | funcname = lua_pushfstring(L, LUA_POF"%s", modname); | |
| 433 | return ll_loadfunc(L, filename, funcname); | |
| 420 | const char *funcname; | |
| 421 | const char *mark; | |
| 422 | modname = luaL_gsub(L, modname, ".", LUA_OFSEP); | |
| 423 | mark = strchr(modname, *LUA_IGMARK); | |
| 424 | if (mark) { | |
| 425 | int stat; | |
| 426 | funcname = lua_pushlstring(L, modname, mark - modname); | |
| 427 | funcname = lua_pushfstring(L, LUA_POF"%s", funcname); | |
| 428 | stat = ll_loadfunc(L, filename, funcname); | |
| 429 | if (stat != ERRFUNC) return stat; | |
| 430 | modname = mark + 1; /* else go ahead and try old-style name */ | |
| 431 | } | |
| 432 | funcname = lua_pushfstring(L, LUA_POF"%s", modname); | |
| 433 | return ll_loadfunc(L, filename, funcname); | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | |
| 437 | 437 | static int searcher_C (lua_State *L) { |
| 438 | const char *name = luaL_checkstring(L, 1); | |
| 439 | const char *filename = findfile(L, name, "cpath", LUA_CSUBSEP); | |
| 440 | if (filename == NULL) return 1; /* module not found in this path */ | |
| 441 | return checkload(L, (loadfunc(L, filename, name) == 0), filename); | |
| 438 | const char *name = luaL_checkstring(L, 1); | |
| 439 | const char *filename = findfile(L, name, "cpath", LUA_CSUBSEP); | |
| 440 | if (filename == NULL) return 1; /* module not found in this path */ | |
| 441 | return checkload(L, (loadfunc(L, filename, name) == 0), filename); | |
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | |
| 445 | 445 | static int searcher_Croot (lua_State *L) { |
| 446 | const char *filename; | |
| 447 | const char *name = luaL_checkstring(L, 1); | |
| 448 | const char *p = strchr(name, '.'); | |
| 449 | int stat; | |
| 450 | if (p == NULL) return 0; /* is root */ | |
| 451 | lua_pushlstring(L, name, p - name); | |
| 452 | filename = findfile(L, lua_tostring(L, -1), "cpath", LUA_CSUBSEP); | |
| 453 | if (filename == NULL) return 1; /* root not found */ | |
| 454 | if ((stat = loadfunc(L, filename, name)) != 0) { | |
| 455 | if (stat != ERRFUNC) | |
| 456 | return checkload(L, 0, filename); /* real error */ | |
| 457 | else { /* open function not found */ | |
| 458 | lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, | |
| 459 | name, filename); | |
| 460 | return 1; | |
| 461 | } | |
| 462 | } | |
| 463 | lua_pushstring(L, filename); /* will be 2nd argument to module */ | |
| 464 | return 2; | |
| 446 | const char *filename; | |
| 447 | const char *name = luaL_checkstring(L, 1); | |
| 448 | const char *p = strchr(name, '.'); | |
| 449 | int stat; | |
| 450 | if (p == NULL) return 0; /* is root */ | |
| 451 | lua_pushlstring(L, name, p - name); | |
| 452 | filename = findfile(L, lua_tostring(L, -1), "cpath", LUA_CSUBSEP); | |
| 453 | if (filename == NULL) return 1; /* root not found */ | |
| 454 | if ((stat = loadfunc(L, filename, name)) != 0) { | |
| 455 | if (stat != ERRFUNC) | |
| 456 | return checkload(L, 0, filename); /* real error */ | |
| 457 | else { /* open function not found */ | |
| 458 | lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, | |
| 459 | name, filename); | |
| 460 | return 1; | |
| 461 | } | |
| 462 | } | |
| 463 | lua_pushstring(L, filename); /* will be 2nd argument to module */ | |
| 464 | return 2; | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | |
| 468 | 468 | static int searcher_preload (lua_State *L) { |
| 469 | const char *name = luaL_checkstring(L, 1); | |
| 470 | lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD"); | |
| 471 | lua_getfield(L, -1, name); | |
| 472 | if (lua_isnil(L, -1)) /* not found? */ | |
| 473 | lua_pushfstring(L, "\n\tno field package.preload['%s']", name); | |
| 474 | return 1; | |
| 469 | const char *name = luaL_checkstring(L, 1); | |
| 470 | lua_getfield(L, LUA_REGISTRYINDEX, "_PRELOAD"); | |
| 471 | lua_getfield(L, -1, name); | |
| 472 | if (lua_isnil(L, -1)) /* not found? */ | |
| 473 | lua_pushfstring(L, "\n\tno field package.preload['%s']", name); | |
| 474 | return 1; | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | |
| 478 | 478 | static void findloader (lua_State *L, const char *name) { |
| 479 | int i; | |
| 480 | luaL_Buffer msg; /* to build error message */ | |
| 481 | luaL_buffinit(L, &msg); | |
| 482 | lua_getfield(L, lua_upvalueindex(1), "searchers"); /* will be at index 3 */ | |
| 483 | if (!lua_istable(L, 3)) | |
| 484 | luaL_error(L, LUA_QL("package.searchers") " must be a table"); | |
| 485 | /* iterate over available searchers to find a loader */ | |
| 486 | for (i = 1; ; i++) { | |
| 487 | lua_rawgeti(L, 3, i); /* get a searcher */ | |
| 488 | if (lua_isnil(L, -1)) { /* no more searchers? */ | |
| 489 | lua_pop(L, 1); /* remove nil */ | |
| 490 | luaL_pushresult(&msg); /* create error message */ | |
| 491 | luaL_error(L, "module " LUA_QS " not found:%s", | |
| 492 | name, lua_tostring(L, -1)); | |
| 493 | } | |
| 494 | lua_pushstring(L, name); | |
| 495 | lua_call(L, 1, 2); /* call it */ | |
| 496 | if (lua_isfunction(L, -2)) /* did it find a loader? */ | |
| 497 | return; /* module loader found */ | |
| 498 | else if (lua_isstring(L, -2)) { /* searcher returned error message? */ | |
| 499 | lua_pop(L, 1); /* remove extra return */ | |
| 500 | luaL_addvalue(&msg); /* concatenate error message */ | |
| 501 | } | |
| 502 | else | |
| 503 | lua_pop(L, 2); /* remove both returns */ | |
| 504 | } | |
| 479 | int i; | |
| 480 | luaL_Buffer msg; /* to build error message */ | |
| 481 | luaL_buffinit(L, &msg); | |
| 482 | lua_getfield(L, lua_upvalueindex(1), "searchers"); /* will be at index 3 */ | |
| 483 | if (!lua_istable(L, 3)) | |
| 484 | luaL_error(L, LUA_QL("package.searchers") " must be a table"); | |
| 485 | /* iterate over available searchers to find a loader */ | |
| 486 | for (i = 1; ; i++) { | |
| 487 | lua_rawgeti(L, 3, i); /* get a searcher */ | |
| 488 | if (lua_isnil(L, -1)) { /* no more searchers? */ | |
| 489 | lua_pop(L, 1); /* remove nil */ | |
| 490 | luaL_pushresult(&msg); /* create error message */ | |
| 491 | luaL_error(L, "module " LUA_QS " not found:%s", | |
| 492 | name, lua_tostring(L, -1)); | |
| 493 | } | |
| 494 | lua_pushstring(L, name); | |
| 495 | lua_call(L, 1, 2); /* call it */ | |
| 496 | if (lua_isfunction(L, -2)) /* did it find a loader? */ | |
| 497 | return; /* module loader found */ | |
| 498 | else if (lua_isstring(L, -2)) { /* searcher returned error message? */ | |
| 499 | lua_pop(L, 1); /* remove extra return */ | |
| 500 | luaL_addvalue(&msg); /* concatenate error message */ | |
| 501 | } | |
| 502 | else | |
| 503 | lua_pop(L, 2); /* remove both returns */ | |
| 504 | } | |
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | |
| 508 | 508 | static int ll_require (lua_State *L) { |
| 509 | const char *name = luaL_checkstring(L, 1); | |
| 510 | lua_settop(L, 1); /* _LOADED table will be at index 2 */ | |
| 511 | lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); | |
| 512 | lua_getfield(L, 2, name); /* _LOADED[name] */ | |
| 513 | if (lua_toboolean(L, -1)) /* is it there? */ | |
| 514 | return 1; /* package is already loaded */ | |
| 515 | /* else must load package */ | |
| 516 | lua_pop(L, 1); /* remove 'getfield' result */ | |
| 517 | findloader(L, name); | |
| 518 | lua_pushstring(L, name); /* pass name as argument to module loader */ | |
| 519 | lua_insert(L, -2); /* name is 1st argument (before search data) */ | |
| 520 | lua_call(L, 2, 1); /* run loader to load module */ | |
| 521 | if (!lua_isnil(L, -1)) /* non-nil return? */ | |
| 522 | lua_setfield(L, 2, name); /* _LOADED[name] = returned value */ | |
| 523 | lua_getfield(L, 2, name); | |
| 524 | if (lua_isnil(L, -1)) { /* module did not set a value? */ | |
| 525 | lua_pushboolean(L, 1); /* use true as result */ | |
| 526 | lua_pushvalue(L, -1); /* extra copy to be returned */ | |
| 527 | lua_setfield(L, 2, name); /* _LOADED[name] = true */ | |
| 528 | } | |
| 529 | return 1; | |
| 509 | const char *name = luaL_checkstring(L, 1); | |
| 510 | lua_settop(L, 1); /* _LOADED table will be at index 2 */ | |
| 511 | lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); | |
| 512 | lua_getfield(L, 2, name); /* _LOADED[name] */ | |
| 513 | if (lua_toboolean(L, -1)) /* is it there? */ | |
| 514 | return 1; /* package is already loaded */ | |
| 515 | /* else must load package */ | |
| 516 | lua_pop(L, 1); /* remove 'getfield' result */ | |
| 517 | findloader(L, name); | |
| 518 | lua_pushstring(L, name); /* pass name as argument to module loader */ | |
| 519 | lua_insert(L, -2); /* name is 1st argument (before search data) */ | |
| 520 | lua_call(L, 2, 1); /* run loader to load module */ | |
| 521 | if (!lua_isnil(L, -1)) /* non-nil return? */ | |
| 522 | lua_setfield(L, 2, name); /* _LOADED[name] = returned value */ | |
| 523 | lua_getfield(L, 2, name); | |
| 524 | if (lua_isnil(L, -1)) { /* module did not set a value? */ | |
| 525 | lua_pushboolean(L, 1); /* use true as result */ | |
| 526 | lua_pushvalue(L, -1); /* extra copy to be returned */ | |
| 527 | lua_setfield(L, 2, name); /* _LOADED[name] = true */ | |
| 528 | } | |
| 529 | return 1; | |
| 530 | 530 | } |
| 531 | 531 | |
| 532 | 532 | /* }====================================================== */ |
| r31373 | r31374 | |
| 544 | 544 | ** changes the environment variable of calling function |
| 545 | 545 | */ |
| 546 | 546 | static void set_env (lua_State *L) { |
| 547 | lua_Debug ar; | |
| 548 | if (lua_getstack(L, 1, &ar) == 0 || | |
| 549 | lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ | |
| 550 | lua_iscfunction(L, -1)) | |
| 551 | luaL_error(L, LUA_QL("module") " not called from a Lua function"); | |
| 552 | lua_pushvalue(L, -2); /* copy new environment table to top */ | |
| 553 | lua_setupvalue(L, -2, 1); | |
| 554 | lua_pop(L, 1); /* remove function */ | |
| 547 | lua_Debug ar; | |
| 548 | if (lua_getstack(L, 1, &ar) == 0 || | |
| 549 | lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ | |
| 550 | lua_iscfunction(L, -1)) | |
| 551 | luaL_error(L, LUA_QL("module") " not called from a Lua function"); | |
| 552 | lua_pushvalue(L, -2); /* copy new environment table to top */ | |
| 553 | lua_setupvalue(L, -2, 1); | |
| 554 | lua_pop(L, 1); /* remove function */ | |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | |
| 558 | 558 | static void dooptions (lua_State *L, int n) { |
| 559 | int i; | |
| 560 | for (i = 2; i <= n; i++) { | |
| 561 | if (lua_isfunction(L, i)) { /* avoid 'calling' extra info. */ | |
| 562 | lua_pushvalue(L, i); /* get option (a function) */ | |
| 563 | lua_pushvalue(L, -2); /* module */ | |
| 564 | lua_call(L, 1, 0); | |
| 565 | } | |
| 566 | } | |
| 559 | int i; | |
| 560 | for (i = 2; i <= n; i++) { | |
| 561 | if (lua_isfunction(L, i)) { /* avoid 'calling' extra info. */ | |
| 562 | lua_pushvalue(L, i); /* get option (a function) */ | |
| 563 | lua_pushvalue(L, -2); /* module */ | |
| 564 | lua_call(L, 1, 0); | |
| 565 | } | |
| 566 | } | |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | |
| 570 | 570 | static void modinit (lua_State *L, const char *modname) { |
| 571 | const char *dot; | |
| 572 | lua_pushvalue(L, -1); | |
| 573 | lua_setfield(L, -2, "_M"); /* module._M = module */ | |
| 574 | lua_pushstring(L, modname); | |
| 575 | lua_setfield(L, -2, "_NAME"); | |
| 576 | dot = strrchr(modname, '.'); /* look for last dot in module name */ | |
| 577 | if (dot == NULL) dot = modname; | |
| 578 | else dot++; | |
| 579 | /* set _PACKAGE as package name (full module name minus last part) */ | |
| 580 | lua_pushlstring(L, modname, dot - modname); | |
| 581 | lua_setfield(L, -2, "_PACKAGE"); | |
| 571 | const char *dot; | |
| 572 | lua_pushvalue(L, -1); | |
| 573 | lua_setfield(L, -2, "_M"); /* module._M = module */ | |
| 574 | lua_pushstring(L, modname); | |
| 575 | lua_setfield(L, -2, "_NAME"); | |
| 576 | dot = strrchr(modname, '.'); /* look for last dot in module name */ | |
| 577 | if (dot == NULL) dot = modname; | |
| 578 | else dot++; | |
| 579 | /* set _PACKAGE as package name (full module name minus last part) */ | |
| 580 | lua_pushlstring(L, modname, dot - modname); | |
| 581 | lua_setfield(L, -2, "_PACKAGE"); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | |
| 585 | 585 | static int ll_module (lua_State *L) { |
| 586 | const char *modname = luaL_checkstring(L, 1); | |
| 587 | int lastarg = lua_gettop(L); /* last parameter */ | |
| 588 | luaL_pushmodule(L, modname, 1); /* get/create module table */ | |
| 589 | /* check whether table already has a _NAME field */ | |
| 590 | lua_getfield(L, -1, "_NAME"); | |
| 591 | if (!lua_isnil(L, -1)) /* is table an initialized module? */ | |
| 592 | lua_pop(L, 1); | |
| 593 | else { /* no; initialize it */ | |
| 594 | lua_pop(L, 1); | |
| 595 | modinit(L, modname); | |
| 596 | } | |
| 597 | lua_pushvalue(L, -1); | |
| 598 | set_env(L); | |
| 599 | dooptions(L, lastarg); | |
| 600 | return 1; | |
| 586 | const char *modname = luaL_checkstring(L, 1); | |
| 587 | int lastarg = lua_gettop(L); /* last parameter */ | |
| 588 | luaL_pushmodule(L, modname, 1); /* get/create module table */ | |
| 589 | /* check whether table already has a _NAME field */ | |
| 590 | lua_getfield(L, -1, "_NAME"); | |
| 591 | if (!lua_isnil(L, -1)) /* is table an initialized module? */ | |
| 592 | lua_pop(L, 1); | |
| 593 | else { /* no; initialize it */ | |
| 594 | lua_pop(L, 1); | |
| 595 | modinit(L, modname); | |
| 596 | } | |
| 597 | lua_pushvalue(L, -1); | |
| 598 | set_env(L); | |
| 599 | dooptions(L, lastarg); | |
| 600 | return 1; | |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | |
| 604 | 604 | static int ll_seeall (lua_State *L) { |
| 605 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 606 | if (!lua_getmetatable(L, 1)) { | |
| 607 | lua_createtable(L, 0, 1); /* create new metatable */ | |
| 608 | lua_pushvalue(L, -1); | |
| 609 | lua_setmetatable(L, 1); | |
| 610 | } | |
| 611 | lua_pushglobaltable(L); | |
| 612 | lua_setfield(L, -2, "__index"); /* mt.__index = _G */ | |
| 613 | return 0; | |
| 605 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 606 | if (!lua_getmetatable(L, 1)) { | |
| 607 | lua_createtable(L, 0, 1); /* create new metatable */ | |
| 608 | lua_pushvalue(L, -1); | |
| 609 | lua_setmetatable(L, 1); | |
| 610 | } | |
| 611 | lua_pushglobaltable(L); | |
| 612 | lua_setfield(L, -2, "__index"); /* mt.__index = _G */ | |
| 613 | return 0; | |
| 614 | 614 | } |
| 615 | 615 | |
| 616 | 616 | #endif |
| r31373 | r31374 | |
| 619 | 619 | |
| 620 | 620 | |
| 621 | 621 | /* auxiliary mark (for internal use) */ |
| 622 | #define AUXMARK | |
| 622 | #define AUXMARK "\1" | |
| 623 | 623 | |
| 624 | 624 | |
| 625 | 625 | /* |
| 626 | 626 | ** return registry.LUA_NOENV as a boolean |
| 627 | 627 | */ |
| 628 | 628 | static int noenv (lua_State *L) { |
| 629 | int b; | |
| 630 | lua_getfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); | |
| 631 | b = lua_toboolean(L, -1); | |
| 632 | lua_pop(L, 1); /* remove value */ | |
| 633 | return b; | |
| 629 | int b; | |
| 630 | lua_getfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); | |
| 631 | b = lua_toboolean(L, -1); | |
| 632 | lua_pop(L, 1); /* remove value */ | |
| 633 | return b; | |
| 634 | 634 | } |
| 635 | 635 | |
| 636 | 636 | |
| 637 | 637 | static void setpath (lua_State *L, const char *fieldname, const char *envname1, |
| 638 | const char *envname2, const char *def) { | |
| 639 | const char *path = getenv(envname1); | |
| 640 | if (path == NULL) /* no environment variable? */ | |
| 641 | path = getenv(envname2); /* try alternative name */ | |
| 642 | if (path == NULL || noenv(L)) /* no environment variable? */ | |
| 643 | lua_pushstring(L, def); /* use default */ | |
| 644 | else { | |
| 645 | /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */ | |
| 646 | path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP, | |
| 647 | LUA_PATH_SEP AUXMARK LUA_PATH_SEP); | |
| 648 | luaL_gsub(L, path, AUXMARK, def); | |
| 649 | lua_remove(L, -2); | |
| 650 | } | |
| 651 | setprogdir(L); | |
| 652 | lua_setfield(L, -2, fieldname); | |
| 638 | const char *envname2, const char *def) { | |
| 639 | const char *path = getenv(envname1); | |
| 640 | if (path == NULL) /* no environment variable? */ | |
| 641 | path = getenv(envname2); /* try alternative name */ | |
| 642 | if (path == NULL || noenv(L)) /* no environment variable? */ | |
| 643 | lua_pushstring(L, def); /* use default */ | |
| 644 | else { | |
| 645 | /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */ | |
| 646 | path = luaL_gsub(L, path, LUA_PATH_SEP LUA_PATH_SEP, | |
| 647 | LUA_PATH_SEP AUXMARK LUA_PATH_SEP); | |
| 648 | luaL_gsub(L, path, AUXMARK, def); | |
| 649 | lua_remove(L, -2); | |
| 650 | } | |
| 651 | setprogdir(L); | |
| 652 | lua_setfield(L, -2, fieldname); | |
| 653 | 653 | } |
| 654 | 654 | |
| 655 | 655 | |
| 656 | 656 | static const luaL_Reg pk_funcs[] = { |
| 657 | {"loadlib", ll_loadlib}, | |
| 658 | {"searchpath", ll_searchpath}, | |
| 657 | {"loadlib", ll_loadlib}, | |
| 658 | {"searchpath", ll_searchpath}, | |
| 659 | 659 | #if defined(LUA_COMPAT_MODULE) |
| 660 | ||
| 660 | {"seeall", ll_seeall}, | |
| 661 | 661 | #endif |
| 662 | ||
| 662 | {NULL, NULL} | |
| 663 | 663 | }; |
| 664 | 664 | |
| 665 | 665 | |
| 666 | 666 | static const luaL_Reg ll_funcs[] = { |
| 667 | 667 | #if defined(LUA_COMPAT_MODULE) |
| 668 | ||
| 668 | {"module", ll_module}, | |
| 669 | 669 | #endif |
| 670 | {"require", ll_require}, | |
| 671 | {NULL, NULL} | |
| 670 | {"require", ll_require}, | |
| 671 | {NULL, NULL} | |
| 672 | 672 | }; |
| 673 | 673 | |
| 674 | 674 | |
| 675 | 675 | static void createsearcherstable (lua_State *L) { |
| 676 | static const lua_CFunction searchers[] = | |
| 677 | {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL}; | |
| 678 | int i; | |
| 679 | /* create 'searchers' table */ | |
| 680 | lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0); | |
| 681 | /* fill it with pre-defined searchers */ | |
| 682 | for (i=0; searchers[i] != NULL; i++) { | |
| 683 | lua_pushvalue(L, -2); /* set 'package' as upvalue for all searchers */ | |
| 684 | lua_pushcclosure(L, searchers[i], 1); | |
| 685 | lua_rawseti(L, -2, i+1); | |
| 686 | } | |
| 676 | static const lua_CFunction searchers[] = | |
| 677 | {searcher_preload, searcher_Lua, searcher_C, searcher_Croot, NULL}; | |
| 678 | int i; | |
| 679 | /* create 'searchers' table */ | |
| 680 | lua_createtable(L, sizeof(searchers)/sizeof(searchers[0]) - 1, 0); | |
| 681 | /* fill it with pre-defined searchers */ | |
| 682 | for (i=0; searchers[i] != NULL; i++) { | |
| 683 | lua_pushvalue(L, -2); /* set 'package' as upvalue for all searchers */ | |
| 684 | lua_pushcclosure(L, searchers[i], 1); | |
| 685 | lua_rawseti(L, -2, i+1); | |
| 686 | } | |
| 687 | 687 | } |
| 688 | 688 | |
| 689 | 689 | |
| 690 | 690 | LUAMOD_API int luaopen_package (lua_State *L) { |
| 691 | /* create table CLIBS to keep track of loaded C libraries */ | |
| 692 | luaL_getsubtable(L, LUA_REGISTRYINDEX, CLIBS); | |
| 693 | lua_createtable(L, 0, 1); /* metatable for CLIBS */ | |
| 694 | lua_pushcfunction(L, gctm); | |
| 695 | lua_setfield(L, -2, "__gc"); /* set finalizer for CLIBS table */ | |
| 696 | lua_setmetatable(L, -2); | |
| 697 | /* create `package' table */ | |
| 698 | luaL_newlib(L, pk_funcs); | |
| 699 | createsearcherstable(L); | |
| 691 | /* create table CLIBS to keep track of loaded C libraries */ | |
| 692 | luaL_getsubtable(L, LUA_REGISTRYINDEX, CLIBS); | |
| 693 | lua_createtable(L, 0, 1); /* metatable for CLIBS */ | |
| 694 | lua_pushcfunction(L, gctm); | |
| 695 | lua_setfield(L, -2, "__gc"); /* set finalizer for CLIBS table */ | |
| 696 | lua_setmetatable(L, -2); | |
| 697 | /* create `package' table */ | |
| 698 | luaL_newlib(L, pk_funcs); | |
| 699 | createsearcherstable(L); | |
| 700 | 700 | #if defined(LUA_COMPAT_LOADERS) |
| 701 | lua_pushvalue(L, -1); /* make a copy of 'searchers' table */ | |
| 702 | lua_setfield(L, -3, "loaders"); /* put it in field `loaders' */ | |
| 701 | lua_pushvalue(L, -1); /* make a copy of 'searchers' table */ | |
| 702 | lua_setfield(L, -3, "loaders"); /* put it in field `loaders' */ | |
| 703 | 703 | #endif |
| 704 | lua_setfield(L, -2, "searchers"); /* put it in field 'searchers' */ | |
| 705 | /* set field 'path' */ | |
| 706 | setpath(L, "path", LUA_PATHVERSION, LUA_PATH, LUA_PATH_DEFAULT); | |
| 707 | /* set field 'cpath' */ | |
| 708 | setpath(L, "cpath", LUA_CPATHVERSION, LUA_CPATH, LUA_CPATH_DEFAULT); | |
| 709 | /* store config information */ | |
| 710 | lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATH_SEP "\n" LUA_PATH_MARK "\n" | |
| 711 | LUA_EXEC_DIR "\n" LUA_IGMARK "\n"); | |
| 712 | lua_setfield(L, -2, "config"); | |
| 713 | /* set field `loaded' */ | |
| 714 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); | |
| 715 | lua_setfield(L, -2, "loaded"); | |
| 716 | /* set field `preload' */ | |
| 717 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); | |
| 718 | lua_setfield(L, -2, "preload"); | |
| 719 | lua_pushglobaltable(L); | |
| 720 | lua_pushvalue(L, -2); /* set 'package' as upvalue for next lib */ | |
| 721 | luaL_setfuncs(L, ll_funcs, 1); /* open lib into global table */ | |
| 722 | lua_pop(L, 1); /* pop global table */ | |
| 723 | return 1; /* return 'package' table */ | |
| 704 | lua_setfield(L, -2, "searchers"); /* put it in field 'searchers' */ | |
| 705 | /* set field 'path' */ | |
| 706 | setpath(L, "path", LUA_PATHVERSION, LUA_PATH, LUA_PATH_DEFAULT); | |
| 707 | /* set field 'cpath' */ | |
| 708 | setpath(L, "cpath", LUA_CPATHVERSION, LUA_CPATH, LUA_CPATH_DEFAULT); | |
| 709 | /* store config information */ | |
| 710 | lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATH_SEP "\n" LUA_PATH_MARK "\n" | |
| 711 | LUA_EXEC_DIR "\n" LUA_IGMARK "\n"); | |
| 712 | lua_setfield(L, -2, "config"); | |
| 713 | /* set field `loaded' */ | |
| 714 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_LOADED"); | |
| 715 | lua_setfield(L, -2, "loaded"); | |
| 716 | /* set field `preload' */ | |
| 717 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); | |
| 718 | lua_setfield(L, -2, "preload"); | |
| 719 | lua_pushglobaltable(L); | |
| 720 | lua_pushvalue(L, -2); /* set 'package' as upvalue for next lib */ | |
| 721 | luaL_setfuncs(L, ll_funcs, 1); /* open lib into global table */ | |
| 722 | lua_pop(L, 1); /* pop global table */ | |
| 723 | return 1; /* return 'package' table */ | |
| 724 | 724 | } |
| 725 |
| r31373 | r31374 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | Closure *luaF_newCclosure (lua_State *L, int n) { |
| 24 | Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n), NULL, 0)->cl; | |
| 25 | c->c.nupvalues = cast_byte(n); | |
| 26 | return c; | |
| 24 | Closure *c = &luaC_newobj(L, LUA_TCCL, sizeCclosure(n), NULL, 0)->cl; | |
| 25 | c->c.nupvalues = cast_byte(n); | |
| 26 | return c; | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | |
| 30 | 30 | Closure *luaF_newLclosure (lua_State *L, int n) { |
| 31 | Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n), NULL, 0)->cl; | |
| 32 | c->l.p = NULL; | |
| 33 | c->l.nupvalues = cast_byte(n); | |
| 34 | while (n--) c->l.upvals[n] = NULL; | |
| 35 | return c; | |
| 31 | Closure *c = &luaC_newobj(L, LUA_TLCL, sizeLclosure(n), NULL, 0)->cl; | |
| 32 | c->l.p = NULL; | |
| 33 | c->l.nupvalues = cast_byte(n); | |
| 34 | while (n--) c->l.upvals[n] = NULL; | |
| 35 | return c; | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | |
| 39 | 39 | UpVal *luaF_newupval (lua_State *L) { |
| 40 | UpVal *uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), NULL, 0)->uv; | |
| 41 | uv->v = &uv->u.value; | |
| 42 | setnilvalue(uv->v); | |
| 43 | return uv; | |
| 40 | UpVal *uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), NULL, 0)->uv; | |
| 41 | uv->v = &uv->u.value; | |
| 42 | setnilvalue(uv->v); | |
| 43 | return uv; | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | UpVal *luaF_findupval (lua_State *L, StkId level) { |
| 48 | global_State *g = G(L); | |
| 49 | GCObject **pp = &L->openupval; | |
| 50 | UpVal *p; | |
| 51 | UpVal *uv; | |
| 52 | while (*pp != NULL && (p = gco2uv(*pp))->v >= level) { | |
| 53 | GCObject *o = obj2gco(p); | |
| 54 | lua_assert(p->v != &p->u.value); | |
| 55 | lua_assert(!isold(o) || isold(obj2gco(L))); | |
| 56 | if (p->v == level) { /* found a corresponding upvalue? */ | |
| 57 | if (isdead(g, o)) /* is it dead? */ | |
| 58 | changewhite(o); /* resurrect it */ | |
| 59 | return p; | |
| 60 | } | |
| 61 | pp = &p->next; | |
| 62 | } | |
| 63 | /* not found: create a new one */ | |
| 64 | uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), pp, 0)->uv; | |
| 65 | uv->v = level; /* current value lives in the stack */ | |
| 66 | uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ | |
| 67 | uv->u.l.next = g->uvhead.u.l.next; | |
| 68 | uv->u.l.next->u.l.prev = uv; | |
| 69 | g->uvhead.u.l.next = uv; | |
| 70 | lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); | |
| 71 | return uv; | |
| 48 | global_State *g = G(L); | |
| 49 | GCObject **pp = &L->openupval; | |
| 50 | UpVal *p; | |
| 51 | UpVal *uv; | |
| 52 | while (*pp != NULL && (p = gco2uv(*pp))->v >= level) { | |
| 53 | GCObject *o = obj2gco(p); | |
| 54 | lua_assert(p->v != &p->u.value); | |
| 55 | lua_assert(!isold(o) || isold(obj2gco(L))); | |
| 56 | if (p->v == level) { /* found a corresponding upvalue? */ | |
| 57 | if (isdead(g, o)) /* is it dead? */ | |
| 58 | changewhite(o); /* resurrect it */ | |
| 59 | return p; | |
| 60 | } | |
| 61 | pp = &p->next; | |
| 62 | } | |
| 63 | /* not found: create a new one */ | |
| 64 | uv = &luaC_newobj(L, LUA_TUPVAL, sizeof(UpVal), pp, 0)->uv; | |
| 65 | uv->v = level; /* current value lives in the stack */ | |
| 66 | uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ | |
| 67 | uv->u.l.next = g->uvhead.u.l.next; | |
| 68 | uv->u.l.next->u.l.prev = uv; | |
| 69 | g->uvhead.u.l.next = uv; | |
| 70 | lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); | |
| 71 | return uv; | |
| 72 | 72 | } |
| 73 | 73 | |
| 74 | 74 | |
| 75 | 75 | static void unlinkupval (UpVal *uv) { |
| 76 | lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); | |
| 77 | uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ | |
| 78 | uv->u.l.prev->u.l.next = uv->u.l.next; | |
| 76 | lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); | |
| 77 | uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ | |
| 78 | uv->u.l.prev->u.l.next = uv->u.l.next; | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| 82 | 82 | void luaF_freeupval (lua_State *L, UpVal *uv) { |
| 83 | if (uv->v != &uv->u.value) /* is it open? */ | |
| 84 | unlinkupval(uv); /* remove from open list */ | |
| 85 | luaM_free(L, uv); /* free upvalue */ | |
| 83 | if (uv->v != &uv->u.value) /* is it open? */ | |
| 84 | unlinkupval(uv); /* remove from open list */ | |
| 85 | luaM_free(L, uv); /* free upvalue */ | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | void luaF_close (lua_State *L, StkId level) { |
| 90 | UpVal *uv; | |
| 91 | global_State *g = G(L); | |
| 92 | while (L->openupval != NULL && (uv = gco2uv(L->openupval))->v >= level) { | |
| 93 | GCObject *o = obj2gco(uv); | |
| 94 | lua_assert(!isblack(o) && uv->v != &uv->u.value); | |
| 95 | L->openupval = uv->next; /* remove from `open' list */ | |
| 96 | if (isdead(g, o)) | |
| 97 | luaF_freeupval(L, uv); /* free upvalue */ | |
| 98 | else { | |
| 99 | unlinkupval(uv); /* remove upvalue from 'uvhead' list */ | |
| 100 | setobj(L, &uv->u.value, uv->v); /* move value to upvalue slot */ | |
| 101 | uv->v = &uv->u.value; /* now current value lives here */ | |
| 102 | gch(o)->next = g->allgc; /* link upvalue into 'allgc' list */ | |
| 103 | g->allgc = o; | |
| 104 | luaC_checkupvalcolor(g, uv); | |
| 105 | } | |
| 106 | } | |
| 90 | UpVal *uv; | |
| 91 | global_State *g = G(L); | |
| 92 | while (L->openupval != NULL && (uv = gco2uv(L->openupval))->v >= level) { | |
| 93 | GCObject *o = obj2gco(uv); | |
| 94 | lua_assert(!isblack(o) && uv->v != &uv->u.value); | |
| 95 | L->openupval = uv->next; /* remove from `open' list */ | |
| 96 | if (isdead(g, o)) | |
| 97 | luaF_freeupval(L, uv); /* free upvalue */ | |
| 98 | else { | |
| 99 | unlinkupval(uv); /* remove upvalue from 'uvhead' list */ | |
| 100 | setobj(L, &uv->u.value, uv->v); /* move value to upvalue slot */ | |
| 101 | uv->v = &uv->u.value; /* now current value lives here */ | |
| 102 | gch(o)->next = g->allgc; /* link upvalue into 'allgc' list */ | |
| 103 | g->allgc = o; | |
| 104 | luaC_checkupvalcolor(g, uv); | |
| 105 | } | |
| 106 | } | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | Proto *luaF_newproto (lua_State *L) { |
| 111 | Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), NULL, 0)->p; | |
| 112 | f->k = NULL; | |
| 113 | f->sizek = 0; | |
| 114 | f->p = NULL; | |
| 115 | f->sizep = 0; | |
| 116 | f->code = NULL; | |
| 117 | f->cache = NULL; | |
| 118 | f->sizecode = 0; | |
| 119 | f->lineinfo = NULL; | |
| 120 | f->sizelineinfo = 0; | |
| 121 | f->upvalues = NULL; | |
| 122 | f->sizeupvalues = 0; | |
| 123 | f->numparams = 0; | |
| 124 | f->is_vararg = 0; | |
| 125 | f->maxstacksize = 0; | |
| 126 | f->locvars = NULL; | |
| 127 | f->sizelocvars = 0; | |
| 128 | f->linedefined = 0; | |
| 129 | f->lastlinedefined = 0; | |
| 130 | f->source = NULL; | |
| 131 | return f; | |
| 111 | Proto *f = &luaC_newobj(L, LUA_TPROTO, sizeof(Proto), NULL, 0)->p; | |
| 112 | f->k = NULL; | |
| 113 | f->sizek = 0; | |
| 114 | f->p = NULL; | |
| 115 | f->sizep = 0; | |
| 116 | f->code = NULL; | |
| 117 | f->cache = NULL; | |
| 118 | f->sizecode = 0; | |
| 119 | f->lineinfo = NULL; | |
| 120 | f->sizelineinfo = 0; | |
| 121 | f->upvalues = NULL; | |
| 122 | f->sizeupvalues = 0; | |
| 123 | f->numparams = 0; | |
| 124 | f->is_vararg = 0; | |
| 125 | f->maxstacksize = 0; | |
| 126 | f->locvars = NULL; | |
| 127 | f->sizelocvars = 0; | |
| 128 | f->linedefined = 0; | |
| 129 | f->lastlinedefined = 0; | |
| 130 | f->source = NULL; | |
| 131 | return f; | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | void luaF_freeproto (lua_State *L, Proto *f) { |
| 136 | luaM_freearray(L, f->code, f->sizecode); | |
| 137 | luaM_freearray(L, f->p, f->sizep); | |
| 138 | luaM_freearray(L, f->k, f->sizek); | |
| 139 | luaM_freearray(L, f->lineinfo, f->sizelineinfo); | |
| 140 | luaM_freearray(L, f->locvars, f->sizelocvars); | |
| 141 | luaM_freearray(L, f->upvalues, f->sizeupvalues); | |
| 142 | luaM_free(L, f); | |
| 136 | luaM_freearray(L, f->code, f->sizecode); | |
| 137 | luaM_freearray(L, f->p, f->sizep); | |
| 138 | luaM_freearray(L, f->k, f->sizek); | |
| 139 | luaM_freearray(L, f->lineinfo, f->sizelineinfo); | |
| 140 | luaM_freearray(L, f->locvars, f->sizelocvars); | |
| 141 | luaM_freearray(L, f->upvalues, f->sizeupvalues); | |
| 142 | luaM_free(L, f); | |
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | |
| r31373 | r31374 | |
| 148 | 148 | ** Returns NULL if not found. |
| 149 | 149 | */ |
| 150 | 150 | const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { |
| 151 | int i; | |
| 152 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { | |
| 153 | if (pc < f->locvars[i].endpc) { /* is variable active? */ | |
| 154 | local_number--; | |
| 155 | if (local_number == 0) | |
| 156 | return getstr(f->locvars[i].varname); | |
| 157 | } | |
| 158 | } | |
| 159 | return NULL; /* not found */ | |
| 151 | int i; | |
| 152 | for (i = 0; i<f->sizelocvars && f->locvars[i].startpc <= pc; i++) { | |
| 153 | if (pc < f->locvars[i].endpc) { /* is variable active? */ | |
| 154 | local_number--; | |
| 155 | if (local_number == 0) | |
| 156 | return getstr(f->locvars[i].varname); | |
| 157 | } | |
| 158 | } | |
| 159 | return NULL; /* not found */ | |
| 160 | 160 | } |
| 161 |
| r31373 | r31374 | |
|---|---|---|
| 29 | 29 | |
| 30 | 30 | /* maximum number of local variables per function (must be smaller |
| 31 | 31 | than 250, due to the bytecode format) */ |
| 32 | #define MAXVARS | |
| 32 | #define MAXVARS 200 | |
| 33 | 33 | |
| 34 | 34 | |
| 35 | #define hasmultret(k) | |
| 35 | #define hasmultret(k) ((k) == VCALL || (k) == VVARARG) | |
| 36 | 36 | |
| 37 | 37 | |
| 38 | 38 | |
| r31373 | r31374 | |
| 40 | 40 | ** nodes for block list (list of active blocks) |
| 41 | 41 | */ |
| 42 | 42 | typedef struct BlockCnt { |
| 43 | struct BlockCnt *previous; /* chain */ | |
| 44 | short firstlabel; /* index of first label in this block */ | |
| 45 | short firstgoto; /* index of first pending goto in this block */ | |
| 46 | lu_byte nactvar; /* # active locals outside the block */ | |
| 47 | lu_byte upval; /* true if some variable in the block is an upvalue */ | |
| 48 | lu_byte isloop; /* true if `block' is a loop */ | |
| 43 | struct BlockCnt *previous; /* chain */ | |
| 44 | short firstlabel; /* index of first label in this block */ | |
| 45 | short firstgoto; /* index of first pending goto in this block */ | |
| 46 | lu_byte nactvar; /* # active locals outside the block */ | |
| 47 | lu_byte upval; /* true if some variable in the block is an upvalue */ | |
| 48 | lu_byte isloop; /* true if `block' is a loop */ | |
| 49 | 49 | } BlockCnt; |
| 50 | 50 | |
| 51 | 51 | |
| r31373 | r31374 | |
| 58 | 58 | |
| 59 | 59 | |
| 60 | 60 | static void anchor_token (LexState *ls) { |
| 61 | /* last token from outer function must be EOS */ | |
| 62 | lua_assert(ls->fs != NULL || ls->t.token == TK_EOS); | |
| 63 | if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) { | |
| 64 | TString *ts = ls->t.seminfo.ts; | |
| 65 | luaX_newstring(ls, getstr(ts), ts->tsv.len); | |
| 66 | } | |
| 61 | /* last token from outer function must be EOS */ | |
| 62 | lua_assert(ls->fs != NULL || ls->t.token == TK_EOS); | |
| 63 | if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) { | |
| 64 | TString *ts = ls->t.seminfo.ts; | |
| 65 | luaX_newstring(ls, getstr(ts), ts->tsv.len); | |
| 66 | } | |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | /* semantic error */ |
| 71 | 71 | static l_noret semerror (LexState *ls, const char *msg) { |
| 72 | ls->t.token = 0; /* remove 'near to' from final message */ | |
| 73 | luaX_syntaxerror(ls, msg); | |
| 72 | ls->t.token = 0; /* remove 'near to' from final message */ | |
| 73 | luaX_syntaxerror(ls, msg); | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
| 77 | 77 | static l_noret error_expected (LexState *ls, int token) { |
| 78 | luaX_syntaxerror(ls, | |
| 79 | luaO_pushfstring(ls->L, "%s expected", luaX_token2str(ls, token))); | |
| 78 | luaX_syntaxerror(ls, | |
| 79 | luaO_pushfstring(ls->L, "%s expected", luaX_token2str(ls, token))); | |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | |
| 83 | 83 | static l_noret errorlimit (FuncState *fs, int limit, const char *what) { |
| 84 | lua_State *L = fs->ls->L; | |
| 85 | const char *msg; | |
| 86 | int line = fs->f->linedefined; | |
| 87 | const char *where = (line == 0) | |
| 88 | ? "main function" | |
| 89 | : luaO_pushfstring(L, "function at line %d", line); | |
| 90 | msg = luaO_pushfstring(L, "too many %s (limit is %d) in %s", | |
| 91 | what, limit, where); | |
| 92 | luaX_syntaxerror(fs->ls, msg); | |
| 84 | lua_State *L = fs->ls->L; | |
| 85 | const char *msg; | |
| 86 | int line = fs->f->linedefined; | |
| 87 | const char *where = (line == 0) | |
| 88 | ? "main function" | |
| 89 | : luaO_pushfstring(L, "function at line %d", line); | |
| 90 | msg = luaO_pushfstring(L, "too many %s (limit is %d) in %s", | |
| 91 | what, limit, where); | |
| 92 | luaX_syntaxerror(fs->ls, msg); | |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
| 96 | 96 | static void checklimit (FuncState *fs, int v, int l, const char *what) { |
| 97 | ||
| 97 | if (v > l) errorlimit(fs, l, what); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | static int testnext (LexState *ls, int c) { |
| 102 | if (ls->t.token == c) { | |
| 103 | luaX_next(ls); | |
| 104 | return 1; | |
| 105 | } | |
| 106 | else return 0; | |
| 102 | if (ls->t.token == c) { | |
| 103 | luaX_next(ls); | |
| 104 | return 1; | |
| 105 | } | |
| 106 | else return 0; | |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | |
| 110 | 110 | static void check (LexState *ls, int c) { |
| 111 | if (ls->t.token != c) | |
| 112 | error_expected(ls, c); | |
| 111 | if (ls->t.token != c) | |
| 112 | error_expected(ls, c); | |
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | |
| 116 | 116 | static void checknext (LexState *ls, int c) { |
| 117 | check(ls, c); | |
| 118 | luaX_next(ls); | |
| 117 | check(ls, c); | |
| 118 | luaX_next(ls); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | |
| 122 | #define check_condition(ls,c,msg) | |
| 122 | #define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); } | |
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | |
| 126 | 126 | static void check_match (LexState *ls, int what, int who, int where) { |
| 127 | if (!testnext(ls, what)) { | |
| 128 | if (where == ls->linenumber) | |
| 129 | error_expected(ls, what); | |
| 130 | else { | |
| 131 | luaX_syntaxerror(ls, luaO_pushfstring(ls->L, | |
| 132 | "%s expected (to close %s at line %d)", | |
| 133 | luaX_token2str(ls, what), luaX_token2str(ls, who), where)); | |
| 134 | } | |
| 135 | } | |
| 127 | if (!testnext(ls, what)) { | |
| 128 | if (where == ls->linenumber) | |
| 129 | error_expected(ls, what); | |
| 130 | else { | |
| 131 | luaX_syntaxerror(ls, luaO_pushfstring(ls->L, | |
| 132 | "%s expected (to close %s at line %d)", | |
| 133 | luaX_token2str(ls, what), luaX_token2str(ls, who), where)); | |
| 134 | } | |
| 135 | } | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | static TString *str_checkname (LexState *ls) { |
| 140 | TString *ts; | |
| 141 | check(ls, TK_NAME); | |
| 142 | ts = ls->t.seminfo.ts; | |
| 143 | luaX_next(ls); | |
| 144 | return ts; | |
| 140 | TString *ts; | |
| 141 | check(ls, TK_NAME); | |
| 142 | ts = ls->t.seminfo.ts; | |
| 143 | luaX_next(ls); | |
| 144 | return ts; | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | static void init_exp (expdesc *e, expkind k, int i) { |
| 149 | e->f = e->t = NO_JUMP; | |
| 150 | e->k = k; | |
| 151 | e->u.info = i; | |
| 149 | e->f = e->t = NO_JUMP; | |
| 150 | e->k = k; | |
| 151 | e->u.info = i; | |
| 152 | 152 | } |
| 153 | 153 | |
| 154 | 154 | |
| 155 | 155 | static void codestring (LexState *ls, expdesc *e, TString *s) { |
| 156 | ||
| 156 | init_exp(e, VK, luaK_stringK(ls->fs, s)); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | static void checkname (LexState *ls, expdesc *e) { |
| 161 | ||
| 161 | codestring(ls, e, str_checkname(ls)); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | static int registerlocalvar (LexState *ls, TString *varname) { |
| 166 | FuncState *fs = ls->fs; | |
| 167 | Proto *f = fs->f; | |
| 168 | int oldsize = f->sizelocvars; | |
| 169 | luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars, | |
| 170 | LocVar, SHRT_MAX, "local variables"); | |
| 171 | while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; | |
| 172 | f->locvars[fs->nlocvars].varname = varname; | |
| 173 | luaC_objbarrier(ls->L, f, varname); | |
| 174 | return fs->nlocvars++; | |
| 166 | FuncState *fs = ls->fs; | |
| 167 | Proto *f = fs->f; | |
| 168 | int oldsize = f->sizelocvars; | |
| 169 | luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars, | |
| 170 | LocVar, SHRT_MAX, "local variables"); | |
| 171 | while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; | |
| 172 | f->locvars[fs->nlocvars].varname = varname; | |
| 173 | luaC_objbarrier(ls->L, f, varname); | |
| 174 | return fs->nlocvars++; | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | static void new_localvar (LexState *ls, TString *name) { |
| 179 | FuncState *fs = ls->fs; | |
| 180 | Dyndata *dyd = ls->dyd; | |
| 181 | int reg = registerlocalvar(ls, name); | |
| 182 | checklimit(fs, dyd->actvar.n + 1 - fs->firstlocal, | |
| 183 | MAXVARS, "local variables"); | |
| 184 | luaM_growvector(ls->L, dyd->actvar.arr, dyd->actvar.n + 1, | |
| 185 | dyd->actvar.size, Vardesc, MAX_INT, "local variables"); | |
| 186 | dyd->actvar.arr[dyd->actvar.n++].idx = cast(short, reg); | |
| 179 | FuncState *fs = ls->fs; | |
| 180 | Dyndata *dyd = ls->dyd; | |
| 181 | int reg = registerlocalvar(ls, name); | |
| 182 | checklimit(fs, dyd->actvar.n + 1 - fs->firstlocal, | |
| 183 | MAXVARS, "local variables"); | |
| 184 | luaM_growvector(ls->L, dyd->actvar.arr, dyd->actvar.n + 1, | |
| 185 | dyd->actvar.size, Vardesc, MAX_INT, "local variables"); | |
| 186 | dyd->actvar.arr[dyd->actvar.n++].idx = cast(short, reg); | |
| 187 | 187 | } |
| 188 | 188 | |
| 189 | 189 | |
| 190 | 190 | static void new_localvarliteral_ (LexState *ls, const char *name, size_t sz) { |
| 191 | ||
| 191 | new_localvar(ls, luaX_newstring(ls, name, sz)); | |
| 192 | 192 | } |
| 193 | 193 | |
| 194 | 194 | #define new_localvarliteral(ls,v) \ |
| r31373 | r31374 | |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | static LocVar *getlocvar (FuncState *fs, int i) { |
| 199 | int idx = fs->ls->dyd->actvar.arr[fs->firstlocal + i].idx; | |
| 200 | lua_assert(idx < fs->nlocvars); | |
| 201 | return &fs->f->locvars[idx]; | |
| 199 | int idx = fs->ls->dyd->actvar.arr[fs->firstlocal + i].idx; | |
| 200 | lua_assert(idx < fs->nlocvars); | |
| 201 | return &fs->f->locvars[idx]; | |
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | |
| 205 | 205 | static void adjustlocalvars (LexState *ls, int nvars) { |
| 206 | FuncState *fs = ls->fs; | |
| 207 | fs->nactvar = cast_byte(fs->nactvar + nvars); | |
| 208 | for (; nvars; nvars--) { | |
| 209 | getlocvar(fs, fs->nactvar - nvars)->startpc = fs->pc; | |
| 210 | } | |
| 206 | FuncState *fs = ls->fs; | |
| 207 | fs->nactvar = cast_byte(fs->nactvar + nvars); | |
| 208 | for (; nvars; nvars--) { | |
| 209 | getlocvar(fs, fs->nactvar - nvars)->startpc = fs->pc; | |
| 210 | } | |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | |
| 214 | 214 | static void removevars (FuncState *fs, int tolevel) { |
| 215 | fs->ls->dyd->actvar.n -= (fs->nactvar - tolevel); | |
| 216 | while (fs->nactvar > tolevel) | |
| 217 | getlocvar(fs, --fs->nactvar)->endpc = fs->pc; | |
| 215 | fs->ls->dyd->actvar.n -= (fs->nactvar - tolevel); | |
| 216 | while (fs->nactvar > tolevel) | |
| 217 | getlocvar(fs, --fs->nactvar)->endpc = fs->pc; | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | |
| 221 | 221 | static int searchupvalue (FuncState *fs, TString *name) { |
| 222 | int i; | |
| 223 | Upvaldesc *up = fs->f->upvalues; | |
| 224 | for (i = 0; i < fs->nups; i++) { | |
| 225 | if (luaS_eqstr(up[i].name, name)) return i; | |
| 226 | } | |
| 227 | return -1; /* not found */ | |
| 222 | int i; | |
| 223 | Upvaldesc *up = fs->f->upvalues; | |
| 224 | for (i = 0; i < fs->nups; i++) { | |
| 225 | if (luaS_eqstr(up[i].name, name)) return i; | |
| 226 | } | |
| 227 | return -1; /* not found */ | |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | |
| 231 | 231 | static int newupvalue (FuncState *fs, TString *name, expdesc *v) { |
| 232 | Proto *f = fs->f; | |
| 233 | int oldsize = f->sizeupvalues; | |
| 234 | checklimit(fs, fs->nups + 1, MAXUPVAL, "upvalues"); | |
| 235 | luaM_growvector(fs->ls->L, f->upvalues, fs->nups, f->sizeupvalues, | |
| 236 | Upvaldesc, MAXUPVAL, "upvalues"); | |
| 237 | while (oldsize < f->sizeupvalues) f->upvalues[oldsize++].name = NULL; | |
| 238 | f->upvalues[fs->nups].instack = (v->k == VLOCAL); | |
| 239 | f->upvalues[fs->nups].idx = cast_byte(v->u.info); | |
| 240 | f->upvalues[fs->nups].name = name; | |
| 241 | luaC_objbarrier(fs->ls->L, f, name); | |
| 242 | return fs->nups++; | |
| 232 | Proto *f = fs->f; | |
| 233 | int oldsize = f->sizeupvalues; | |
| 234 | checklimit(fs, fs->nups + 1, MAXUPVAL, "upvalues"); | |
| 235 | luaM_growvector(fs->ls->L, f->upvalues, fs->nups, f->sizeupvalues, | |
| 236 | Upvaldesc, MAXUPVAL, "upvalues"); | |
| 237 | while (oldsize < f->sizeupvalues) f->upvalues[oldsize++].name = NULL; | |
| 238 | f->upvalues[fs->nups].instack = (v->k == VLOCAL); | |
| 239 | f->upvalues[fs->nups].idx = cast_byte(v->u.info); | |
| 240 | f->upvalues[fs->nups].name = name; | |
| 241 | luaC_objbarrier(fs->ls->L, f, name); | |
| 242 | return fs->nups++; | |
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | |
| 246 | 246 | static int searchvar (FuncState *fs, TString *n) { |
| 247 | int i; | |
| 248 | for (i = cast_int(fs->nactvar) - 1; i >= 0; i--) { | |
| 249 | if (luaS_eqstr(n, getlocvar(fs, i)->varname)) | |
| 250 | return i; | |
| 251 | } | |
| 252 | return -1; /* not found */ | |
| 247 | int i; | |
| 248 | for (i = cast_int(fs->nactvar) - 1; i >= 0; i--) { | |
| 249 | if (luaS_eqstr(n, getlocvar(fs, i)->varname)) | |
| 250 | return i; | |
| 251 | } | |
| 252 | return -1; /* not found */ | |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | |
| r31373 | r31374 | |
| 258 | 258 | (to emit close instructions later). |
| 259 | 259 | */ |
| 260 | 260 | static void markupval (FuncState *fs, int level) { |
| 261 | BlockCnt *bl = fs->bl; | |
| 262 | while (bl->nactvar > level) bl = bl->previous; | |
| 263 | bl->upval = 1; | |
| 261 | BlockCnt *bl = fs->bl; | |
| 262 | while (bl->nactvar > level) bl = bl->previous; | |
| 263 | bl->upval = 1; | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
| r31373 | r31374 | |
| 269 | 269 | upvalue into all intermediate functions. |
| 270 | 270 | */ |
| 271 | 271 | static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) { |
| 272 | if (fs == NULL) /* no more levels? */ | |
| 273 | return VVOID; /* default is global */ | |
| 274 | else { | |
| 275 | int v = searchvar(fs, n); /* look up locals at current level */ | |
| 276 | if (v >= 0) { /* found? */ | |
| 277 | init_exp(var, VLOCAL, v); /* variable is local */ | |
| 278 | if (!base) | |
| 279 | markupval(fs, v); /* local will be used as an upval */ | |
| 280 | return VLOCAL; | |
| 281 | } | |
| 282 | else { /* not found as local at current level; try upvalues */ | |
| 283 | int idx = searchupvalue(fs, n); /* try existing upvalues */ | |
| 284 | if (idx < 0) { /* not found? */ | |
| 285 | if (singlevaraux(fs->prev, n, var, 0) == VVOID) /* try upper levels */ | |
| 286 | return VVOID; /* not found; is a global */ | |
| 287 | /* else was LOCAL or UPVAL */ | |
| 288 | idx = newupvalue(fs, n, var); /* will be a new upvalue */ | |
| 289 | } | |
| 290 | init_exp(var, VUPVAL, idx); | |
| 291 | return VUPVAL; | |
| 292 | } | |
| 293 | } | |
| 272 | if (fs == NULL) /* no more levels? */ | |
| 273 | return VVOID; /* default is global */ | |
| 274 | else { | |
| 275 | int v = searchvar(fs, n); /* look up locals at current level */ | |
| 276 | if (v >= 0) { /* found? */ | |
| 277 | init_exp(var, VLOCAL, v); /* variable is local */ | |
| 278 | if (!base) | |
| 279 | markupval(fs, v); /* local will be used as an upval */ | |
| 280 | return VLOCAL; | |
| 281 | } | |
| 282 | else { /* not found as local at current level; try upvalues */ | |
| 283 | int idx = searchupvalue(fs, n); /* try existing upvalues */ | |
| 284 | if (idx < 0) { /* not found? */ | |
| 285 | if (singlevaraux(fs->prev, n, var, 0) == VVOID) /* try upper levels */ | |
| 286 | return VVOID; /* not found; is a global */ | |
| 287 | /* else was LOCAL or UPVAL */ | |
| 288 | idx = newupvalue(fs, n, var); /* will be a new upvalue */ | |
| 289 | } | |
| 290 | init_exp(var, VUPVAL, idx); | |
| 291 | return VUPVAL; | |
| 292 | } | |
| 293 | } | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | |
| 297 | 297 | static void singlevar (LexState *ls, expdesc *var) { |
| 298 | TString *varname = str_checkname(ls); | |
| 299 | FuncState *fs = ls->fs; | |
| 300 | if (singlevaraux(fs, varname, var, 1) == VVOID) { /* global name? */ | |
| 301 | expdesc key; | |
| 302 | singlevaraux(fs, ls->envn, var, 1); /* get environment variable */ | |
| 303 | lua_assert(var->k == VLOCAL || var->k == VUPVAL); | |
| 304 | codestring(ls, &key, varname); /* key is variable name */ | |
| 305 | luaK_indexed(fs, var, &key); /* env[varname] */ | |
| 306 | } | |
| 298 | TString *varname = str_checkname(ls); | |
| 299 | FuncState *fs = ls->fs; | |
| 300 | if (singlevaraux(fs, varname, var, 1) == VVOID) { /* global name? */ | |
| 301 | expdesc key; | |
| 302 | singlevaraux(fs, ls->envn, var, 1); /* get environment variable */ | |
| 303 | lua_assert(var->k == VLOCAL || var->k == VUPVAL); | |
| 304 | codestring(ls, &key, varname); /* key is variable name */ | |
| 305 | luaK_indexed(fs, var, &key); /* env[varname] */ | |
| 306 | } | |
| 307 | 307 | } |
| 308 | 308 | |
| 309 | 309 | |
| 310 | 310 | static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { |
| 311 | FuncState *fs = ls->fs; | |
| 312 | int extra = nvars - nexps; | |
| 313 | if (hasmultret(e->k)) { | |
| 314 | extra++; /* includes call itself */ | |
| 315 | if (extra < 0) extra = 0; | |
| 316 | luaK_setreturns(fs, e, extra); /* last exp. provides the difference */ | |
| 317 | if (extra > 1) luaK_reserveregs(fs, extra-1); | |
| 318 | } | |
| 319 | else { | |
| 320 | if (e->k != VVOID) luaK_exp2nextreg(fs, e); /* close last expression */ | |
| 321 | if (extra > 0) { | |
| 322 | int reg = fs->freereg; | |
| 323 | luaK_reserveregs(fs, extra); | |
| 324 | luaK_nil(fs, reg, extra); | |
| 325 | } | |
| 326 | } | |
| 311 | FuncState *fs = ls->fs; | |
| 312 | int extra = nvars - nexps; | |
| 313 | if (hasmultret(e->k)) { | |
| 314 | extra++; /* includes call itself */ | |
| 315 | if (extra < 0) extra = 0; | |
| 316 | luaK_setreturns(fs, e, extra); /* last exp. provides the difference */ | |
| 317 | if (extra > 1) luaK_reserveregs(fs, extra-1); | |
| 318 | } | |
| 319 | else { | |
| 320 | if (e->k != VVOID) luaK_exp2nextreg(fs, e); /* close last expression */ | |
| 321 | if (extra > 0) { | |
| 322 | int reg = fs->freereg; | |
| 323 | luaK_reserveregs(fs, extra); | |
| 324 | luaK_nil(fs, reg, extra); | |
| 325 | } | |
| 326 | } | |
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | |
| 330 | 330 | static void enterlevel (LexState *ls) { |
| 331 | lua_State *L = ls->L; | |
| 332 | ++L->nCcalls; | |
| 333 | checklimit(ls->fs, L->nCcalls, LUAI_MAXCCALLS, "C levels"); | |
| 331 | lua_State *L = ls->L; | |
| 332 | ++L->nCcalls; | |
| 333 | checklimit(ls->fs, L->nCcalls, LUAI_MAXCCALLS, "C levels"); | |
| 334 | 334 | } |
| 335 | 335 | |
| 336 | 336 | |
| 337 | #define leavelevel(ls) | |
| 337 | #define leavelevel(ls) ((ls)->L->nCcalls--) | |
| 338 | 338 | |
| 339 | 339 | |
| 340 | 340 | static void closegoto (LexState *ls, int g, Labeldesc *label) { |
| 341 | int i; | |
| 342 | FuncState *fs = ls->fs; | |
| 343 | Labellist *gl = &ls->dyd->gt; | |
| 344 | Labeldesc *gt = &gl->arr[g]; | |
| 345 | lua_assert(luaS_eqstr(gt->name, label->name)); | |
| 346 | if (gt->nactvar < label->nactvar) { | |
| 347 | TString *vname = getlocvar(fs, gt->nactvar)->varname; | |
| 348 | const char *msg = luaO_pushfstring(ls->L, | |
| 349 | "<goto %s> at line %d jumps into the scope of local " LUA_QS, | |
| 350 | getstr(gt->name), gt->line, getstr(vname)); | |
| 351 | semerror(ls, msg); | |
| 352 | } | |
| 353 | luaK_patchlist(fs, gt->pc, label->pc); | |
| 354 | /* remove goto from pending list */ | |
| 355 | for (i = g; i < gl->n - 1; i++) | |
| 356 | gl->arr[i] = gl->arr[i + 1]; | |
| 357 | gl->n--; | |
| 341 | int i; | |
| 342 | FuncState *fs = ls->fs; | |
| 343 | Labellist *gl = &ls->dyd->gt; | |
| 344 | Labeldesc *gt = &gl->arr[g]; | |
| 345 | lua_assert(luaS_eqstr(gt->name, label->name)); | |
| 346 | if (gt->nactvar < label->nactvar) { | |
| 347 | TString *vname = getlocvar(fs, gt->nactvar)->varname; | |
| 348 | const char *msg = luaO_pushfstring(ls->L, | |
| 349 | "<goto %s> at line %d jumps into the scope of local " LUA_QS, | |
| 350 | getstr(gt->name), gt->line, getstr(vname)); | |
| 351 | semerror(ls, msg); | |
| 352 | } | |
| 353 | luaK_patchlist(fs, gt->pc, label->pc); | |
| 354 | /* remove goto from pending list */ | |
| 355 | for (i = g; i < gl->n - 1; i++) | |
| 356 | gl->arr[i] = gl->arr[i + 1]; | |
| 357 | gl->n--; | |
| 358 | 358 | } |
| 359 | 359 | |
| 360 | 360 | |
| r31373 | r31374 | |
| 362 | 362 | ** try to close a goto with existing labels; this solves backward jumps |
| 363 | 363 | */ |
| 364 | 364 | static int findlabel (LexState *ls, int g) { |
| 365 | int i; | |
| 366 | BlockCnt *bl = ls->fs->bl; | |
| 367 | Dyndata *dyd = ls->dyd; | |
| 368 | Labeldesc *gt = &dyd->gt.arr[g]; | |
| 369 | /* check labels in current block for a match */ | |
| 370 | for (i = bl->firstlabel; i < dyd->label.n; i++) { | |
| 371 | Labeldesc *lb = &dyd->label.arr[i]; | |
| 372 | if (luaS_eqstr(lb->name, gt->name)) { /* correct label? */ | |
| 373 | if (gt->nactvar > lb->nactvar && | |
| 374 | (bl->upval || dyd->label.n > bl->firstlabel)) | |
| 375 | luaK_patchclose(ls->fs, gt->pc, lb->nactvar); | |
| 376 | closegoto(ls, g, lb); /* close it */ | |
| 377 | return 1; | |
| 378 | } | |
| 379 | } | |
| 380 | return 0; /* label not found; cannot close goto */ | |
| 365 | int i; | |
| 366 | BlockCnt *bl = ls->fs->bl; | |
| 367 | Dyndata *dyd = ls->dyd; | |
| 368 | Labeldesc *gt = &dyd->gt.arr[g]; | |
| 369 | /* check labels in current block for a match */ | |
| 370 | for (i = bl->firstlabel; i < dyd->label.n; i++) { | |
| 371 | Labeldesc *lb = &dyd->label.arr[i]; | |
| 372 | if (luaS_eqstr(lb->name, gt->name)) { /* correct label? */ | |
| 373 | if (gt->nactvar > lb->nactvar && | |
| 374 | (bl->upval || dyd->label.n > bl->firstlabel)) | |
| 375 | luaK_patchclose(ls->fs, gt->pc, lb->nactvar); | |
| 376 | closegoto(ls, g, lb); /* close it */ | |
| 377 | return 1; | |
| 378 | } | |
| 379 | } | |
| 380 | return 0; /* label not found; cannot close goto */ | |
| 381 | 381 | } |
| 382 | 382 | |
| 383 | 383 | |
| 384 | 384 | static int newlabelentry (LexState *ls, Labellist *l, TString *name, |
| 385 | int line, int pc) { | |
| 386 | int n = l->n; | |
| 387 | luaM_growvector(ls->L, l->arr, n, l->size, | |
| 388 | Labeldesc, SHRT_MAX, "labels/gotos"); | |
| 389 | l->arr[n].name = name; | |
| 390 | l->arr[n].line = line; | |
| 391 | l->arr[n].nactvar = ls->fs->nactvar; | |
| 392 | l->arr[n].pc = pc; | |
| 393 | l->n++; | |
| 394 | return n; | |
| 385 | int line, int pc) { | |
| 386 | int n = l->n; | |
| 387 | luaM_growvector(ls->L, l->arr, n, l->size, | |
| 388 | Labeldesc, SHRT_MAX, "labels/gotos"); | |
| 389 | l->arr[n].name = name; | |
| 390 | l->arr[n].line = line; | |
| 391 | l->arr[n].nactvar = ls->fs->nactvar; | |
| 392 | l->arr[n].pc = pc; | |
| 393 | l->n++; | |
| 394 | return n; | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
| r31373 | r31374 | |
| 400 | 400 | ** block; solves forward jumps |
| 401 | 401 | */ |
| 402 | 402 | static void findgotos (LexState *ls, Labeldesc *lb) { |
| 403 | Labellist *gl = &ls->dyd->gt; | |
| 404 | int i = ls->fs->bl->firstgoto; | |
| 405 | while (i < gl->n) { | |
| 406 | if (luaS_eqstr(gl->arr[i].name, lb->name)) | |
| 407 | closegoto(ls, i, lb); | |
| 408 | else | |
| 409 | i++; | |
| 410 | } | |
| 403 | Labellist *gl = &ls->dyd->gt; | |
| 404 | int i = ls->fs->bl->firstgoto; | |
| 405 | while (i < gl->n) { | |
| 406 | if (luaS_eqstr(gl->arr[i].name, lb->name)) | |
| 407 | closegoto(ls, i, lb); | |
| 408 | else | |
| 409 | i++; | |
| 410 | } | |
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | |
| r31373 | r31374 | |
| 418 | 418 | ** upvalue), close those variables being exited. |
| 419 | 419 | */ |
| 420 | 420 | static void movegotosout (FuncState *fs, BlockCnt *bl) { |
| 421 | int i = bl->firstgoto; | |
| 422 | Labellist *gl = &fs->ls->dyd->gt; | |
| 423 | /* correct pending gotos to current block and try to close it | |
| 424 | with visible labels */ | |
| 425 | while (i < gl->n) { | |
| 426 | Labeldesc *gt = &gl->arr[i]; | |
| 427 | if (gt->nactvar > bl->nactvar) { | |
| 428 | if (bl->upval) | |
| 429 | luaK_patchclose(fs, gt->pc, bl->nactvar); | |
| 430 | gt->nactvar = bl->nactvar; | |
| 431 | } | |
| 432 | if (!findlabel(fs->ls, i)) | |
| 433 | i++; /* move to next one */ | |
| 434 | } | |
| 421 | int i = bl->firstgoto; | |
| 422 | Labellist *gl = &fs->ls->dyd->gt; | |
| 423 | /* correct pending gotos to current block and try to close it | |
| 424 | with visible labels */ | |
| 425 | while (i < gl->n) { | |
| 426 | Labeldesc *gt = &gl->arr[i]; | |
| 427 | if (gt->nactvar > bl->nactvar) { | |
| 428 | if (bl->upval) | |
| 429 | luaK_patchclose(fs, gt->pc, bl->nactvar); | |
| 430 | gt->nactvar = bl->nactvar; | |
| 431 | } | |
| 432 | if (!findlabel(fs->ls, i)) | |
| 433 | i++; /* move to next one */ | |
| 434 | } | |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | |
| 438 | 438 | static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isloop) { |
| 439 | bl->isloop = isloop; | |
| 440 | bl->nactvar = fs->nactvar; | |
| 441 | bl->firstlabel = fs->ls->dyd->label.n; | |
| 442 | bl->firstgoto = fs->ls->dyd->gt.n; | |
| 443 | bl->upval = 0; | |
| 444 | bl->previous = fs->bl; | |
| 445 | fs->bl = bl; | |
| 446 | lua_assert(fs->freereg == fs->nactvar); | |
| 439 | bl->isloop = isloop; | |
| 440 | bl->nactvar = fs->nactvar; | |
| 441 | bl->firstlabel = fs->ls->dyd->label.n; | |
| 442 | bl->firstgoto = fs->ls->dyd->gt.n; | |
| 443 | bl->upval = 0; | |
| 444 | bl->previous = fs->bl; | |
| 445 | fs->bl = bl; | |
| 446 | lua_assert(fs->freereg == fs->nactvar); | |
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | |
| r31373 | r31374 | |
| 451 | 451 | ** create a label named "break" to resolve break statements |
| 452 | 452 | */ |
| 453 | 453 | static void breaklabel (LexState *ls) { |
| 454 | TString *n = luaS_new(ls->L, "break"); | |
| 455 | int l = newlabelentry(ls, &ls->dyd->label, n, 0, ls->fs->pc); | |
| 456 | findgotos(ls, &ls->dyd->label.arr[l]); | |
| 454 | TString *n = luaS_new(ls->L, "break"); | |
| 455 | int l = newlabelentry(ls, &ls->dyd->label, n, 0, ls->fs->pc); | |
| 456 | findgotos(ls, &ls->dyd->label.arr[l]); | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | /* |
| r31373 | r31374 | |
| 461 | 461 | ** message when label name is a reserved word (which can only be 'break') |
| 462 | 462 | */ |
| 463 | 463 | static l_noret undefgoto (LexState *ls, Labeldesc *gt) { |
| 464 | const char *msg = isreserved(gt->name) | |
| 465 | ? "<%s> at line %d not inside a loop" | |
| 466 | : "no visible label " LUA_QS " for <goto> at line %d"; | |
| 467 | msg = luaO_pushfstring(ls->L, msg, getstr(gt->name), gt->line); | |
| 468 | semerror(ls, msg); | |
| 464 | const char *msg = isreserved(gt->name) | |
| 465 | ? "<%s> at line %d not inside a loop" | |
| 466 | : "no visible label " LUA_QS " for <goto> at line %d"; | |
| 467 | msg = luaO_pushfstring(ls->L, msg, getstr(gt->name), gt->line); | |
| 468 | semerror(ls, msg); | |
| 469 | 469 | } |
| 470 | 470 | |
| 471 | 471 | |
| 472 | 472 | static void leaveblock (FuncState *fs) { |
| 473 | BlockCnt *bl = fs->bl; | |
| 474 | LexState *ls = fs->ls; | |
| 475 | if (bl->previous && bl->upval) { | |
| 476 | /* create a 'jump to here' to close upvalues */ | |
| 477 | int j = luaK_jump(fs); | |
| 478 | luaK_patchclose(fs, j, bl->nactvar); | |
| 479 | luaK_patchtohere(fs, j); | |
| 480 | } | |
| 481 | if (bl->isloop) | |
| 482 | breaklabel(ls); /* close pending breaks */ | |
| 483 | fs->bl = bl->previous; | |
| 484 | removevars(fs, bl->nactvar); | |
| 485 | lua_assert(bl->nactvar == fs->nactvar); | |
| 486 | fs->freereg = fs->nactvar; /* free registers */ | |
| 487 | ls->dyd->label.n = bl->firstlabel; /* remove local labels */ | |
| 488 | if (bl->previous) /* inner block? */ | |
| 489 | movegotosout(fs, bl); /* update pending gotos to outer block */ | |
| 490 | else if (bl->firstgoto < ls->dyd->gt.n) /* pending gotos in outer block? */ | |
| 491 | undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */ | |
| 473 | BlockCnt *bl = fs->bl; | |
| 474 | LexState *ls = fs->ls; | |
| 475 | if (bl->previous && bl->upval) { | |
| 476 | /* create a 'jump to here' to close upvalues */ | |
| 477 | int j = luaK_jump(fs); | |
| 478 | luaK_patchclose(fs, j, bl->nactvar); | |
| 479 | luaK_patchtohere(fs, j); | |
| 480 | } | |
| 481 | if (bl->isloop) | |
| 482 | breaklabel(ls); /* close pending breaks */ | |
| 483 | fs->bl = bl->previous; | |
| 484 | removevars(fs, bl->nactvar); | |
| 485 | lua_assert(bl->nactvar == fs->nactvar); | |
| 486 | fs->freereg = fs->nactvar; /* free registers */ | |
| 487 | ls->dyd->label.n = bl->firstlabel; /* remove local labels */ | |
| 488 | if (bl->previous) /* inner block? */ | |
| 489 | movegotosout(fs, bl); /* update pending gotos to outer block */ | |
| 490 | else if (bl->firstgoto < ls->dyd->gt.n) /* pending gotos in outer block? */ | |
| 491 | undefgoto(ls, &ls->dyd->gt.arr[bl->firstgoto]); /* error */ | |
| 492 | 492 | } |
| 493 | 493 | |
| 494 | 494 | |
| r31373 | r31374 | |
| 496 | 496 | ** adds a new prototype into list of prototypes |
| 497 | 497 | */ |
| 498 | 498 | static Proto *addprototype (LexState *ls) { |
| 499 | Proto *clp; | |
| 500 | lua_State *L = ls->L; | |
| 501 | FuncState *fs = ls->fs; | |
| 502 | Proto *f = fs->f; /* prototype of current function */ | |
| 503 | if (fs->np >= f->sizep) { | |
| 504 | int oldsize = f->sizep; | |
| 505 | luaM_growvector(L, f->p, fs->np, f->sizep, Proto *, MAXARG_Bx, "functions"); | |
| 506 | while (oldsize < f->sizep) f->p[oldsize++] = NULL; | |
| 507 | } | |
| 508 | f->p[fs->np++] = clp = luaF_newproto(L); | |
| 509 | luaC_objbarrier(L, f, clp); | |
| 510 | return clp; | |
| 499 | Proto *clp; | |
| 500 | lua_State *L = ls->L; | |
| 501 | FuncState *fs = ls->fs; | |
| 502 | Proto *f = fs->f; /* prototype of current function */ | |
| 503 | if (fs->np >= f->sizep) { | |
| 504 | int oldsize = f->sizep; | |
| 505 | luaM_growvector(L, f->p, fs->np, f->sizep, Proto *, MAXARG_Bx, "functions"); | |
| 506 | while (oldsize < f->sizep) f->p[oldsize++] = NULL; | |
| 507 | } | |
| 508 | f->p[fs->np++] = clp = luaF_newproto(L); | |
| 509 | luaC_objbarrier(L, f, clp); | |
| 510 | return clp; | |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | |
| r31373 | r31374 | |
| 518 | 518 | ** are in use at that time. |
| 519 | 519 | */ |
| 520 | 520 | static void codeclosure (LexState *ls, expdesc *v) { |
| 521 | FuncState *fs = ls->fs->prev; | |
| 522 | init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np - 1)); | |
| 523 | luaK_exp2nextreg(fs, v); /* fix it at the last register */ | |
| 521 | FuncState *fs = ls->fs->prev; | |
| 522 | init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np - 1)); | |
| 523 | luaK_exp2nextreg(fs, v); /* fix it at the last register */ | |
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | |
| 527 | 527 | static void open_func (LexState *ls, FuncState *fs, BlockCnt *bl) { |
| 528 | lua_State *L = ls->L; | |
| 529 | Proto *f; | |
| 530 | fs->prev = ls->fs; /* linked list of funcstates */ | |
| 531 | fs->ls = ls; | |
| 532 | ls->fs = fs; | |
| 533 | fs->pc = 0; | |
| 534 | fs->lasttarget = 0; | |
| 535 | fs->jpc = NO_JUMP; | |
| 536 | fs->freereg = 0; | |
| 537 | fs->nk = 0; | |
| 538 | fs->np = 0; | |
| 539 | fs->nups = 0; | |
| 540 | fs->nlocvars = 0; | |
| 541 | fs->nactvar = 0; | |
| 542 | fs->firstlocal = ls->dyd->actvar.n; | |
| 543 | fs->bl = NULL; | |
| 544 | f = fs->f; | |
| 545 | f->source = ls->source; | |
| 546 | f->maxstacksize = 2; /* registers 0/1 are always valid */ | |
| 547 | fs->h = luaH_new(L); | |
| 548 | /* anchor table of constants (to avoid being collected) */ | |
| 549 | sethvalue2s(L, L->top, fs->h); | |
| 550 | incr_top(L); | |
| 551 | enterblock(fs, bl, 0); | |
| 528 | lua_State *L = ls->L; | |
| 529 | Proto *f; | |
| 530 | fs->prev = ls->fs; /* linked list of funcstates */ | |
| 531 | fs->ls = ls; | |
| 532 | ls->fs = fs; | |
| 533 | fs->pc = 0; | |
| 534 | fs->lasttarget = 0; | |
| 535 | fs->jpc = NO_JUMP; | |
| 536 | fs->freereg = 0; | |
| 537 | fs->nk = 0; | |
| 538 | fs->np = 0; | |
| 539 | fs->nups = 0; | |
| 540 | fs->nlocvars = 0; | |
| 541 | fs->nactvar = 0; | |
| 542 | fs->firstlocal = ls->dyd->actvar.n; | |
| 543 | fs->bl = NULL; | |
| 544 | f = fs->f; | |
| 545 | f->source = ls->source; | |
| 546 | f->maxstacksize = 2; /* registers 0/1 are always valid */ | |
| 547 | fs->h = luaH_new(L); | |
| 548 | /* anchor table of constants (to avoid being collected) */ | |
| 549 | sethvalue2s(L, L->top, fs->h); | |
| 550 | incr_top(L); | |
| 551 | enterblock(fs, bl, 0); | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | |
| 555 | 555 | static void close_func (LexState *ls) { |
| 556 | lua_State *L = ls->L; | |
| 557 | FuncState *fs = ls->fs; | |
| 558 | Proto *f = fs->f; | |
| 559 | luaK_ret(fs, 0, 0); /* final return */ | |
| 560 | leaveblock(fs); | |
| 561 | luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); | |
| 562 | f->sizecode = fs->pc; | |
| 563 | luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); | |
| 564 | f->sizelineinfo = fs->pc; | |
| 565 | luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); | |
| 566 | f->sizek = fs->nk; | |
| 567 | luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); | |
| 568 | f->sizep = fs->np; | |
| 569 | luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); | |
| 570 | f->sizelocvars = fs->nlocvars; | |
| 571 | luaM_reallocvector(L, f->upvalues, f->sizeupvalues, fs->nups, Upvaldesc); | |
| 572 | f->sizeupvalues = fs->nups; | |
| 573 | lua_assert(fs->bl == NULL); | |
| 574 | ls->fs = fs->prev; | |
| 575 | /* last token read was anchored in defunct function; must re-anchor it */ | |
| 576 | anchor_token(ls); | |
| 577 | L->top--; /* pop table of constants */ | |
| 578 | luaC_checkGC(L); | |
| 556 | lua_State *L = ls->L; | |
| 557 | FuncState *fs = ls->fs; | |
| 558 | Proto *f = fs->f; | |
| 559 | luaK_ret(fs, 0, 0); /* final return */ | |
| 560 | leaveblock(fs); | |
| 561 | luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); | |
| 562 | f->sizecode = fs->pc; | |
| 563 | luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); | |
| 564 | f->sizelineinfo = fs->pc; | |
| 565 | luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); | |
| 566 | f->sizek = fs->nk; | |
| 567 | luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); | |
| 568 | f->sizep = fs->np; | |
| 569 | luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); | |
| 570 | f->sizelocvars = fs->nlocvars; | |
| 571 | luaM_reallocvector(L, f->upvalues, f->sizeupvalues, fs->nups, Upvaldesc); | |
| 572 | f->sizeupvalues = fs->nups; | |
| 573 | lua_assert(fs->bl == NULL); | |
| 574 | ls->fs = fs->prev; | |
| 575 | /* last token read was anchored in defunct function; must re-anchor it */ | |
| 576 | anchor_token(ls); | |
| 577 | L->top--; /* pop table of constants */ | |
| 578 | luaC_checkGC(L); | |
| 579 | 579 | } |
| 580 | 580 | |
| 581 | 581 | |
| r31373 | r31374 | |
| 591 | 591 | ** so it handled in separate. |
| 592 | 592 | */ |
| 593 | 593 | static int block_follow (LexState *ls, int withuntil) { |
| 594 | switch (ls->t.token) { | |
| 595 | case TK_ELSE: case TK_ELSEIF: | |
| 596 | case TK_END: case TK_EOS: | |
| 597 | return 1; | |
| 598 | case TK_UNTIL: return withuntil; | |
| 599 | default: return 0; | |
| 600 | } | |
| 594 | switch (ls->t.token) { | |
| 595 | case TK_ELSE: case TK_ELSEIF: | |
| 596 | case TK_END: case TK_EOS: | |
| 597 | return 1; | |
| 598 | case TK_UNTIL: return withuntil; | |
| 599 | default: return 0; | |
| 600 | } | |
| 601 | 601 | } |
| 602 | 602 | |
| 603 | 603 | |
| 604 | 604 | static void statlist (LexState *ls) { |
| 605 | /* statlist -> { stat [`;'] } */ | |
| 606 | while (!block_follow(ls, 1)) { | |
| 607 | if (ls->t.token == TK_RETURN) { | |
| 608 | statement(ls); | |
| 609 | return; /* 'return' must be last statement */ | |
| 610 | } | |
| 611 | statement(ls); | |
| 612 | } | |
| 605 | /* statlist -> { stat [`;'] } */ | |
| 606 | while (!block_follow(ls, 1)) { | |
| 607 | if (ls->t.token == TK_RETURN) { | |
| 608 | statement(ls); | |
| 609 | return; /* 'return' must be last statement */ | |
| 610 | } | |
| 611 | statement(ls); | |
| 612 | } | |
| 613 | 613 | } |
| 614 | 614 | |
| 615 | 615 | |
| 616 | 616 | static void fieldsel (LexState *ls, expdesc *v) { |
| 617 | /* fieldsel -> ['.' | ':'] NAME */ | |
| 618 | FuncState *fs = ls->fs; | |
| 619 | expdesc key; | |
| 620 | luaK_exp2anyregup(fs, v); | |
| 621 | luaX_next(ls); /* skip the dot or colon */ | |
| 622 | checkname(ls, &key); | |
| 623 | luaK_indexed(fs, v, &key); | |
| 617 | /* fieldsel -> ['.' | ':'] NAME */ | |
| 618 | FuncState *fs = ls->fs; | |
| 619 | expdesc key; | |
| 620 | luaK_exp2anyregup(fs, v); | |
| 621 | luaX_next(ls); /* skip the dot or colon */ | |
| 622 | checkname(ls, &key); | |
| 623 | luaK_indexed(fs, v, &key); | |
| 624 | 624 | } |
| 625 | 625 | |
| 626 | 626 | |
| 627 | 627 | static void yindex (LexState *ls, expdesc *v) { |
| 628 | /* index -> '[' expr ']' */ | |
| 629 | luaX_next(ls); /* skip the '[' */ | |
| 630 | expr(ls, v); | |
| 631 | luaK_exp2val(ls->fs, v); | |
| 632 | checknext(ls, ']'); | |
| 628 | /* index -> '[' expr ']' */ | |
| 629 | luaX_next(ls); /* skip the '[' */ | |
| 630 | expr(ls, v); | |
| 631 | luaK_exp2val(ls->fs, v); | |
| 632 | checknext(ls, ']'); | |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | |
| r31373 | r31374 | |
| 641 | 641 | |
| 642 | 642 | |
| 643 | 643 | struct ConsControl { |
| 644 | expdesc v; /* last list item read */ | |
| 645 | expdesc *t; /* table descriptor */ | |
| 646 | int nh; /* total number of `record' elements */ | |
| 647 | int na; /* total number of array elements */ | |
| 648 | int tostore; /* number of array elements pending to be stored */ | |
| 644 | expdesc v; /* last list item read */ | |
| 645 | expdesc *t; /* table descriptor */ | |
| 646 | int nh; /* total number of `record' elements */ | |
| 647 | int na; /* total number of array elements */ | |
| 648 | int tostore; /* number of array elements pending to be stored */ | |
| 649 | 649 | }; |
| 650 | 650 | |
| 651 | 651 | |
| 652 | 652 | static void recfield (LexState *ls, struct ConsControl *cc) { |
| 653 | /* recfield -> (NAME | `['exp1`]') = exp1 */ | |
| 654 | FuncState *fs = ls->fs; | |
| 655 | int reg = ls->fs->freereg; | |
| 656 | expdesc key, val; | |
| 657 | int rkkey; | |
| 658 | if (ls->t.token == TK_NAME) { | |
| 659 | checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); | |
| 660 | checkname(ls, &key); | |
| 661 | } | |
| 662 | else /* ls->t.token == '[' */ | |
| 663 | yindex(ls, &key); | |
| 664 | cc->nh++; | |
| 665 | checknext(ls, '='); | |
| 666 | rkkey = luaK_exp2RK(fs, &key); | |
| 667 | expr(ls, &val); | |
| 668 | luaK_codeABC(fs, OP_SETTABLE, cc->t->u.info, rkkey, luaK_exp2RK(fs, &val)); | |
| 669 | fs->freereg = reg; /* free registers */ | |
| 653 | /* recfield -> (NAME | `['exp1`]') = exp1 */ | |
| 654 | FuncState *fs = ls->fs; | |
| 655 | int reg = ls->fs->freereg; | |
| 656 | expdesc key, val; | |
| 657 | int rkkey; | |
| 658 | if (ls->t.token == TK_NAME) { | |
| 659 | checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); | |
| 660 | checkname(ls, &key); | |
| 661 | } | |
| 662 | else /* ls->t.token == '[' */ | |
| 663 | yindex(ls, &key); | |
| 664 | cc->nh++; | |
| 665 | checknext(ls, '='); | |
| 666 | rkkey = luaK_exp2RK(fs, &key); | |
| 667 | expr(ls, &val); | |
| 668 | luaK_codeABC(fs, OP_SETTABLE, cc->t->u.info, rkkey, luaK_exp2RK(fs, &val)); | |
| 669 | fs->freereg = reg; /* free registers */ | |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | |
| 673 | 673 | static void closelistfield (FuncState *fs, struct ConsControl *cc) { |
| 674 | if (cc->v.k == VVOID) return; /* there is no list item */ | |
| 675 | luaK_exp2nextreg(fs, &cc->v); | |
| 676 | cc->v.k = VVOID; | |
| 677 | if (cc->tostore == LFIELDS_PER_FLUSH) { | |
| 678 | luaK_setlist(fs, cc->t->u.info, cc->na, cc->tostore); /* flush */ | |
| 679 | cc->tostore = 0; /* no more items pending */ | |
| 680 | } | |
| 674 | if (cc->v.k == VVOID) return; /* there is no list item */ | |
| 675 | luaK_exp2nextreg(fs, &cc->v); | |
| 676 | cc->v.k = VVOID; | |
| 677 | if (cc->tostore == LFIELDS_PER_FLUSH) { | |
| 678 | luaK_setlist(fs, cc->t->u.info, cc->na, cc->tostore); /* flush */ | |
| 679 | cc->tostore = 0; /* no more items pending */ | |
| 680 | } | |
| 681 | 681 | } |
| 682 | 682 | |
| 683 | 683 | |
| 684 | 684 | static void lastlistfield (FuncState *fs, struct ConsControl *cc) { |
| 685 | if (cc->tostore == 0) return; | |
| 686 | if (hasmultret(cc->v.k)) { | |
| 687 | luaK_setmultret(fs, &cc->v); | |
| 688 | luaK_setlist(fs, cc->t->u.info, cc->na, LUA_MULTRET); | |
| 689 | cc->na--; /* do not count last expression (unknown number of elements) */ | |
| 690 | } | |
| 691 | else { | |
| 692 | if (cc->v.k != VVOID) | |
| 693 | luaK_exp2nextreg(fs, &cc->v); | |
| 694 | luaK_setlist(fs, cc->t->u.info, cc->na, cc->tostore); | |
| 695 | } | |
| 685 | if (cc->tostore == 0) return; | |
| 686 | if (hasmultret(cc->v.k)) { | |
| 687 | luaK_setmultret(fs, &cc->v); | |
| 688 | luaK_setlist(fs, cc->t->u.info, cc->na, LUA_MULTRET); | |
| 689 | cc->na--; /* do not count last expression (unknown number of elements) */ | |
| 690 | } | |
| 691 | else { | |
| 692 | if (cc->v.k != VVOID) | |
| 693 | luaK_exp2nextreg(fs, &cc->v); | |
| 694 | luaK_setlist(fs, cc->t->u.info, cc->na, cc->tostore); | |
| 695 | } | |
| 696 | 696 | } |
| 697 | 697 | |
| 698 | 698 | |
| 699 | 699 | static void listfield (LexState *ls, struct ConsControl *cc) { |
| 700 | /* listfield -> exp */ | |
| 701 | expr(ls, &cc->v); | |
| 702 | checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor"); | |
| 703 | cc->na++; | |
| 704 | cc->tostore++; | |
| 700 | /* listfield -> exp */ | |
| 701 | expr(ls, &cc->v); | |
| 702 | checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor"); | |
| 703 | cc->na++; | |
| 704 | cc->tostore++; | |
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | |
| 708 | 708 | static void field (LexState *ls, struct ConsControl *cc) { |
| 709 | /* field -> listfield | recfield */ | |
| 710 | switch(ls->t.token) { | |
| 711 | case TK_NAME: { /* may be 'listfield' or 'recfield' */ | |
| 712 | if (luaX_lookahead(ls) != '=') /* expression? */ | |
| 713 | listfield(ls, cc); | |
| 714 | else | |
| 715 | recfield(ls, cc); | |
| 716 | break; | |
| 717 | } | |
| 718 | case '[': { | |
| 719 | recfield(ls, cc); | |
| 720 | break; | |
| 721 | } | |
| 722 | default: { | |
| 723 | listfield(ls, cc); | |
| 724 | break; | |
| 725 | } | |
| 726 | } | |
| 709 | /* field -> listfield | recfield */ | |
| 710 | switch(ls->t.token) { | |
| 711 | case TK_NAME: { /* may be 'listfield' or 'recfield' */ | |
| 712 | if (luaX_lookahead(ls) != '=') /* expression? */ | |
| 713 | listfield(ls, cc); | |
| 714 | else | |
| 715 | recfield(ls, cc); | |
| 716 | break; | |
| 717 | } | |
| 718 | case '[': { | |
| 719 | recfield(ls, cc); | |
| 720 | break; | |
| 721 | } | |
| 722 | default: { | |
| 723 | listfield(ls, cc); | |
| 724 | break; | |
| 725 | } | |
| 726 | } | |
| 727 | 727 | } |
| 728 | 728 | |
| 729 | 729 | |
| 730 | 730 | static void constructor (LexState *ls, expdesc *t) { |
| 731 | /* constructor -> '{' [ field { sep field } [sep] ] '}' | |
| 732 | sep -> ',' | ';' */ | |
| 733 | FuncState *fs = ls->fs; | |
| 734 | int line = ls->linenumber; | |
| 735 | int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0); | |
| 736 | struct ConsControl cc; | |
| 737 | cc.na = cc.nh = cc.tostore = 0; | |
| 738 | cc.t = t; | |
| 739 | init_exp(t, VRELOCABLE, pc); | |
| 740 | init_exp(&cc.v, VVOID, 0); /* no value (yet) */ | |
| 741 | luaK_exp2nextreg(ls->fs, t); /* fix it at stack top */ | |
| 742 | checknext(ls, '{'); | |
| 743 | do { | |
| 744 | lua_assert(cc.v.k == VVOID || cc.tostore > 0); | |
| 745 | if (ls->t.token == '}') break; | |
| 746 | closelistfield(fs, &cc); | |
| 747 | field(ls, &cc); | |
| 748 | } while (testnext(ls, ',') || testnext(ls, ';')); | |
| 749 | check_match(ls, '}', '{', line); | |
| 750 | lastlistfield(fs, &cc); | |
| 751 | SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */ | |
| 752 | SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh)); /* set initial table size */ | |
| 731 | /* constructor -> '{' [ field { sep field } [sep] ] '}' | |
| 732 | sep -> ',' | ';' */ | |
| 733 | FuncState *fs = ls->fs; | |
| 734 | int line = ls->linenumber; | |
| 735 | int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0); | |
| 736 | struct ConsControl cc; | |
| 737 | cc.na = cc.nh = cc.tostore = 0; | |
| 738 | cc.t = t; | |
| 739 | init_exp(t, VRELOCABLE, pc); | |
| 740 | init_exp(&cc.v, VVOID, 0); /* no value (yet) */ | |
| 741 | luaK_exp2nextreg(ls->fs, t); /* fix it at stack top */ | |
| 742 | checknext(ls, '{'); | |
| 743 | do { | |
| 744 | lua_assert(cc.v.k == VVOID || cc.tostore > 0); | |
| 745 | if (ls->t.token == '}') break; | |
| 746 | closelistfield(fs, &cc); | |
| 747 | field(ls, &cc); | |
| 748 | } while (testnext(ls, ',') || testnext(ls, ';')); | |
| 749 | check_match(ls, '}', '{', line); | |
| 750 | lastlistfield(fs, &cc); | |
| 751 | SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */ | |
| 752 | SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh)); /* set initial table size */ | |
| 753 | 753 | } |
| 754 | 754 | |
| 755 | 755 | /* }====================================================================== */ |
| r31373 | r31374 | |
| 757 | 757 | |
| 758 | 758 | |
| 759 | 759 | static void parlist (LexState *ls) { |
| 760 | /* parlist -> [ param { `,' param } ] */ | |
| 761 | FuncState *fs = ls->fs; | |
| 762 | Proto *f = fs->f; | |
| 763 | int nparams = 0; | |
| 764 | f->is_vararg = 0; | |
| 765 | if (ls->t.token != ')') { /* is `parlist' not empty? */ | |
| 766 | do { | |
| 767 | switch (ls->t.token) { | |
| 768 | case TK_NAME: { /* param -> NAME */ | |
| 769 | new_localvar(ls, str_checkname(ls)); | |
| 770 | nparams++; | |
| 771 | break; | |
| 772 | } | |
| 773 | case TK_DOTS: { /* param -> `...' */ | |
| 774 | luaX_next(ls); | |
| 775 | f->is_vararg = 1; | |
| 776 | break; | |
| 777 | } | |
| 778 | default: luaX_syntaxerror(ls, "<name> or " LUA_QL("...") " expected"); | |
| 779 | } | |
| 780 | } while (!f->is_vararg && testnext(ls, ',')); | |
| 781 | } | |
| 782 | adjustlocalvars(ls, nparams); | |
| 783 | f->numparams = cast_byte(fs->nactvar); | |
| 784 | luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */ | |
| 760 | /* parlist -> [ param { `,' param } ] */ | |
| 761 | FuncState *fs = ls->fs; | |
| 762 | Proto *f = fs->f; | |
| 763 | int nparams = 0; | |
| 764 | f->is_vararg = 0; | |
| 765 | if (ls->t.token != ')') { /* is `parlist' not empty? */ | |
| 766 | do { | |
| 767 | switch (ls->t.token) { | |
| 768 | case TK_NAME: { /* param -> NAME */ | |
| 769 | new_localvar(ls, str_checkname(ls)); | |
| 770 | nparams++; | |
| 771 | break; | |
| 772 | } | |
| 773 | case TK_DOTS: { /* param -> `...' */ | |
| 774 | luaX_next(ls); | |
| 775 | f->is_vararg = 1; | |
| 776 | break; | |
| 777 | } | |
| 778 | default: luaX_syntaxerror(ls, "<name> or " LUA_QL("...") " expected"); | |
| 779 | } | |
| 780 | } while (!f->is_vararg && testnext(ls, ',')); | |
| 781 | } | |
| 782 | adjustlocalvars(ls, nparams); | |
| 783 | f->numparams = cast_byte(fs->nactvar); | |
| 784 | luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */ | |
| 785 | 785 | } |
| 786 | 786 | |
| 787 | 787 | |
| 788 | 788 | static void body (LexState *ls, expdesc *e, int ismethod, int line) { |
| 789 | /* body -> `(' parlist `)' block END */ | |
| 790 | FuncState new_fs; | |
| 791 | BlockCnt bl; | |
| 792 | new_fs.f = addprototype(ls); | |
| 793 | new_fs.f->linedefined = line; | |
| 794 | open_func(ls, &new_fs, &bl); | |
| 795 | checknext(ls, '('); | |
| 796 | if (ismethod) { | |
| 797 | new_localvarliteral(ls, "self"); /* create 'self' parameter */ | |
| 798 | adjustlocalvars(ls, 1); | |
| 799 | } | |
| 800 | parlist(ls); | |
| 801 | checknext(ls, ')'); | |
| 802 | statlist(ls); | |
| 803 | new_fs.f->lastlinedefined = ls->linenumber; | |
| 804 | check_match(ls, TK_END, TK_FUNCTION, line); | |
| 805 | codeclosure(ls, e); | |
| 806 | close_func(ls); | |
| 789 | /* body -> `(' parlist `)' block END */ | |
| 790 | FuncState new_fs; | |
| 791 | BlockCnt bl; | |
| 792 | new_fs.f = addprototype(ls); | |
| 793 | new_fs.f->linedefined = line; | |
| 794 | open_func(ls, &new_fs, &bl); | |
| 795 | checknext(ls, '('); | |
| 796 | if (ismethod) { | |
| 797 | new_localvarliteral(ls, "self"); /* create 'self' parameter */ | |
| 798 | adjustlocalvars(ls, 1); | |
| 799 | } | |
| 800 | parlist(ls); | |
| 801 | checknext(ls, ')'); | |
| 802 | statlist(ls); | |
| 803 | new_fs.f->lastlinedefined = ls->linenumber; | |
| 804 | check_match(ls, TK_END, TK_FUNCTION, line); | |
| 805 | codeclosure(ls, e); | |
| 806 | close_func(ls); | |
| 807 | 807 | } |
| 808 | 808 | |
| 809 | 809 | |
| 810 | 810 | static int explist (LexState *ls, expdesc *v) { |
| 811 | /* explist -> expr { `,' expr } */ | |
| 812 | int n = 1; /* at least one expression */ | |
| 813 | expr(ls, v); | |
| 814 | while (testnext(ls, ',')) { | |
| 815 | luaK_exp2nextreg(ls->fs, v); | |
| 816 | expr(ls, v); | |
| 817 | n++; | |
| 818 | } | |
| 819 | return n; | |
| 811 | /* explist -> expr { `,' expr } */ | |
| 812 | int n = 1; /* at least one expression */ | |
| 813 | expr(ls, v); | |
| 814 | while (testnext(ls, ',')) { | |
| 815 | luaK_exp2nextreg(ls->fs, v); | |
| 816 | expr(ls, v); | |
| 817 | n++; | |
| 818 | } | |
| 819 | return n; | |
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | |
| 823 | 823 | static void funcargs (LexState *ls, expdesc *f, int line) { |
| 824 | FuncState *fs = ls->fs; | |
| 825 | expdesc args; | |
| 826 | int base, nparams; | |
| 827 | switch (ls->t.token) { | |
| 828 | case '(': { /* funcargs -> `(' [ explist ] `)' */ | |
| 829 | luaX_next(ls); | |
| 830 | if (ls->t.token == ')') /* arg list is empty? */ | |
| 831 | args.k = VVOID; | |
| 832 | else { | |
| 833 | explist(ls, &args); | |
| 834 | luaK_setmultret(fs, &args); | |
| 835 | } | |
| 836 | check_match(ls, ')', '(', line); | |
| 837 | break; | |
| 838 | } | |
| 839 | case '{': { /* funcargs -> constructor */ | |
| 840 | constructor(ls, &args); | |
| 841 | break; | |
| 842 | } | |
| 843 | case TK_STRING: { /* funcargs -> STRING */ | |
| 844 | codestring(ls, &args, ls->t.seminfo.ts); | |
| 845 | luaX_next(ls); /* must use `seminfo' before `next' */ | |
| 846 | break; | |
| 847 | } | |
| 848 | default: { | |
| 849 | luaX_syntaxerror(ls, "function arguments expected"); | |
| 850 | } | |
| 851 | } | |
| 852 | lua_assert(f->k == VNONRELOC); | |
| 853 | base = f->u.info; /* base register for call */ | |
| 854 | if (hasmultret(args.k)) | |
| 855 | nparams = LUA_MULTRET; /* open call */ | |
| 856 | else { | |
| 857 | if (args.k != VVOID) | |
| 858 | luaK_exp2nextreg(fs, &args); /* close last argument */ | |
| 859 | nparams = fs->freereg - (base+1); | |
| 860 | } | |
| 861 | init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); | |
| 862 | luaK_fixline(fs, line); | |
| 863 | fs->freereg = base+1; /* call remove function and arguments and leaves | |
| 824 | FuncState *fs = ls->fs; | |
| 825 | expdesc args; | |
| 826 | int base, nparams; | |
| 827 | switch (ls->t.token) { | |
| 828 | case '(': { /* funcargs -> `(' [ explist ] `)' */ | |
| 829 | luaX_next(ls); | |
| 830 | if (ls->t.token == ')') /* arg list is empty? */ | |
| 831 | args.k = VVOID; | |
| 832 | else { | |
| 833 | explist(ls, &args); | |
| 834 | luaK_setmultret(fs, &args); | |
| 835 | } | |
| 836 | check_match(ls, ')', '(', line); | |
| 837 | break; | |
| 838 | } | |
| 839 | case '{': { /* funcargs -> constructor */ | |
| 840 | constructor(ls, &args); | |
| 841 | break; | |
| 842 | } | |
| 843 | case TK_STRING: { /* funcargs -> STRING */ | |
| 844 | codestring(ls, &args, ls->t.seminfo.ts); | |
| 845 | luaX_next(ls); /* must use `seminfo' before `next' */ | |
| 846 | break; | |
| 847 | } | |
| 848 | default: { | |
| 849 | luaX_syntaxerror(ls, "function arguments expected"); | |
| 850 | } | |
| 851 | } | |
| 852 | lua_assert(f->k == VNONRELOC); | |
| 853 | base = f->u.info; /* base register for call */ | |
| 854 | if (hasmultret(args.k)) | |
| 855 | nparams = LUA_MULTRET; /* open call */ | |
| 856 | else { | |
| 857 | if (args.k != VVOID) | |
| 858 | luaK_exp2nextreg(fs, &args); /* close last argument */ | |
| 859 | nparams = fs->freereg - (base+1); | |
| 860 | } | |
| 861 | init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); | |
| 862 | luaK_fixline(fs, line); | |
| 863 | fs->freereg = base+1; /* call remove function and arguments and leaves | |
| 864 | 864 | (unless changed) one result */ |
| 865 | 865 | } |
| 866 | 866 | |
| r31373 | r31374 | |
| 875 | 875 | |
| 876 | 876 | |
| 877 | 877 | static void primaryexp (LexState *ls, expdesc *v) { |
| 878 | /* primaryexp -> NAME | '(' expr ')' */ | |
| 879 | switch (ls->t.token) { | |
| 880 | case '(': { | |
| 881 | int line = ls->linenumber; | |
| 882 | luaX_next(ls); | |
| 883 | expr(ls, v); | |
| 884 | check_match(ls, ')', '(', line); | |
| 885 | luaK_dischargevars(ls->fs, v); | |
| 886 | return; | |
| 887 | } | |
| 888 | case TK_NAME: { | |
| 889 | singlevar(ls, v); | |
| 890 | return; | |
| 891 | } | |
| 892 | default: { | |
| 893 | luaX_syntaxerror(ls, "unexpected symbol"); | |
| 894 | } | |
| 895 | } | |
| 878 | /* primaryexp -> NAME | '(' expr ')' */ | |
| 879 | switch (ls->t.token) { | |
| 880 | case '(': { | |
| 881 | int line = ls->linenumber; | |
| 882 | luaX_next(ls); | |
| 883 | expr(ls, v); | |
| 884 | check_match(ls, ')', '(', line); | |
| 885 | luaK_dischargevars(ls->fs, v); | |
| 886 | return; | |
| 887 | } | |
| 888 | case TK_NAME: { | |
| 889 | singlevar(ls, v); | |
| 890 | return; | |
| 891 | } | |
| 892 | default: { | |
| 893 | luaX_syntaxerror(ls, "unexpected symbol"); | |
| 894 | } | |
| 895 | } | |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | 898 | |
| 899 | 899 | static void suffixedexp (LexState *ls, expdesc *v) { |
| 900 | /* suffixedexp -> | |
| 901 | primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ | |
| 902 | FuncState *fs = ls->fs; | |
| 903 | int line = ls->linenumber; | |
| 904 | primaryexp(ls, v); | |
| 905 | for (;;) { | |
| 906 | switch (ls->t.token) { | |
| 907 | case '.': { /* fieldsel */ | |
| 908 | fieldsel(ls, v); | |
| 909 | break; | |
| 910 | } | |
| 911 | case '[': { /* `[' exp1 `]' */ | |
| 912 | expdesc key; | |
| 913 | luaK_exp2anyregup(fs, v); | |
| 914 | yindex(ls, &key); | |
| 915 | luaK_indexed(fs, v, &key); | |
| 916 | break; | |
| 917 | } | |
| 918 | case ':': { /* `:' NAME funcargs */ | |
| 919 | expdesc key; | |
| 920 | luaX_next(ls); | |
| 921 | checkname(ls, &key); | |
| 922 | luaK_self(fs, v, &key); | |
| 923 | funcargs(ls, v, line); | |
| 924 | break; | |
| 925 | } | |
| 926 | case '(': case TK_STRING: case '{': { /* funcargs */ | |
| 927 | luaK_exp2nextreg(fs, v); | |
| 928 | funcargs(ls, v, line); | |
| 929 | break; | |
| 930 | } | |
| 931 | default: return; | |
| 932 | } | |
| 933 | } | |
| 900 | /* suffixedexp -> | |
| 901 | primaryexp { '.' NAME | '[' exp ']' | ':' NAME funcargs | funcargs } */ | |
| 902 | FuncState *fs = ls->fs; | |
| 903 | int line = ls->linenumber; | |
| 904 | primaryexp(ls, v); | |
| 905 | for (;;) { | |
| 906 | switch (ls->t.token) { | |
| 907 | case '.': { /* fieldsel */ | |
| 908 | fieldsel(ls, v); | |
| 909 | break; | |
| 910 | } | |
| 911 | case '[': { /* `[' exp1 `]' */ | |
| 912 | expdesc key; | |
| 913 | luaK_exp2anyregup(fs, v); | |
| 914 | yindex(ls, &key); | |
| 915 | luaK_indexed(fs, v, &key); | |
| 916 | break; | |
| 917 | } | |
| 918 | case ':': { /* `:' NAME funcargs */ | |
| 919 | expdesc key; | |
| 920 | luaX_next(ls); | |
| 921 | checkname(ls, &key); | |
| 922 | luaK_self(fs, v, &key); | |
| 923 | funcargs(ls, v, line); | |
| 924 | break; | |
| 925 | } | |
| 926 | case '(': case TK_STRING: case '{': { /* funcargs */ | |
| 927 | luaK_exp2nextreg(fs, v); | |
| 928 | funcargs(ls, v, line); | |
| 929 | break; | |
| 930 | } | |
| 931 | default: return; | |
| 932 | } | |
| 933 | } | |
| 934 | 934 | } |
| 935 | 935 | |
| 936 | 936 | |
| 937 | 937 | static void simpleexp (LexState *ls, expdesc *v) { |
| 938 | /* simpleexp -> NUMBER | STRING | NIL | TRUE | FALSE | ... | | |
| 939 | constructor | FUNCTION body | suffixedexp */ | |
| 940 | switch (ls->t.token) { | |
| 941 | case TK_NUMBER: { | |
| 942 | init_exp(v, VKNUM, 0); | |
| 943 | v->u.nval = ls->t.seminfo.r; | |
| 944 | break; | |
| 945 | } | |
| 946 | case TK_STRING: { | |
| 947 | codestring(ls, v, ls->t.seminfo.ts); | |
| 948 | break; | |
| 949 | } | |
| 950 | case TK_NIL: { | |
| 951 | init_exp(v, VNIL, 0); | |
| 952 | break; | |
| 953 | } | |
| 954 | case TK_TRUE: { | |
| 955 | init_exp(v, VTRUE, 0); | |
| 956 | break; | |
| 957 | } | |
| 958 | case TK_FALSE: { | |
| 959 | init_exp(v, VFALSE, 0); | |
| 960 | break; | |
| 961 | } | |
| 962 | case TK_DOTS: { /* vararg */ | |
| 963 | FuncState *fs = ls->fs; | |
| 964 | check_condition(ls, fs->f->is_vararg, | |
| 965 | "cannot use " LUA_QL("...") " outside a vararg function"); | |
| 966 | init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); | |
| 967 | break; | |
| 968 | } | |
| 969 | case '{': { /* constructor */ | |
| 970 | constructor(ls, v); | |
| 971 | return; | |
| 972 | } | |
| 973 | case TK_FUNCTION: { | |
| 974 | luaX_next(ls); | |
| 975 | body(ls, v, 0, ls->linenumber); | |
| 976 | return; | |
| 977 | } | |
| 978 | default: { | |
| 979 | suffixedexp(ls, v); | |
| 980 | return; | |
| 981 | } | |
| 982 | } | |
| 983 | luaX_next(ls); | |
| 938 | /* simpleexp -> NUMBER | STRING | NIL | TRUE | FALSE | ... | | |
| 939 | constructor | FUNCTION body | suffixedexp */ | |
| 940 | switch (ls->t.token) { | |
| 941 | case TK_NUMBER: { | |
| 942 | init_exp(v, VKNUM, 0); | |
| 943 | v->u.nval = ls->t.seminfo.r; | |
| 944 | break; | |
| 945 | } | |
| 946 | case TK_STRING: { | |
| 947 | codestring(ls, v, ls->t.seminfo.ts); | |
| 948 | break; | |
| 949 | } | |
| 950 | case TK_NIL: { | |
| 951 | init_exp(v, VNIL, 0); | |
| 952 | break; | |
| 953 | } | |
| 954 | case TK_TRUE: { | |
| 955 | init_exp(v, VTRUE, 0); | |
| 956 | break; | |
| 957 | } | |
| 958 | case TK_FALSE: { | |
| 959 | init_exp(v, VFALSE, 0); | |
| 960 | break; | |
| 961 | } | |
| 962 | case TK_DOTS: { /* vararg */ | |
| 963 | FuncState *fs = ls->fs; | |
| 964 | check_condition(ls, fs->f->is_vararg, | |
| 965 | "cannot use " LUA_QL("...") " outside a vararg function"); | |
| 966 | init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); | |
| 967 | break; | |
| 968 | } | |
| 969 | case '{': { /* constructor */ | |
| 970 | constructor(ls, v); | |
| 971 | return; | |
| 972 | } | |
| 973 | case TK_FUNCTION: { | |
| 974 | luaX_next(ls); | |
| 975 | body(ls, v, 0, ls->linenumber); | |
| 976 | return; | |
| 977 | } | |
| 978 | default: { | |
| 979 | suffixedexp(ls, v); | |
| 980 | return; | |
| 981 | } | |
| 982 | } | |
| 983 | luaX_next(ls); | |
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | |
| 987 | 987 | static UnOpr getunopr (int op) { |
| 988 | switch (op) { | |
| 989 | case TK_NOT: return OPR_NOT; | |
| 990 | case '-': return OPR_MINUS; | |
| 991 | case '#': return OPR_LEN; | |
| 992 | default: return OPR_NOUNOPR; | |
| 993 | } | |
| 988 | switch (op) { | |
| 989 | case TK_NOT: return OPR_NOT; | |
| 990 | case '-': return OPR_MINUS; | |
| 991 | case '#': return OPR_LEN; | |
| 992 | default: return OPR_NOUNOPR; | |
| 993 | } | |
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | |
| 997 | 997 | static BinOpr getbinopr (int op) { |
| 998 | switch (op) { | |
| 999 | case '+': return OPR_ADD; | |
| 1000 | case '-': return OPR_SUB; | |
| 1001 | case '*': return OPR_MUL; | |
| 1002 | case '/': return OPR_DIV; | |
| 1003 | case '%': return OPR_MOD; | |
| 1004 | case '^': return OPR_POW; | |
| 1005 | case TK_CONCAT: return OPR_CONCAT; | |
| 1006 | case TK_NE: return OPR_NE; | |
| 1007 | case TK_EQ: return OPR_EQ; | |
| 1008 | case '<': return OPR_LT; | |
| 1009 | case TK_LE: return OPR_LE; | |
| 1010 | case '>': return OPR_GT; | |
| 1011 | case TK_GE: return OPR_GE; | |
| 1012 | case TK_AND: return OPR_AND; | |
| 1013 | case TK_OR: return OPR_OR; | |
| 1014 | default: return OPR_NOBINOPR; | |
| 1015 | } | |
| 998 | switch (op) { | |
| 999 | case '+': return OPR_ADD; | |
| 1000 | case '-': return OPR_SUB; | |
| 1001 | case '*': return OPR_MUL; | |
| 1002 | case '/': return OPR_DIV; | |
| 1003 | case '%': return OPR_MOD; | |
| 1004 | case '^': return OPR_POW; | |
| 1005 | case TK_CONCAT: return OPR_CONCAT; | |
| 1006 | case TK_NE: return OPR_NE; | |
| 1007 | case TK_EQ: return OPR_EQ; | |
| 1008 | case '<': return OPR_LT; | |
| 1009 | case TK_LE: return OPR_LE; | |
| 1010 | case '>': return OPR_GT; | |
| 1011 | case TK_GE: return OPR_GE; | |
| 1012 | case TK_AND: return OPR_AND; | |
| 1013 | case TK_OR: return OPR_OR; | |
| 1014 | default: return OPR_NOBINOPR; | |
| 1015 | } | |
| 1016 | 1016 | } |
| 1017 | 1017 | |
| 1018 | 1018 | |
| 1019 | 1019 | static const struct { |
| 1020 | lu_byte left; /* left priority for each binary operator */ | |
| 1021 | lu_byte right; /* right priority */ | |
| 1020 | lu_byte left; /* left priority for each binary operator */ | |
| 1021 | lu_byte right; /* right priority */ | |
| 1022 | 1022 | } priority[] = { /* ORDER OPR */ |
| 1023 | {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `*' `/' `%' */ | |
| 1024 | {10, 9}, {5, 4}, /* ^, .. (right associative) */ | |
| 1025 | {3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */ | |
| 1026 | {3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */ | |
| 1027 | {2, 2}, {1, 1} /* and, or */ | |
| 1023 | {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `*' `/' `%' */ | |
| 1024 | {10, 9}, {5, 4}, /* ^, .. (right associative) */ | |
| 1025 | {3, 3}, {3, 3}, {3, 3}, /* ==, <, <= */ | |
| 1026 | {3, 3}, {3, 3}, {3, 3}, /* ~=, >, >= */ | |
| 1027 | {2, 2}, {1, 1} /* and, or */ | |
| 1028 | 1028 | }; |
| 1029 | 1029 | |
| 1030 | #define UNARY_PRIORITY | |
| 1030 | #define UNARY_PRIORITY 8 /* priority for unary operators */ | |
| 1031 | 1031 | |
| 1032 | 1032 | |
| 1033 | 1033 | /* |
| r31373 | r31374 | |
| 1035 | 1035 | ** where `binop' is any binary operator with a priority higher than `limit' |
| 1036 | 1036 | */ |
| 1037 | 1037 | static BinOpr subexpr (LexState *ls, expdesc *v, int limit) { |
| 1038 | BinOpr op; | |
| 1039 | UnOpr uop; | |
| 1040 | enterlevel(ls); | |
| 1041 | uop = getunopr(ls->t.token); | |
| 1042 | if (uop != OPR_NOUNOPR) { | |
| 1043 | int line = ls->linenumber; | |
| 1044 | luaX_next(ls); | |
| 1045 | subexpr(ls, v, UNARY_PRIORITY); | |
| 1046 | luaK_prefix(ls->fs, uop, v, line); | |
| 1047 | } | |
| 1048 | else simpleexp(ls, v); | |
| 1049 | /* expand while operators have priorities higher than `limit' */ | |
| 1050 | op = getbinopr(ls->t.token); | |
| 1051 | while (op != OPR_NOBINOPR && priority[op].left > limit) { | |
| 1052 | expdesc v2; | |
| 1053 | BinOpr nextop; | |
| 1054 | int line = ls->linenumber; | |
| 1055 | luaX_next(ls); | |
| 1056 | luaK_infix(ls->fs, op, v); | |
| 1057 | /* read sub-expression with higher priority */ | |
| 1058 | nextop = subexpr(ls, &v2, priority[op].right); | |
| 1059 | luaK_posfix(ls->fs, op, v, &v2, line); | |
| 1060 | op = nextop; | |
| 1061 | } | |
| 1062 | leavelevel(ls); | |
| 1063 | return op; /* return first untreated operator */ | |
| 1038 | BinOpr op; | |
| 1039 | UnOpr uop; | |
| 1040 | enterlevel(ls); | |
| 1041 | uop = getunopr(ls->t.token); | |
| 1042 | if (uop != OPR_NOUNOPR) { | |
| 1043 | int line = ls->linenumber; | |
| 1044 | luaX_next(ls); | |
| 1045 | subexpr(ls, v, UNARY_PRIORITY); | |
| 1046 | luaK_prefix(ls->fs, uop, v, line); | |
| 1047 | } | |
| 1048 | else simpleexp(ls, v); | |
| 1049 | /* expand while operators have priorities higher than `limit' */ | |
| 1050 | op = getbinopr(ls->t.token); | |
| 1051 | while (op != OPR_NOBINOPR && priority[op].left > limit) { | |
| 1052 | expdesc v2; | |
| 1053 | BinOpr nextop; | |
| 1054 | int line = ls->linenumber; | |
| 1055 | luaX_next(ls); | |
| 1056 | luaK_infix(ls->fs, op, v); | |
| 1057 | /* read sub-expression with higher priority */ | |
| 1058 | nextop = subexpr(ls, &v2, priority[op].right); | |
| 1059 | luaK_posfix(ls->fs, op, v, &v2, line); | |
| 1060 | op = nextop; | |
| 1061 | } | |
| 1062 | leavelevel(ls); | |
| 1063 | return op; /* return first untreated operator */ | |
| 1064 | 1064 | } |
| 1065 | 1065 | |
| 1066 | 1066 | |
| 1067 | 1067 | static void expr (LexState *ls, expdesc *v) { |
| 1068 | ||
| 1068 | subexpr(ls, v, 0); | |
| 1069 | 1069 | } |
| 1070 | 1070 | |
| 1071 | 1071 | /* }==================================================================== */ |
| r31373 | r31374 | |
| 1080 | 1080 | |
| 1081 | 1081 | |
| 1082 | 1082 | static void block (LexState *ls) { |
| 1083 | /* block -> statlist */ | |
| 1084 | FuncState *fs = ls->fs; | |
| 1085 | BlockCnt bl; | |
| 1086 | enterblock(fs, &bl, 0); | |
| 1087 | statlist(ls); | |
| 1088 | leaveblock(fs); | |
| 1083 | /* block -> statlist */ | |
| 1084 | FuncState *fs = ls->fs; | |
| 1085 | BlockCnt bl; | |
| 1086 | enterblock(fs, &bl, 0); | |
| 1087 | statlist(ls); | |
| 1088 | leaveblock(fs); | |
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | 1091 | |
| r31373 | r31374 | |
| 1094 | 1094 | ** assignment |
| 1095 | 1095 | */ |
| 1096 | 1096 | struct LHS_assign { |
| 1097 | struct LHS_assign *prev; | |
| 1098 | expdesc v; /* variable (global, local, upvalue, or indexed) */ | |
| 1097 | struct LHS_assign *prev; | |
| 1098 | expdesc v; /* variable (global, local, upvalue, or indexed) */ | |
| 1099 | 1099 | }; |
| 1100 | 1100 | |
| 1101 | 1101 | |
| r31373 | r31374 | |
| 1106 | 1106 | ** use this safe copy in the previous assignment. |
| 1107 | 1107 | */ |
| 1108 | 1108 | static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) { |
| 1109 | FuncState *fs = ls->fs; | |
| 1110 | int extra = fs->freereg; /* eventual position to save local variable */ | |
| 1111 | int conflict = 0; | |
| 1112 | for (; lh; lh = lh->prev) { /* check all previous assignments */ | |
| 1113 | if (lh->v.k == VINDEXED) { /* assigning to a table? */ | |
| 1114 | /* table is the upvalue/local being assigned now? */ | |
| 1115 | if (lh->v.u.ind.vt == v->k && lh->v.u.ind.t == v->u.info) { | |
| 1116 | conflict = 1; | |
| 1117 | lh->v.u.ind.vt = VLOCAL; | |
| 1118 | lh->v.u.ind.t = extra; /* previous assignment will use safe copy */ | |
| 1119 | } | |
| 1120 | /* index is the local being assigned? (index cannot be upvalue) */ | |
| 1121 | if (v->k == VLOCAL && lh->v.u.ind.idx == v->u.info) { | |
| 1122 | conflict = 1; | |
| 1123 | lh->v.u.ind.idx = extra; /* previous assignment will use safe copy */ | |
| 1124 | } | |
| 1125 | } | |
| 1126 | } | |
| 1127 | if (conflict) { | |
| 1128 | /* copy upvalue/local value to a temporary (in position 'extra') */ | |
| 1129 | OpCode op = (v->k == VLOCAL) ? OP_MOVE : OP_GETUPVAL; | |
| 1130 | luaK_codeABC(fs, op, extra, v->u.info, 0); | |
| 1131 | luaK_reserveregs(fs, 1); | |
| 1132 | } | |
| 1109 | FuncState *fs = ls->fs; | |
| 1110 | int extra = fs->freereg; /* eventual position to save local variable */ | |
| 1111 | int conflict = 0; | |
| 1112 | for (; lh; lh = lh->prev) { /* check all previous assignments */ | |
| 1113 | if (lh->v.k == VINDEXED) { /* assigning to a table? */ | |
| 1114 | /* table is the upvalue/local being assigned now? */ | |
| 1115 | if (lh->v.u.ind.vt == v->k && lh->v.u.ind.t == v->u.info) { | |
| 1116 | conflict = 1; | |
| 1117 | lh->v.u.ind.vt = VLOCAL; | |
| 1118 | lh->v.u.ind.t = extra; /* previous assignment will use safe copy */ | |
| 1119 | } | |
| 1120 | /* index is the local being assigned? (index cannot be upvalue) */ | |
| 1121 | if (v->k == VLOCAL && lh->v.u.ind.idx == v->u.info) { | |
| 1122 | conflict = 1; | |
| 1123 | lh->v.u.ind.idx = extra; /* previous assignment will use safe copy */ | |
| 1124 | } | |
| 1125 | } | |
| 1126 | } | |
| 1127 | if (conflict) { | |
| 1128 | /* copy upvalue/local value to a temporary (in position 'extra') */ | |
| 1129 | OpCode op = (v->k == VLOCAL) ? OP_MOVE : OP_GETUPVAL; | |
| 1130 | luaK_codeABC(fs, op, extra, v->u.info, 0); | |
| 1131 | luaK_reserveregs(fs, 1); | |
| 1132 | } | |
| 1133 | 1133 | } |
| 1134 | 1134 | |
| 1135 | 1135 | |
| 1136 | 1136 | static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { |
| 1137 | expdesc e; | |
| 1138 | check_condition(ls, vkisvar(lh->v.k), "syntax error"); | |
| 1139 | if (testnext(ls, ',')) { /* assignment -> ',' suffixedexp assignment */ | |
| 1140 | struct LHS_assign nv; | |
| 1141 | nv.prev = lh; | |
| 1142 | suffixedexp(ls, &nv.v); | |
| 1143 | if (nv.v.k != VINDEXED) | |
| 1144 | check_conflict(ls, lh, &nv.v); | |
| 1145 | checklimit(ls->fs, nvars + ls->L->nCcalls, LUAI_MAXCCALLS, | |
| 1146 | "C levels"); | |
| 1147 | assignment(ls, &nv, nvars+1); | |
| 1148 | } | |
| 1149 | else { /* assignment -> `=' explist */ | |
| 1150 | int nexps; | |
| 1151 | checknext(ls, '='); | |
| 1152 | nexps = explist(ls, &e); | |
| 1153 | if (nexps != nvars) { | |
| 1154 | adjust_assign(ls, nvars, nexps, &e); | |
| 1155 | if (nexps > nvars) | |
| 1156 | ls->fs->freereg -= nexps - nvars; /* remove extra values */ | |
| 1157 | } | |
| 1158 | else { | |
| 1159 | luaK_setoneret(ls->fs, &e); /* close last expression */ | |
| 1160 | luaK_storevar(ls->fs, &lh->v, &e); | |
| 1161 | return; /* avoid default */ | |
| 1162 | } | |
| 1163 | } | |
| 1164 | init_exp(&e, VNONRELOC, ls->fs->freereg-1); /* default assignment */ | |
| 1165 | luaK_storevar(ls->fs, &lh->v, &e); | |
| 1137 | expdesc e; | |
| 1138 | check_condition(ls, vkisvar(lh->v.k), "syntax error"); | |
| 1139 | if (testnext(ls, ',')) { /* assignment -> ',' suffixedexp assignment */ | |
| 1140 | struct LHS_assign nv; | |
| 1141 | nv.prev = lh; | |
| 1142 | suffixedexp(ls, &nv.v); | |
| 1143 | if (nv.v.k != VINDEXED) | |
| 1144 | check_conflict(ls, lh, &nv.v); | |
| 1145 | checklimit(ls->fs, nvars + ls->L->nCcalls, LUAI_MAXCCALLS, | |
| 1146 | "C levels"); | |
| 1147 | assignment(ls, &nv, nvars+1); | |
| 1148 | } | |
| 1149 | else { /* assignment -> `=' explist */ | |
| 1150 | int nexps; | |
| 1151 | checknext(ls, '='); | |
| 1152 | nexps = explist(ls, &e); | |
| 1153 | if (nexps != nvars) { | |
| 1154 | adjust_assign(ls, nvars, nexps, &e); | |
| 1155 | if (nexps > nvars) | |
| 1156 | ls->fs->freereg -= nexps - nvars; /* remove extra values */ | |
| 1157 | } | |
| 1158 | else { | |
| 1159 | luaK_setoneret(ls->fs, &e); /* close last expression */ | |
| 1160 | luaK_storevar(ls->fs, &lh->v, &e); | |
| 1161 | return; /* avoid default */ | |
| 1162 | } | |
| 1163 | } | |
| 1164 | init_exp(&e, VNONRELOC, ls->fs->freereg-1); /* default assignment */ | |
| 1165 | luaK_storevar(ls->fs, &lh->v, &e); | |
| 1166 | 1166 | } |
| 1167 | 1167 | |
| 1168 | 1168 | |
| 1169 | 1169 | static int cond (LexState *ls) { |
| 1170 | /* cond -> exp */ | |
| 1171 | expdesc v; | |
| 1172 | expr(ls, &v); /* read condition */ | |
| 1173 | if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ | |
| 1174 | luaK_goiftrue(ls->fs, &v); | |
| 1175 | return v.f; | |
| 1170 | /* cond -> exp */ | |
| 1171 | expdesc v; | |
| 1172 | expr(ls, &v); /* read condition */ | |
| 1173 | if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ | |
| 1174 | luaK_goiftrue(ls->fs, &v); | |
| 1175 | return v.f; | |
| 1176 | 1176 | } |
| 1177 | 1177 | |
| 1178 | 1178 | |
| 1179 | 1179 | static void gotostat (LexState *ls, int pc) { |
| 1180 | int line = ls->linenumber; | |
| 1181 | TString *label; | |
| 1182 | int g; | |
| 1183 | if (testnext(ls, TK_GOTO)) | |
| 1184 | label = str_checkname(ls); | |
| 1185 | else { | |
| 1186 | luaX_next(ls); /* skip break */ | |
| 1187 | label = luaS_new(ls->L, "break"); | |
| 1188 | } | |
| 1189 | g = newlabelentry(ls, &ls->dyd->gt, label, line, pc); | |
| 1190 | findlabel(ls, g); /* close it if label already defined */ | |
| 1180 | int line = ls->linenumber; | |
| 1181 | TString *label; | |
| 1182 | int g; | |
| 1183 | if (testnext(ls, TK_GOTO)) | |
| 1184 | label = str_checkname(ls); | |
| 1185 | else { | |
| 1186 | luaX_next(ls); /* skip break */ | |
| 1187 | label = luaS_new(ls->L, "break"); | |
| 1188 | } | |
| 1189 | g = newlabelentry(ls, &ls->dyd->gt, label, line, pc); | |
| 1190 | findlabel(ls, g); /* close it if label already defined */ | |
| 1191 | 1191 | } |
| 1192 | 1192 | |
| 1193 | 1193 | |
| 1194 | 1194 | /* check for repeated labels on the same block */ |
| 1195 | 1195 | static void checkrepeated (FuncState *fs, Labellist *ll, TString *label) { |
| 1196 | int i; | |
| 1197 | for (i = fs->bl->firstlabel; i < ll->n; i++) { | |
| 1198 | if (luaS_eqstr(label, ll->arr[i].name)) { | |
| 1199 | const char *msg = luaO_pushfstring(fs->ls->L, | |
| 1200 | "label " LUA_QS " already defined on line %d", | |
| 1201 | getstr(label), ll->arr[i].line); | |
| 1202 | semerror(fs->ls, msg); | |
| 1203 | } | |
| 1204 | } | |
| 1196 | int i; | |
| 1197 | for (i = fs->bl->firstlabel; i < ll->n; i++) { | |
| 1198 | if (luaS_eqstr(label, ll->arr[i].name)) { | |
| 1199 | const char *msg = luaO_pushfstring(fs->ls->L, | |
| 1200 | "label " LUA_QS " already defined on line %d", | |
| 1201 | getstr(label), ll->arr[i].line); | |
| 1202 | semerror(fs->ls, msg); | |
| 1203 | } | |
| 1204 | } | |
| 1205 | 1205 | } |
| 1206 | 1206 | |
| 1207 | 1207 | |
| 1208 | 1208 | /* skip no-op statements */ |
| 1209 | 1209 | static void skipnoopstat (LexState *ls) { |
| 1210 | while (ls->t.token == ';' || ls->t.token == TK_DBCOLON) | |
| 1211 | statement(ls); | |
| 1210 | while (ls->t.token == ';' || ls->t.token == TK_DBCOLON) | |
| 1211 | statement(ls); | |
| 1212 | 1212 | } |
| 1213 | 1213 | |
| 1214 | 1214 | |
| 1215 | 1215 | static void labelstat (LexState *ls, TString *label, int line) { |
| 1216 | /* label -> '::' NAME '::' */ | |
| 1217 | FuncState *fs = ls->fs; | |
| 1218 | Labellist *ll = &ls->dyd->label; | |
| 1219 | int l; /* index of new label being created */ | |
| 1220 | checkrepeated(fs, ll, label); /* check for repeated labels */ | |
| 1221 | checknext(ls, TK_DBCOLON); /* skip double colon */ | |
| 1222 | /* create new entry for this label */ | |
| 1223 | l = newlabelentry(ls, ll, label, line, fs->pc); | |
| 1224 | skipnoopstat(ls); /* skip other no-op statements */ | |
| 1225 | if (block_follow(ls, 0)) { /* label is last no-op statement in the block? */ | |
| 1226 | /* assume that locals are already out of scope */ | |
| 1227 | ll->arr[l].nactvar = fs->bl->nactvar; | |
| 1228 | } | |
| 1229 | findgotos(ls, &ll->arr[l]); | |
| 1216 | /* label -> '::' NAME '::' */ | |
| 1217 | FuncState *fs = ls->fs; | |
| 1218 | Labellist *ll = &ls->dyd->label; | |
| 1219 | int l; /* index of new label being created */ | |
| 1220 | checkrepeated(fs, ll, label); /* check for repeated labels */ | |
| 1221 | checknext(ls, TK_DBCOLON); /* skip double colon */ | |
| 1222 | /* create new entry for this label */ | |
| 1223 | l = newlabelentry(ls, ll, label, line, fs->pc); | |
| 1224 | skipnoopstat(ls); /* skip other no-op statements */ | |
| 1225 | if (block_follow(ls, 0)) { /* label is last no-op statement in the block? */ | |
| 1226 | /* assume that locals are already out of scope */ | |
| 1227 | ll->arr[l].nactvar = fs->bl->nactvar; | |
| 1228 | } | |
| 1229 | findgotos(ls, &ll->arr[l]); | |
| 1230 | 1230 | } |
| 1231 | 1231 | |
| 1232 | 1232 | |
| 1233 | 1233 | static void whilestat (LexState *ls, int line) { |
| 1234 | /* whilestat -> WHILE cond DO block END */ | |
| 1235 | FuncState *fs = ls->fs; | |
| 1236 | int whileinit; | |
| 1237 | int condexit; | |
| 1238 | BlockCnt bl; | |
| 1239 | luaX_next(ls); /* skip WHILE */ | |
| 1240 | whileinit = luaK_getlabel(fs); | |
| 1241 | condexit = cond(ls); | |
| 1242 | enterblock(fs, &bl, 1); | |
| 1243 | checknext(ls, TK_DO); | |
| 1244 | block(ls); | |
| 1245 | luaK_jumpto(fs, whileinit); | |
| 1246 | check_match(ls, TK_END, TK_WHILE, line); | |
| 1247 | leaveblock(fs); | |
| 1248 | luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ | |
| 1234 | /* whilestat -> WHILE cond DO block END */ | |
| 1235 | FuncState *fs = ls->fs; | |
| 1236 | int whileinit; | |
| 1237 | int condexit; | |
| 1238 | BlockCnt bl; | |
| 1239 | luaX_next(ls); /* skip WHILE */ | |
| 1240 | whileinit = luaK_getlabel(fs); | |
| 1241 | condexit = cond(ls); | |
| 1242 | enterblock(fs, &bl, 1); | |
| 1243 | checknext(ls, TK_DO); | |
| 1244 | block(ls); | |
| 1245 | luaK_jumpto(fs, whileinit); | |
| 1246 | check_match(ls, TK_END, TK_WHILE, line); | |
| 1247 | leaveblock(fs); | |
| 1248 | luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ | |
| 1249 | 1249 | } |
| 1250 | 1250 | |
| 1251 | 1251 | |
| 1252 | 1252 | static void repeatstat (LexState *ls, int line) { |
| 1253 | /* repeatstat -> REPEAT block UNTIL cond */ | |
| 1254 | int condexit; | |
| 1255 | FuncState *fs = ls->fs; | |
| 1256 | int repeat_init = luaK_getlabel(fs); | |
| 1257 | BlockCnt bl1, bl2; | |
| 1258 | enterblock(fs, &bl1, 1); /* loop block */ | |
| 1259 | enterblock(fs, &bl2, 0); /* scope block */ | |
| 1260 | luaX_next(ls); /* skip REPEAT */ | |
| 1261 | statlist(ls); | |
| 1262 | check_match(ls, TK_UNTIL, TK_REPEAT, line); | |
| 1263 | condexit = cond(ls); /* read condition (inside scope block) */ | |
| 1264 | if (bl2.upval) /* upvalues? */ | |
| 1265 | luaK_patchclose(fs, condexit, bl2.nactvar); | |
| 1266 | leaveblock(fs); /* finish scope */ | |
| 1267 | luaK_patchlist(fs, condexit, repeat_init); /* close the loop */ | |
| 1268 | leaveblock(fs); /* finish loop */ | |
| 1253 | /* repeatstat -> REPEAT block UNTIL cond */ | |
| 1254 | int condexit; | |
| 1255 | FuncState *fs = ls->fs; | |
| 1256 | int repeat_init = luaK_getlabel(fs); | |
| 1257 | BlockCnt bl1, bl2; | |
| 1258 | enterblock(fs, &bl1, 1); /* loop block */ | |
| 1259 | enterblock(fs, &bl2, 0); /* scope block */ | |
| 1260 | luaX_next(ls); /* skip REPEAT */ | |
| 1261 | statlist(ls); | |
| 1262 | check_match(ls, TK_UNTIL, TK_REPEAT, line); | |
| 1263 | condexit = cond(ls); /* read condition (inside scope block) */ | |
| 1264 | if (bl2.upval) /* upvalues? */ | |
| 1265 | luaK_patchclose(fs, condexit, bl2.nactvar); | |
| 1266 | leaveblock(fs); /* finish scope */ | |
| 1267 | luaK_patchlist(fs, condexit, repeat_init); /* close the loop */ | |
| 1268 | leaveblock(fs); /* finish loop */ | |
| 1269 | 1269 | } |
| 1270 | 1270 | |
| 1271 | 1271 | |
| 1272 | 1272 | static int exp1 (LexState *ls) { |
| 1273 | expdesc e; | |
| 1274 | int reg; | |
| 1275 | expr(ls, &e); | |
| 1276 | luaK_exp2nextreg(ls->fs, &e); | |
| 1277 | lua_assert(e.k == VNONRELOC); | |
| 1278 | reg = e.u.info; | |
| 1279 | return reg; | |
| 1273 | expdesc e; | |
| 1274 | int reg; | |
| 1275 | expr(ls, &e); | |
| 1276 | luaK_exp2nextreg(ls->fs, &e); | |
| 1277 | lua_assert(e.k == VNONRELOC); | |
| 1278 | reg = e.u.info; | |
| 1279 | return reg; | |
| 1280 | 1280 | } |
| 1281 | 1281 | |
| 1282 | 1282 | |
| 1283 | 1283 | static void forbody (LexState *ls, int base, int line, int nvars, int isnum) { |
| 1284 | /* forbody -> DO block */ | |
| 1285 | BlockCnt bl; | |
| 1286 | FuncState *fs = ls->fs; | |
| 1287 | int prep, endfor; | |
| 1288 | adjustlocalvars(ls, 3); /* control variables */ | |
| 1289 | checknext(ls, TK_DO); | |
| 1290 | prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs); | |
| 1291 | enterblock(fs, &bl, 0); /* scope for declared variables */ | |
| 1292 | adjustlocalvars(ls, nvars); | |
| 1293 | luaK_reserveregs(fs, nvars); | |
| 1294 | block(ls); | |
| 1295 | leaveblock(fs); /* end of scope for declared variables */ | |
| 1296 | luaK_patchtohere(fs, prep); | |
| 1297 | if (isnum) /* numeric for? */ | |
| 1298 | endfor = luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP); | |
| 1299 | else { /* generic for */ | |
| 1300 | luaK_codeABC(fs, OP_TFORCALL, base, 0, nvars); | |
| 1301 | luaK_fixline(fs, line); | |
| 1302 | endfor = luaK_codeAsBx(fs, OP_TFORLOOP, base + 2, NO_JUMP); | |
| 1303 | } | |
| 1304 | luaK_patchlist(fs, endfor, prep + 1); | |
| 1305 | luaK_fixline(fs, line); | |
| 1284 | /* forbody -> DO block */ | |
| 1285 | BlockCnt bl; | |
| 1286 | FuncState *fs = ls->fs; | |
| 1287 | int prep, endfor; | |
| 1288 | adjustlocalvars(ls, 3); /* control variables */ | |
| 1289 | checknext(ls, TK_DO); | |
| 1290 | prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs); | |
| 1291 | enterblock(fs, &bl, 0); /* scope for declared variables */ | |
| 1292 | adjustlocalvars(ls, nvars); | |
| 1293 | luaK_reserveregs(fs, nvars); | |
| 1294 | block(ls); | |
| 1295 | leaveblock(fs); /* end of scope for declared variables */ | |
| 1296 | luaK_patchtohere(fs, prep); | |
| 1297 | if (isnum) /* numeric for? */ | |
| 1298 | endfor = luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP); | |
| 1299 | else { /* generic for */ | |
| 1300 | luaK_codeABC(fs, OP_TFORCALL, base, 0, nvars); | |
| 1301 | luaK_fixline(fs, line); | |
| 1302 | endfor = luaK_codeAsBx(fs, OP_TFORLOOP, base + 2, NO_JUMP); | |
| 1303 | } | |
| 1304 | luaK_patchlist(fs, endfor, prep + 1); | |
| 1305 | luaK_fixline(fs, line); | |
| 1306 | 1306 | } |
| 1307 | 1307 | |
| 1308 | 1308 | |
| 1309 | 1309 | static void fornum (LexState *ls, TString *varname, int line) { |
| 1310 | /* fornum -> NAME = exp1,exp1[,exp1] forbody */ | |
| 1311 | FuncState *fs = ls->fs; | |
| 1312 | int base = fs->freereg; | |
| 1313 | new_localvarliteral(ls, "(for index)"); | |
| 1314 | new_localvarliteral(ls, "(for limit)"); | |
| 1315 | new_localvarliteral(ls, "(for step)"); | |
| 1316 | new_localvar(ls, varname); | |
| 1317 | checknext(ls, '='); | |
| 1318 | exp1(ls); /* initial value */ | |
| 1319 | checknext(ls, ','); | |
| 1320 | exp1(ls); /* limit */ | |
| 1321 | if (testnext(ls, ',')) | |
| 1322 | exp1(ls); /* optional step */ | |
| 1323 | else { /* default step = 1 */ | |
| 1324 | luaK_codek(fs, fs->freereg, luaK_numberK(fs, 1)); | |
| 1325 | luaK_reserveregs(fs, 1); | |
| 1326 | } | |
| 1327 | forbody(ls, base, line, 1, 1); | |
| 1310 | /* fornum -> NAME = exp1,exp1[,exp1] forbody */ | |
| 1311 | FuncState *fs = ls->fs; | |
| 1312 | int base = fs->freereg; | |
| 1313 | new_localvarliteral(ls, "(for index)"); | |
| 1314 | new_localvarliteral(ls, "(for limit)"); | |
| 1315 | new_localvarliteral(ls, "(for step)"); | |
| 1316 | new_localvar(ls, varname); | |
| 1317 | checknext(ls, '='); | |
| 1318 | exp1(ls); /* initial value */ | |
| 1319 | checknext(ls, ','); | |
| 1320 | exp1(ls); /* limit */ | |
| 1321 | if (testnext(ls, ',')) | |
| 1322 | exp1(ls); /* optional step */ | |
| 1323 | else { /* default step = 1 */ | |
| 1324 | luaK_codek(fs, fs->freereg, luaK_numberK(fs, 1)); | |
| 1325 | luaK_reserveregs(fs, 1); | |
| 1326 | } | |
| 1327 | forbody(ls, base, line, 1, 1); | |
| 1328 | 1328 | } |
| 1329 | 1329 | |
| 1330 | 1330 | |
| 1331 | 1331 | static void forlist (LexState *ls, TString *indexname) { |
| 1332 | /* forlist -> NAME {,NAME} IN explist forbody */ | |
| 1333 | FuncState *fs = ls->fs; | |
| 1334 | expdesc e; | |
| 1335 | int nvars = 4; /* gen, state, control, plus at least one declared var */ | |
| 1336 | int line; | |
| 1337 | int base = fs->freereg; | |
| 1338 | /* create control variables */ | |
| 1339 | new_localvarliteral(ls, "(for generator)"); | |
| 1340 | new_localvarliteral(ls, "(for state)"); | |
| 1341 | new_localvarliteral(ls, "(for control)"); | |
| 1342 | /* create declared variables */ | |
| 1343 | new_localvar(ls, indexname); | |
| 1344 | while (testnext(ls, ',')) { | |
| 1345 | new_localvar(ls, str_checkname(ls)); | |
| 1346 | nvars++; | |
| 1347 | } | |
| 1348 | checknext(ls, TK_IN); | |
| 1349 | line = ls->linenumber; | |
| 1350 | adjust_assign(ls, 3, explist(ls, &e), &e); | |
| 1351 | luaK_checkstack(fs, 3); /* extra space to call generator */ | |
| 1352 | forbody(ls, base, line, nvars - 3, 0); | |
| 1332 | /* forlist -> NAME {,NAME} IN explist forbody */ | |
| 1333 | FuncState *fs = ls->fs; | |
| 1334 | expdesc e; | |
| 1335 | int nvars = 4; /* gen, state, control, plus at least one declared var */ | |
| 1336 | int line; | |
| 1337 | int base = fs->freereg; | |
| 1338 | /* create control variables */ | |
| 1339 | new_localvarliteral(ls, "(for generator)"); | |
| 1340 | new_localvarliteral(ls, "(for state)"); | |
| 1341 | new_localvarliteral(ls, "(for control)"); | |
| 1342 | /* create declared variables */ | |
| 1343 | new_localvar(ls, indexname); | |
| 1344 | while (testnext(ls, ',')) { | |
| 1345 | new_localvar(ls, str_checkname(ls)); | |
| 1346 | nvars++; | |
| 1347 | } | |
| 1348 | checknext(ls, TK_IN); | |
| 1349 | line = ls->linenumber; | |
| 1350 | adjust_assign(ls, 3, explist(ls, &e), &e); | |
| 1351 | luaK_checkstack(fs, 3); /* extra space to call generator */ | |
| 1352 | forbody(ls, base, line, nvars - 3, 0); | |
| 1353 | 1353 | } |
| 1354 | 1354 | |
| 1355 | 1355 | |
| 1356 | 1356 | static void forstat (LexState *ls, int line) { |
| 1357 | /* forstat -> FOR (fornum | forlist) END */ | |
| 1358 | FuncState *fs = ls->fs; | |
| 1359 | TString *varname; | |
| 1360 | BlockCnt bl; | |
| 1361 | enterblock(fs, &bl, 1); /* scope for loop and control variables */ | |
| 1362 | luaX_next(ls); /* skip `for' */ | |
| 1363 | varname = str_checkname(ls); /* first variable name */ | |
| 1364 | switch (ls->t.token) { | |
| 1365 | case '=': fornum(ls, varname, line); break; | |
| 1366 | case ',': case TK_IN: forlist(ls, varname); break; | |
| 1367 | default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected"); | |
| 1368 | } | |
| 1369 | check_match(ls, TK_END, TK_FOR, line); | |
| 1370 | leaveblock(fs); /* loop scope (`break' jumps to this point) */ | |
| 1357 | /* forstat -> FOR (fornum | forlist) END */ | |
| 1358 | FuncState *fs = ls->fs; | |
| 1359 | TString *varname; | |
| 1360 | BlockCnt bl; | |
| 1361 | enterblock(fs, &bl, 1); /* scope for loop and control variables */ | |
| 1362 | luaX_next(ls); /* skip `for' */ | |
| 1363 | varname = str_checkname(ls); /* first variable name */ | |
| 1364 | switch (ls->t.token) { | |
| 1365 | case '=': fornum(ls, varname, line); break; | |
| 1366 | case ',': case TK_IN: forlist(ls, varname); break; | |
| 1367 | default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected"); | |
| 1368 | } | |
| 1369 | check_match(ls, TK_END, TK_FOR, line); | |
| 1370 | leaveblock(fs); /* loop scope (`break' jumps to this point) */ | |
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | 1373 | |
| 1374 | 1374 | static void test_then_block (LexState *ls, int *escapelist) { |
| 1375 | /* test_then_block -> [IF | ELSEIF] cond THEN block */ | |
| 1376 | BlockCnt bl; | |
| 1377 | FuncState *fs = ls->fs; | |
| 1378 | expdesc v; | |
| 1379 | int jf; /* instruction to skip 'then' code (if condition is false) */ | |
| 1380 | luaX_next(ls); /* skip IF or ELSEIF */ | |
| 1381 | expr(ls, &v); /* read condition */ | |
| 1382 | checknext(ls, TK_THEN); | |
| 1383 | if (ls->t.token == TK_GOTO || ls->t.token == TK_BREAK) { | |
| 1384 | luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */ | |
| 1385 | enterblock(fs, &bl, 0); /* must enter block before 'goto' */ | |
| 1386 | gotostat(ls, v.t); /* handle goto/break */ | |
| 1387 | skipnoopstat(ls); /* skip other no-op statements */ | |
| 1388 | if (block_follow(ls, 0)) { /* 'goto' is the entire block? */ | |
| 1389 | leaveblock(fs); | |
| 1390 | return; /* and that is it */ | |
| 1391 | } | |
| 1392 | else /* must skip over 'then' part if condition is false */ | |
| 1393 | jf = luaK_jump(fs); | |
| 1394 | } | |
| 1395 | else { /* regular case (not goto/break) */ | |
| 1396 | luaK_goiftrue(ls->fs, &v); /* skip over block if condition is false */ | |
| 1397 | enterblock(fs, &bl, 0); | |
| 1398 | jf = v.f; | |
| 1399 | } | |
| 1400 | statlist(ls); /* `then' part */ | |
| 1401 | leaveblock(fs); | |
| 1402 | if (ls->t.token == TK_ELSE || | |
| 1403 | ls->t.token == TK_ELSEIF) /* followed by 'else'/'elseif'? */ | |
| 1404 | luaK_concat(fs, escapelist, luaK_jump(fs)); /* must jump over it */ | |
| 1405 | luaK_patchtohere(fs, jf); | |
| 1375 | /* test_then_block -> [IF | ELSEIF] cond THEN block */ | |
| 1376 | BlockCnt bl; | |
| 1377 | FuncState *fs = ls->fs; | |
| 1378 | expdesc v; | |
| 1379 | int jf; /* instruction to skip 'then' code (if condition is false) */ | |
| 1380 | luaX_next(ls); /* skip IF or ELSEIF */ | |
| 1381 | expr(ls, &v); /* read condition */ | |
| 1382 | checknext(ls, TK_THEN); | |
| 1383 | if (ls->t.token == TK_GOTO || ls->t.token == TK_BREAK) { | |
| 1384 | luaK_goiffalse(ls->fs, &v); /* will jump to label if condition is true */ | |
| 1385 | enterblock(fs, &bl, 0); /* must enter block before 'goto' */ | |
| 1386 | gotostat(ls, v.t); /* handle goto/break */ | |
| 1387 | skipnoopstat(ls); /* skip other no-op statements */ | |
| 1388 | if (block_follow(ls, 0)) { /* 'goto' is the entire block? */ | |
| 1389 | leaveblock(fs); | |
| 1390 | return; /* and that is it */ | |
| 1391 | } | |
| 1392 | else /* must skip over 'then' part if condition is false */ | |
| 1393 | jf = luaK_jump(fs); | |
| 1394 | } | |
| 1395 | else { /* regular case (not goto/break) */ | |
| 1396 | luaK_goiftrue(ls->fs, &v); /* skip over block if condition is false */ | |
| 1397 | enterblock(fs, &bl, 0); | |
| 1398 | jf = v.f; | |
| 1399 | } | |
| 1400 | statlist(ls); /* `then' part */ | |
| 1401 | leaveblock(fs); | |
| 1402 | if (ls->t.token == TK_ELSE || | |
| 1403 | ls->t.token == TK_ELSEIF) /* followed by 'else'/'elseif'? */ | |
| 1404 | luaK_concat(fs, escapelist, luaK_jump(fs)); /* must jump over it */ | |
| 1405 | luaK_patchtohere(fs, jf); | |
| 1406 | 1406 | } |
| 1407 | 1407 | |
| 1408 | 1408 | |
| 1409 | 1409 | static void ifstat (LexState *ls, int line) { |
| 1410 | /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ | |
| 1411 | FuncState *fs = ls->fs; | |
| 1412 | int escapelist = NO_JUMP; /* exit list for finished parts */ | |
| 1413 | test_then_block(ls, &escapelist); /* IF cond THEN block */ | |
| 1414 | while (ls->t.token == TK_ELSEIF) | |
| 1415 | test_then_block(ls, &escapelist); /* ELSEIF cond THEN block */ | |
| 1416 | if (testnext(ls, TK_ELSE)) | |
| 1417 | block(ls); /* `else' part */ | |
| 1418 | check_match(ls, TK_END, TK_IF, line); | |
| 1419 | luaK_patchtohere(fs, escapelist); /* patch escape list to 'if' end */ | |
| 1410 | /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ | |
| 1411 | FuncState *fs = ls->fs; | |
| 1412 | int escapelist = NO_JUMP; /* exit list for finished parts */ | |
| 1413 | test_then_block(ls, &escapelist); /* IF cond THEN block */ | |
| 1414 | while (ls->t.token == TK_ELSEIF) | |
| 1415 | test_then_block(ls, &escapelist); /* ELSEIF cond THEN block */ | |
| 1416 | if (testnext(ls, TK_ELSE)) | |
| 1417 | block(ls); /* `else' part */ | |
| 1418 | check_match(ls, TK_END, TK_IF, line); | |
| 1419 | luaK_patchtohere(fs, escapelist); /* patch escape list to 'if' end */ | |
| 1420 | 1420 | } |
| 1421 | 1421 | |
| 1422 | 1422 | |
| 1423 | 1423 | static void localfunc (LexState *ls) { |
| 1424 | expdesc b; | |
| 1425 | FuncState *fs = ls->fs; | |
| 1426 | new_localvar(ls, str_checkname(ls)); /* new local variable */ | |
| 1427 | adjustlocalvars(ls, 1); /* enter its scope */ | |
| 1428 | body(ls, &b, 0, ls->linenumber); /* function created in next register */ | |
| 1429 | /* debug information will only see the variable after this point! */ | |
| 1430 | getlocvar(fs, b.u.info)->startpc = fs->pc; | |
| 1424 | expdesc b; | |
| 1425 | FuncState *fs = ls->fs; | |
| 1426 | new_localvar(ls, str_checkname(ls)); /* new local variable */ | |
| 1427 | adjustlocalvars(ls, 1); /* enter its scope */ | |
| 1428 | body(ls, &b, 0, ls->linenumber); /* function created in next register */ | |
| 1429 | /* debug information will only see the variable after this point! */ | |
| 1430 | getlocvar(fs, b.u.info)->startpc = fs->pc; | |
| 1431 | 1431 | } |
| 1432 | 1432 | |
| 1433 | 1433 | |
| 1434 | 1434 | static void localstat (LexState *ls) { |
| 1435 | /* stat -> LOCAL NAME {`,' NAME} [`=' explist] */ | |
| 1436 | int nvars = 0; | |
| 1437 | int nexps; | |
| 1438 | expdesc e; | |
| 1439 | do { | |
| 1440 | new_localvar(ls, str_checkname(ls)); | |
| 1441 | nvars++; | |
| 1442 | } while (testnext(ls, ',')); | |
| 1443 | if (testnext(ls, '=')) | |
| 1444 | nexps = explist(ls, &e); | |
| 1445 | else { | |
| 1446 | e.k = VVOID; | |
| 1447 | nexps = 0; | |
| 1448 | } | |
| 1449 | adjust_assign(ls, nvars, nexps, &e); | |
| 1450 | adjustlocalvars(ls, nvars); | |
| 1435 | /* stat -> LOCAL NAME {`,' NAME} [`=' explist] */ | |
| 1436 | int nvars = 0; | |
| 1437 | int nexps; | |
| 1438 | expdesc e; | |
| 1439 | do { | |
| 1440 | new_localvar(ls, str_checkname(ls)); | |
| 1441 | nvars++; | |
| 1442 | } while (testnext(ls, ',')); | |
| 1443 | if (testnext(ls, '=')) | |
| 1444 | nexps = explist(ls, &e); | |
| 1445 | else { | |
| 1446 | e.k = VVOID; | |
| 1447 | nexps = 0; | |
| 1448 | } | |
| 1449 | adjust_assign(ls, nvars, nexps, &e); | |
| 1450 | adjustlocalvars(ls, nvars); | |
| 1451 | 1451 | } |
| 1452 | 1452 | |
| 1453 | 1453 | |
| 1454 | 1454 | static int funcname (LexState *ls, expdesc *v) { |
| 1455 | /* funcname -> NAME {fieldsel} [`:' NAME] */ | |
| 1456 | int ismethod = 0; | |
| 1457 | singlevar(ls, v); | |
| 1458 | while (ls->t.token == '.') | |
| 1459 | fieldsel(ls, v); | |
| 1460 | if (ls->t.token == ':') { | |
| 1461 | ismethod = 1; | |
| 1462 | fieldsel(ls, v); | |
| 1463 | } | |
| 1464 | return ismethod; | |
| 1455 | /* funcname -> NAME {fieldsel} [`:' NAME] */ | |
| 1456 | int ismethod = 0; | |
| 1457 | singlevar(ls, v); | |
| 1458 | while (ls->t.token == '.') | |
| 1459 | fieldsel(ls, v); | |
| 1460 | if (ls->t.token == ':') { | |
| 1461 | ismethod = 1; | |
| 1462 | fieldsel(ls, v); | |
| 1463 | } | |
| 1464 | return ismethod; | |
| 1465 | 1465 | } |
| 1466 | 1466 | |
| 1467 | 1467 | |
| 1468 | 1468 | static void funcstat (LexState *ls, int line) { |
| 1469 | /* funcstat -> FUNCTION funcname body */ | |
| 1470 | int ismethod; | |
| 1471 | expdesc v, b; | |
| 1472 | luaX_next(ls); /* skip FUNCTION */ | |
| 1473 | ismethod = funcname(ls, &v); | |
| 1474 | body(ls, &b, ismethod, line); | |
| 1475 | luaK_storevar(ls->fs, &v, &b); | |
| 1476 | luaK_fixline(ls->fs, line); /* definition `happens' in the first line */ | |
| 1469 | /* funcstat -> FUNCTION funcname body */ | |
| 1470 | int ismethod; | |
| 1471 | expdesc v, b; | |
| 1472 | luaX_next(ls); /* skip FUNCTION */ | |
| 1473 | ismethod = funcname(ls, &v); | |
| 1474 | body(ls, &b, ismethod, line); | |
| 1475 | luaK_storevar(ls->fs, &v, &b); | |
| 1476 | luaK_fixline(ls->fs, line); /* definition `happens' in the first line */ | |
| 1477 | 1477 | } |
| 1478 | 1478 | |
| 1479 | 1479 | |
| 1480 | 1480 | static void exprstat (LexState *ls) { |
| 1481 | /* stat -> func | assignment */ | |
| 1482 | FuncState *fs = ls->fs; | |
| 1483 | struct LHS_assign v; | |
| 1484 | suffixedexp(ls, &v.v); | |
| 1485 | if (ls->t.token == '=' || ls->t.token == ',') { /* stat -> assignment ? */ | |
| 1486 | v.prev = NULL; | |
| 1487 | assignment(ls, &v, 1); | |
| 1488 | } | |
| 1489 | else { /* stat -> func */ | |
| 1490 | check_condition(ls, v.v.k == VCALL, "syntax error"); | |
| 1491 | SETARG_C(getcode(fs, &v.v), 1); /* call statement uses no results */ | |
| 1492 | } | |
| 1481 | /* stat -> func | assignment */ | |
| 1482 | FuncState *fs = ls->fs; | |
| 1483 | struct LHS_assign v; | |
| 1484 | suffixedexp(ls, &v.v); | |
| 1485 | if (ls->t.token == '=' || ls->t.token == ',') { /* stat -> assignment ? */ | |
| 1486 | v.prev = NULL; | |
| 1487 | assignment(ls, &v, 1); | |
| 1488 | } | |
| 1489 | else { /* stat -> func */ | |
| 1490 | check_condition(ls, v.v.k == VCALL, "syntax error"); | |
| 1491 | SETARG_C(getcode(fs, &v.v), 1); /* call statement uses no results */ | |
| 1492 | } | |
| 1493 | 1493 | } |
| 1494 | 1494 | |
| 1495 | 1495 | |
| 1496 | 1496 | static void retstat (LexState *ls) { |
| 1497 | /* stat -> RETURN [explist] [';'] */ | |
| 1498 | FuncState *fs = ls->fs; | |
| 1499 | expdesc e; | |
| 1500 | int first, nret; /* registers with returned values */ | |
| 1501 | if (block_follow(ls, 1) || ls->t.token == ';') | |
| 1502 | first = nret = 0; /* return no values */ | |
| 1503 | else { | |
| 1504 | nret = explist(ls, &e); /* optional return values */ | |
| 1505 | if (hasmultret(e.k)) { | |
| 1506 | luaK_setmultret(fs, &e); | |
| 1507 | if (e.k == VCALL && nret == 1) { /* tail call? */ | |
| 1508 | SET_OPCODE(getcode(fs,&e), OP_TAILCALL); | |
| 1509 | lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar); | |
| 1510 | } | |
| 1511 | first = fs->nactvar; | |
| 1512 | nret = LUA_MULTRET; /* return all values */ | |
| 1513 | } | |
| 1514 | else { | |
| 1515 | if (nret == 1) /* only one single value? */ | |
| 1516 | first = luaK_exp2anyreg(fs, &e); | |
| 1517 | else { | |
| 1518 | luaK_exp2nextreg(fs, &e); /* values must go to the `stack' */ | |
| 1519 | first = fs->nactvar; /* return all `active' values */ | |
| 1520 | lua_assert(nret == fs->freereg - first); | |
| 1521 | } | |
| 1522 | } | |
| 1523 | } | |
| 1524 | luaK_ret(fs, first, nret); | |
| 1525 | testnext(ls, ';'); /* skip optional semicolon */ | |
| 1497 | /* stat -> RETURN [explist] [';'] */ | |
| 1498 | FuncState *fs = ls->fs; | |
| 1499 | expdesc e; | |
| 1500 | int first, nret; /* registers with returned values */ | |
| 1501 | if (block_follow(ls, 1) || ls->t.token == ';') | |
| 1502 | first = nret = 0; /* return no values */ | |
| 1503 | else { | |
| 1504 | nret = explist(ls, &e); /* optional return values */ | |
| 1505 | if (hasmultret(e.k)) { | |
| 1506 | luaK_setmultret(fs, &e); | |
| 1507 | if (e.k == VCALL && nret == 1) { /* tail call? */ | |
| 1508 | SET_OPCODE(getcode(fs,&e), OP_TAILCALL); | |
| 1509 | lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar); | |
| 1510 | } | |
| 1511 | first = fs->nactvar; | |
| 1512 | nret = LUA_MULTRET; /* return all values */ | |
| 1513 | } | |
| 1514 | else { | |
| 1515 | if (nret == 1) /* only one single value? */ | |
| 1516 | first = luaK_exp2anyreg(fs, &e); | |
| 1517 | else { | |
| 1518 | luaK_exp2nextreg(fs, &e); /* values must go to the `stack' */ | |
| 1519 | first = fs->nactvar; /* return all `active' values */ | |
| 1520 | lua_assert(nret == fs->freereg - first); | |
| 1521 | } | |
| 1522 | } | |
| 1523 | } | |
| 1524 | luaK_ret(fs, first, nret); | |
| 1525 | testnext(ls, ';'); /* skip optional semicolon */ | |
| 1526 | 1526 | } |
| 1527 | 1527 | |
| 1528 | 1528 | |
| 1529 | 1529 | static void statement (LexState *ls) { |
| 1530 | int line = ls->linenumber; /* may be needed for error messages */ | |
| 1531 | enterlevel(ls); | |
| 1532 | switch (ls->t.token) { | |
| 1533 | case ';': { /* stat -> ';' (empty statement) */ | |
| 1534 | luaX_next(ls); /* skip ';' */ | |
| 1535 | break; | |
| 1536 | } | |
| 1537 | case TK_IF: { /* stat -> ifstat */ | |
| 1538 | ifstat(ls, line); | |
| 1539 | break; | |
| 1540 | } | |
| 1541 | case TK_WHILE: { /* stat -> whilestat */ | |
| 1542 | whilestat(ls, line); | |
| 1543 | break; | |
| 1544 | } | |
| 1545 | case TK_DO: { /* stat -> DO block END */ | |
| 1546 | luaX_next(ls); /* skip DO */ | |
| 1547 | block(ls); | |
| 1548 | check_match(ls, TK_END, TK_DO, line); | |
| 1549 | break; | |
| 1550 | } | |
| 1551 | case TK_FOR: { /* stat -> forstat */ | |
| 1552 | forstat(ls, line); | |
| 1553 | break; | |
| 1554 | } | |
| 1555 | case TK_REPEAT: { /* stat -> repeatstat */ | |
| 1556 | repeatstat(ls, line); | |
| 1557 | break; | |
| 1558 | } | |
| 1559 | case TK_FUNCTION: { /* stat -> funcstat */ | |
| 1560 | funcstat(ls, line); | |
| 1561 | break; | |
| 1562 | } | |
| 1563 | case TK_LOCAL: { /* stat -> localstat */ | |
| 1564 | luaX_next(ls); /* skip LOCAL */ | |
| 1565 | if (testnext(ls, TK_FUNCTION)) /* local function? */ | |
| 1566 | localfunc(ls); | |
| 1567 | else | |
| 1568 | localstat(ls); | |
| 1569 | break; | |
| 1570 | } | |
| 1571 | case TK_DBCOLON: { /* stat -> label */ | |
| 1572 | luaX_next(ls); /* skip double colon */ | |
| 1573 | labelstat(ls, str_checkname(ls), line); | |
| 1574 | break; | |
| 1575 | } | |
| 1576 | case TK_RETURN: { /* stat -> retstat */ | |
| 1577 | luaX_next(ls); /* skip RETURN */ | |
| 1578 | retstat(ls); | |
| 1579 | break; | |
| 1580 | } | |
| 1581 | case TK_BREAK: /* stat -> breakstat */ | |
| 1582 | case TK_GOTO: { /* stat -> 'goto' NAME */ | |
| 1583 | gotostat(ls, luaK_jump(ls->fs)); | |
| 1584 | break; | |
| 1585 | } | |
| 1586 | default: { /* stat -> func | assignment */ | |
| 1587 | exprstat(ls); | |
| 1588 | break; | |
| 1589 | } | |
| 1590 | } | |
| 1591 | lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg && | |
| 1592 | ls->fs->freereg >= ls->fs->nactvar); | |
| 1593 | ls->fs->freereg = ls->fs->nactvar; /* free registers */ | |
| 1594 | leavelevel(ls); | |
| 1530 | int line = ls->linenumber; /* may be needed for error messages */ | |
| 1531 | enterlevel(ls); | |
| 1532 | switch (ls->t.token) { | |
| 1533 | case ';': { /* stat -> ';' (empty statement) */ | |
| 1534 | luaX_next(ls); /* skip ';' */ | |
| 1535 | break; | |
| 1536 | } | |
| 1537 | case TK_IF: { /* stat -> ifstat */ | |
| 1538 | ifstat(ls, line); | |
| 1539 | break; | |
| 1540 | } | |
| 1541 | case TK_WHILE: { /* stat -> whilestat */ | |
| 1542 | whilestat(ls, line); | |
| 1543 | break; | |
| 1544 | } | |
| 1545 | case TK_DO: { /* stat -> DO block END */ | |
| 1546 | luaX_next(ls); /* skip DO */ | |
| 1547 | block(ls); | |
| 1548 | check_match(ls, TK_END, TK_DO, line); | |
| 1549 | break; | |
| 1550 | } | |
| 1551 | case TK_FOR: { /* stat -> forstat */ | |
| 1552 | forstat(ls, line); | |
| 1553 | break; | |
| 1554 | } | |
| 1555 | case TK_REPEAT: { /* stat -> repeatstat */ | |
| 1556 | repeatstat(ls, line); | |
| 1557 | break; | |
| 1558 | } | |
| 1559 | case TK_FUNCTION: { /* stat -> funcstat */ | |
| 1560 | funcstat(ls, line); | |
| 1561 | break; | |
| 1562 | } | |
| 1563 | case TK_LOCAL: { /* stat -> localstat */ | |
| 1564 | luaX_next(ls); /* skip LOCAL */ | |
| 1565 | if (testnext(ls, TK_FUNCTION)) /* local function? */ | |
| 1566 | localfunc(ls); | |
| 1567 | else | |
| 1568 | localstat(ls); | |
| 1569 | break; | |
| 1570 | } | |
| 1571 | case TK_DBCOLON: { /* stat -> label */ | |
| 1572 | luaX_next(ls); /* skip double colon */ | |
| 1573 | labelstat(ls, str_checkname(ls), line); | |
| 1574 | break; | |
| 1575 | } | |
| 1576 | case TK_RETURN: { /* stat -> retstat */ | |
| 1577 | luaX_next(ls); /* skip RETURN */ | |
| 1578 | retstat(ls); | |
| 1579 | break; | |
| 1580 | } | |
| 1581 | case TK_BREAK: /* stat -> breakstat */ | |
| 1582 | case TK_GOTO: { /* stat -> 'goto' NAME */ | |
| 1583 | gotostat(ls, luaK_jump(ls->fs)); | |
| 1584 | break; | |
| 1585 | } | |
| 1586 | default: { /* stat -> func | assignment */ | |
| 1587 | exprstat(ls); | |
| 1588 | break; | |
| 1589 | } | |
| 1590 | } | |
| 1591 | lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg && | |
| 1592 | ls->fs->freereg >= ls->fs->nactvar); | |
| 1593 | ls->fs->freereg = ls->fs->nactvar; /* free registers */ | |
| 1594 | leavelevel(ls); | |
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | 1597 | /* }====================================================================== */ |
| r31373 | r31374 | |
| 1602 | 1602 | ** upvalue named LUA_ENV |
| 1603 | 1603 | */ |
| 1604 | 1604 | static void mainfunc (LexState *ls, FuncState *fs) { |
| 1605 | BlockCnt bl; | |
| 1606 | expdesc v; | |
| 1607 | open_func(ls, fs, &bl); | |
| 1608 | fs->f->is_vararg = 1; /* main function is always vararg */ | |
| 1609 | init_exp(&v, VLOCAL, 0); /* create and... */ | |
| 1610 | newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */ | |
| 1611 | luaX_next(ls); /* read first token */ | |
| 1612 | statlist(ls); /* parse main body */ | |
| 1613 | check(ls, TK_EOS); | |
| 1614 | close_func(ls); | |
| 1605 | BlockCnt bl; | |
| 1606 | expdesc v; | |
| 1607 | open_func(ls, fs, &bl); | |
| 1608 | fs->f->is_vararg = 1; /* main function is always vararg */ | |
| 1609 | init_exp(&v, VLOCAL, 0); /* create and... */ | |
| 1610 | newupvalue(fs, ls->envn, &v); /* ...set environment upvalue */ | |
| 1611 | luaX_next(ls); /* read first token */ | |
| 1612 | statlist(ls); /* parse main body */ | |
| 1613 | check(ls, TK_EOS); | |
| 1614 | close_func(ls); | |
| 1615 | 1615 | } |
| 1616 | 1616 | |
| 1617 | 1617 | |
| 1618 | 1618 | Closure *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, |
| 1619 | Dyndata *dyd, const char *name, int firstchar) { | |
| 1620 | LexState lexstate; | |
| 1621 | FuncState funcstate; | |
| 1622 | Closure *cl = luaF_newLclosure(L, 1); /* create main closure */ | |
| 1623 | /* anchor closure (to avoid being collected) */ | |
| 1624 | setclLvalue(L, L->top, cl); | |
| 1625 | incr_top(L); | |
| 1626 | funcstate.f = cl->l.p = luaF_newproto(L); | |
| 1627 | funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ | |
| 1628 | lexstate.buff = buff; | |
| 1629 | lexstate.dyd = dyd; | |
| 1630 | dyd->actvar.n = dyd->gt.n = dyd->label.n = 0; | |
| 1631 | luaX_setinput(L, &lexstate, z, funcstate.f->source, firstchar); | |
| 1632 | mainfunc(&lexstate, &funcstate); | |
| 1633 | lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs); | |
| 1634 | /* all scopes should be correctly finished */ | |
| 1635 | lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0); | |
| 1636 | return cl; /* it's on the stack too */ | |
| 1619 | Dyndata *dyd, const char *name, int firstchar) { | |
| 1620 | LexState lexstate; | |
| 1621 | FuncState funcstate; | |
| 1622 | Closure *cl = luaF_newLclosure(L, 1); /* create main closure */ | |
| 1623 | /* anchor closure (to avoid being collected) */ | |
| 1624 | setclLvalue(L, L->top, cl); | |
| 1625 | incr_top(L); | |
| 1626 | funcstate.f = cl->l.p = luaF_newproto(L); | |
| 1627 | funcstate.f->source = luaS_new(L, name); /* create and anchor TString */ | |
| 1628 | lexstate.buff = buff; | |
| 1629 | lexstate.dyd = dyd; | |
| 1630 | dyd->actvar.n = dyd->gt.n = dyd->label.n = 0; | |
| 1631 | luaX_setinput(L, &lexstate, z, funcstate.f->source, firstchar); | |
| 1632 | mainfunc(&lexstate, &funcstate); | |
| 1633 | lua_assert(!funcstate.prev && funcstate.nups == 1 && !lexstate.fs); | |
| 1634 | /* all scopes should be correctly finished */ | |
| 1635 | lua_assert(dyd->actvar.n == 0 && dyd->gt.n == 0 && dyd->label.n == 0); | |
| 1636 | return cl; /* it's on the stack too */ | |
| 1637 | 1637 | } |
| 1638 |
| r31373 | r31374 | |
|---|---|---|
| 15 | 15 | /* ORDER OP */ |
| 16 | 16 | |
| 17 | 17 | LUAI_DDEF const char *const luaP_opnames[NUM_OPCODES+1] = { |
| 18 | "MOVE", | |
| 19 | "LOADK", | |
| 20 | "LOADKX", | |
| 21 | "LOADBOOL", | |
| 22 | "LOADNIL", | |
| 23 | "GETUPVAL", | |
| 24 | "GETTABUP", | |
| 25 | "GETTABLE", | |
| 26 | "SETTABUP", | |
| 27 | "SETUPVAL", | |
| 28 | "SETTABLE", | |
| 29 | "NEWTABLE", | |
| 30 | "SELF", | |
| 31 | "ADD", | |
| 32 | "SUB", | |
| 33 | "MUL", | |
| 34 | "DIV", | |
| 35 | "MOD", | |
| 36 | "POW", | |
| 37 | "UNM", | |
| 38 | "NOT", | |
| 39 | "LEN", | |
| 40 | "CONCAT", | |
| 41 | "JMP", | |
| 42 | "EQ", | |
| 43 | "LT", | |
| 44 | "LE", | |
| 45 | "TEST", | |
| 46 | "TESTSET", | |
| 47 | "CALL", | |
| 48 | "TAILCALL", | |
| 49 | "RETURN", | |
| 50 | "FORLOOP", | |
| 51 | "FORPREP", | |
| 52 | "TFORCALL", | |
| 53 | "TFORLOOP", | |
| 54 | "SETLIST", | |
| 55 | "CLOSURE", | |
| 56 | "VARARG", | |
| 57 | "EXTRAARG", | |
| 58 | NULL | |
| 18 | "MOVE", | |
| 19 | "LOADK", | |
| 20 | "LOADKX", | |
| 21 | "LOADBOOL", | |
| 22 | "LOADNIL", | |
| 23 | "GETUPVAL", | |
| 24 | "GETTABUP", | |
| 25 | "GETTABLE", | |
| 26 | "SETTABUP", | |
| 27 | "SETUPVAL", | |
| 28 | "SETTABLE", | |
| 29 | "NEWTABLE", | |
| 30 | "SELF", | |
| 31 | "ADD", | |
| 32 | "SUB", | |
| 33 | "MUL", | |
| 34 | "DIV", | |
| 35 | "MOD", | |
| 36 | "POW", | |
| 37 | "UNM", | |
| 38 | "NOT", | |
| 39 | "LEN", | |
| 40 | "CONCAT", | |
| 41 | "JMP", | |
| 42 | "EQ", | |
| 43 | "LT", | |
| 44 | "LE", | |
| 45 | "TEST", | |
| 46 | "TESTSET", | |
| 47 | "CALL", | |
| 48 | "TAILCALL", | |
| 49 | "RETURN", | |
| 50 | "FORLOOP", | |
| 51 | "FORPREP", | |
| 52 | "TFORCALL", | |
| 53 | "TFORLOOP", | |
| 54 | "SETLIST", | |
| 55 | "CLOSURE", | |
| 56 | "VARARG", | |
| 57 | "EXTRAARG", | |
| 58 | NULL | |
| 59 | 59 | }; |
| 60 | 60 | |
| 61 | 61 | |
| 62 | 62 | #define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) |
| 63 | 63 | |
| 64 | 64 | LUAI_DDEF const lu_byte luaP_opmodes[NUM_OPCODES] = { |
| 65 | /* T A B C mode opcode */ | |
| 66 | opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ | |
| 67 | ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ | |
| 68 | ,opmode(0, 1, OpArgN, OpArgN, iABx) /* OP_LOADKX */ | |
| 69 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ | |
| 70 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_LOADNIL */ | |
| 71 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ | |
| 72 | ,opmode(0, 1, OpArgU, OpArgK, iABC) /* OP_GETTABUP */ | |
| 73 | ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ | |
| 74 | ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABUP */ | |
| 75 | ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ | |
| 76 | ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ | |
| 77 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ | |
| 78 | ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ | |
| 79 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ | |
| 80 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ | |
| 81 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ | |
| 82 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ | |
| 83 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ | |
| 84 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ | |
| 85 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ | |
| 86 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ | |
| 87 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ | |
| 88 | ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ | |
| 89 | ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ | |
| 90 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ | |
| 91 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ | |
| 92 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ | |
| 93 | ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TEST */ | |
| 94 | ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ | |
| 95 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ | |
| 96 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ | |
| 97 | ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ | |
| 98 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ | |
| 99 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ | |
| 100 | ,opmode(0, 0, OpArgN, OpArgU, iABC) /* OP_TFORCALL */ | |
| 101 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_TFORLOOP */ | |
| 102 | ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ | |
| 103 | ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ | |
| 104 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ | |
| 105 | ,opmode(0, 0, OpArgU, OpArgU, iAx) /* OP_EXTRAARG */ | |
| 65 | /* T A B C mode opcode */ | |
| 66 | opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ | |
| 67 | ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ | |
| 68 | ,opmode(0, 1, OpArgN, OpArgN, iABx) /* OP_LOADKX */ | |
| 69 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ | |
| 70 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_LOADNIL */ | |
| 71 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ | |
| 72 | ,opmode(0, 1, OpArgU, OpArgK, iABC) /* OP_GETTABUP */ | |
| 73 | ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ | |
| 74 | ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABUP */ | |
| 75 | ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ | |
| 76 | ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ | |
| 77 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ | |
| 78 | ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ | |
| 79 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ | |
| 80 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ | |
| 81 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ | |
| 82 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ | |
| 83 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ | |
| 84 | ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ | |
| 85 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ | |
| 86 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ | |
| 87 | ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ | |
| 88 | ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ | |
| 89 | ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ | |
| 90 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ | |
| 91 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ | |
| 92 | ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ | |
| 93 | ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TEST */ | |
| 94 | ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ | |
| 95 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ | |
| 96 | ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ | |
| 97 | ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ | |
| 98 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ | |
| 99 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ | |
| 100 | ,opmode(0, 0, OpArgN, OpArgU, iABC) /* OP_TFORCALL */ | |
| 101 | ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_TFORLOOP */ | |
| 102 | ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ | |
| 103 | ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ | |
| 104 | ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ | |
| 105 | ,opmode(0, 0, OpArgU, OpArgU, iAx) /* OP_EXTRAARG */ | |
| 106 | 106 | }; |
| 107 |
| r31373 | r31374 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | |
| 23 | 23 | static int luaB_print (lua_State *L) { |
| 24 | int n = lua_gettop(L); /* number of arguments */ | |
| 25 | int i; | |
| 26 | lua_getglobal(L, "tostring"); | |
| 27 | for (i=1; i<=n; i++) { | |
| 28 | const char *s; | |
| 29 | size_t l; | |
| 30 | lua_pushvalue(L, -1); /* function to be called */ | |
| 31 | lua_pushvalue(L, i); /* value to print */ | |
| 32 | lua_call(L, 1, 1); | |
| 33 | s = lua_tolstring(L, -1, &l); /* get result */ | |
| 34 | if (s == NULL) | |
| 35 | return luaL_error(L, | |
| 36 | LUA_QL("tostring") " must return a string to " LUA_QL("print")); | |
| 37 | if (i>1) luai_writestring("\t", 1); | |
| 38 | luai_writestring(s, l); | |
| 39 | lua_pop(L, 1); /* pop result */ | |
| 40 | } | |
| 41 | luai_writeline(); | |
| 42 | return 0; | |
| 24 | int n = lua_gettop(L); /* number of arguments */ | |
| 25 | int i; | |
| 26 | lua_getglobal(L, "tostring"); | |
| 27 | for (i=1; i<=n; i++) { | |
| 28 | const char *s; | |
| 29 | size_t l; | |
| 30 | lua_pushvalue(L, -1); /* function to be called */ | |
| 31 | lua_pushvalue(L, i); /* value to print */ | |
| 32 | lua_call(L, 1, 1); | |
| 33 | s = lua_tolstring(L, -1, &l); /* get result */ | |
| 34 | if (s == NULL) | |
| 35 | return luaL_error(L, | |
| 36 | LUA_QL("tostring") " must return a string to " LUA_QL("print")); | |
| 37 | if (i>1) luai_writestring("\t", 1); | |
| 38 | luai_writestring(s, l); | |
| 39 | lua_pop(L, 1); /* pop result */ | |
| 40 | } | |
| 41 | luai_writeline(); | |
| 42 | return 0; | |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | |
| 46 | #define SPACECHARS | |
| 46 | #define SPACECHARS " \f\n\r\t\v" | |
| 47 | 47 | |
| 48 | 48 | static int luaB_tonumber (lua_State *L) { |
| 49 | if (lua_isnoneornil(L, 2)) { /* standard conversion */ | |
| 50 | int isnum; | |
| 51 | lua_Number n = lua_tonumberx(L, 1, &isnum); | |
| 52 | if (isnum) { | |
| 53 | lua_pushnumber(L, n); | |
| 54 | return 1; | |
| 55 | } /* else not a number; must be something */ | |
| 56 | luaL_checkany(L, 1); | |
| 57 | } | |
| 58 | else { | |
| 59 | size_t l; | |
| 60 | const char *s = luaL_checklstring(L, 1, &l); | |
| 61 | const char *e = s + l; /* end point for 's' */ | |
| 62 | int base = luaL_checkint(L, 2); | |
| 63 | int neg = 0; | |
| 64 | luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range"); | |
| 65 | s += strspn(s, SPACECHARS); /* skip initial spaces */ | |
| 66 | if (*s == '-') { s++; neg = 1; } /* handle signal */ | |
| 67 | else if (*s == '+') s++; | |
| 68 | if (isalnum((unsigned char)*s)) { | |
| 69 | lua_Number n = 0; | |
| 70 | do { | |
| 71 | int digit = (isdigit((unsigned char)*s)) ? *s - '0' | |
| 72 | : toupper((unsigned char)*s) - 'A' + 10; | |
| 73 | if (digit >= base) break; /* invalid numeral; force a fail */ | |
| 74 | n = n * (lua_Number)base + (lua_Number)digit; | |
| 75 | s++; | |
| 76 | } while (isalnum((unsigned char)*s)); | |
| 77 | s += strspn(s, SPACECHARS); /* skip trailing spaces */ | |
| 78 | if (s == e) { /* no invalid trailing characters? */ | |
| 79 | lua_pushnumber(L, (neg) ? -n : n); | |
| 80 | return 1; | |
| 81 | } /* else not a number */ | |
| 82 | } /* else not a number */ | |
| 83 | } | |
| 84 | lua_pushnil(L); /* not a number */ | |
| 85 | return 1; | |
| 49 | if (lua_isnoneornil(L, 2)) { /* standard conversion */ | |
| 50 | int isnum; | |
| 51 | lua_Number n = lua_tonumberx(L, 1, &isnum); | |
| 52 | if (isnum) { | |
| 53 | lua_pushnumber(L, n); | |
| 54 | return 1; | |
| 55 | } /* else not a number; must be something */ | |
| 56 | luaL_checkany(L, 1); | |
| 57 | } | |
| 58 | else { | |
| 59 | size_t l; | |
| 60 | const char *s = luaL_checklstring(L, 1, &l); | |
| 61 | const char *e = s + l; /* end point for 's' */ | |
| 62 | int base = luaL_checkint(L, 2); | |
| 63 | int neg = 0; | |
| 64 | luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range"); | |
| 65 | s += strspn(s, SPACECHARS); /* skip initial spaces */ | |
| 66 | if (*s == '-') { s++; neg = 1; } /* handle signal */ | |
| 67 | else if (*s == '+') s++; | |
| 68 | if (isalnum((unsigned char)*s)) { | |
| 69 | lua_Number n = 0; | |
| 70 | do { | |
| 71 | int digit = (isdigit((unsigned char)*s)) ? *s - '0' | |
| 72 | : toupper((unsigned char)*s) - 'A' + 10; | |
| 73 | if (digit >= base) break; /* invalid numeral; force a fail */ | |
| 74 | n = n * (lua_Number)base + (lua_Number)digit; | |
| 75 | s++; | |
| 76 | } while (isalnum((unsigned char)*s)); | |
| 77 | s += strspn(s, SPACECHARS); /* skip trailing spaces */ | |
| 78 | if (s == e) { /* no invalid trailing characters? */ | |
| 79 | lua_pushnumber(L, (neg) ? -n : n); | |
| 80 | return 1; | |
| 81 | } /* else not a number */ | |
| 82 | } /* else not a number */ | |
| 83 | } | |
| 84 | lua_pushnil(L); /* not a number */ | |
| 85 | return 1; | |
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | static int luaB_error (lua_State *L) { |
| 90 | int level = luaL_optint(L, 2, 1); | |
| 91 | lua_settop(L, 1); | |
| 92 | if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ | |
| 93 | luaL_where(L, level); | |
| 94 | lua_pushvalue(L, 1); | |
| 95 | lua_concat(L, 2); | |
| 96 | } | |
| 97 | return lua_error(L); | |
| 90 | int level = luaL_optint(L, 2, 1); | |
| 91 | lua_settop(L, 1); | |
| 92 | if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ | |
| 93 | luaL_where(L, level); | |
| 94 | lua_pushvalue(L, 1); | |
| 95 | lua_concat(L, 2); | |
| 96 | } | |
| 97 | return lua_error(L); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | static int luaB_getmetatable (lua_State *L) { |
| 102 | luaL_checkany(L, 1); | |
| 103 | if (!lua_getmetatable(L, 1)) { | |
| 104 | lua_pushnil(L); | |
| 105 | return 1; /* no metatable */ | |
| 106 | } | |
| 107 | luaL_getmetafield(L, 1, "__metatable"); | |
| 108 | return 1; /* returns either __metatable field (if present) or metatable */ | |
| 102 | luaL_checkany(L, 1); | |
| 103 | if (!lua_getmetatable(L, 1)) { | |
| 104 | lua_pushnil(L); | |
| 105 | return 1; /* no metatable */ | |
| 106 | } | |
| 107 | luaL_getmetafield(L, 1, "__metatable"); | |
| 108 | return 1; /* returns either __metatable field (if present) or metatable */ | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | static int luaB_setmetatable (lua_State *L) { |
| 113 | int t = lua_type(L, 2); | |
| 114 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 115 | luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, | |
| 116 | "nil or table expected"); | |
| 117 | if (luaL_getmetafield(L, 1, "__metatable")) | |
| 118 | return luaL_error(L, "cannot change a protected metatable"); | |
| 119 | lua_settop(L, 2); | |
| 120 | lua_setmetatable(L, 1); | |
| 121 | return 1; | |
| 113 | int t = lua_type(L, 2); | |
| 114 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 115 | luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, | |
| 116 | "nil or table expected"); | |
| 117 | if (luaL_getmetafield(L, 1, "__metatable")) | |
| 118 | return luaL_error(L, "cannot change a protected metatable"); | |
| 119 | lua_settop(L, 2); | |
| 120 | lua_setmetatable(L, 1); | |
| 121 | return 1; | |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | |
| 125 | 125 | static int luaB_rawequal (lua_State *L) { |
| 126 | luaL_checkany(L, 1); | |
| 127 | luaL_checkany(L, 2); | |
| 128 | lua_pushboolean(L, lua_rawequal(L, 1, 2)); | |
| 129 | return 1; | |
| 126 | luaL_checkany(L, 1); | |
| 127 | luaL_checkany(L, 2); | |
| 128 | lua_pushboolean(L, lua_rawequal(L, 1, 2)); | |
| 129 | return 1; | |
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | |
| 133 | 133 | static int luaB_rawlen (lua_State *L) { |
| 134 | int t = lua_type(L, 1); | |
| 135 | luaL_argcheck(L, t == LUA_TTABLE || t == LUA_TSTRING, 1, | |
| 136 | "table or string expected"); | |
| 137 | lua_pushinteger(L, lua_rawlen(L, 1)); | |
| 138 | return 1; | |
| 134 | int t = lua_type(L, 1); | |
| 135 | luaL_argcheck(L, t == LUA_TTABLE || t == LUA_TSTRING, 1, | |
| 136 | "table or string expected"); | |
| 137 | lua_pushinteger(L, lua_rawlen(L, 1)); | |
| 138 | return 1; | |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | |
| 142 | 142 | static int luaB_rawget (lua_State *L) { |
| 143 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 144 | luaL_checkany(L, 2); | |
| 145 | lua_settop(L, 2); | |
| 146 | lua_rawget(L, 1); | |
| 147 | return 1; | |
| 143 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 144 | luaL_checkany(L, 2); | |
| 145 | lua_settop(L, 2); | |
| 146 | lua_rawget(L, 1); | |
| 147 | return 1; | |
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | static int luaB_rawset (lua_State *L) { |
| 151 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 152 | luaL_checkany(L, 2); | |
| 153 | luaL_checkany(L, 3); | |
| 154 | lua_settop(L, 3); | |
| 155 | lua_rawset(L, 1); | |
| 156 | return 1; | |
| 151 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 152 | luaL_checkany(L, 2); | |
| 153 | luaL_checkany(L, 3); | |
| 154 | lua_settop(L, 3); | |
| 155 | lua_rawset(L, 1); | |
| 156 | return 1; | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | static int luaB_collectgarbage (lua_State *L) { |
| 161 | static const char *const opts[] = {"stop", "restart", "collect", | |
| 162 | "count", "step", "setpause", "setstepmul", | |
| 163 | "setmajorinc", "isrunning", "generational", "incremental", NULL}; | |
| 164 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, | |
| 165 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, | |
| 166 | LUA_GCSETMAJORINC, LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC}; | |
| 167 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; | |
| 168 | int ex = luaL_optint(L, 2, 0); | |
| 169 | int res = lua_gc(L, o, ex); | |
| 170 | switch (o) { | |
| 171 | case LUA_GCCOUNT: { | |
| 172 | int b = lua_gc(L, LUA_GCCOUNTB, 0); | |
| 173 | lua_pushnumber(L, res + ((lua_Number)b/1024)); | |
| 174 | lua_pushinteger(L, b); | |
| 175 | return 2; | |
| 176 | } | |
| 177 | case LUA_GCSTEP: case LUA_GCISRUNNING: { | |
| 178 | lua_pushboolean(L, res); | |
| 179 | return 1; | |
| 180 | } | |
| 181 | default: { | |
| 182 | lua_pushinteger(L, res); | |
| 183 | return 1; | |
| 184 | } | |
| 185 | } | |
| 161 | static const char *const opts[] = {"stop", "restart", "collect", | |
| 162 | "count", "step", "setpause", "setstepmul", | |
| 163 | "setmajorinc", "isrunning", "generational", "incremental", NULL}; | |
| 164 | static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, | |
| 165 | LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL, | |
| 166 | LUA_GCSETMAJORINC, LUA_GCISRUNNING, LUA_GCGEN, LUA_GCINC}; | |
| 167 | int o = optsnum[luaL_checkoption(L, 1, "collect", opts)]; | |
| 168 | int ex = luaL_optint(L, 2, 0); | |
| 169 | int res = lua_gc(L, o, ex); | |
| 170 | switch (o) { | |
| 171 | case LUA_GCCOUNT: { | |
| 172 | int b = lua_gc(L, LUA_GCCOUNTB, 0); | |
| 173 | lua_pushnumber(L, res + ((lua_Number)b/1024)); | |
| 174 | lua_pushinteger(L, b); | |
| 175 | return 2; | |
| 176 | } | |
| 177 | case LUA_GCSTEP: case LUA_GCISRUNNING: { | |
| 178 | lua_pushboolean(L, res); | |
| 179 | return 1; | |
| 180 | } | |
| 181 | default: { | |
| 182 | lua_pushinteger(L, res); | |
| 183 | return 1; | |
| 184 | } | |
| 185 | } | |
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | |
| 189 | 189 | static int luaB_type (lua_State *L) { |
| 190 | luaL_checkany(L, 1); | |
| 191 | lua_pushstring(L, luaL_typename(L, 1)); | |
| 192 | return 1; | |
| 190 | luaL_checkany(L, 1); | |
| 191 | lua_pushstring(L, luaL_typename(L, 1)); | |
| 192 | return 1; | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | |
| 196 | 196 | static int pairsmeta (lua_State *L, const char *method, int iszero, |
| 197 | lua_CFunction iter) { | |
| 198 | if (!luaL_getmetafield(L, 1, method)) { /* no metamethod? */ | |
| 199 | luaL_checktype(L, 1, LUA_TTABLE); /* argument must be a table */ | |
| 200 | lua_pushcfunction(L, iter); /* will return generator, */ | |
| 201 | lua_pushvalue(L, 1); /* state, */ | |
| 202 | if (iszero) lua_pushinteger(L, 0); /* and initial value */ | |
| 203 | else lua_pushnil(L); | |
| 204 | } | |
| 205 | else { | |
| 206 | lua_pushvalue(L, 1); /* argument 'self' to metamethod */ | |
| 207 | lua_call(L, 1, 3); /* get 3 values from metamethod */ | |
| 208 | } | |
| 209 | return 3; | |
| 197 | lua_CFunction iter) { | |
| 198 | if (!luaL_getmetafield(L, 1, method)) { /* no metamethod? */ | |
| 199 | luaL_checktype(L, 1, LUA_TTABLE); /* argument must be a table */ | |
| 200 | lua_pushcfunction(L, iter); /* will return generator, */ | |
| 201 | lua_pushvalue(L, 1); /* state, */ | |
| 202 | if (iszero) lua_pushinteger(L, 0); /* and initial value */ | |
| 203 | else lua_pushnil(L); | |
| 204 | } | |
| 205 | else { | |
| 206 | lua_pushvalue(L, 1); /* argument 'self' to metamethod */ | |
| 207 | lua_call(L, 1, 3); /* get 3 values from metamethod */ | |
| 208 | } | |
| 209 | return 3; | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | |
| 213 | 213 | static int luaB_next (lua_State *L) { |
| 214 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 215 | lua_settop(L, 2); /* create a 2nd argument if there isn't one */ | |
| 216 | if (lua_next(L, 1)) | |
| 217 | return 2; | |
| 218 | else { | |
| 219 | lua_pushnil(L); | |
| 220 | return 1; | |
| 221 | } | |
| 214 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 215 | lua_settop(L, 2); /* create a 2nd argument if there isn't one */ | |
| 216 | if (lua_next(L, 1)) | |
| 217 | return 2; | |
| 218 | else { | |
| 219 | lua_pushnil(L); | |
| 220 | return 1; | |
| 221 | } | |
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | |
| 225 | 225 | static int luaB_pairs (lua_State *L) { |
| 226 | ||
| 226 | return pairsmeta(L, "__pairs", 0, luaB_next); | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | |
| 230 | 230 | static int ipairsaux (lua_State *L) { |
| 231 | int i = luaL_checkint(L, 2); | |
| 232 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 233 | i++; /* next value */ | |
| 234 | lua_pushinteger(L, i); | |
| 235 | lua_rawgeti(L, 1, i); | |
| 236 | return (lua_isnil(L, -1)) ? 1 : 2; | |
| 231 | int i = luaL_checkint(L, 2); | |
| 232 | luaL_checktype(L, 1, LUA_TTABLE); | |
| 233 | i++; /* next value */ | |
| 234 | lua_pushinteger(L, i); | |
| 235 | lua_rawgeti(L, 1, i); | |
| 236 | return (lua_isnil(L, -1)) ? 1 : 2; | |
| 237 | 237 | } |
| 238 | 238 | |
| 239 | 239 | |
| 240 | 240 | static int luaB_ipairs (lua_State *L) { |
| 241 | ||
| 241 | return pairsmeta(L, "__ipairs", 1, ipairsaux); | |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | |
| 245 | 245 | static int load_aux (lua_State *L, int status, int envidx) { |
| 246 | if (status == LUA_OK) { | |
| 247 | if (envidx != 0) { /* 'env' parameter? */ | |
| 248 | lua_pushvalue(L, envidx); /* environment for loaded function */ | |
| 249 | if (!lua_setupvalue(L, -2, 1)) /* set it as 1st upvalue */ | |
| 250 | lua_pop(L, 1); /* remove 'env' if not used by previous call */ | |
| 251 | } | |
| 252 | return 1; | |
| 253 | } | |
| 254 | else { /* error (message is on top of the stack) */ | |
| 255 | lua_pushnil(L); | |
| 256 | lua_insert(L, -2); /* put before error message */ | |
| 257 | return 2; /* return nil plus error message */ | |
| 258 | } | |
| 246 | if (status == LUA_OK) { | |
| 247 | if (envidx != 0) { /* 'env' parameter? */ | |
| 248 | lua_pushvalue(L, envidx); /* environment for loaded function */ | |
| 249 | if (!lua_setupvalue(L, -2, 1)) /* set it as 1st upvalue */ | |
| 250 | lua_pop(L, 1); /* remove 'env' if not used by previous call */ | |
| 251 | } | |
| 252 | return 1; | |
| 253 | } | |
| 254 | else { /* error (message is on top of the stack) */ | |
| 255 | lua_pushnil(L); | |
| 256 | lua_insert(L, -2); /* put before error message */ | |
| 257 | return 2; /* return nil plus error message */ | |
| 258 | } | |
| 259 | 259 | } |
| 260 | 260 | |
| 261 | 261 | |
| 262 | 262 | static int luaB_loadfile (lua_State *L) { |
| 263 | const char *fname = luaL_optstring(L, 1, NULL); | |
| 264 | const char *mode = luaL_optstring(L, 2, NULL); | |
| 265 | int env = (!lua_isnone(L, 3) ? 3 : 0); /* 'env' index or 0 if no 'env' */ | |
| 266 | int status = luaL_loadfilex(L, fname, mode); | |
| 267 | return load_aux(L, status, env); | |
| 263 | const char *fname = luaL_optstring(L, 1, NULL); | |
| 264 | const char *mode = luaL_optstring(L, 2, NULL); | |
| 265 | int env = (!lua_isnone(L, 3) ? 3 : 0); /* 'env' index or 0 if no 'env' */ | |
| 266 | int status = luaL_loadfilex(L, fname, mode); | |
| 267 | return load_aux(L, status, env); | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
| r31373 | r31374 | |
| 280 | 280 | ** string to avoid it being collected while parsed. 'load' has four |
| 281 | 281 | ** optional arguments (chunk, source name, mode, and environment). |
| 282 | 282 | */ |
| 283 | #define RESERVEDSLOT | |
| 283 | #define RESERVEDSLOT 5 | |
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | /* |
| r31373 | r31374 | |
| 290 | 290 | ** reserved slot inside the stack. |
| 291 | 291 | */ |
| 292 | 292 | static const char *generic_reader (lua_State *L, void *ud, size_t *size) { |
| 293 | (void)(ud); /* not used */ | |
| 294 | luaL_checkstack(L, 2, "too many nested functions"); | |
| 295 | lua_pushvalue(L, 1); /* get function */ | |
| 296 | lua_call(L, 0, 1); /* call it */ | |
| 297 | if (lua_isnil(L, -1)) { | |
| 298 | lua_pop(L, 1); /* pop result */ | |
| 299 | *size = 0; | |
| 300 | return NULL; | |
| 301 | } | |
| 302 | else if (!lua_isstring(L, -1)) | |
| 303 | luaL_error(L, "reader function must return a string"); | |
| 304 | lua_replace(L, RESERVEDSLOT); /* save string in reserved slot */ | |
| 305 | return lua_tolstring(L, RESERVEDSLOT, size); | |
| 293 | (void)(ud); /* not used */ | |
| 294 | luaL_checkstack(L, 2, "too many nested functions"); | |
| 295 | lua_pushvalue(L, 1); /* get function */ | |
| 296 | lua_call(L, 0, 1); /* call it */ | |
| 297 | if (lua_isnil(L, -1)) { | |
| 298 | lua_pop(L, 1); /* pop result */ | |
| 299 | *size = 0; | |
| 300 | return NULL; | |
| 301 | } | |
| 302 | else if (!lua_isstring(L, -1)) | |
| 303 | luaL_error(L, "reader function must return a string"); | |
| 304 | lua_replace(L, RESERVEDSLOT); /* save string in reserved slot */ | |
| 305 | return lua_tolstring(L, RESERVEDSLOT, size); | |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | |
| 309 | 309 | static int luaB_load (lua_State *L) { |
| 310 | int status; | |
| 311 | size_t l; | |
| 312 | const char *s = lua_tolstring(L, 1, &l); | |
| 313 | const char *mode = luaL_optstring(L, 3, "bt"); | |
| 314 | int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */ | |
| 315 | if (s != NULL) { /* loading a string? */ | |
| 316 | const char *chunkname = luaL_optstring(L, 2, s); | |
| 317 | status = luaL_loadbufferx(L, s, l, chunkname, mode); | |
| 318 | } | |
| 319 | else { /* loading from a reader function */ | |
| 320 | const char *chunkname = luaL_optstring(L, 2, "=(load)"); | |
| 321 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 322 | lua_settop(L, RESERVEDSLOT); /* create reserved slot */ | |
| 323 | status = lua_load(L, generic_reader, NULL, chunkname, mode); | |
| 324 | } | |
| 325 | return load_aux(L, status, env); | |
| 310 | int status; | |
| 311 | size_t l; | |
| 312 | const char *s = lua_tolstring(L, 1, &l); | |
| 313 | const char *mode = luaL_optstring(L, 3, "bt"); | |
| 314 | int env = (!lua_isnone(L, 4) ? 4 : 0); /* 'env' index or 0 if no 'env' */ | |
| 315 | if (s != NULL) { /* loading a string? */ | |
| 316 | const char *chunkname = luaL_optstring(L, 2, s); | |
| 317 | status = luaL_loadbufferx(L, s, l, chunkname, mode); | |
| 318 | } | |
| 319 | else { /* loading from a reader function */ | |
| 320 | const char *chunkname = luaL_optstring(L, 2, "=(load)"); | |
| 321 | luaL_checktype(L, 1, LUA_TFUNCTION); | |
| 322 | lua_settop(L, RESERVEDSLOT); /* create reserved slot */ | |
| 323 | status = lua_load(L, generic_reader, NULL, chunkname, mode); | |
| 324 | } | |
| 325 | return load_aux(L, status, env); | |
| 326 | 326 | } |
| 327 | 327 | |
| 328 | 328 | /* }====================================================== */ |
| 329 | 329 | |
| 330 | 330 | |
| 331 | 331 | static int dofilecont (lua_State *L) { |
| 332 | ||
| 332 | return lua_gettop(L) - 1; | |
| 333 | 333 | } |
| 334 | 334 | |
| 335 | 335 | |
| 336 | 336 | static int luaB_dofile (lua_State *L) { |
| 337 | const char *fname = luaL_optstring(L, 1, NULL); | |
| 338 | lua_settop(L, 1); | |
| 339 | if (luaL_loadfile(L, fname) != LUA_OK) | |
| 340 | return lua_error(L); | |
| 341 | lua_callk(L, 0, LUA_MULTRET, 0, dofilecont); | |
| 342 | return dofilecont(L); | |
| 337 | const char *fname = luaL_optstring(L, 1, NULL); | |
| 338 | lua_settop(L, 1); | |
| 339 | if (luaL_loadfile(L, fname) != LUA_OK) | |
| 340 | return lua_error(L); | |
| 341 | lua_callk(L, 0, LUA_MULTRET, 0, dofilecont); | |
| 342 | return dofilecont(L); | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | |
| 346 | 346 | static int luaB_assert (lua_State *L) { |
| 347 | if (!lua_toboolean(L, 1)) | |
| 348 | return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!")); | |
| 349 | return lua_gettop(L); | |
| 347 | if (!lua_toboolean(L, 1)) | |
| 348 | return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!")); | |
| 349 | return lua_gettop(L); | |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | 352 | |
| 353 | 353 | static int luaB_select (lua_State *L) { |
| 354 | int n = lua_gettop(L); | |
| 355 | if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { | |
| 356 | lua_pushinteger(L, n-1); | |
| 357 | return 1; | |
| 358 | } | |
| 359 | else { | |
| 360 | int i = luaL_checkint(L, 1); | |
| 361 | if (i < 0) i = n + i; | |
| 362 | else if (i > n) i = n; | |
| 363 | luaL_argcheck(L, 1 <= i, 1, "index out of range"); | |
| 364 | return n - i; | |
| 365 | } | |
| 354 | int n = lua_gettop(L); | |
| 355 | if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { | |
| 356 | lua_pushinteger(L, n-1); | |
| 357 | return 1; | |
| 358 | } | |
| 359 | else { | |
| 360 | int i = luaL_checkint(L, 1); | |
| 361 | if (i < 0) i = n + i; | |
| 362 | else if (i > n) i = n; | |
| 363 | luaL_argcheck(L, 1 <= i, 1, "index out of range"); | |
| 364 | return n - i; | |
| 365 | } | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | |
| 369 | 369 | static int finishpcall (lua_State *L, int status) { |
| 370 | if (!lua_checkstack(L, 1)) { /* no space for extra boolean? */ | |
| 371 | lua_settop(L, 0); /* create space for return values */ | |
| 372 | lua_pushboolean(L, 0); | |
| 373 | lua_pushstring(L, "stack overflow"); | |
| 374 | return 2; /* return false, msg */ | |
| 375 | } | |
| 376 | lua_pushboolean(L, status); /* first result (status) */ | |
| 377 | lua_replace(L, 1); /* put first result in first slot */ | |
| 378 | return lua_gettop(L); | |
| 370 | if (!lua_checkstack(L, 1)) { /* no space for extra boolean? */ | |
| 371 | lua_settop(L, 0); /* create space for return values */ | |
| 372 | lua_pushboolean(L, 0); | |
| 373 | lua_pushstring(L, "stack overflow"); | |
| 374 | return 2; /* return false, msg */ | |
| 375 | } | |
| 376 | lua_pushboolean(L, status); /* first result (status) */ | |
| 377 | lua_replace(L, 1); /* put first result in first slot */ | |
| 378 | return lua_gettop(L); | |
| 379 | 379 | } |
| 380 | 380 | |
| 381 | 381 | |
| 382 | 382 | static int pcallcont (lua_State *L) { |
| 383 | int status = lua_getctx(L, NULL); | |
| 384 | return finishpcall(L, (status == LUA_YIELD)); | |
| 383 | int status = lua_getctx(L, NULL); | |
| 384 | return finishpcall(L, (status == LUA_YIELD)); | |
| 385 | 385 | } |
| 386 | 386 | |
| 387 | 387 | |
| 388 | 388 | static int luaB_pcall (lua_State *L) { |
| 389 | int status; | |
| 390 | luaL_checkany(L, 1); | |
| 391 | lua_pushnil(L); | |
| 392 | lua_insert(L, 1); /* create space for status result */ | |
| 393 | status = lua_pcallk(L, lua_gettop(L) - 2, LUA_MULTRET, 0, 0, pcallcont); | |
| 394 | return finishpcall(L, (status == LUA_OK)); | |
| 389 | int status; | |
| 390 | luaL_checkany(L, 1); | |
| 391 | lua_pushnil(L); | |
| 392 | lua_insert(L, 1); /* create space for status result */ | |
| 393 | status = lua_pcallk(L, lua_gettop(L) - 2, LUA_MULTRET, 0, 0, pcallcont); | |
| 394 | return finishpcall(L, (status == LUA_OK)); | |
| 395 | 395 | } |
| 396 | 396 | |
| 397 | 397 | |
| 398 | 398 | static int luaB_xpcall (lua_State *L) { |
| 399 | int status; | |
| 400 | int n = lua_gettop(L); | |
| 401 | luaL_argcheck(L, n >= 2, 2, "value expected"); | |
| 402 | lua_pushvalue(L, 1); /* exchange function... */ | |
| 403 | lua_copy(L, 2, 1); /* ...and error handler */ | |
| 404 | lua_replace(L, 2); | |
| 405 | status = lua_pcallk(L, n - 2, LUA_MULTRET, 1, 0, pcallcont); | |
| 406 | return finishpcall(L, (status == LUA_OK)); | |
| 399 | int status; | |
| 400 | int n = lua_gettop(L); | |
| 401 | luaL_argcheck(L, n >= 2, 2, "value expected"); | |
| 402 | lua_pushvalue(L, 1); /* exchange function... */ | |
| 403 | lua_copy(L, 2, 1); /* ...and error handler */ | |
| 404 | lua_replace(L, 2); | |
| 405 | status = lua_pcallk(L, n - 2, LUA_MULTRET, 1, 0, pcallcont); | |
| 406 | return finishpcall(L, (status == LUA_OK)); | |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | |
| 410 | 410 | static int luaB_tostring (lua_State *L) { |
| 411 | luaL_checkany(L, 1); | |
| 412 | luaL_tolstring(L, 1, NULL); | |
| 413 | return 1; | |
| 411 | luaL_checkany(L, 1); | |
| 412 | luaL_tolstring(L, 1, NULL); | |
| 413 | return 1; | |
| 414 | 414 | } |
| 415 | 415 | |
| 416 | 416 | |
| 417 | 417 | static const luaL_Reg base_funcs[] = { |
| 418 | {"assert", luaB_assert}, | |
| 419 | {"collectgarbage", luaB_collectgarbage}, | |
| 420 | {"dofile", luaB_dofile}, | |
| 421 | {"error", luaB_error}, | |
| 422 | {"getmetatable", luaB_getmetatable}, | |
| 423 | {"ipairs", luaB_ipairs}, | |
| 424 | {"loadfile", luaB_loadfile}, | |
| 425 | {"load", luaB_load}, | |
| 418 | {"assert", luaB_assert}, | |
| 419 | {"collectgarbage", luaB_collectgarbage}, | |
| 420 | {"dofile", luaB_dofile}, | |
| 421 | {"error", luaB_error}, | |
| 422 | {"getmetatable", luaB_getmetatable}, | |
| 423 | {"ipairs", luaB_ipairs}, | |
| 424 | {"loadfile", luaB_loadfile}, | |
| 425 | {"load", luaB_load}, | |
| 426 | 426 | #if defined(LUA_COMPAT_LOADSTRING) |
| 427 | ||
| 427 | {"loadstring", luaB_load}, | |
| 428 | 428 | #endif |
| 429 | {"next", luaB_next}, | |
| 430 | {"pairs", luaB_pairs}, | |
| 431 | {"pcall", luaB_pcall}, | |
| 432 | {"print", luaB_print}, | |
| 433 | {"rawequal", luaB_rawequal}, | |
| 434 | {"rawlen", luaB_rawlen}, | |
| 435 | {"rawget", luaB_rawget}, | |
| 436 | {"rawset", luaB_rawset}, | |
| 437 | {"select", luaB_select}, | |
| 438 | {"setmetatable", luaB_setmetatable}, | |
| 439 | {"tonumber", luaB_tonumber}, | |
| 440 | {"tostring", luaB_tostring}, | |
| 441 | {"type", luaB_type}, | |
| 442 | {"xpcall", luaB_xpcall}, | |
| 443 | {NULL, NULL} | |
| 429 | {"next", luaB_next}, | |
| 430 | {"pairs", luaB_pairs}, | |
| 431 | {"pcall", luaB_pcall}, | |
| 432 | {"print", luaB_print}, | |
| 433 | {"rawequal", luaB_rawequal}, | |
| 434 | {"rawlen", luaB_rawlen}, | |
| 435 | {"rawget", luaB_rawget}, | |
| 436 | {"rawset", luaB_rawset}, | |
| 437 | {"select", luaB_select}, | |
| 438 | {"setmetatable", luaB_setmetatable}, | |
| 439 | {"tonumber", luaB_tonumber}, | |
| 440 | {"tostring", luaB_tostring}, | |
| 441 | {"type", luaB_type}, | |
| 442 | {"xpcall", luaB_xpcall}, | |
| 443 | {NULL, NULL} | |
| 444 | 444 | }; |
| 445 | 445 | |
| 446 | 446 | |
| 447 | 447 | LUAMOD_API int luaopen_base (lua_State *L) { |
| 448 | /* set global _G */ | |
| 449 | lua_pushglobaltable(L); | |
| 450 | lua_pushglobaltable(L); | |
| 451 | lua_setfield(L, -2, "_G"); | |
| 452 | /* open lib into global table */ | |
| 453 | luaL_setfuncs(L, base_funcs, 0); | |
| 454 | lua_pushliteral(L, LUA_VERSION); | |
| 455 | lua_setfield(L, -2, "_VERSION"); /* set global _VERSION */ | |
| 456 | return 1; | |
| 448 | /* set global _G */ | |
| 449 | lua_pushglobaltable(L); | |
| 450 | lua_pushglobaltable(L); | |
| 451 | lua_setfield(L, -2, "_G"); | |
| 452 | /* open lib into global table */ | |
| 453 | luaL_setfuncs(L, base_funcs, 0); | |
| 454 | lua_pushliteral(L, LUA_VERSION); | |
| 455 | lua_setfield(L, -2, "_VERSION"); /* set global _VERSION */ | |
| 456 | return 1; | |
| 457 | 457 | } |
| 458 |
| r31373 | r31374 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | int luaZ_fill (ZIO *z) { |
| 22 | size_t size; | |
| 23 | lua_State *L = z->L; | |
| 24 | const char *buff; | |
| 25 | lua_unlock(L); | |
| 26 | buff = z->reader(L, z->data, &size); | |
| 27 | lua_lock(L); | |
| 28 | if (buff == NULL || size == 0) | |
| 29 | return EOZ; | |
| 30 | z->n = size - 1; /* discount char being returned */ | |
| 31 | z->p = buff; | |
| 32 | return cast_uchar(*(z->p++)); | |
| 22 | size_t size; | |
| 23 | lua_State *L = z->L; | |
| 24 | const char *buff; | |
| 25 | lua_unlock(L); | |
| 26 | buff = z->reader(L, z->data, &size); | |
| 27 | lua_lock(L); | |
| 28 | if (buff == NULL || size == 0) | |
| 29 | return EOZ; | |
| 30 | z->n = size - 1; /* discount char being returned */ | |
| 31 | z->p = buff; | |
| 32 | return cast_uchar(*(z->p++)); | |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | |
| 36 | 36 | void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { |
| 37 | z->L = L; | |
| 38 | z->reader = reader; | |
| 39 | z->data = data; | |
| 40 | z->n = 0; | |
| 41 | z->p = NULL; | |
| 37 | z->L = L; | |
| 38 | z->reader = reader; | |
| 39 | z->data = data; | |
| 40 | z->n = 0; | |
| 41 | z->p = NULL; | |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | /* --------------------------------------------------------------- read --- */ |
| 46 | 46 | size_t luaZ_read (ZIO *z, void *b, size_t n) { |
| 47 | while (n) { | |
| 48 | size_t m; | |
| 49 | if (z->n == 0) { /* no bytes in buffer? */ | |
| 50 | if (luaZ_fill(z) == EOZ) /* try to read more */ | |
| 51 | return n; /* no more input; return number of missing bytes */ | |
| 52 | else { | |
| 53 | z->n++; /* luaZ_fill consumed first byte; put it back */ | |
| 54 | z->p--; | |
| 55 | } | |
| 56 | } | |
| 57 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ | |
| 58 | memcpy(b, z->p, m); | |
| 59 | z->n -= m; | |
| 60 | z->p += m; | |
| 61 | b = (char *)b + m; | |
| 62 | n -= m; | |
| 63 | } | |
| 64 | return 0; | |
| 47 | while (n) { | |
| 48 | size_t m; | |
| 49 | if (z->n == 0) { /* no bytes in buffer? */ | |
| 50 | if (luaZ_fill(z) == EOZ) /* try to read more */ | |
| 51 | return n; /* no more input; return number of missing bytes */ | |
| 52 | else { | |
| 53 | z->n++; /* luaZ_fill consumed first byte; put it back */ | |
| 54 | z->p--; | |
| 55 | } | |
| 56 | } | |
| 57 | m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ | |
| 58 | memcpy(b, z->p, m); | |
| 59 | z->n -= m; | |
| 60 | z->p += m; | |
| 61 | b = (char *)b + m; | |
| 62 | n -= m; | |
| 63 | } | |
| 64 | return 0; | |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | 67 | /* ------------------------------------------------------------------------ */ |
| 68 | 68 | char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) { |
| 69 | if (n > buff->buffsize) { | |
| 70 | if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; | |
| 71 | luaZ_resizebuffer(L, buff, n); | |
| 72 | } | |
| 73 | return buff->buffer; | |
| 69 | if (n > buff->buffsize) { | |
| 70 | if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; | |
| 71 | luaZ_resizebuffer(L, buff, n); | |
| 72 | } | |
| 73 | return buff->buffer; | |
| 74 | 74 | } |
| 75 | ||
| 76 |
| r31373 | r31374 | |
|---|---|---|
| 27 | 27 | ** program |
| 28 | 28 | */ |
| 29 | 29 | static const luaL_Reg loadedlibs[] = { |
| 30 | {"_G", luaopen_base}, | |
| 31 | {LUA_LOADLIBNAME, luaopen_package}, | |
| 32 | {LUA_COLIBNAME, luaopen_coroutine}, | |
| 33 | {LUA_TABLIBNAME, luaopen_table}, | |
| 34 | {LUA_IOLIBNAME, luaopen_io}, | |
| 35 | {LUA_OSLIBNAME, luaopen_os}, | |
| 36 | {LUA_STRLIBNAME, luaopen_string}, | |
| 37 | {LUA_BITLIBNAME, luaopen_bit32}, | |
| 38 | {LUA_MATHLIBNAME, luaopen_math}, | |
| 39 | {LUA_DBLIBNAME, luaopen_debug}, | |
| 40 | {NULL, NULL} | |
| 30 | {"_G", luaopen_base}, | |
| 31 | {LUA_LOADLIBNAME, luaopen_package}, | |
| 32 | {LUA_COLIBNAME, luaopen_coroutine}, | |
| 33 | {LUA_TABLIBNAME, luaopen_table}, | |
| 34 | {LUA_IOLIBNAME, luaopen_io}, | |
| 35 | {LUA_OSLIBNAME, luaopen_os}, | |
| 36 | {LUA_STRLIBNAME, luaopen_string}, | |
| 37 | {LUA_BITLIBNAME, luaopen_bit32}, | |
| 38 | {LUA_MATHLIBNAME, luaopen_math}, | |
| 39 | {LUA_DBLIBNAME, luaopen_debug}, | |
| 40 | {NULL, NULL} | |
| 41 | 41 | }; |
| 42 | 42 | |
| 43 | 43 | |
| r31373 | r31374 | |
| 45 | 45 | ** these libs are preloaded and must be required before used |
| 46 | 46 | */ |
| 47 | 47 | static const luaL_Reg preloadedlibs[] = { |
| 48 | ||
| 48 | {NULL, NULL} | |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | 51 | |
| 52 | 52 | LUALIB_API void luaL_openlibs (lua_State *L) { |
| 53 | const luaL_Reg *lib; | |
| 54 | /* call open functions from 'loadedlibs' and set results to global table */ | |
| 55 | for (lib = loadedlibs; lib->func; lib++) { | |
| 56 | luaL_requiref(L, lib->name, lib->func, 1); | |
| 57 | lua_pop(L, 1); /* remove lib */ | |
| 58 | } | |
| 59 | /* add open functions from 'preloadedlibs' into 'package.preload' table */ | |
| 60 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); | |
| 61 | for (lib = preloadedlibs; lib->func; lib++) { | |
| 62 | lua_pushcfunction(L, lib->func); | |
| 63 | lua_setfield(L, -2, lib->name); | |
| 64 | } | |
| 65 | lua_pop(L, 1); /* remove _PRELOAD table */ | |
| 53 | const luaL_Reg *lib; | |
| 54 | /* call open functions from 'loadedlibs' and set results to global table */ | |
| 55 | for (lib = loadedlibs; lib->func; lib++) { | |
| 56 | luaL_requiref(L, lib->name, lib->func, 1); | |
| 57 | lua_pop(L, 1); /* remove lib */ | |
| 58 | } | |
| 59 | /* add open functions from 'preloadedlibs' into 'package.preload' table */ | |
| 60 | luaL_getsubtable(L, LUA_REGISTRYINDEX, "_PRELOAD"); | |
| 61 | for (lib = preloadedlibs; lib->func; lib++) { | |
| 62 | lua_pushcfunction(L, lib->func); | |
| 63 | lua_setfield(L, -2, lib->name); | |
| 64 | } | |
| 65 | lua_pop(L, 1); /* remove _PRELOAD table */ | |
| 66 | 66 | } |
| 67 |
| r31373 | r31374 | |
|---|---|---|
| 19 | 19 | |
| 20 | 20 | |
| 21 | 21 | #if !defined(LUA_PROMPT) |
| 22 | #define LUA_PROMPT "> " | |
| 23 | #define LUA_PROMPT2 ">> " | |
| 22 | #define LUA_PROMPT "> " | |
| 23 | #define LUA_PROMPT2 ">> " | |
| 24 | 24 | #endif |
| 25 | 25 | |
| 26 | 26 | #if !defined(LUA_PROGNAME) |
| 27 | #define LUA_PROGNAME | |
| 27 | #define LUA_PROGNAME "lua" | |
| 28 | 28 | #endif |
| 29 | 29 | |
| 30 | 30 | #if !defined(LUA_MAXINPUT) |
| 31 | #define LUA_MAXINPUT | |
| 31 | #define LUA_MAXINPUT 512 | |
| 32 | 32 | #endif |
| 33 | 33 | |
| 34 | 34 | #if !defined(LUA_INIT) |
| 35 | #define LUA_INIT | |
| 35 | #define LUA_INIT "LUA_INIT" | |
| 36 | 36 | #endif |
| 37 | 37 | |
| 38 | 38 | #define LUA_INITVERSION \ |
| r31373 | r31374 | |
| 45 | 45 | */ |
| 46 | 46 | #if defined(LUA_USE_ISATTY) |
| 47 | 47 | #include <unistd.h> |
| 48 | #define lua_stdin_is_tty() | |
| 48 | #define lua_stdin_is_tty() isatty(0) | |
| 49 | 49 | #elif defined(LUA_WIN) |
| 50 | 50 | #include <io.h> |
| 51 | 51 | #include <stdio.h> |
| 52 | #define lua_stdin_is_tty() | |
| 52 | #define lua_stdin_is_tty() _isatty(_fileno(stdin)) | |
| 53 | 53 | #else |
| 54 | #define lua_stdin_is_tty() | |
| 54 | #define lua_stdin_is_tty() 1 /* assume stdin is a tty */ | |
| 55 | 55 | #endif |
| 56 | 56 | |
| 57 | 57 | |
| r31373 | r31374 | |
| 66 | 66 | #include <stdio.h> |
| 67 | 67 | #include <readline/readline.h> |
| 68 | 68 | #include <readline/history.h> |
| 69 | #define lua_readline(L,b,p) | |
| 69 | #define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) | |
| 70 | 70 | #define lua_saveline(L,idx) \ |
| 71 | if (lua_rawlen(L,idx) > 0) /* non-empty line? */ \ | |
| 72 | add_history(lua_tostring(L, idx)); /* add it to history */ | |
| 73 | #define lua_freeline(L,b) ((void)L, free(b)) | |
| 71 | if (lua_rawlen(L,idx) > 0) /* non-empty line? */ \ | |
| 72 | add_history(lua_tostring(L, idx)); /* add it to history */ | |
| 73 | #define lua_freeline(L,b) ((void)L, free(b)) | |
| 74 | 74 | |
| 75 | 75 | #elif !defined(lua_readline) |
| 76 | 76 | |
| 77 | 77 | #define lua_readline(L,b,p) \ |
| 78 | ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ | |
| 79 | fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ | |
| 80 | #define lua_saveline(L,idx) { (void)L; (void)idx; } | |
| 81 | #define lua_freeline(L,b) { (void)L; (void)b; } | |
| 78 | ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ | |
| 79 | fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ | |
| 80 | #define lua_saveline(L,idx) { (void)L; (void)idx; } | |
| 81 | #define lua_freeline(L,b) { (void)L; (void)b; } | |
| 82 | 82 | |
| 83 | 83 | #endif |
| 84 | 84 | |
| r31373 | r31374 | |
| 92 | 92 | |
| 93 | 93 | |
| 94 | 94 | static void lstop (lua_State *L, lua_Debug *ar) { |
| 95 | (void)ar; /* unused arg. */ | |
| 96 | lua_sethook(L, NULL, 0, 0); | |
| 97 | luaL_error(L, "interrupted!"); | |
| 95 | (void)ar; /* unused arg. */ | |
| 96 | lua_sethook(L, NULL, 0, 0); | |
| 97 | luaL_error(L, "interrupted!"); | |
| 98 | 98 | } |
| 99 | 99 | |
| 100 | 100 | |
| 101 | 101 | static void laction (int i) { |
| 102 | ||
| 102 | signal(i, SIG_DFL); /* if another SIGINT happens before lstop, | |
| 103 | 103 | terminate process (default action) */ |
| 104 | ||
| 104 | lua_sethook(globalL, lstop, LUA_MASKCALL | LUA_MASKRET | LUA_MASKCOUNT, 1); | |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | |
| 108 | 108 | static void print_usage (const char *badoption) { |
| 109 | luai_writestringerror("%s: ", progname); | |
| 110 | if (badoption[1] == 'e' || badoption[1] == 'l') | |
| 111 | luai_writestringerror("'%s' needs argument\n", badoption); | |
| 112 | else | |
| 113 | luai_writestringerror("unrecognized option '%s'\n", badoption); | |
| 114 | luai_writestringerror( | |
| 115 | "usage: %s [options] [script [args]]\n" | |
| 116 | "Available options are:\n" | |
| 117 | " -e stat execute string " LUA_QL("stat") "\n" | |
| 118 | " -i enter interactive mode after executing " LUA_QL("script") "\n" | |
| 119 | " -l name require library " LUA_QL("name") "\n" | |
| 120 | " -v show version information\n" | |
| 121 | " -E ignore environment variables\n" | |
| 122 | " -- stop handling options\n" | |
| 123 | " - stop handling options and execute stdin\n" | |
| 124 | , | |
| 125 | progname); | |
| 109 | luai_writestringerror("%s: ", progname); | |
| 110 | if (badoption[1] == 'e' || badoption[1] == 'l') | |
| 111 | luai_writestringerror("'%s' needs argument\n", badoption); | |
| 112 | else | |
| 113 | luai_writestringerror("unrecognized option '%s'\n", badoption); | |
| 114 | luai_writestringerror( | |
| 115 | "usage: %s [options] [script [args]]\n" | |
| 116 | "Available options are:\n" | |
| 117 | " -e stat execute string " LUA_QL("stat") "\n" | |
| 118 | " -i enter interactive mode after executing " LUA_QL("script") "\n" | |
| 119 | " -l name require library " LUA_QL("name") "\n" | |
| 120 | " -v show version information\n" | |
| 121 | " -E ignore environment variables\n" | |
| 122 | " -- stop handling options\n" | |
| 123 | " - stop handling options and execute stdin\n" | |
| 124 | , | |
| 125 | progname); | |
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | |
| 129 | 129 | static void l_message (const char *pname, const char *msg) { |
| 130 | if (pname) luai_writestringerror("%s: ", pname); | |
| 131 | luai_writestringerror("%s\n", msg); | |
| 130 | if (pname) luai_writestringerror("%s: ", pname); | |
| 131 | luai_writestringerror("%s\n", msg); | |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | |
| 135 | 135 | static int report (lua_State *L, int status) { |
| 136 | if (status != LUA_OK && !lua_isnil(L, -1)) { | |
| 137 | const char *msg = lua_tostring(L, -1); | |
| 138 | if (msg == NULL) msg = "(error object is not a string)"; | |
| 139 | l_message(progname, msg); | |
| 140 | lua_pop(L, 1); | |
| 141 | /* force a complete garbage collection in case of errors */ | |
| 142 | lua_gc(L, LUA_GCCOLLECT, 0); | |
| 143 | } | |
| 144 | return status; | |
| 136 | if (status != LUA_OK && !lua_isnil(L, -1)) { | |
| 137 | const char *msg = lua_tostring(L, -1); | |
| 138 | if (msg == NULL) msg = "(error object is not a string)"; | |
| 139 | l_message(progname, msg); | |
| 140 | lua_pop(L, 1); | |
| 141 | /* force a complete garbage collection in case of errors */ | |
| 142 | lua_gc(L, LUA_GCCOLLECT, 0); | |
| 143 | } | |
| 144 | return status; | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | /* the next function is called unprotected, so it must avoid errors */ |
| 149 | 149 | static void finalreport (lua_State *L, int status) { |
| 150 | if (status != LUA_OK) { | |
| 151 | const char *msg = (lua_type(L, -1) == LUA_TSTRING) ? lua_tostring(L, -1) | |
| 152 | : NULL; | |
| 153 | if (msg == NULL) msg = "(error object is not a string)"; | |
| 154 | l_message(progname, msg); | |
| 155 | lua_pop(L, 1); | |
| 156 | } | |
| 150 | if (status != LUA_OK) { | |
| 151 | const char *msg = (lua_type(L, -1) == LUA_TSTRING) ? lua_tostring(L, -1) | |
| 152 | : NULL; | |
| 153 | if (msg == NULL) msg = "(error object is not a string)"; | |
| 154 | l_message(progname, msg); | |
| 155 | lua_pop(L, 1); | |
| 156 | } | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | static int traceback (lua_State *L) { |
| 161 | const char *msg = lua_tostring(L, 1); | |
| 162 | if (msg) | |
| 163 | luaL_traceback(L, L, msg, 1); | |
| 164 | else if (!lua_isnoneornil(L, 1)) { /* is there an error object? */ | |
| 165 | if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */ | |
| 166 | lua_pushliteral(L, "(no error message)"); | |
| 167 | } | |
| 168 | return 1; | |
| 161 | const char *msg = lua_tostring(L, 1); | |
| 162 | if (msg) | |
| 163 | luaL_traceback(L, L, msg, 1); | |
| 164 | else if (!lua_isnoneornil(L, 1)) { /* is there an error object? */ | |
| 165 | if (!luaL_callmeta(L, 1, "__tostring")) /* try its 'tostring' metamethod */ | |
| 166 | lua_pushliteral(L, "(no error message)"); | |
| 167 | } | |
| 168 | return 1; | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | static int docall (lua_State *L, int narg, int nres) { |
| 173 | int status; | |
| 174 | int base = lua_gettop(L) - narg; /* function index */ | |
| 175 | lua_pushcfunction(L, traceback); /* push traceback function */ | |
| 176 | lua_insert(L, base); /* put it under chunk and args */ | |
| 177 | globalL = L; /* to be available to 'laction' */ | |
| 178 | signal(SIGINT, laction); | |
| 179 | status = lua_pcall(L, narg, nres, base); | |
| 180 | signal(SIGINT, SIG_DFL); | |
| 181 | lua_remove(L, base); /* remove traceback function */ | |
| 182 | return status; | |
| 173 | int status; | |
| 174 | int base = lua_gettop(L) - narg; /* function index */ | |
| 175 | lua_pushcfunction(L, traceback); /* push traceback function */ | |
| 176 | lua_insert(L, base); /* put it under chunk and args */ | |
| 177 | globalL = L; /* to be available to 'laction' */ | |
| 178 | signal(SIGINT, laction); | |
| 179 | status = lua_pcall(L, narg, nres, base); | |
| 180 | signal(SIGINT, SIG_DFL); | |
| 181 | lua_remove(L, base); /* remove traceback function */ | |
| 182 | return status; | |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | |
| 186 | 186 | static void print_version (void) { |
| 187 | luai_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); | |
| 188 | luai_writeline(); | |
| 187 | luai_writestring(LUA_COPYRIGHT, strlen(LUA_COPYRIGHT)); | |
| 188 | luai_writeline(); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
| 192 | 192 | static int getargs (lua_State *L, char **argv, int n) { |
| 193 | int narg; | |
| 194 | int i; | |
| 195 | int argc = 0; | |
| 196 | while (argv[argc]) argc++; /* count total number of arguments */ | |
| 197 | narg = argc - (n + 1); /* number of arguments to the script */ | |
| 198 | luaL_checkstack(L, narg + 3, "too many arguments to script"); | |
| 199 | for (i=n+1; i < argc; i++) | |
| 200 | lua_pushstring(L, argv[i]); | |
| 201 | lua_createtable(L, narg, n + 1); | |
| 202 | for (i=0; i < argc; i++) { | |
| 203 | lua_pushstring(L, argv[i]); | |
| 204 | lua_rawseti(L, -2, i - n); | |
| 205 | } | |
| 206 | return narg; | |
| 193 | int narg; | |
| 194 | int i; | |
| 195 | int argc = 0; | |
| 196 | while (argv[argc]) argc++; /* count total number of arguments */ | |
| 197 | narg = argc - (n + 1); /* number of arguments to the script */ | |
| 198 | luaL_checkstack(L, narg + 3, "too many arguments to script"); | |
| 199 | for (i=n+1; i < argc; i++) | |
| 200 | lua_pushstring(L, argv[i]); | |
| 201 | lua_createtable(L, narg, n + 1); | |
| 202 | for (i=0; i < argc; i++) { | |
| 203 | lua_pushstring(L, argv[i]); | |
| 204 | lua_rawseti(L, -2, i - n); | |
| 205 | } | |
| 206 | return narg; | |
| 207 | 207 | } |
| 208 | 208 | |
| 209 | 209 | |
| 210 | 210 | static int dofile (lua_State *L, const char *name) { |
| 211 | int status = luaL_loadfile(L, name); | |
| 212 | if (status == LUA_OK) status = docall(L, 0, 0); | |
| 213 | return report(L, status); | |
| 211 | int status = luaL_loadfile(L, name); | |
| 212 | if (status == LUA_OK) status = docall(L, 0, 0); | |
| 213 | return report(L, status); | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | static int dostring (lua_State *L, const char *s, const char *name) { |
| 218 | int status = luaL_loadbuffer(L, s, strlen(s), name); | |
| 219 | if (status == LUA_OK) status = docall(L, 0, 0); | |
| 220 | return report(L, status); | |
| 218 | int status = luaL_loadbuffer(L, s, strlen(s), name); | |
| 219 | if (status == LUA_OK) status = docall(L, 0, 0); | |
| 220 | return report(L, status); | |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | |
| 224 | 224 | static int dolibrary (lua_State *L, const char *name) { |
| 225 | int status; | |
| 226 | lua_getglobal(L, "require"); | |
| 227 | lua_pushstring(L, name); | |
| 228 | status = docall(L, 1, 1); /* call 'require(name)' */ | |
| 229 | if (status == LUA_OK) | |
| 230 | lua_setglobal(L, name); /* global[name] = require return */ | |
| 231 | return report(L, status); | |
| 225 | int status; | |
| 226 | lua_getglobal(L, "require"); | |
| 227 | lua_pushstring(L, name); | |
| 228 | status = docall(L, 1, 1); /* call 'require(name)' */ | |
| 229 | if (status == LUA_OK) | |
| 230 | lua_setglobal(L, name); /* global[name] = require return */ | |
| 231 | return report(L, status); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | static const char *get_prompt (lua_State *L, int firstline) { |
| 236 | const char *p; | |
| 237 | lua_getglobal(L, firstline ? "_PROMPT" : "_PROMPT2"); | |
| 238 | p = lua_tostring(L, -1); | |
| 239 | if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); | |
| 240 | return p; | |
| 236 | const char *p; | |
| 237 | lua_getglobal(L, firstline ? "_PROMPT" : "_PROMPT2"); | |
| 238 | p = lua_tostring(L, -1); | |
| 239 | if (p == NULL) p = (firstline ? LUA_PROMPT : LUA_PROMPT2); | |
| 240 | return p; | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | /* mark in error messages for incomplete statements */ |
| 244 | #define EOFMARK "<eof>" | |
| 245 | #define marklen (sizeof(EOFMARK)/sizeof(char) - 1) | |
| 244 | #define EOFMARK "<eof>" | |
| 245 | #define marklen (sizeof(EOFMARK)/sizeof(char) - 1) | |
| 246 | 246 | |
| 247 | 247 | static int incomplete (lua_State *L, int status) { |
| 248 | if (status == LUA_ERRSYNTAX) { | |
| 249 | size_t lmsg; | |
| 250 | const char *msg = lua_tolstring(L, -1, &lmsg); | |
| 251 | if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) { | |
| 252 | lua_pop(L, 1); | |
| 253 | return 1; | |
| 254 | } | |
| 255 | } | |
| 256 | return 0; /* else... */ | |
| 248 | if (status == LUA_ERRSYNTAX) { | |
| 249 | size_t lmsg; | |
| 250 | const char *msg = lua_tolstring(L, -1, &lmsg); | |
| 251 | if (lmsg >= marklen && strcmp(msg + lmsg - marklen, EOFMARK) == 0) { | |
| 252 | lua_pop(L, 1); | |
| 253 | return 1; | |
| 254 | } | |
| 255 | } | |
| 256 | return 0; /* else... */ | |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | |
| 260 | 260 | static int pushline (lua_State *L, int firstline) { |
| 261 | char buffer[LUA_MAXINPUT]; | |
| 262 | char *b = buffer; | |
| 263 | size_t l; | |
| 264 | const char *prmt = get_prompt(L, firstline); | |
| 265 | int readstatus = lua_readline(L, b, prmt); | |
| 266 | lua_pop(L, 1); /* remove result from 'get_prompt' */ | |
| 267 | if (readstatus == 0) | |
| 268 | return 0; /* no input */ | |
| 269 | l = strlen(b); | |
| 270 | if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ | |
| 271 | b[l-1] = '\0'; /* remove it */ | |
| 272 | if (firstline && b[0] == '=') /* first line starts with `=' ? */ | |
| 273 | lua_pushfstring(L, "return %s", b+1); /* change it to `return' */ | |
| 274 | else | |
| 275 | lua_pushstring(L, b); | |
| 276 | lua_freeline(L, b); | |
| 277 | return 1; | |
| 261 | char buffer[LUA_MAXINPUT]; | |
| 262 | char *b = buffer; | |
| 263 | size_t l; | |
| 264 | const char *prmt = get_prompt(L, firstline); | |
| 265 | int readstatus = lua_readline(L, b, prmt); | |
| 266 | lua_pop(L, 1); /* remove result from 'get_prompt' */ | |
| 267 | if (readstatus == 0) | |
| 268 | return 0; /* no input */ | |
| 269 | l = strlen(b); | |
| 270 | if (l > 0 && b[l-1] == '\n') /* line ends with newline? */ | |
| 271 | b[l-1] = '\0'; /* remove it */ | |
| 272 | if (firstline && b[0] == '=') /* first line starts with `=' ? */ | |
| 273 | lua_pushfstring(L, "return %s", b+1); /* change it to `return' */ | |
| 274 | else | |
| 275 | lua_pushstring(L, b); | |
| 276 | lua_freeline(L, b); | |
| 277 | return 1; | |
| 278 | 278 | } |
| 279 | 279 | |
| 280 | 280 | |
| 281 | 281 | static int loadline (lua_State *L) { |
| 282 | int status; | |
| 283 | lua_settop(L, 0); | |
| 284 | if (!pushline(L, 1)) | |
| 285 | return -1; /* no input */ | |
| 286 | for (;;) { /* repeat until gets a complete line */ | |
| 287 | size_t l; | |
| 288 | const char *line = lua_tolstring(L, 1, &l); | |
| 289 | status = luaL_loadbuffer(L, line, l, "=stdin"); | |
| 290 | if (!incomplete(L, status)) break; /* cannot try to add lines? */ | |
| 291 | if (!pushline(L, 0)) /* no more input? */ | |
| 292 | return -1; | |
| 293 | lua_pushliteral(L, "\n"); /* add a new line... */ | |
| 294 | lua_insert(L, -2); /* ...between the two lines */ | |
| 295 | lua_concat(L, 3); /* join them */ | |
| 296 | } | |
| 297 | lua_saveline(L, 1); | |
| 298 | lua_remove(L, 1); /* remove line */ | |
| 299 | return status; | |
| 282 | int status; | |
| 283 | lua_settop(L, 0); | |
| 284 | if (!pushline(L, 1)) | |
| 285 | return -1; /* no input */ | |
| 286 | for (;;) { /* repeat until gets a complete line */ | |
| 287 | size_t l; | |
| 288 | const char *line = lua_tolstring(L, 1, &l); | |
| 289 | status = luaL_loadbuffer(L, line, l, "=stdin"); | |
| 290 | if (!incomplete(L, status)) break; /* cannot try to add lines? */ | |
| 291 | if (!pushline(L, 0)) /* no more input? */ | |
| 292 | return -1; | |
| 293 | lua_pushliteral(L, "\n"); /* add a new line... */ | |
| 294 | lua_insert(L, -2); /* ...between the two lines */ | |
| 295 | lua_concat(L, 3); /* join them */ | |
| 296 | } | |
| 297 | lua_saveline(L, 1); | |
| 298 | lua_remove(L, 1); /* remove line */ | |
| 299 | return status; | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | |
| 303 | 303 | static void dotty (lua_State *L) { |
| 304 | int status; | |
| 305 | const char *oldprogname = progname; | |
| 306 | progname = NULL; | |
| 307 | while ((status = loadline(L)) != -1) { | |
| 308 | if (status == LUA_OK) status = docall(L, 0, LUA_MULTRET); | |
| 309 | report(L, status); | |
| 310 | if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */ | |
| 311 | luaL_checkstack(L, LUA_MINSTACK, "too many results to print"); | |
| 312 | lua_getglobal(L, "print"); | |
| 313 | lua_insert(L, 1); | |
| 314 | if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK) | |
| 315 | l_message(progname, lua_pushfstring(L, | |
| 316 | "error calling " LUA_QL("print") " (%s)", | |
| 317 | lua_tostring(L, -1))); | |
| 318 | } | |
| 319 | } | |
| 320 | lua_settop(L, 0); /* clear stack */ | |
| 321 | luai_writeline(); | |
| 322 | progname = oldprogname; | |
| 304 | int status; | |
| 305 | const char *oldprogname = progname; | |
| 306 | progname = NULL; | |
| 307 | while ((status = loadline(L)) != -1) { | |
| 308 | if (status == LUA_OK) status = docall(L, 0, LUA_MULTRET); | |
| 309 | report(L, status); | |
| 310 | if (status == LUA_OK && lua_gettop(L) > 0) { /* any result to print? */ | |
| 311 | luaL_checkstack(L, LUA_MINSTACK, "too many results to print"); | |
| 312 | lua_getglobal(L, "print"); | |
| 313 | lua_insert(L, 1); | |
| 314 | if (lua_pcall(L, lua_gettop(L)-1, 0, 0) != LUA_OK) | |
| 315 | l_message(progname, lua_pushfstring(L, | |
| 316 | "error calling " LUA_QL("print") " (%s)", | |
| 317 | lua_tostring(L, -1))); | |
| 318 | } | |
| 319 | } | |
| 320 | lua_settop(L, 0); /* clear stack */ | |
| 321 | luai_writeline(); | |
| 322 | progname = oldprogname; | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| 326 | 326 | static int handle_script (lua_State *L, char **argv, int n) { |
| 327 | int status; | |
| 328 | const char *fname; | |
| 329 | int narg = getargs(L, argv, n); /* collect arguments */ | |
| 330 | lua_setglobal(L, "arg"); | |
| 331 | fname = argv[n]; | |
| 332 | if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) | |
| 333 | fname = NULL; /* stdin */ | |
| 334 | status = luaL_loadfile(L, fname); | |
| 335 | lua_insert(L, -(narg+1)); | |
| 336 | if (status == LUA_OK) | |
| 337 | status = docall(L, narg, LUA_MULTRET); | |
| 338 | else | |
| 339 | lua_pop(L, narg); | |
| 340 | return report(L, status); | |
| 327 | int status; | |
| 328 | const char *fname; | |
| 329 | int narg = getargs(L, argv, n); /* collect arguments */ | |
| 330 | lua_setglobal(L, "arg"); | |
| 331 | fname = argv[n]; | |
| 332 | if (strcmp(fname, "-") == 0 && strcmp(argv[n-1], "--") != 0) | |
| 333 | fname = NULL; /* stdin */ | |
| 334 | status = luaL_loadfile(L, fname); | |
| 335 | lua_insert(L, -(narg+1)); | |
| 336 | if (status == LUA_OK) | |
| 337 | status = docall(L, narg, LUA_MULTRET); | |
| 338 | else | |
| 339 | lua_pop(L, narg); | |
| 340 | return report(L, status); | |
| 341 | 341 | } |
| 342 | 342 | |
| 343 | 343 | |
| 344 | 344 | /* check that argument has no extra characters at the end */ |
| 345 | #define noextrachars(x) | |
| 345 | #define noextrachars(x) {if ((x)[2] != '\0') return -1;} | |
| 346 | 346 | |
| 347 | 347 | |
| 348 | 348 | /* indices of various argument indicators in array args */ |
| 349 | #define has_i 0 /* -i */ | |
| 350 | #define has_v 1 /* -v */ | |
| 351 | #define has_e 2 /* -e */ | |
| 352 | #define has_E 3 /* -E */ | |
| 349 | #define has_i 0 /* -i */ | |
| 350 | #define has_v 1 /* -v */ | |
| 351 | #define has_e 2 /* -e */ | |
| 352 | #define has_E 3 /* -E */ | |
| 353 | 353 | |
| 354 | #define num_has | |
| 354 | #define num_has 4 /* number of 'has_*' */ | |
| 355 | 355 | |
| 356 | 356 | |
| 357 | 357 | static int collectargs (char **argv, int *args) { |
| 358 | int i; | |
| 359 | for (i = 1; argv[i] != NULL; i++) { | |
| 360 | if (argv[i][0] != '-') /* not an option? */ | |
| 361 | return i; | |
| 362 | switch (argv[i][1]) { /* option */ | |
| 363 | case '-': | |
| 364 | noextrachars(argv[i]); | |
| 365 | return (argv[i+1] != NULL ? i+1 : 0); | |
| 366 | case '\0': | |
| 367 | return i; | |
| 368 | case 'E': | |
| 369 | args[has_E] = 1; | |
| 370 | break; | |
| 371 | case 'i': | |
| 372 | noextrachars(argv[i]); | |
| 373 | args[has_i] = 1; /* go through */ | |
| 374 | case 'v': | |
| 375 | noextrachars(argv[i]); | |
| 376 | args[has_v] = 1; | |
| 377 | break; | |
| 378 | case 'e': | |
| 379 | args[has_e] = 1; /* go through */ | |
| 380 | case 'l': /* both options need an argument */ | |
| 381 | if (argv[i][2] == '\0') { /* no concatenated argument? */ | |
| 382 | i++; /* try next 'argv' */ | |
| 383 | if (argv[i] == NULL || argv[i][0] == '-') | |
| 384 | return -(i - 1); /* no next argument or it is another option */ | |
| 385 | } | |
| 386 | break; | |
| 387 | default: /* invalid option; return its index... */ | |
| 388 | return -i; /* ...as a negative value */ | |
| 389 | } | |
| 390 | } | |
| 391 | return 0; | |
| 358 | int i; | |
| 359 | for (i = 1; argv[i] != NULL; i++) { | |
| 360 | if (argv[i][0] != '-') /* not an option? */ | |
| 361 | return i; | |
| 362 | switch (argv[i][1]) { /* option */ | |
| 363 | case '-': | |
| 364 | noextrachars(argv[i]); | |
| 365 | return (argv[i+1] != NULL ? i+1 : 0); | |
| 366 | case '\0': | |
| 367 | return i; | |
| 368 | case 'E': | |
| 369 | args[has_E] = 1; | |
| 370 | break; | |
| 371 | case 'i': | |
| 372 | noextrachars(argv[i]); | |
| 373 | args[has_i] = 1; /* go through */ | |
| 374 | case 'v': | |
| 375 | noextrachars(argv[i]); | |
| 376 | args[has_v] = 1; | |
| 377 | break; | |
| 378 | case 'e': | |
| 379 | args[has_e] = 1; /* go through */ | |
| 380 | case 'l': /* both options need an argument */ | |
| 381 | if (argv[i][2] == '\0') { /* no concatenated argument? */ | |
| 382 | i++; /* try next 'argv' */ | |
| 383 | if (argv[i] == NULL || argv[i][0] == '-') | |
| 384 | return -(i - 1); /* no next argument or it is another option */ | |
| 385 | } | |
| 386 | break; | |
| 387 | default: /* invalid option; return its index... */ | |
| 388 | return -i; /* ...as a negative value */ | |
| 389 | } | |
| 390 | } | |
| 391 | return 0; | |
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | |
| 395 | 395 | static int runargs (lua_State *L, char **argv, int n) { |
| 396 | int i; | |
| 397 | for (i = 1; i < n; i++) { | |
| 398 | lua_assert(argv[i][0] == '-'); | |
| 399 | switch (argv[i][1]) { /* option */ | |
| 400 | case 'e': { | |
| 401 | const char *chunk = argv[i] + 2; | |
| 402 | if (*chunk == '\0') chunk = argv[++i]; | |
| 403 | lua_assert(chunk != NULL); | |
| 404 | if (dostring(L, chunk, "=(command line)") != LUA_OK) | |
| 405 | return 0; | |
| 406 | break; | |
| 407 | } | |
| 408 | case 'l': { | |
| 409 | const char *filename = argv[i] + 2; | |
| 410 | if (*filename == '\0') filename = argv[++i]; | |
| 411 | lua_assert(filename != NULL); | |
| 412 | if (dolibrary(L, filename) != LUA_OK) | |
| 413 | return 0; /* stop if file fails */ | |
| 414 | break; | |
| 415 | } | |
| 416 | default: break; | |
| 417 | } | |
| 418 | } | |
| 419 | return 1; | |
| 396 | int i; | |
| 397 | for (i = 1; i < n; i++) { | |
| 398 | lua_assert(argv[i][0] == '-'); | |
| 399 | switch (argv[i][1]) { /* option */ | |
| 400 | case 'e': { | |
| 401 | const char *chunk = argv[i] + 2; | |
| 402 | if (*chunk == '\0') chunk = argv[++i]; | |
| 403 | lua_assert(chunk != NULL); | |
| 404 | if (dostring(L, chunk, "=(command line)") != LUA_OK) | |
| 405 | return 0; | |
| 406 | break; | |
| 407 | } | |
| 408 | case 'l': { | |
| 409 | const char *filename = argv[i] + 2; | |
| 410 | if (*filename == '\0') filename = argv[++i]; | |
| 411 | lua_assert(filename != NULL); | |
| 412 | if (dolibrary(L, filename) != LUA_OK) | |
| 413 | return 0; /* stop if file fails */ | |
| 414 | break; | |
| 415 | } | |
| 416 | default: break; | |
| 417 | } | |
| 418 | } | |
| 419 | return 1; | |
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | |
| 423 | 423 | static int handle_luainit (lua_State *L) { |
| 424 | const char *name = "=" LUA_INITVERSION; | |
| 425 | const char *init = getenv(name + 1); | |
| 426 | if (init == NULL) { | |
| 427 | name = "=" LUA_INIT; | |
| 428 | init = getenv(name + 1); /* try alternative name */ | |
| 429 | } | |
| 430 | if (init == NULL) return LUA_OK; | |
| 431 | else if (init[0] == '@') | |
| 432 | return dofile(L, init+1); | |
| 433 | else | |
| 434 | return dostring(L, init, name); | |
| 424 | const char *name = "=" LUA_INITVERSION; | |
| 425 | const char *init = getenv(name + 1); | |
| 426 | if (init == NULL) { | |
| 427 | name = "=" LUA_INIT; | |
| 428 | init = getenv(name + 1); /* try alternative name */ | |
| 429 | } | |
| 430 | if (init == NULL) return LUA_OK; | |
| 431 | else if (init[0] == '@') | |
| 432 | return dofile(L, init+1); | |
| 433 | else | |
| 434 | return dostring(L, init, name); | |
| 435 | 435 | } |
| 436 | 436 | |
| 437 | 437 | |
| 438 | 438 | static int pmain (lua_State *L) { |
| 439 | int argc = (int)lua_tointeger(L, 1); | |
| 440 | char **argv = (char **)lua_touserdata(L, 2); | |
| 441 | int script; | |
| 442 | int args[num_has]; | |
| 443 | args[has_i] = args[has_v] = args[has_e] = args[has_E] = 0; | |
| 444 | if (argv[0] && argv[0][0]) progname = argv[0]; | |
| 445 | script = collectargs(argv, args); | |
| 446 | if (script < 0) { /* invalid arg? */ | |
| 447 | print_usage(argv[-script]); | |
| 448 | return 0; | |
| 449 | } | |
| 450 | if (args[has_v]) print_version(); | |
| 451 | if (args[has_E]) { /* option '-E'? */ | |
| 452 | lua_pushboolean(L, 1); /* signal for libraries to ignore env. vars. */ | |
| 453 | lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); | |
| 454 | } | |
| 455 | /* open standard libraries */ | |
| 456 | luaL_checkversion(L); | |
| 457 | lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ | |
| 458 | luaL_openlibs(L); /* open libraries */ | |
| 459 | lua_gc(L, LUA_GCRESTART, 0); | |
| 460 | if (!args[has_E] && handle_luainit(L) != LUA_OK) | |
| 461 | return 0; /* error running LUA_INIT */ | |
| 462 | /* execute arguments -e and -l */ | |
| 463 | if (!runargs(L, argv, (script > 0) ? script : argc)) return 0; | |
| 464 | /* execute main script (if there is one) */ | |
| 465 | if (script && handle_script(L, argv, script) != LUA_OK) return 0; | |
| 466 | if (args[has_i]) /* -i option? */ | |
| 467 | dotty(L); | |
| 468 | else if (script == 0 && !args[has_e] && !args[has_v]) { /* no arguments? */ | |
| 469 | if (lua_stdin_is_tty()) { | |
| 470 | print_version(); | |
| 471 | dotty(L); | |
| 472 | } | |
| 473 | else dofile(L, NULL); /* executes stdin as a file */ | |
| 474 | } | |
| 475 | lua_pushboolean(L, 1); /* signal no errors */ | |
| 476 | return 1; | |
| 439 | int argc = (int)lua_tointeger(L, 1); | |
| 440 | char **argv = (char **)lua_touserdata(L, 2); | |
| 441 | int script; | |
| 442 | int args[num_has]; | |
| 443 | args[has_i] = args[has_v] = args[has_e] = args[has_E] = 0; | |
| 444 | if (argv[0] && argv[0][0]) progname = argv[0]; | |
| 445 | script = collectargs(argv, args); | |
| 446 | if (script < 0) { /* invalid arg? */ | |
| 447 | print_usage(argv[-script]); | |
| 448 | return 0; | |
| 449 | } | |
| 450 | if (args[has_v]) print_version(); | |
| 451 | if (args[has_E]) { /* option '-E'? */ | |
| 452 | lua_pushboolean(L, 1); /* signal for libraries to ignore env. vars. */ | |
| 453 | lua_setfield(L, LUA_REGISTRYINDEX, "LUA_NOENV"); | |
| 454 | } | |
| 455 | /* open standard libraries */ | |
| 456 | luaL_checkversion(L); | |
| 457 | lua_gc(L, LUA_GCSTOP, 0); /* stop collector during initialization */ | |
| 458 | luaL_openlibs(L); /* open libraries */ | |
| 459 | lua_gc(L, LUA_GCRESTART, 0); | |
| 460 | if (!args[has_E] && handle_luainit(L) != LUA_OK) | |
| 461 | return 0; /* error running LUA_INIT */ | |
| 462 | /* execute arguments -e and -l */ | |
| 463 | if (!runargs(L, argv, (script > 0) ? script : argc)) return 0; | |
| 464 | /* execute main script (if there is one) */ | |
| 465 | if (script && handle_script(L, argv, script) != LUA_OK) return 0; | |
| 466 | if (args[has_i]) /* -i option? */ | |
| 467 | dotty(L); | |
| 468 | else if (script == 0 && !args[has_e] && !args[has_v]) { /* no arguments? */ | |
| 469 | if (lua_stdin_is_tty()) { | |
| 470 | print_version(); | |
| 471 | dotty(L); | |
| 472 | } | |
| 473 | else dofile(L, NULL); /* executes stdin as a file */ | |
| 474 | } | |
| 475 | lua_pushboolean(L, 1); /* signal no errors */ | |
| 476 | return 1; | |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | |
| 480 | 480 | int main (int argc, char **argv) { |
| 481 | int status, result; | |
| 482 | lua_State *L = luaL_newstate(); /* create state */ | |
| 483 | if (L == NULL) { | |
| 484 | l_message(argv[0], "cannot create state: not enough memory"); | |
| 485 | return EXIT_FAILURE; | |
| 486 | } | |
| 487 | /* call 'pmain' in protected mode */ | |
| 488 | lua_pushcfunction(L, &pmain); | |
| 489 | lua_pushinteger(L, argc); /* 1st argument */ | |
| 490 | lua_pushlightuserdata(L, argv); /* 2nd argument */ | |
| 491 | status = lua_pcall(L, 2, 1, 0); | |
| 492 | result = lua_toboolean(L, -1); /* get result */ | |
| 493 | finalreport(L, status); | |
| 494 | lua_close(L); | |
| 495 | return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; | |
| 481 | int status, result; | |
| 482 | lua_State *L = luaL_newstate(); /* create state */ | |
| 483 | if (L == NULL) { | |
| 484 | l_message(argv[0], "cannot create state: not enough memory"); | |
| 485 | return EXIT_FAILURE; | |
| 486 | } | |
| 487 | /* call 'pmain' in protected mode */ | |
| 488 | lua_pushcfunction(L, &pmain); | |
| 489 | lua_pushinteger(L, argc); /* 1st argument */ | |
| 490 | lua_pushlightuserdata(L, argv); /* 2nd argument */ | |
| 491 | status = lua_pcall(L, 2, 1, 0); | |
| 492 | result = lua_toboolean(L, -1); /* get result */ | |
| 493 | finalreport(L, status); | |
| 494 | lua_close(L); | |
| 495 | return (result && status == LUA_OK) ? EXIT_SUCCESS : EXIT_FAILURE; | |
| 496 | 496 | } |
| 497 |
| r31373 | r31374 | |
|---|---|---|
| 23 | 23 | ** compute its hash |
| 24 | 24 | */ |
| 25 | 25 | #if !defined(LUAI_HASHLIMIT) |
| 26 | #define LUAI_HASHLIMIT | |
| 26 | #define LUAI_HASHLIMIT 5 | |
| 27 | 27 | #endif |
| 28 | 28 | |
| 29 | 29 | |
| r31373 | r31374 | |
| 31 | 31 | ** equality for long strings |
| 32 | 32 | */ |
| 33 | 33 | int luaS_eqlngstr (TString *a, TString *b) { |
| 34 | size_t len = a->tsv.len; | |
| 35 | lua_assert(a->tsv.tt == LUA_TLNGSTR && b->tsv.tt == LUA_TLNGSTR); | |
| 36 | return (a == b) || /* same instance or... */ | |
| 37 | ((len == b->tsv.len) && /* equal length and ... */ | |
| 38 | (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */ | |
| 34 | size_t len = a->tsv.len; | |
| 35 | lua_assert(a->tsv.tt == LUA_TLNGSTR && b->tsv.tt == LUA_TLNGSTR); | |
| 36 | return (a == b) || /* same instance or... */ | |
| 37 | ((len == b->tsv.len) && /* equal length and ... */ | |
| 38 | (memcmp(getstr(a), getstr(b), len) == 0)); /* equal contents */ | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | |
| r31373 | r31374 | |
| 43 | 43 | ** equality for strings |
| 44 | 44 | */ |
| 45 | 45 | int luaS_eqstr (TString *a, TString *b) { |
| 46 | return (a->tsv.tt == b->tsv.tt) && | |
| 47 | (a->tsv.tt == LUA_TSHRSTR ? eqshrstr(a, b) : luaS_eqlngstr(a, b)); | |
| 46 | return (a->tsv.tt == b->tsv.tt) && | |
| 47 | (a->tsv.tt == LUA_TSHRSTR ? eqshrstr(a, b) : luaS_eqlngstr(a, b)); | |
| 48 | 48 | } |
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | unsigned int luaS_hash (const char *str, size_t l, unsigned int seed) { |
| 52 | unsigned int h = seed ^ cast(unsigned int, l); | |
| 53 | size_t l1; | |
| 54 | size_t step = (l >> LUAI_HASHLIMIT) + 1; | |
| 55 | for (l1 = l; l1 >= step; l1 -= step) | |
| 56 | h = h ^ ((h<<5) + (h>>2) + cast_byte(str[l1 - 1])); | |
| 57 | return h; | |
| 52 | unsigned int h = seed ^ cast(unsigned int, l); | |
| 53 | size_t l1; | |
| 54 | size_t step = (l >> LUAI_HASHLIMIT) + 1; | |
| 55 | for (l1 = l; l1 >= step; l1 -= step) | |
| 56 | h = h ^ ((h<<5) + (h>>2) + cast_byte(str[l1 - 1])); | |
| 57 | return h; | |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | 60 | |
| r31373 | r31374 | |
| 62 | 62 | ** resizes the string table |
| 63 | 63 | */ |
| 64 | 64 | void luaS_resize (lua_State *L, int newsize) { |
| 65 | int i; | |
| 66 | stringtable *tb = &G(L)->strt; | |
| 67 | /* cannot resize while GC is traversing strings */ | |
| 68 | luaC_runtilstate(L, ~bitmask(GCSsweepstring)); | |
| 69 | if (newsize > tb->size) { | |
| 70 | luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); | |
| 71 | for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL; | |
| 72 | } | |
| 73 | /* rehash */ | |
| 74 | for (i=0; i<tb->size; i++) { | |
| 75 | GCObject *p = tb->hash[i]; | |
| 76 | tb->hash[i] = NULL; | |
| 77 | while (p) { /* for each node in the list */ | |
| 78 | GCObject *next = gch(p)->next; /* save next */ | |
| 79 | unsigned int h = lmod(gco2ts(p)->hash, newsize); /* new position */ | |
| 80 | gch(p)->next = tb->hash[h]; /* chain it */ | |
| 81 | tb->hash[h] = p; | |
| 82 | resetoldbit(p); /* see MOVE OLD rule */ | |
| 83 | p = next; | |
| 84 | } | |
| 85 | } | |
| 86 | if (newsize < tb->size) { | |
| 87 | /* shrinking slice must be empty */ | |
| 88 | lua_assert(tb->hash[newsize] == NULL && tb->hash[tb->size - 1] == NULL); | |
| 89 | luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); | |
| 90 | } | |
| 91 | tb->size = newsize; | |
| 65 | int i; | |
| 66 | stringtable *tb = &G(L)->strt; | |
| 67 | /* cannot resize while GC is traversing strings */ | |
| 68 | luaC_runtilstate(L, ~bitmask(GCSsweepstring)); | |
| 69 | if (newsize > tb->size) { | |
| 70 | luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); | |
| 71 | for (i = tb->size; i < newsize; i++) tb->hash[i] = NULL; | |
| 72 | } | |
| 73 | /* rehash */ | |
| 74 | for (i=0; i<tb->size; i++) { | |
| 75 | GCObject *p = tb->hash[i]; | |
| 76 | tb->hash[i] = NULL; | |
| 77 | while (p) { /* for each node in the list */ | |
| 78 | GCObject *next = gch(p)->next; /* save next */ | |
| 79 | unsigned int h = lmod(gco2ts(p)->hash, newsize); /* new position */ | |
| 80 | gch(p)->next = tb->hash[h]; /* chain it */ | |
| 81 | tb->hash[h] = p; | |
| 82 | resetoldbit(p); /* see MOVE OLD rule */ | |
| 83 | p = next; | |
| 84 | } | |
| 85 | } | |
| 86 | if (newsize < tb->size) { | |
| 87 | /* shrinking slice must be empty */ | |
| 88 | lua_assert(tb->hash[newsize] == NULL && tb->hash[tb->size - 1] == NULL); | |
| 89 | luaM_reallocvector(L, tb->hash, tb->size, newsize, GCObject *); | |
| 90 | } | |
| 91 | tb->size = newsize; | |
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| r31373 | r31374 | |
| 96 | 96 | ** creates a new string object |
| 97 | 97 | */ |
| 98 | 98 | static TString *createstrobj (lua_State *L, const char *str, size_t l, |
| 99 | int tag, unsigned int h, GCObject **list) { | |
| 100 | TString *ts; | |
| 101 | size_t totalsize; /* total size of TString object */ | |
| 102 | totalsize = sizeof(TString) + ((l + 1) * sizeof(char)); | |
| 103 | ts = &luaC_newobj(L, tag, totalsize, list, 0)->ts; | |
| 104 | ts->tsv.len = l; | |
| 105 | ts->tsv.hash = h; | |
| 106 | ts->tsv.extra = 0; | |
| 107 | memcpy(ts+1, str, l*sizeof(char)); | |
| 108 | ((char *)(ts+1))[l] = '\0'; /* ending 0 */ | |
| 109 | return ts; | |
| 99 | int tag, unsigned int h, GCObject **list) { | |
| 100 | TString *ts; | |
| 101 | size_t totalsize; /* total size of TString object */ | |
| 102 | totalsize = sizeof(TString) + ((l + 1) * sizeof(char)); | |
| 103 | ts = &luaC_newobj(L, tag, totalsize, list, 0)->ts; | |
| 104 | ts->tsv.len = l; | |
| 105 | ts->tsv.hash = h; | |
| 106 | ts->tsv.extra = 0; | |
| 107 | memcpy(ts+1, str, l*sizeof(char)); | |
| 108 | ((char *)(ts+1))[l] = '\0'; /* ending 0 */ | |
| 109 | return ts; | |
| 110 | 110 | } |
| 111 | 111 | |
| 112 | 112 | |
| r31373 | r31374 | |
| 114 | 114 | ** creates a new short string, inserting it into string table |
| 115 | 115 | */ |
| 116 | 116 | static TString *newshrstr (lua_State *L, const char *str, size_t l, |
| 117 | unsigned int h) { | |
| 118 | GCObject **list; /* (pointer to) list where it will be inserted */ | |
| 119 | stringtable *tb = &G(L)->strt; | |
| 120 | TString *s; | |
| 121 | if (tb->nuse >= cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) | |
| 122 | luaS_resize(L, tb->size*2); /* too crowded */ | |
| 123 | list = &tb->hash[lmod(h, tb->size)]; | |
| 124 | s = createstrobj(L, str, l, LUA_TSHRSTR, h, list); | |
| 125 | tb->nuse++; | |
| 126 | return s; | |
| 117 | unsigned int h) { | |
| 118 | GCObject **list; /* (pointer to) list where it will be inserted */ | |
| 119 | stringtable *tb = &G(L)->strt; | |
| 120 | TString *s; | |
| 121 | if (tb->nuse >= cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) | |
| 122 | luaS_resize(L, tb->size*2); /* too crowded */ | |
| 123 | list = &tb->hash[lmod(h, tb->size)]; | |
| 124 | s = createstrobj(L, str, l, LUA_TSHRSTR, h, list); | |
| 125 | tb->nuse++; | |
| 126 | return s; | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
| r31373 | r31374 | |
| 131 | 131 | ** checks whether short string exists and reuses it or creates a new one |
| 132 | 132 | */ |
| 133 | 133 | static TString *internshrstr (lua_State *L, const char *str, size_t l) { |
| 134 | GCObject *o; | |
| 135 | global_State *g = G(L); | |
| 136 | unsigned int h = luaS_hash(str, l, g->seed); | |
| 137 | for (o = g->strt.hash[lmod(h, g->strt.size)]; | |
| 138 | o != NULL; | |
| 139 | o = gch(o)->next) { | |
| 140 | TString *ts = rawgco2ts(o); | |
| 141 | if (h == ts->tsv.hash && | |
| 142 | l == ts->tsv.len && | |
| 143 | (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { | |
| 144 | if (isdead(G(L), o)) /* string is dead (but was not collected yet)? */ | |
| 145 | changewhite(o); /* resurrect it */ | |
| 146 | return ts; | |
| 147 | } | |
| 148 | } | |
| 149 | return newshrstr(L, str, l, h); /* not found; create a new string */ | |
| 134 | GCObject *o; | |
| 135 | global_State *g = G(L); | |
| 136 | unsigned int h = luaS_hash(str, l, g->seed); | |
| 137 | for (o = g->strt.hash[lmod(h, g->strt.size)]; | |
| 138 | o != NULL; | |
| 139 | o = gch(o)->next) { | |
| 140 | TString *ts = rawgco2ts(o); | |
| 141 | if (h == ts->tsv.hash && | |
| 142 | l == ts->tsv.len && | |
| 143 | (memcmp(str, getstr(ts), l * sizeof(char)) == 0)) { | |
| 144 | if (isdead(G(L), o)) /* string is dead (but was not collected yet)? */ | |
| 145 | changewhite(o); /* resurrect it */ | |
| 146 | return ts; | |
| 147 | } | |
| 148 | } | |
| 149 | return newshrstr(L, str, l, h); /* not found; create a new string */ | |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | |
| r31373 | r31374 | |
| 154 | 154 | ** new string (with explicit length) |
| 155 | 155 | */ |
| 156 | 156 | TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { |
| 157 | if (l <= LUAI_MAXSHORTLEN) /* short string? */ | |
| 158 | return internshrstr(L, str, l); | |
| 159 | else { | |
| 160 | if (l + 1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) | |
| 161 | luaM_toobig(L); | |
| 162 | return createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed, NULL); | |
| 163 | } | |
| 157 | if (l <= LUAI_MAXSHORTLEN) /* short string? */ | |
| 158 | return internshrstr(L, str, l); | |
| 159 | else { | |
| 160 | if (l + 1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) | |
| 161 | luaM_toobig(L); | |
| 162 | return createstrobj(L, str, l, LUA_TLNGSTR, G(L)->seed, NULL); | |
| 163 | } | |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | 166 | |
| r31373 | r31374 | |
| 168 | 168 | ** new zero-terminated string |
| 169 | 169 | */ |
| 170 | 170 | TString *luaS_new (lua_State *L, const char *str) { |
| 171 | ||
| 171 | return luaS_newlstr(L, str, strlen(str)); | |
| 172 | 172 | } |
| 173 | 173 | |
| 174 | 174 | |
| 175 | 175 | Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { |
| 176 | Udata *u; | |
| 177 | if (s > MAX_SIZET - sizeof(Udata)) | |
| 178 | luaM_toobig(L); | |
| 179 | u = &luaC_newobj(L, LUA_TUSERDATA, sizeof(Udata) + s, NULL, 0)->u; | |
| 180 | u->uv.len = s; | |
| 181 | u->uv.metatable = NULL; | |
| 182 | u->uv.env = e; | |
| 183 | return u; | |
| 176 | Udata *u; | |
| 177 | if (s > MAX_SIZET - sizeof(Udata)) | |
| 178 | luaM_toobig(L); | |
| 179 | u = &luaC_newobj(L, LUA_TUSERDATA, sizeof(Udata) + s, NULL, 0)->u; | |
| 180 | u->uv.len = s; | |
| 181 | u->uv.metatable = NULL; | |
| 182 | u->uv.env = e; | |
| 183 | return u; | |
| 184 | 184 | } |
| 185 |
| r31373 | r31374 | |
|---|---|---|
| 34 | 34 | ** eeeee != 0 and (xxx) otherwise. |
| 35 | 35 | */ |
| 36 | 36 | int luaO_int2fb (unsigned int x) { |
| 37 | int e = 0; /* exponent */ | |
| 38 | if (x < 8) return x; | |
| 39 | while (x >= 0x10) { | |
| 40 | x = (x+1) >> 1; | |
| 41 | e++; | |
| 42 | } | |
| 43 | return ((e+1) << 3) | (cast_int(x) - 8); | |
| 37 | int e = 0; /* exponent */ | |
| 38 | if (x < 8) return x; | |
| 39 | while (x >= 0x10) { | |
| 40 | x = (x+1) >> 1; | |
| 41 | e++; | |
| 42 | } | |
| 43 | return ((e+1) << 3) | (cast_int(x) - 8); | |
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | |
| 47 | 47 | /* converts back */ |
| 48 | 48 | int luaO_fb2int (int x) { |
| 49 | int e = (x >> 3) & 0x1f; | |
| 50 | if (e == 0) return x; | |
| 51 | else return ((x & 7) + 8) << (e - 1); | |
| 49 | int e = (x >> 3) & 0x1f; | |
| 50 | if (e == 0) return x; | |
| 51 | else return ((x & 7) + 8) << (e - 1); | |
| 52 | 52 | } |
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | int luaO_ceillog2 (unsigned int x) { |
| 56 | static const lu_byte log_2[256] = { | |
| 57 | 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, | |
| 58 | 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, | |
| 59 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | |
| 60 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | |
| 61 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, | |
| 62 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, | |
| 63 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, | |
| 64 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 | |
| 65 | }; | |
| 66 | int l = 0; | |
| 67 | x--; | |
| 68 | while (x >= 256) { l += 8; x >>= 8; } | |
| 69 | return l + log_2[x]; | |
| 56 | static const lu_byte log_2[256] = { | |
| 57 | 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, | |
| 58 | 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, | |
| 59 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | |
| 60 | 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | |
| 61 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, | |
| 62 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, | |
| 63 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, | |
| 64 | 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 | |
| 65 | }; | |
| 66 | int l = 0; | |
| 67 | x--; | |
| 68 | while (x >= 256) { l += 8; x >>= 8; } | |
| 69 | return l + log_2[x]; | |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | 72 | |
| 73 | 73 | lua_Number luaO_arith (int op, lua_Number v1, lua_Number v2) { |
| 74 | switch (op) { | |
| 75 | case LUA_OPADD: return luai_numadd(NULL, v1, v2); | |
| 76 | case LUA_OPSUB: return luai_numsub(NULL, v1, v2); | |
| 77 | case LUA_OPMUL: return luai_nummul(NULL, v1, v2); | |
| 78 | case LUA_OPDIV: return luai_numdiv(NULL, v1, v2); | |
| 79 | case LUA_OPMOD: return luai_nummod(NULL, v1, v2); | |
| 80 | case LUA_OPPOW: return luai_numpow(NULL, v1, v2); | |
| 81 | case LUA_OPUNM: return luai_numunm(NULL, v1); | |
| 82 | default: lua_assert(0); return 0; | |
| 83 | } | |
| 74 | switch (op) { | |
| 75 | case LUA_OPADD: return luai_numadd(NULL, v1, v2); | |
| 76 | case LUA_OPSUB: return luai_numsub(NULL, v1, v2); | |
| 77 | case LUA_OPMUL: return luai_nummul(NULL, v1, v2); | |
| 78 | case LUA_OPDIV: return luai_numdiv(NULL, v1, v2); | |
| 79 | case LUA_OPMOD: return luai_nummod(NULL, v1, v2); | |
| 80 | case LUA_OPPOW: return luai_numpow(NULL, v1, v2); | |
| 81 | case LUA_OPUNM: return luai_numunm(NULL, v1); | |
| 82 | default: lua_assert(0); return 0; | |
| 83 | } | |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | |
| 87 | 87 | int luaO_hexavalue (int c) { |
| 88 | if (lisdigit(c)) return c - '0'; | |
| 89 | else return ltolower(c) - 'a' + 10; | |
| 88 | if (lisdigit(c)) return c - '0'; | |
| 89 | else return ltolower(c) - 'a' + 10; | |
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | |
| r31373 | r31374 | |
| 96 | 96 | |
| 97 | 97 | |
| 98 | 98 | static int isneg (const char **s) { |
| 99 | if (**s == '-') { (*s)++; return 1; } | |
| 100 | else if (**s == '+') (*s)++; | |
| 101 | return 0; | |
| 99 | if (**s == '-') { (*s)++; return 1; } | |
| 100 | else if (**s == '+') (*s)++; | |
| 101 | return 0; | |
| 102 | 102 | } |
| 103 | 103 | |
| 104 | 104 | |
| 105 | 105 | static lua_Number readhexa (const char **s, lua_Number r, int *count) { |
| 106 | for (; lisxdigit(cast_uchar(**s)); (*s)++) { /* read integer part */ | |
| 107 | r = (r * cast_num(16.0)) + cast_num(1.0*luaO_hexavalue(cast_uchar(**s))); | |
| 108 | (*count)++; | |
| 109 | } | |
| 110 | return r; | |
| 106 | for (; lisxdigit(cast_uchar(**s)); (*s)++) { /* read integer part */ | |
| 107 | r = (r * cast_num(16.0)) + cast_num(1.0*luaO_hexavalue(cast_uchar(**s))); | |
| 108 | (*count)++; | |
| 109 | } | |
| 110 | return r; | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | |
| r31373 | r31374 | |
| 116 | 116 | ** C99 specification for 'strtod' |
| 117 | 117 | */ |
| 118 | 118 | static lua_Number lua_strx2number (const char *s, char **endptr) { |
| 119 | lua_Number r = 0.0; | |
| 120 | int e = 0, i = 0; | |
| 121 | int neg = 0; /* 1 if number is negative */ | |
| 122 | *endptr = cast(char *, s); /* nothing is valid yet */ | |
| 123 | while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */ | |
| 124 | neg = isneg(&s); /* check signal */ | |
| 125 | if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))) /* check '0x' */ | |
| 126 | return 0.0; /* invalid format (no '0x') */ | |
| 127 | s += 2; /* skip '0x' */ | |
| 128 | r = readhexa(&s, r, &i); /* read integer part */ | |
| 129 | if (*s == '.') { | |
| 130 | s++; /* skip dot */ | |
| 131 | r = readhexa(&s, r, &e); /* read fractional part */ | |
| 132 | } | |
| 133 | if (i == 0 && e == 0) | |
| 134 | return 0.0; /* invalid format (no digit) */ | |
| 135 | e *= -4; /* each fractional digit divides value by 2^-4 */ | |
| 136 | *endptr = cast(char *, s); /* valid up to here */ | |
| 137 | if (*s == 'p' || *s == 'P') { /* exponent part? */ | |
| 138 | int exp1 = 0; | |
| 139 | int neg1; | |
| 140 | s++; /* skip 'p' */ | |
| 141 | neg1 = isneg(&s); /* signal */ | |
| 142 | if (!lisdigit(cast_uchar(*s))) | |
| 143 | goto ret; /* must have at least one digit */ | |
| 144 | while (lisdigit(cast_uchar(*s))) /* read exponent */ | |
| 145 | exp1 = exp1 * 10 + *(s++) - '0'; | |
| 146 | if (neg1) exp1 = -exp1; | |
| 147 | e += exp1; | |
| 148 | } | |
| 149 | *endptr = cast(char *, s); /* valid up to here */ | |
| 150 | ret: | |
| 151 | if (neg) r = -r; | |
| 152 | return l_mathop(ldexp)(r, e); | |
| 119 | lua_Number r = 0.0; | |
| 120 | int e = 0, i = 0; | |
| 121 | int neg = 0; /* 1 if number is negative */ | |
| 122 | *endptr = cast(char *, s); /* nothing is valid yet */ | |
| 123 | while (lisspace(cast_uchar(*s))) s++; /* skip initial spaces */ | |
| 124 | neg = isneg(&s); /* check signal */ | |
| 125 | if (!(*s == '0' && (*(s + 1) == 'x' || *(s + 1) == 'X'))) /* check '0x' */ | |
| 126 | return 0.0; /* invalid format (no '0x') */ | |
| 127 | s += 2; /* skip '0x' */ | |
| 128 | r = readhexa(&s, r, &i); /* read integer part */ | |
| 129 | if (*s == '.') { | |
| 130 | s++; /* skip dot */ | |
| 131 | r = readhexa(&s, r, &e); /* read fractional part */ | |
| 132 | } | |
| 133 | if (i == 0 && e == 0) | |
| 134 | return 0.0; /* invalid format (no digit) */ | |
| 135 | e *= -4; /* each fractional digit divides value by 2^-4 */ | |
| 136 | *endptr = cast(char *, s); /* valid up to here */ | |
| 137 | if (*s == 'p' || *s == 'P') { /* exponent part? */ | |
| 138 | int exp1 = 0; | |
| 139 | int neg1; | |
| 140 | s++; /* skip 'p' */ | |
| 141 | neg1 = isneg(&s); /* signal */ | |
| 142 | if (!lisdigit(cast_uchar(*s))) | |
| 143 | goto ret; /* must have at least one digit */ | |
| 144 | while (lisdigit(cast_uchar(*s))) /* read exponent */ | |
| 145 | exp1 = exp1 * 10 + *(s++) - '0'; | |
| 146 | if (neg1) exp1 = -exp1; | |
| 147 | e += exp1; | |
| 148 | } | |
| 149 | *endptr = cast(char *, s); /* valid up to here */ | |
| 150 | ret: | |
| 151 | if (neg) r = -r; | |
| 152 | return l_mathop(ldexp)(r, e); | |
| 153 | 153 | } |
| 154 | 154 | |
| 155 | 155 | #endif |
| 156 | 156 | |
| 157 | 157 | |
| 158 | 158 | int luaO_str2d (const char *s, size_t len, lua_Number *result) { |
| 159 | char *endptr; | |
| 160 | if (strpbrk(s, "nN")) /* reject 'inf' and 'nan' */ | |
| 161 | return 0; | |
| 162 | else if (strpbrk(s, "xX")) /* hexa? */ | |
| 163 | *result = lua_strx2number(s, &endptr); | |
| 164 | else | |
| 165 | *result = lua_str2number(s, &endptr); | |
| 166 | if (endptr == s) return 0; /* nothing recognized */ | |
| 167 | while (lisspace(cast_uchar(*endptr))) endptr++; | |
| 168 | return (endptr == s + len); /* OK if no trailing characters */ | |
| 159 | char *endptr; | |
| 160 | if (strpbrk(s, "nN")) /* reject 'inf' and 'nan' */ | |
| 161 | return 0; | |
| 162 | else if (strpbrk(s, "xX")) /* hexa? */ | |
| 163 | *result = lua_strx2number(s, &endptr); | |
| 164 | else | |
| 165 | *result = lua_str2number(s, &endptr); | |
| 166 | if (endptr == s) return 0; /* nothing recognized */ | |
| 167 | while (lisspace(cast_uchar(*endptr))) endptr++; | |
| 168 | return (endptr == s + len); /* OK if no trailing characters */ | |
| 169 | 169 | } |
| 170 | 170 | |
| 171 | 171 | |
| 172 | 172 | |
| 173 | 173 | static void pushstr (lua_State *L, const char *str, size_t l) { |
| 174 | ||
| 174 | setsvalue2s(L, L->top++, luaS_newlstr(L, str, l)); | |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | 177 | |
| 178 | 178 | /* this function handles only `%d', `%c', %f, %p, and `%s' formats */ |
| 179 | 179 | const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { |
| 180 | int n = 0; | |
| 181 | for (;;) { | |
| 182 | const char *e = strchr(fmt, '%'); | |
| 183 | if (e == NULL) break; | |
| 184 | luaD_checkstack(L, 2); /* fmt + item */ | |
| 185 | pushstr(L, fmt, e - fmt); | |
| 186 | switch (*(e+1)) { | |
| 187 | case 's': { | |
| 188 | const char *s = va_arg(argp, char *); | |
| 189 | if (s == NULL) s = "(null)"; | |
| 190 | pushstr(L, s, strlen(s)); | |
| 191 | break; | |
| 192 | } | |
| 193 | case 'c': { | |
| 194 | char buff; | |
| 195 | buff = cast(char, va_arg(argp, int)); | |
| 196 | pushstr(L, &buff, 1); | |
| 197 | break; | |
| 198 | } | |
| 199 | case 'd': { | |
| 200 | setnvalue(L->top++, cast_num(va_arg(argp, int))); | |
| 201 | break; | |
| 202 | } | |
| 203 | case 'f': { | |
| 204 | setnvalue(L->top++, cast_num(va_arg(argp, l_uacNumber))); | |
| 205 | break; | |
| 206 | } | |
| 207 | case 'p': { | |
| 208 | char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ | |
| 209 | int l = sprintf(buff, "%p", va_arg(argp, void *)); | |
| 210 | pushstr(L, buff, l); | |
| 211 | break; | |
| 212 | } | |
| 213 | case '%': { | |
| 214 | pushstr(L, "%", 1); | |
| 215 | break; | |
| 216 | } | |
| 217 | default: { | |
| 218 | luaG_runerror(L, | |
| 219 | "invalid option " LUA_QL("%%%c") " to " LUA_QL("lua_pushfstring"), | |
| 220 | *(e + 1)); | |
| 221 | } | |
| 222 | } | |
| 223 | n += 2; | |
| 224 | fmt = e+2; | |
| 225 | } | |
| 226 | luaD_checkstack(L, 1); | |
| 227 | pushstr(L, fmt, strlen(fmt)); | |
| 228 | if (n > 0) luaV_concat(L, n + 1); | |
| 229 | return svalue(L->top - 1); | |
| 180 | int n = 0; | |
| 181 | for (;;) { | |
| 182 | const char *e = strchr(fmt, '%'); | |
| 183 | if (e == NULL) break; | |
| 184 | luaD_checkstack(L, 2); /* fmt + item */ | |
| 185 | pushstr(L, fmt, e - fmt); | |
| 186 | switch (*(e+1)) { | |
| 187 | case 's': { | |
| 188 | const char *s = va_arg(argp, char *); | |
| 189 | if (s == NULL) s = "(null)"; | |
| 190 | pushstr(L, s, strlen(s)); | |
| 191 | break; | |
| 192 | } | |
| 193 | case 'c': { | |
| 194 | char buff; | |
| 195 | buff = cast(char, va_arg(argp, int)); | |
| 196 | pushstr(L, &buff, 1); | |
| 197 | break; | |
| 198 | } | |
| 199 | case 'd': { | |
| 200 | setnvalue(L->top++, cast_num(va_arg(argp, int))); | |
| 201 | break; | |
| 202 | } | |
| 203 | case 'f': { | |
| 204 | setnvalue(L->top++, cast_num(va_arg(argp, l_uacNumber))); | |
| 205 | break; | |
| 206 | } | |
| 207 | case 'p': { | |
| 208 | char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ | |
| 209 | int l = sprintf(buff, "%p", va_arg(argp, void *)); | |
| 210 | pushstr(L, buff, l); | |
| 211 | break; | |
| 212 | } | |
| 213 | case '%': { | |
| 214 | pushstr(L, "%", 1); | |
| 215 | break; | |
| 216 | } | |
| 217 | default: { | |
| 218 | luaG_runerror(L, | |
| 219 | "invalid option " LUA_QL("%%%c") " to " LUA_QL("lua_pushfstring"), | |
| 220 | *(e + 1)); | |
| 221 | } | |
| 222 | } | |
| 223 | n += 2; | |
| 224 | fmt = e+2; | |
| 225 | } | |
| 226 | luaD_checkstack(L, 1); | |
| 227 | pushstr(L, fmt, strlen(fmt)); | |
| 228 | if (n > 0) luaV_concat(L, n + 1); | |
| 229 | return svalue(L->top - 1); | |
| 230 | 230 | } |
| 231 | 231 | |
| 232 | 232 | |
| 233 | 233 | const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { |
| 234 | const char *msg; | |
| 235 | va_list argp; | |
| 236 | va_start(argp, fmt); | |
| 237 | msg = luaO_pushvfstring(L, fmt, argp); | |
| 238 | va_end(argp); | |
| 239 | return msg; | |
| 234 | const char *msg; | |
| 235 | va_list argp; | |
| 236 | va_start(argp, fmt); | |
| 237 | msg = luaO_pushvfstring(L, fmt, argp); | |
| 238 | va_end(argp); | |
| 239 | return msg; | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| 243 | 243 | /* number of chars of a literal string without the ending \0 */ |
| 244 | #define LL(x) | |
| 244 | #define LL(x) (sizeof(x)/sizeof(char) - 1) | |
| 245 | 245 | |
| 246 | #define RETS "..." | |
| 247 | #define PRE "[string \"" | |
| 248 | #define POS "\"]" | |
| 246 | #define RETS "..." | |
| 247 | #define PRE "[string \"" | |
| 248 | #define POS "\"]" | |
| 249 | 249 | |
| 250 | #define addstr(a,b,l) | |
| 250 | #define addstr(a,b,l) ( memcpy(a,b,(l) * sizeof(char)), a += (l) ) | |
| 251 | 251 | |
| 252 | 252 | void luaO_chunkid (char *out, const char *source, size_t bufflen) { |
| 253 | size_t l = strlen(source); | |
| 254 | if (*source == '=') { /* 'literal' source */ | |
| 255 | if (l <= bufflen) /* small enough? */ | |
| 256 | memcpy(out, source + 1, l * sizeof(char)); | |
| 257 | else { /* truncate it */ | |
| 258 | addstr(out, source + 1, bufflen - 1); | |
| 259 | *out = '\0'; | |
| 260 | } | |
| 261 | } | |
| 262 | else if (*source == '@') { /* file name */ | |
| 263 | if (l <= bufflen) /* small enough? */ | |
| 264 | memcpy(out, source + 1, l * sizeof(char)); | |
| 265 | else { /* add '...' before rest of name */ | |
| 266 | addstr(out, RETS, LL(RETS)); | |
| 267 | bufflen -= LL(RETS); | |
| 268 | memcpy(out, source + 1 + l - bufflen, bufflen * sizeof(char)); | |
| 269 | } | |
| 270 | } | |
| 271 | else { /* string; format as [string "source"] */ | |
| 272 | const char *nl = strchr(source, '\n'); /* find first new line (if any) */ | |
| 273 | addstr(out, PRE, LL(PRE)); /* add prefix */ | |
| 274 | bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ | |
| 275 | if (l < bufflen && nl == NULL) { /* small one-line source? */ | |
| 276 | addstr(out, source, l); /* keep it */ | |
| 277 | } | |
| 278 | else { | |
| 279 | if (nl != NULL) l = nl - source; /* stop at first newline */ | |
| 280 | if (l > bufflen) l = bufflen; | |
| 281 | addstr(out, source, l); | |
| 282 | addstr(out, RETS, LL(RETS)); | |
| 283 | } | |
| 284 | memcpy(out, POS, (LL(POS) + 1) * sizeof(char)); | |
| 285 | } | |
| 253 | size_t l = strlen(source); | |
| 254 | if (*source == '=') { /* 'literal' source */ | |
| 255 | if (l <= bufflen) /* small enough? */ | |
| 256 | memcpy(out, source + 1, l * sizeof(char)); | |
| 257 | else { /* truncate it */ | |
| 258 | addstr(out, source + 1, bufflen - 1); | |
| 259 | *out = '\0'; | |
| 260 | } | |
| 261 | } | |
| 262 | else if (*source == '@') { /* file name */ | |
| 263 | if (l <= bufflen) /* small enough? */ | |
| 264 | memcpy(out, source + 1, l * sizeof(char)); | |
| 265 | else { /* add '...' before rest of name */ | |
| 266 | addstr(out, RETS, LL(RETS)); | |
| 267 | bufflen -= LL(RETS); | |
| 268 | memcpy(out, source + 1 + l - bufflen, bufflen * sizeof(char)); | |
| 269 | } | |
| 270 | } | |
| 271 | else { /* string; format as [string "source"] */ | |
| 272 | const char *nl = strchr(source, '\n'); /* find first new line (if any) */ | |
| 273 | addstr(out, PRE, LL(PRE)); /* add prefix */ | |
| 274 | bufflen -= LL(PRE RETS POS) + 1; /* save space for prefix+suffix+'\0' */ | |
| 275 | if (l < bufflen && nl == NULL) { /* small one-line source? */ | |
| 276 | addstr(out, source, l); /* keep it */ | |
| 277 | } | |
| 278 | else { | |
| 279 | if (nl != NULL) l = nl - source; /* stop at first newline */ | |
| 280 | if (l > bufflen) l = bufflen; | |
| 281 | addstr(out, source, l); | |
| 282 | addstr(out, RETS, LL(RETS)); | |
| 283 | } | |
| 284 | memcpy(out, POS, (LL(POS) + 1) * sizeof(char)); | |
| 285 | } | |
| 286 | 286 | } |
| 287 |
| r31373 | r31374 | |
|---|---|---|
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | const char lua_ident[] = |
| 33 | "$LuaVersion: " LUA_COPYRIGHT " $" | |
| 34 | "$LuaAuthors: " LUA_AUTHORS " $"; | |
| 33 | "$LuaVersion: " LUA_COPYRIGHT " $" | |
| 34 | "$LuaAuthors: " LUA_AUTHORS " $"; | |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | /* value at a non-valid index */ |
| 38 | #define NONVALIDVALUE | |
| 38 | #define NONVALIDVALUE cast(TValue *, luaO_nilobject) | |
| 39 | 39 | |
| 40 | 40 | /* corresponding test */ |
| 41 | #define isvalid(o) | |
| 41 | #define isvalid(o) ((o) != luaO_nilobject) | |
| 42 | 42 | |
| 43 | 43 | /* test for pseudo index */ |
| 44 | #define ispseudo(i) | |
| 44 | #define ispseudo(i) ((i) <= LUA_REGISTRYINDEX) | |
| 45 | 45 | |
| 46 | 46 | /* test for valid but not pseudo index */ |
| 47 | #define isstackindex(i, o) | |
| 47 | #define isstackindex(i, o) (isvalid(o) && !ispseudo(i)) | |
| 48 | 48 | |
| 49 | 49 | #define api_checkvalidindex(L, o) api_check(L, isvalid(o), "invalid index") |
| 50 | 50 | |
| r31373 | r31374 | |
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | static TValue *index2addr (lua_State *L, int idx) { |
| 56 | CallInfo *ci = L->ci; | |
| 57 | if (idx > 0) { | |
| 58 | TValue *o = ci->func + idx; | |
| 59 | api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index"); | |
| 60 | if (o >= L->top) return NONVALIDVALUE; | |
| 61 | else return o; | |
| 62 | } | |
| 63 | else if (!ispseudo(idx)) { /* negative index */ | |
| 64 | api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); | |
| 65 | return L->top + idx; | |
| 66 | } | |
| 67 | else if (idx == LUA_REGISTRYINDEX) | |
| 68 | return &G(L)->l_registry; | |
| 69 | else { /* upvalues */ | |
| 70 | idx = LUA_REGISTRYINDEX - idx; | |
| 71 | api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large"); | |
| 72 | if (ttislcf(ci->func)) /* light C function? */ | |
| 73 | return NONVALIDVALUE; /* it has no upvalues */ | |
| 74 | else { | |
| 75 | CClosure *func = clCvalue(ci->func); | |
| 76 | return (idx <= func->nupvalues) ? &func->upvalue[idx-1] : NONVALIDVALUE; | |
| 77 | } | |
| 78 | } | |
| 56 | CallInfo *ci = L->ci; | |
| 57 | if (idx > 0) { | |
| 58 | TValue *o = ci->func + idx; | |
| 59 | api_check(L, idx <= ci->top - (ci->func + 1), "unacceptable index"); | |
| 60 | if (o >= L->top) return NONVALIDVALUE; | |
| 61 | else return o; | |
| 62 | } | |
| 63 | else if (!ispseudo(idx)) { /* negative index */ | |
| 64 | api_check(L, idx != 0 && -idx <= L->top - (ci->func + 1), "invalid index"); | |
| 65 | return L->top + idx; | |
| 66 | } | |
| 67 | else if (idx == LUA_REGISTRYINDEX) | |
| 68 | return &G(L)->l_registry; | |
| 69 | else { /* upvalues */ | |
| 70 | idx = LUA_REGISTRYINDEX - idx; | |
| 71 | api_check(L, idx <= MAXUPVAL + 1, "upvalue index too large"); | |
| 72 | if (ttislcf(ci->func)) /* light C function? */ | |
| 73 | return NONVALIDVALUE; /* it has no upvalues */ | |
| 74 | else { | |
| 75 | CClosure *func = clCvalue(ci->func); | |
| 76 | return (idx <= func->nupvalues) ? &func->upvalue[idx-1] : NONVALIDVALUE; | |
| 77 | } | |
| 78 | } | |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | 81 | |
| r31373 | r31374 | |
| 84 | 84 | ** capturing memory errors |
| 85 | 85 | */ |
| 86 | 86 | static void growstack (lua_State *L, void *ud) { |
| 87 | int size = *(int *)ud; | |
| 88 | luaD_growstack(L, size); | |
| 87 | int size = *(int *)ud; | |
| 88 | luaD_growstack(L, size); | |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | 91 | |
| 92 | 92 | LUA_API int lua_checkstack (lua_State *L, int size) { |
| 93 | int res; | |
| 94 | CallInfo *ci = L->ci; | |
| 95 | lua_lock(L); | |
| 96 | if (L->stack_last - L->top > size) /* stack large enough? */ | |
| 97 | res = 1; /* yes; check is OK */ | |
| 98 | else { /* no; need to grow stack */ | |
| 99 | int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; | |
| 100 | if (inuse > LUAI_MAXSTACK - size) /* can grow without overflow? */ | |
| 101 | res = 0; /* no */ | |
| 102 | else /* try to grow stack */ | |
| 103 | res = (luaD_rawrunprotected(L, &growstack, &size) == LUA_OK); | |
| 104 | } | |
| 105 | if (res && ci->top < L->top + size) | |
| 106 | ci->top = L->top + size; /* adjust frame top */ | |
| 107 | lua_unlock(L); | |
| 108 | return res; | |
| 93 | int res; | |
| 94 | CallInfo *ci = L->ci; | |
| 95 | lua_lock(L); | |
| 96 | if (L->stack_last - L->top > size) /* stack large enough? */ | |
| 97 | res = 1; /* yes; check is OK */ | |
| 98 | else { /* no; need to grow stack */ | |
| 99 | int inuse = cast_int(L->top - L->stack) + EXTRA_STACK; | |
| 100 | if (inuse > LUAI_MAXSTACK - size) /* can grow without overflow? */ | |
| 101 | res = 0; /* no */ | |
| 102 | else /* try to grow stack */ | |
| 103 | res = (luaD_rawrunprotected(L, &growstack, &size) == LUA_OK); | |
| 104 | } | |
| 105 | if (res && ci->top < L->top + size) | |
| 106 | ci->top = L->top + size; /* adjust frame top */ | |
| 107 | lua_unlock(L); | |
| 108 | return res; | |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { |
| 113 | int i; | |
| 114 | if (from == to) return; | |
| 115 | lua_lock(to); | |
| 116 | api_checknelems(from, n); | |
| 117 | api_check(from, G(from) == G(to), "moving among independent states"); | |
| 118 | api_check(from, to->ci->top - to->top >= n, "not enough elements to move"); | |
| 119 | from->top -= n; | |
| 120 | for (i = 0; i < n; i++) { | |
| 121 | setobj2s(to, to->top++, from->top + i); | |
| 122 | } | |
| 123 | lua_unlock(to); | |
| 113 | int i; | |
| 114 | if (from == to) return; | |
| 115 | lua_lock(to); | |
| 116 | api_checknelems(from, n); | |
| 117 | api_check(from, G(from) == G(to), "moving among independent states"); | |
| 118 | api_check(from, to->ci->top - to->top >= n, "not enough elements to move"); | |
| 119 | from->top -= n; | |
| 120 | for (i = 0; i < n; i++) { | |
| 121 | setobj2s(to, to->top++, from->top + i); | |
| 122 | } | |
| 123 | lua_unlock(to); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | |
| 127 | 127 | LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { |
| 128 | lua_CFunction old; | |
| 129 | lua_lock(L); | |
| 130 | old = G(L)->panic; | |
| 131 | G(L)->panic = panicf; | |
| 132 | lua_unlock(L); | |
| 133 | return old; | |
| 128 | lua_CFunction old; | |
| 129 | lua_lock(L); | |
| 130 | old = G(L)->panic; | |
| 131 | G(L)->panic = panicf; | |
| 132 | lua_unlock(L); | |
| 133 | return old; | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | |
| 137 | 137 | LUA_API const lua_Number *lua_version (lua_State *L) { |
| 138 | static const lua_Number version = LUA_VERSION_NUM; | |
| 139 | if (L == NULL) return &version; | |
| 140 | else return G(L)->version; | |
| 138 | static const lua_Number version = LUA_VERSION_NUM; | |
| 139 | if (L == NULL) return &version; | |
| 140 | else return G(L)->version; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| r31373 | r31374 | |
| 151 | 151 | ** convert an acceptable stack index into an absolute index |
| 152 | 152 | */ |
| 153 | 153 | LUA_API int lua_absindex (lua_State *L, int idx) { |
| 154 | return (idx > 0 || ispseudo(idx)) | |
| 155 | ? idx | |
| 156 | : cast_int(L->top - L->ci->func + idx); | |
| 154 | return (idx > 0 || ispseudo(idx)) | |
| 155 | ? idx | |
| 156 | : cast_int(L->top - L->ci->func + idx); | |
| 157 | 157 | } |
| 158 | 158 | |
| 159 | 159 | |
| 160 | 160 | LUA_API int lua_gettop (lua_State *L) { |
| 161 | ||
| 161 | return cast_int(L->top - (L->ci->func + 1)); | |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | |
| 165 | 165 | LUA_API void lua_settop (lua_State *L, int idx) { |
| 166 | StkId func = L->ci->func; | |
| 167 | lua_lock(L); | |
| 168 | if (idx >= 0) { | |
| 169 | api_check(L, idx <= L->stack_last - (func + 1), "new top too large"); | |
| 170 | while (L->top < (func + 1) + idx) | |
| 171 | setnilvalue(L->top++); | |
| 172 | L->top = (func + 1) + idx; | |
| 173 | } | |
| 174 | else { | |
| 175 | api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); | |
| 176 | L->top += idx+1; /* `subtract' index (index is negative) */ | |
| 177 | } | |
| 178 | lua_unlock(L); | |
| 166 | StkId func = L->ci->func; | |
| 167 | lua_lock(L); | |
| 168 | if (idx >= 0) { | |
| 169 | api_check(L, idx <= L->stack_last - (func + 1), "new top too large"); | |
| 170 | while (L->top < (func + 1) + idx) | |
| 171 | setnilvalue(L->top++); | |
| 172 | L->top = (func + 1) + idx; | |
| 173 | } | |
| 174 | else { | |
| 175 | api_check(L, -(idx+1) <= (L->top - (func + 1)), "invalid new top"); | |
| 176 | L->top += idx+1; /* `subtract' index (index is negative) */ | |
| 177 | } | |
| 178 | lua_unlock(L); | |
| 179 | 179 | } |
| 180 | 180 | |
| 181 | 181 | |
| 182 | 182 | LUA_API void lua_remove (lua_State *L, int idx) { |
| 183 | StkId p; | |
| 184 | lua_lock(L); | |
| 185 | p = index2addr(L, idx); | |
| 186 | api_checkstackindex(L, idx, p); | |
| 187 | while (++p < L->top) setobjs2s(L, p-1, p); | |
| 188 | L->top--; | |
| 189 | lua_unlock(L); | |
| 183 | StkId p; | |
| 184 | lua_lock(L); | |
| 185 | p = index2addr(L, idx); | |
| 186 | api_checkstackindex(L, idx, p); | |
| 187 | while (++p < L->top) setobjs2s(L, p-1, p); | |
| 188 | L->top--; | |
| 189 | lua_unlock(L); | |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | 192 | |
| 193 | 193 | LUA_API void lua_insert (lua_State *L, int idx) { |
| 194 | StkId p; | |
| 195 | StkId q; | |
| 196 | lua_lock(L); | |
| 197 | p = index2addr(L, idx); | |
| 198 | api_checkstackindex(L, idx, p); | |
| 199 | for (q = L->top; q > p; q--) /* use L->top as a temporary */ | |
| 200 | setobjs2s(L, q, q - 1); | |
| 201 | setobjs2s(L, p, L->top); | |
| 202 | lua_unlock(L); | |
| 194 | StkId p; | |
| 195 | StkId q; | |
| 196 | lua_lock(L); | |
| 197 | p = index2addr(L, idx); | |
| 198 | api_checkstackindex(L, idx, p); | |
| 199 | for (q = L->top; q > p; q--) /* use L->top as a temporary */ | |
| 200 | setobjs2s(L, q, q - 1); | |
| 201 | setobjs2s(L, p, L->top); | |
| 202 | lua_unlock(L); | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | |
| 206 | 206 | static void moveto (lua_State *L, TValue *fr, int idx) { |
| 207 | TValue *to = index2addr(L, idx); | |
| 208 | api_checkvalidindex(L, to); | |
| 209 | setobj(L, to, fr); | |
| 210 | if (idx < LUA_REGISTRYINDEX) /* function upvalue? */ | |
| 211 | luaC_barrier(L, clCvalue(L->ci->func), fr); | |
| 212 | /* LUA_REGISTRYINDEX does not need gc barrier | |
| 213 | (collector revisits it before finishing collection) */ | |
| 207 | TValue *to = index2addr(L, idx); | |
| 208 | api_checkvalidindex(L, to); | |
| 209 | setobj(L, to, fr); | |
| 210 | if (idx < LUA_REGISTRYINDEX) /* function upvalue? */ | |
| 211 | luaC_barrier(L, clCvalue(L->ci->func), fr); | |
| 212 | /* LUA_REGISTRYINDEX does not need gc barrier | |
| 213 | (collector revisits it before finishing collection) */ | |
| 214 | 214 | } |
| 215 | 215 | |
| 216 | 216 | |
| 217 | 217 | LUA_API void lua_replace (lua_State *L, int idx) { |
| 218 | lua_lock(L); | |
| 219 | api_checknelems(L, 1); | |
| 220 | moveto(L, L->top - 1, idx); | |
| 221 | L->top--; | |
| 222 | lua_unlock(L); | |
| 218 | lua_lock(L); | |
| 219 | api_checknelems(L, 1); | |
| 220 | moveto(L, L->top - 1, idx); | |
| 221 | L->top--; | |
| 222 | lua_unlock(L); | |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | 225 | |
| 226 | 226 | LUA_API void lua_copy (lua_State *L, int fromidx, int toidx) { |
| 227 | TValue *fr; | |
| 228 | lua_lock(L); | |
| 229 | fr = index2addr(L, fromidx); | |
| 230 | moveto(L, fr, toidx); | |
| 231 | lua_unlock(L); | |
| 227 | TValue *fr; | |
| 228 | lua_lock(L); | |
| 229 | fr = index2addr(L, fromidx); | |
| 230 | moveto(L, fr, toidx); | |
| 231 | lua_unlock(L); | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | |
| 235 | 235 | LUA_API void lua_pushvalue (lua_State *L, int idx) { |
| 236 | lua_lock(L); | |
| 237 | setobj2s(L, L->top, index2addr(L, idx)); | |
| 238 | api_incr_top(L); | |
| 239 | lua_unlock(L); | |
| 236 | lua_lock(L); | |
| 237 | setobj2s(L, L->top, index2addr(L, idx)); | |
| 238 | api_incr_top(L); | |
| 239 | lua_unlock(L); | |
| 240 | 240 | } |
| 241 | 241 | |
| 242 | 242 | |
| r31373 | r31374 | |
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | LUA_API int lua_type (lua_State *L, int idx) { |
| 250 | StkId o = index2addr(L, idx); | |
| 251 | return (isvalid(o) ? ttypenv(o) : LUA_TNONE); | |
| 250 | StkId o = index2addr(L, idx); | |
| 251 | return (isvalid(o) ? ttypenv(o) : LUA_TNONE); | |
| 252 | 252 | } |
| 253 | 253 | |
| 254 | 254 | |
| 255 | 255 | LUA_API const char *lua_typename (lua_State *L, int t) { |
| 256 | UNUSED(L); | |
| 257 | return ttypename(t); | |
| 256 | UNUSED(L); | |
| 257 | return ttypename(t); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| 261 | 261 | LUA_API int lua_iscfunction (lua_State *L, int idx) { |
| 262 | StkId o = index2addr(L, idx); | |
| 263 | return (ttislcf(o) || (ttisCclosure(o))); | |
| 262 | StkId o = index2addr(L, idx); | |
| 263 | return (ttislcf(o) || (ttisCclosure(o))); | |
| 264 | 264 | } |
| 265 | 265 | |
| 266 | 266 | |
| 267 | 267 | LUA_API int lua_isnumber (lua_State *L, int idx) { |
| 268 | TValue n; | |
| 269 | const TValue *o = index2addr(L, idx); | |
| 270 | return tonumber(o, &n); | |
| 268 | TValue n; | |
| 269 | const TValue *o = index2addr(L, idx); | |
| 270 | return tonumber(o, &n); | |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | 273 | |
| 274 | 274 | LUA_API int lua_isstring (lua_State *L, int idx) { |
| 275 | int t = lua_type(L, idx); | |
| 276 | return (t == LUA_TSTRING || t == LUA_TNUMBER); | |
| 275 | int t = lua_type(L, idx); | |
| 276 | return (t == LUA_TSTRING || t == LUA_TNUMBER); | |
| 277 | 277 | } |
| 278 | 278 | |
| 279 | 279 | |
| 280 | 280 | LUA_API int lua_isuserdata (lua_State *L, int idx) { |
| 281 | const TValue *o = index2addr(L, idx); | |
| 282 | return (ttisuserdata(o) || ttislightuserdata(o)); | |
| 281 | const TValue *o = index2addr(L, idx); | |
| 282 | return (ttisuserdata(o) || ttislightuserdata(o)); | |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | |
| 286 | 286 | LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { |
| 287 | StkId o1 = index2addr(L, index1); | |
| 288 | StkId o2 = index2addr(L, index2); | |
| 289 | return (isvalid(o1) && isvalid(o2)) ? luaV_rawequalobj(o1, o2) : 0; | |
| 287 | StkId o1 = index2addr(L, index1); | |
| 288 | StkId o2 = index2addr(L, index2); | |
| 289 | return (isvalid(o1) && isvalid(o2)) ? luaV_rawequalobj(o1, o2) : 0; | |
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | |
| 293 | 293 | LUA_API void lua_arith (lua_State *L, int op) { |
| 294 | StkId o1; /* 1st operand */ | |
| 295 | StkId o2; /* 2nd operand */ | |
| 296 | lua_lock(L); | |
| 297 | if (op != LUA_OPUNM) /* all other operations expect two operands */ | |
| 298 | api_checknelems(L, 2); | |
| 299 | else { /* for unary minus, add fake 2nd operand */ | |
| 300 | api_checknelems(L, 1); | |
| 301 | setobjs2s(L, L->top, L->top - 1); | |
| 302 | L->top++; | |
| 303 | } | |
| 304 | o1 = L->top - 2; | |
| 305 | o2 = L->top - 1; | |
| 306 | if (ttisnumber(o1) && ttisnumber(o2)) { | |
| 307 | setnvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2))); | |
| 308 | } | |
| 309 | else | |
| 310 | luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD)); | |
| 311 | L->top--; | |
| 312 | lua_unlock(L); | |
| 294 | StkId o1; /* 1st operand */ | |
| 295 | StkId o2; /* 2nd operand */ | |
| 296 | lua_lock(L); | |
| 297 | if (op != LUA_OPUNM) /* all other operations expect two operands */ | |
| 298 | api_checknelems(L, 2); | |
| 299 | else { /* for unary minus, add fake 2nd operand */ | |
| 300 | api_checknelems(L, 1); | |
| 301 | setobjs2s(L, L->top, L->top - 1); | |
| 302 | L->top++; | |
| 303 | } | |
| 304 | o1 = L->top - 2; | |
| 305 | o2 = L->top - 1; | |
| 306 | if (ttisnumber(o1) && ttisnumber(o2)) { | |
| 307 | setnvalue(o1, luaO_arith(op, nvalue(o1), nvalue(o2))); | |
| 308 | } | |
| 309 | else | |
| 310 | luaV_arith(L, o1, o1, o2, cast(TMS, op - LUA_OPADD + TM_ADD)); | |
| 311 | L->top--; | |
| 312 | lua_unlock(L); | |
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | |
| 316 | 316 | LUA_API int lua_compare (lua_State *L, int index1, int index2, int op) { |
| 317 | StkId o1, o2; | |
| 318 | int i = 0; | |
| 319 | lua_lock(L); /* may call tag method */ | |
| 320 | o1 = index2addr(L, index1); | |
| 321 | o2 = index2addr(L, index2); | |
| 322 | if (isvalid(o1) && isvalid(o2)) { | |
| 323 | switch (op) { | |
| 324 | case LUA_OPEQ: i = equalobj(L, o1, o2); break; | |
| 325 | case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break; | |
| 326 | case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break; | |
| 327 | default: api_check(L, 0, "invalid option"); | |
| 328 | } | |
| 329 | } | |
| 330 | lua_unlock(L); | |
| 331 | return i; | |
| 317 | StkId o1, o2; | |
| 318 | int i = 0; | |
| 319 | lua_lock(L); /* may call tag method */ | |
| 320 | o1 = index2addr(L, index1); | |
| 321 | o2 = index2addr(L, index2); | |
| 322 | if (isvalid(o1) && isvalid(o2)) { | |
| 323 | switch (op) { | |
| 324 | case LUA_OPEQ: i = equalobj(L, o1, o2); break; | |
| 325 | case LUA_OPLT: i = luaV_lessthan(L, o1, o2); break; | |
| 326 | case LUA_OPLE: i = luaV_lessequal(L, o1, o2); break; | |
| 327 | default: api_check(L, 0, "invalid option"); | |
| 328 | } | |
| 329 | } | |
| 330 | lua_unlock(L); | |
| 331 | return i; | |
| 332 | 332 | } |
| 333 | 333 | |
| 334 | 334 | |
| 335 | 335 | LUA_API lua_Number lua_tonumberx (lua_State *L, int idx, int *isnum) { |
| 336 | TValue n; | |
| 337 | const TValue *o = index2addr(L, idx); | |
| 338 | if (tonumber(o, &n)) { | |
| 339 | if (isnum) *isnum = 1; | |
| 340 | return nvalue(o); | |
| 341 | } | |
| 342 | else { | |
| 343 | if (isnum) *isnum = 0; | |
| 344 | return 0; | |
| 345 | } | |
| 336 | TValue n; | |
| 337 | const TValue *o = index2addr(L, idx); | |
| 338 | if (tonumber(o, &n)) { | |
| 339 | if (isnum) *isnum = 1; | |
| 340 | return nvalue(o); | |
| 341 | } | |
| 342 | else { | |
| 343 | if (isnum) *isnum = 0; | |
| 344 | return 0; | |
| 345 | } | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
| 349 | 349 | LUA_API lua_Integer lua_tointegerx (lua_State *L, int idx, int *isnum) { |
| 350 | TValue n; | |
| 351 | const TValue *o = index2addr(L, idx); | |
| 352 | if (tonumber(o, &n)) { | |
| 353 | lua_Integer res; | |
| 354 | lua_Number num = nvalue(o); | |
| 355 | lua_number2integer(res, num); | |
| 356 | if (isnum) *isnum = 1; | |
| 357 | return res; | |
| 358 | } | |
| 359 | else { | |
| 360 | if (isnum) *isnum = 0; | |
| 361 | return 0; | |
| 362 | } | |
| 350 | TValue n; | |
| 351 | const TValue *o = index2addr(L, idx); | |
| 352 | if (tonumber(o, &n)) { | |
| 353 | lua_Integer res; | |
| 354 | lua_Number num = nvalue(o); | |
| 355 | lua_number2integer(res, num); | |
| 356 | if (isnum) *isnum = 1; | |
| 357 | return res; | |
| 358 | } | |
| 359 | else { | |
| 360 | if (isnum) *isnum = 0; | |
| 361 | return 0; | |
| 362 | } | |
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | |
| 366 | 366 | LUA_API lua_Unsigned lua_tounsignedx (lua_State *L, int idx, int *isnum) { |
| 367 | TValue n; | |
| 368 | const TValue *o = index2addr(L, idx); | |
| 369 | if (tonumber(o, &n)) { | |
| 370 | lua_Unsigned res; | |
| 371 | lua_Number num = nvalue(o); | |
| 372 | lua_number2unsigned(res, num); | |
| 373 | if (isnum) *isnum = 1; | |
| 374 | return res; | |
| 375 | } | |
| 376 | else { | |
| 377 | if (isnum) *isnum = 0; | |
| 378 | return 0; | |
| 379 | } | |
| 367 | TValue n; | |
| 368 | const TValue *o = index2addr(L, idx); | |
| 369 | if (tonumber(o, &n)) { | |
| 370 | lua_Unsigned res; | |
| 371 | lua_Number num = nvalue(o); | |
| 372 | lua_number2unsigned(res, num); | |
| 373 | if (isnum) *isnum = 1; | |
| 374 | return res; | |
| 375 | } | |
| 376 | else { | |
| 377 | if (isnum) *isnum = 0; | |
| 378 | return 0; | |
| 379 | } | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | |
| 383 | 383 | LUA_API int lua_toboolean (lua_State *L, int idx) { |
| 384 | const TValue *o = index2addr(L, idx); | |
| 385 | return !l_isfalse(o); | |
| 384 | const TValue *o = index2addr(L, idx); | |
| 385 | return !l_isfalse(o); | |
| 386 | 386 | } |
| 387 | 387 | |
| 388 | 388 | |
| 389 | 389 | LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { |
| 390 | StkId o = index2addr(L, idx); | |
| 391 | if (!ttisstring(o)) { | |
| 392 | lua_lock(L); /* `luaV_tostring' may create a new string */ | |
| 393 | if (!luaV_tostring(L, o)) { /* conversion failed? */ | |
| 394 | if (len != NULL) *len = 0; | |
| 395 | lua_unlock(L); | |
| 396 | return NULL; | |
| 397 | } | |
| 398 | luaC_checkGC(L); | |
| 399 | o = index2addr(L, idx); /* previous call may reallocate the stack */ | |
| 400 | lua_unlock(L); | |
| 401 | } | |
| 402 | if (len != NULL) *len = tsvalue(o)->len; | |
| 403 | return svalue(o); | |
| 390 | StkId o = index2addr(L, idx); | |
| 391 | if (!ttisstring(o)) { | |
| 392 | lua_lock(L); /* `luaV_tostring' may create a new string */ | |
| 393 | if (!luaV_tostring(L, o)) { /* conversion failed? */ | |
| 394 | if (len != NULL) *len = 0; | |
| 395 | lua_unlock(L); | |
| 396 | return NULL; | |
| 397 | } | |
| 398 | luaC_checkGC(L); | |
| 399 | o = index2addr(L, idx); /* previous call may reallocate the stack */ | |
| 400 | lua_unlock(L); | |
| 401 | } | |
| 402 | if (len != NULL) *len = tsvalue(o)->len; | |
| 403 | return svalue(o); | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | |
| 407 | 407 | LUA_API size_t lua_rawlen (lua_State *L, int idx) { |
| 408 | StkId o = index2addr(L, idx); | |
| 409 | switch (ttypenv(o)) { | |
| 410 | case LUA_TSTRING: return tsvalue(o)->len; | |
| 411 | case LUA_TUSERDATA: return uvalue(o)->len; | |
| 412 | case LUA_TTABLE: return luaH_getn(hvalue(o)); | |
| 413 | default: return 0; | |
| 414 | } | |
| 408 | StkId o = index2addr(L, idx); | |
| 409 | switch (ttypenv(o)) { | |
| 410 | case LUA_TSTRING: return tsvalue(o)->len; | |
| 411 | case LUA_TUSERDATA: return uvalue(o)->len; | |
| 412 | case LUA_TTABLE: return luaH_getn(hvalue(o)); | |
| 413 | default: return 0; | |
| 414 | } | |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | |
| 418 | 418 | LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { |
| 419 | StkId o = index2addr(L, idx); | |
| 420 | if (ttislcf(o)) return fvalue(o); | |
| 421 | else if (ttisCclosure(o)) | |
| 422 | return clCvalue(o)->f; | |
| 423 | else return NULL; /* not a C function */ | |
| 419 | StkId o = index2addr(L, idx); | |
| 420 | if (ttislcf(o)) return fvalue(o); | |
| 421 | else if (ttisCclosure(o)) | |
| 422 | return clCvalue(o)->f; | |
| 423 | else return NULL; /* not a C function */ | |
| 424 | 424 | } |
| 425 | 425 | |
| 426 | 426 | |
| 427 | 427 | LUA_API void *lua_touserdata (lua_State *L, int idx) { |
| 428 | StkId o = index2addr(L, idx); | |
| 429 | switch (ttypenv(o)) { | |
| 430 | case LUA_TUSERDATA: return (rawuvalue(o) + 1); | |
| 431 | case LUA_TLIGHTUSERDATA: return pvalue(o); | |
| 432 | default: return NULL; | |
| 433 | } | |
| 428 | StkId o = index2addr(L, idx); | |
| 429 | switch (ttypenv(o)) { | |
| 430 | case LUA_TUSERDATA: return (rawuvalue(o) + 1); | |
| 431 | case LUA_TLIGHTUSERDATA: return pvalue(o); | |
| 432 | default: return NULL; | |
| 433 | } | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | |
| 437 | 437 | LUA_API lua_State *lua_tothread (lua_State *L, int idx) { |
| 438 | StkId o = index2addr(L, idx); | |
| 439 | return (!ttisthread(o)) ? NULL : thvalue(o); | |
| 438 | StkId o = index2addr(L, idx); | |
| 439 | return (!ttisthread(o)) ? NULL : thvalue(o); | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | |
| 443 | 443 | LUA_API const void *lua_topointer (lua_State *L, int idx) { |
| 444 | StkId o = index2addr(L, idx); | |
| 445 | switch (ttype(o)) { | |
| 446 | case LUA_TTABLE: return hvalue(o); | |
| 447 | case LUA_TLCL: return clLvalue(o); | |
| 448 | case LUA_TCCL: return clCvalue(o); | |
| 449 | case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o))); | |
| 450 | case LUA_TTHREAD: return thvalue(o); | |
| 451 | case LUA_TUSERDATA: | |
| 452 | case LUA_TLIGHTUSERDATA: | |
| 453 | return lua_touserdata(L, idx); | |
| 454 | default: return NULL; | |
| 455 | } | |
| 444 | StkId o = index2addr(L, idx); | |
| 445 | switch (ttype(o)) { | |
| 446 | case LUA_TTABLE: return hvalue(o); | |
| 447 | case LUA_TLCL: return clLvalue(o); | |
| 448 | case LUA_TCCL: return clCvalue(o); | |
| 449 | case LUA_TLCF: return cast(void *, cast(size_t, fvalue(o))); | |
| 450 | case LUA_TTHREAD: return thvalue(o); | |
| 451 | case LUA_TUSERDATA: | |
| 452 | case LUA_TLIGHTUSERDATA: | |
| 453 | return lua_touserdata(L, idx); | |
| 454 | default: return NULL; | |
| 455 | } | |
| 456 | 456 | } |
| 457 | 457 | |
| 458 | 458 | |
| r31373 | r31374 | |
| 463 | 463 | |
| 464 | 464 | |
| 465 | 465 | LUA_API void lua_pushnil (lua_State *L) { |
| 466 | lua_lock(L); | |
| 467 | setnilvalue(L->top); | |
| 468 | api_incr_top(L); | |
| 469 | lua_unlock(L); | |
| 466 | lua_lock(L); | |
| 467 | setnilvalue(L->top); | |
| 468 | api_incr_top(L); | |
| 469 | lua_unlock(L); | |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | 472 | |
| 473 | 473 | LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { |
| 474 | lua_lock(L); | |
| 475 | setnvalue(L->top, n); | |
| 476 | luai_checknum(L, L->top, | |
| 477 | luaG_runerror(L, "C API - attempt to push a signaling NaN")); | |
| 478 | api_incr_top(L); | |
| 479 | lua_unlock(L); | |
| 474 | lua_lock(L); | |
| 475 | setnvalue(L->top, n); | |
| 476 | luai_checknum(L, L->top, | |
| 477 | luaG_runerror(L, "C API - attempt to push a signaling NaN")); | |
| 478 | api_incr_top(L); | |
| 479 | lua_unlock(L); | |
| 480 | 480 | } |
| 481 | 481 | |
| 482 | 482 | |
| 483 | 483 | LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { |
| 484 | lua_lock(L); | |
| 485 | setnvalue(L->top, cast_num(n)); | |
| 486 | api_incr_top(L); | |
| 487 | lua_unlock(L); | |
| 484 | lua_lock(L); | |
| 485 | setnvalue(L->top, cast_num(n)); | |
| 486 | api_incr_top(L); | |
| 487 | lua_unlock(L); | |
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | |
| 491 | 491 | LUA_API void lua_pushunsigned (lua_State *L, lua_Unsigned u) { |
| 492 | lua_Number n; | |
| 493 | lua_lock(L); | |
| 494 | n = lua_unsigned2number(u); | |
| 495 | setnvalue(L->top, n); | |
| 496 | api_incr_top(L); | |
| 497 | lua_unlock(L); | |
| 492 | lua_Number n; | |
| 493 | lua_lock(L); | |
| 494 | n = lua_unsigned2number(u); | |
| 495 | setnvalue(L->top, n); | |
| 496 | api_incr_top(L); | |
| 497 | lua_unlock(L); | |
| 498 | 498 | } |
| 499 | 499 | |
| 500 | 500 | |
| 501 | 501 | LUA_API const char *lua_pushlstring (lua_State *L, const char *s, size_t len) { |
| 502 | TString *ts; | |
| 503 | lua_lock(L); | |
| 504 | luaC_checkGC(L); | |
| 505 | ts = luaS_newlstr(L, s, len); | |
| 506 | setsvalue2s(L, L->top, ts); | |
| 507 | api_incr_top(L); | |
| 508 | lua_unlock(L); | |
| 509 | return getstr(ts); | |
| 502 | TString *ts; | |
| 503 | lua_lock(L); | |
| 504 | luaC_checkGC(L); | |
| 505 | ts = luaS_newlstr(L, s, len); | |
| 506 | setsvalue2s(L, L->top, ts); | |
| 507 | api_incr_top(L); | |
| 508 | lua_unlock(L); | |
| 509 | return getstr(ts); | |
| 510 | 510 | } |
| 511 | 511 | |
| 512 | 512 | |
| 513 | 513 | LUA_API const char *lua_pushstring (lua_State *L, const char *s) { |
| 514 | if (s == NULL) { | |
| 515 | lua_pushnil(L); | |
| 516 | return NULL; | |
| 517 | } | |
| 518 | else { | |
| 519 | TString *ts; | |
| 520 | lua_lock(L); | |
| 521 | luaC_checkGC(L); | |
| 522 | ts = luaS_new(L, s); | |
| 523 | setsvalue2s(L, L->top, ts); | |
| 524 | api_incr_top(L); | |
| 525 | lua_unlock(L); | |
| 526 | return getstr(ts); | |
| 527 | } | |
| 514 | if (s == NULL) { | |
| 515 | lua_pushnil(L); | |
| 516 | return NULL; | |
| 517 | } | |
| 518 | else { | |
| 519 | TString *ts; | |
| 520 | lua_lock(L); | |
| 521 | luaC_checkGC(L); | |
| 522 | ts = luaS_new(L, s); | |
| 523 | setsvalue2s(L, L->top, ts); | |
| 524 | api_incr_top(L); | |
| 525 | lua_unlock(L); | |
| 526 | return getstr(ts); | |
| 527 | } | |
| 528 | 528 | } |
| 529 | 529 | |
| 530 | 530 | |
| 531 | 531 | LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, |
| 532 | va_list argp) { | |
| 533 | const char *ret; | |
| 534 | lua_lock(L); | |
| 535 | luaC_checkGC(L); | |
| 536 | ret = luaO_pushvfstring(L, fmt, argp); | |
| 537 | lua_unlock(L); | |
| 538 | return ret; | |
| 532 | va_list argp) { | |
| 533 | const char *ret; | |
| 534 | lua_lock(L); | |
| 535 | luaC_checkGC(L); | |
| 536 | ret = luaO_pushvfstring(L, fmt, argp); | |
| 537 | lua_unlock(L); | |
| 538 | return ret; | |
| 539 | 539 | } |
| 540 | 540 | |
| 541 | 541 | |
| 542 | 542 | LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { |
| 543 | const char *ret; | |
| 544 | va_list argp; | |
| 545 | lua_lock(L); | |
| 546 | luaC_checkGC(L); | |
| 547 | va_start(argp, fmt); | |
| 548 | ret = luaO_pushvfstring(L, fmt, argp); | |
| 549 | va_end(argp); | |
| 550 | lua_unlock(L); | |
| 551 | return ret; | |
| 543 | const char *ret; | |
| 544 | va_list argp; | |
| 545 | lua_lock(L); | |
| 546 | luaC_checkGC(L); | |
| 547 | va_start(argp, fmt); | |
| 548 | ret = luaO_pushvfstring(L, fmt, argp); | |
| 549 | va_end(argp); | |
| 550 | lua_unlock(L); | |
| 551 | return ret; | |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | 554 | |
| 555 | 555 | LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { |
| 556 | lua_lock(L); | |
| 557 | if (n == 0) { | |
| 558 | setfvalue(L->top, fn); | |
| 559 | } | |
| 560 | else { | |
| 561 | Closure *cl; | |
| 562 | api_checknelems(L, n); | |
| 563 | api_check(L, n <= MAXUPVAL, "upvalue index too large"); | |
| 564 | luaC_checkGC(L); | |
| 565 | cl = luaF_newCclosure(L, n); | |
| 566 | cl->c.f = fn; | |
| 567 | L->top -= n; | |
| 568 | while (n--) | |
| 569 | setobj2n(L, &cl->c.upvalue[n], L->top + n); | |
| 570 | setclCvalue(L, L->top, cl); | |
| 571 | } | |
| 572 | api_incr_top(L); | |
| 573 | lua_unlock(L); | |
| 556 | lua_lock(L); | |
| 557 | if (n == 0) { | |
| 558 | setfvalue(L->top, fn); | |
| 559 | } | |
| 560 | else { | |
| 561 | Closure *cl; | |
| 562 | api_checknelems(L, n); | |
| 563 | api_check(L, n <= MAXUPVAL, "upvalue index too large"); | |
| 564 | luaC_checkGC(L); | |
| 565 | cl = luaF_newCclosure(L, n); | |
| 566 | cl->c.f = fn; | |
| 567 | L->top -= n; | |
| 568 | while (n--) | |
| 569 | setobj2n(L, &cl->c.upvalue[n], L->top + n); | |
| 570 | setclCvalue(L, L->top, cl); | |
| 571 | } | |
| 572 | api_incr_top(L); | |
| 573 | lua_unlock(L); | |
| 574 | 574 | } |
| 575 | 575 | |
| 576 | 576 | |
| 577 | 577 | LUA_API void lua_pushboolean (lua_State *L, int b) { |
| 578 | lua_lock(L); | |
| 579 | setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ | |
| 580 | api_incr_top(L); | |
| 581 | lua_unlock(L); | |
| 578 | lua_lock(L); | |
| 579 | setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ | |
| 580 | api_incr_top(L); | |
| 581 | lua_unlock(L); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | |
| 585 | 585 | LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { |
| 586 | lua_lock(L); | |
| 587 | setpvalue(L->top, p); | |
| 588 | api_incr_top(L); | |
| 589 | lua_unlock(L); | |
| 586 | lua_lock(L); | |
| 587 | setpvalue(L->top, p); | |
| 588 | api_incr_top(L); | |
| 589 | lua_unlock(L); | |
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | |
| 593 | 593 | LUA_API int lua_pushthread (lua_State *L) { |
| 594 | lua_lock(L); | |
| 595 | setthvalue(L, L->top, L); | |
| 596 | api_incr_top(L); | |
| 597 | lua_unlock(L); | |
| 598 | return (G(L)->mainthread == L); | |
| 594 | lua_lock(L); | |
| 595 | setthvalue(L, L->top, L); | |
| 596 | api_incr_top(L); | |
| 597 | lua_unlock(L); | |
| 598 | return (G(L)->mainthread == L); | |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | |
| r31373 | r31374 | |
| 606 | 606 | |
| 607 | 607 | |
| 608 | 608 | LUA_API void lua_getglobal (lua_State *L, const char *var) { |
| 609 | Table *reg = hvalue(&G(L)->l_registry); | |
| 610 | const TValue *gt; /* global table */ | |
| 611 | lua_lock(L); | |
| 612 | gt = luaH_getint(reg, LUA_RIDX_GLOBALS); | |
| 613 | setsvalue2s(L, L->top++, luaS_new(L, var)); | |
| 614 | luaV_gettable(L, gt, L->top - 1, L->top - 1); | |
| 615 | lua_unlock(L); | |
| 609 | Table *reg = hvalue(&G(L)->l_registry); | |
| 610 | const TValue *gt; /* global table */ | |
| 611 | lua_lock(L); | |
| 612 | gt = luaH_getint(reg, LUA_RIDX_GLOBALS); | |
| 613 | setsvalue2s(L, L->top++, luaS_new(L, var)); | |
| 614 | luaV_gettable(L, gt, L->top - 1, L->top - 1); | |
| 615 | lua_unlock(L); | |
| 616 | 616 | } |
| 617 | 617 | |
| 618 | 618 | |
| 619 | 619 | LUA_API void lua_gettable (lua_State *L, int idx) { |
| 620 | StkId t; | |
| 621 | lua_lock(L); | |
| 622 | t = index2addr(L, idx); | |
| 623 | luaV_gettable(L, t, L->top - 1, L->top - 1); | |
| 624 | lua_unlock(L); | |
| 620 | StkId t; | |
| 621 | lua_lock(L); | |
| 622 | t = index2addr(L, idx); | |
| 623 | luaV_gettable(L, t, L->top - 1, L->top - 1); | |
| 624 | lua_unlock(L); | |
| 625 | 625 | } |
| 626 | 626 | |
| 627 | 627 | |
| 628 | 628 | LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { |
| 629 | StkId t; | |
| 630 | lua_lock(L); | |
| 631 | t = index2addr(L, idx); | |
| 632 | setsvalue2s(L, L->top, luaS_new(L, k)); | |
| 633 | api_incr_top(L); | |
| 634 | luaV_gettable(L, t, L->top - 1, L->top - 1); | |
| 635 | lua_unlock(L); | |
| 629 | StkId t; | |
| 630 | lua_lock(L); | |
| 631 | t = index2addr(L, idx); | |
| 632 | setsvalue2s(L, L->top, luaS_new(L, k)); | |
| 633 | api_incr_top(L); | |
| 634 | luaV_gettable(L, t, L->top - 1, L->top - 1); | |
| 635 | lua_unlock(L); | |
| 636 | 636 | } |
| 637 | 637 | |
| 638 | 638 | |
| 639 | 639 | LUA_API void lua_rawget (lua_State *L, int idx) { |
| 640 | StkId t; | |
| 641 | lua_lock(L); | |
| 642 | t = index2addr(L, idx); | |
| 643 | api_check(L, ttistable(t), "table expected"); | |
| 644 | setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); | |
| 645 | lua_unlock(L); | |
| 640 | StkId t; | |
| 641 | lua_lock(L); | |
| 642 | t = index2addr(L, idx); | |
| 643 | api_check(L, ttistable(t), "table expected"); | |
| 644 | setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); | |
| 645 | lua_unlock(L); | |
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | |
| 649 | 649 | LUA_API void lua_rawgeti (lua_State *L, int idx, int n) { |
| 650 | StkId t; | |
| 651 | lua_lock(L); | |
| 652 | t = index2addr(L, idx); | |
| 653 | api_check(L, ttistable(t), "table expected"); | |
| 654 | setobj2s(L, L->top, luaH_getint(hvalue(t), n)); | |
| 655 | api_incr_top(L); | |
| 656 | lua_unlock(L); | |
| 650 | StkId t; | |
| 651 | lua_lock(L); | |
| 652 | t = index2addr(L, idx); | |
| 653 | api_check(L, ttistable(t), "table expected"); | |
| 654 | setobj2s(L, L->top, luaH_getint(hvalue(t), n)); | |
| 655 | api_incr_top(L); | |
| 656 | lua_unlock(L); | |
| 657 | 657 | } |
| 658 | 658 | |
| 659 | 659 | |
| 660 | 660 | LUA_API void lua_rawgetp (lua_State *L, int idx, const void *p) { |
| 661 | StkId t; | |
| 662 | TValue k; | |
| 663 | lua_lock(L); | |
| 664 | t = index2addr(L, idx); | |
| 665 | api_check(L, ttistable(t), "table expected"); | |
| 666 | setpvalue(&k, cast(void *, p)); | |
| 667 | setobj2s(L, L->top, luaH_get(hvalue(t), &k)); | |
| 668 | api_incr_top(L); | |
| 669 | lua_unlock(L); | |
| 661 | StkId t; | |
| 662 | TValue k; | |
| 663 | lua_lock(L); | |
| 664 | t = index2addr(L, idx); | |
| 665 | api_check(L, ttistable(t), "table expected"); | |
| 666 | setpvalue(&k, cast(void *, p)); | |
| 667 | setobj2s(L, L->top, luaH_get(hvalue(t), &k)); | |
| 668 | api_incr_top(L); | |
| 669 | lua_unlock(L); | |
| 670 | 670 | } |
| 671 | 671 | |
| 672 | 672 | |
| 673 | 673 | LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { |
| 674 | Table *t; | |
| 675 | lua_lock(L); | |
| 676 | luaC_checkGC(L); | |
| 677 | t = luaH_new(L); | |
| 678 | sethvalue(L, L->top, t); | |
| 679 | api_incr_top(L); | |
| 680 | if (narray > 0 || nrec > 0) | |
| 681 | luaH_resize(L, t, narray, nrec); | |
| 682 | lua_unlock(L); | |
| 674 | Table *t; | |
| 675 | lua_lock(L); | |
| 676 | luaC_checkGC(L); | |
| 677 | t = luaH_new(L); | |
| 678 | sethvalue(L, L->top, t); | |
| 679 | api_incr_top(L); | |
| 680 | if (narray > 0 || nrec > 0) | |
| 681 | luaH_resize(L, t, narray, nrec); | |
| 682 | lua_unlock(L); | |
| 683 | 683 | } |
| 684 | 684 | |
| 685 | 685 | |
| 686 | 686 | LUA_API int lua_getmetatable (lua_State *L, int objindex) { |
| 687 | const TValue *obj; | |
| 688 | Table *mt = NULL; | |
| 689 | int res; | |
| 690 | lua_lock(L); | |
| 691 | obj = index2addr(L, objindex); | |
| 692 | switch (ttypenv(obj)) { | |
| 693 | case LUA_TTABLE: | |
| 694 | mt = hvalue(obj)->metatable; | |
| 695 | break; | |
| 696 | case LUA_TUSERDATA: | |
| 697 | mt = uvalue(obj)->metatable; | |
| 698 | break; | |
| 699 | default: | |
| 700 | mt = G(L)->mt[ttypenv(obj)]; | |
| 701 | break; | |
| 702 | } | |
| 703 | if (mt == NULL) | |
| 704 | res = 0; | |
| 705 | else { | |
| 706 | sethvalue(L, L->top, mt); | |
| 707 | api_incr_top(L); | |
| 708 | res = 1; | |
| 709 | } | |
| 710 | lua_unlock(L); | |
| 711 | return res; | |
| 687 | const TValue *obj; | |
| 688 | Table *mt = NULL; | |
| 689 | int res; | |
| 690 | lua_lock(L); | |
| 691 | obj = index2addr(L, objindex); | |
| 692 | switch (ttypenv(obj)) { | |
| 693 | case LUA_TTABLE: | |
| 694 | mt = hvalue(obj)->metatable; | |
| 695 | break; | |
| 696 | case LUA_TUSERDATA: | |
| 697 | mt = uvalue(obj)->metatable; | |
| 698 | break; | |
| 699 | default: | |
| 700 | mt = G(L)->mt[ttypenv(obj)]; | |
| 701 | break; | |
| 702 | } | |
| 703 | if (mt == NULL) | |
| 704 | res = 0; | |
| 705 | else { | |
| 706 | sethvalue(L, L->top, mt); | |
| 707 | api_incr_top(L); | |
| 708 | res = 1; | |
| 709 | } | |
| 710 | lua_unlock(L); | |
| 711 | return res; | |
| 712 | 712 | } |
| 713 | 713 | |
| 714 | 714 | |
| 715 | 715 | LUA_API void lua_getuservalue (lua_State *L, int idx) { |
| 716 | StkId o; | |
| 717 | lua_lock(L); | |
| 718 | o = index2addr(L, idx); | |
| 719 | api_check(L, ttisuserdata(o), "userdata expected"); | |
| 720 | if (uvalue(o)->env) { | |
| 721 | sethvalue(L, L->top, uvalue(o)->env); | |
| 722 | } else | |
| 723 | setnilvalue(L->top); | |
| 724 | api_incr_top(L); | |
| 725 | lua_unlock(L); | |
| 716 | StkId o; | |
| 717 | lua_lock(L); | |
| 718 | o = index2addr(L, idx); | |
| 719 | api_check(L, ttisuserdata(o), "userdata expected"); | |
| 720 | if (uvalue(o)->env) { | |
| 721 | sethvalue(L, L->top, uvalue(o)->env); | |
| 722 | } else | |
| 723 | setnilvalue(L->top); | |
| 724 | api_incr_top(L); | |
| 725 | lua_unlock(L); | |
| 726 | 726 | } |
| 727 | 727 | |
| 728 | 728 | |
| r31373 | r31374 | |
| 732 | 732 | |
| 733 | 733 | |
| 734 | 734 | LUA_API void lua_setglobal (lua_State *L, const char *var) { |
| 735 | Table *reg = hvalue(&G(L)->l_registry); | |
| 736 | const TValue *gt; /* global table */ | |
| 737 | lua_lock(L); | |
| 738 | api_checknelems(L, 1); | |
| 739 | gt = luaH_getint(reg, LUA_RIDX_GLOBALS); | |
| 740 | setsvalue2s(L, L->top++, luaS_new(L, var)); | |
| 741 | luaV_settable(L, gt, L->top - 1, L->top - 2); | |
| 742 | L->top -= 2; /* pop value and key */ | |
| 743 | lua_unlock(L); | |
| 735 | Table *reg = hvalue(&G(L)->l_registry); | |
| 736 | const TValue *gt; /* global table */ | |
| 737 | lua_lock(L); | |
| 738 | api_checknelems(L, 1); | |
| 739 | gt = luaH_getint(reg, LUA_RIDX_GLOBALS); | |
| 740 | setsvalue2s(L, L->top++, luaS_new(L, var)); | |
| 741 | luaV_settable(L, gt, L->top - 1, L->top - 2); | |
| 742 | L->top -= 2; /* pop value and key */ | |
| 743 | lua_unlock(L); | |
| 744 | 744 | } |
| 745 | 745 | |
| 746 | 746 | |
| 747 | 747 | LUA_API void lua_settable (lua_State *L, int idx) { |
| 748 | StkId t; | |
| 749 | lua_lock(L); | |
| 750 | api_checknelems(L, 2); | |
| 751 | t = index2addr(L, idx); | |
| 752 | luaV_settable(L, t, L->top - 2, L->top - 1); | |
| 753 | L->top -= 2; /* pop index and value */ | |
| 754 | lua_unlock(L); | |
| 748 | StkId t; | |
| 749 | lua_lock(L); | |
| 750 | api_checknelems(L, 2); | |
| 751 | t = index2addr(L, idx); | |
| 752 | luaV_settable(L, t, L->top - 2, L->top - 1); | |
| 753 | L->top -= 2; /* pop index and value */ | |
| 754 | lua_unlock(L); | |
| 755 | 755 | } |
| 756 | 756 | |
| 757 | 757 | |
| 758 | 758 | LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { |
| 759 | StkId t; | |
| 760 | lua_lock(L); | |
| 761 | api_checknelems(L, 1); | |
| 762 | t = index2addr(L, idx); | |
| 763 | setsvalue2s(L, L->top++, luaS_new(L, k)); | |
| 764 | luaV_settable(L, t, L->top - 1, L->top - 2); | |
| 765 | L->top -= 2; /* pop value and key */ | |
| 766 | lua_unlock(L); | |
| 759 | StkId t; | |
| 760 | lua_lock(L); | |
| 761 | api_checknelems(L, 1); | |
| 762 | t = index2addr(L, idx); | |
| 763 | setsvalue2s(L, L->top++, luaS_new(L, k)); | |
| 764 | luaV_settable(L, t, L->top - 1, L->top - 2); | |
| 765 | L->top -= 2; /* pop value and key */ | |
| 766 | lua_unlock(L); | |
| 767 | 767 | } |
| 768 | 768 | |
| 769 | 769 | |
| 770 | 770 | LUA_API void lua_rawset (lua_State *L, int idx) { |
| 771 | StkId t; | |
| 772 | lua_lock(L); | |
| 773 | api_checknelems(L, 2); | |
| 774 | t = index2addr(L, idx); | |
| 775 | api_check(L, ttistable(t), "table expected"); | |
| 776 | setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); | |
| 777 | invalidateTMcache(hvalue(t)); | |
| 778 | luaC_barrierback(L, gcvalue(t), L->top-1); | |
| 779 | L->top -= 2; | |
| 780 | lua_unlock(L); | |
| 771 | StkId t; | |
| 772 | lua_lock(L); | |
| 773 | api_checknelems(L, 2); | |
| 774 | t = index2addr(L, idx); | |
| 775 | api_check(L, ttistable(t), "table expected"); | |
| 776 | setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); | |
| 777 | invalidateTMcache(hvalue(t)); | |
| 778 | luaC_barrierback(L, gcvalue(t), L->top-1); | |
| 779 | L->top -= 2; | |
| 780 | lua_unlock(L); | |
| 781 | 781 | } |
| 782 | 782 | |
| 783 | 783 | |
| 784 | 784 | LUA_API void lua_rawseti (lua_State *L, int idx, int n) { |
| 785 | StkId t; | |
| 786 | lua_lock(L); | |
| 787 | api_checknelems(L, 1); | |
| 788 | t = index2addr(L, idx); | |
| 789 | api_check(L, ttistable(t), "table expected"); | |
| 790 | luaH_setint(L, hvalue(t), n, L->top - 1); | |
| 791 | luaC_barrierback(L, gcvalue(t), L->top-1); | |
| 792 | L->top--; | |
| 793 | lua_unlock(L); | |
| 785 | StkId t; | |
| 786 | lua_lock(L); | |
| 787 | api_checknelems(L, 1); | |
| 788 | t = index2addr(L, idx); | |
| 789 | api_check(L, ttistable(t), "table expected"); | |
| 790 | luaH_setint(L, hvalue(t), n, L->top - 1); | |
| 791 | luaC_barrierback(L, gcvalue(t), L->top-1); | |
| 792 | L->top--; | |
| 793 | lua_unlock(L); | |
| 794 | 794 | } |
| 795 | 795 | |
| 796 | 796 | |
| 797 | 797 | LUA_API void lua_rawsetp (lua_State *L, int idx, const void *p) { |
| 798 | StkId t; | |
| 799 | TValue k; | |
| 800 | lua_lock(L); | |
| 801 | api_checknelems(L, 1); | |
| 802 | t = index2addr(L, idx); | |
| 803 | api_check(L, ttistable(t), "table expected"); | |
| 804 | setpvalue(&k, cast(void *, p)); | |
| 805 | setobj2t(L, luaH_set(L, hvalue(t), &k), L->top - 1); | |
| 806 | luaC_barrierback(L, gcvalue(t), L->top - 1); | |
| 807 | L->top--; | |
| 808 | lua_unlock(L); | |
| 798 | StkId t; | |
| 799 | TValue k; | |
| 800 | lua_lock(L); | |
| 801 | api_checknelems(L, 1); | |
| 802 | t = index2addr(L, idx); | |
| 803 | api_check(L, ttistable(t), "table expected"); | |
| 804 | setpvalue(&k, cast(void *, p)); | |
| 805 | setobj2t(L, luaH_set(L, hvalue(t), &k), L->top - 1); | |
| 806 | luaC_barrierback(L, gcvalue(t), L->top - 1); | |
| 807 | L->top--; | |
| 808 | lua_unlock(L); | |
| 809 | 809 | } |
| 810 | 810 | |
| 811 | 811 | |
| 812 | 812 | LUA_API int lua_setmetatable (lua_State *L, int objindex) { |
| 813 | TValue *obj; | |
| 814 | Table *mt; | |
| 815 | lua_lock(L); | |
| 816 | api_checknelems(L, 1); | |
| 817 | obj = index2addr(L, objindex); | |
| 818 | if (ttisnil(L->top - 1)) | |
| 819 | mt = NULL; | |
| 820 | else { | |
| 821 | api_check(L, ttistable(L->top - 1), "table expected"); | |
| 822 | mt = hvalue(L->top - 1); | |
| 823 | } | |
| 824 | switch (ttypenv(obj)) { | |
| 825 | case LUA_TTABLE: { | |
| 826 | hvalue(obj)->metatable = mt; | |
| 827 | if (mt) { | |
| 828 | luaC_objbarrierback(L, gcvalue(obj), mt); | |
| 829 | luaC_checkfinalizer(L, gcvalue(obj), mt); | |
| 830 | } | |
| 831 | break; | |
| 832 | } | |
| 833 | case LUA_TUSERDATA: { | |
| 834 | uvalue(obj)->metatable = mt; | |
| 835 | if (mt) { | |
| 836 | luaC_objbarrier(L, rawuvalue(obj), mt); | |
| 837 | luaC_checkfinalizer(L, gcvalue(obj), mt); | |
| 838 | } | |
| 839 | break; | |
| 840 | } | |
| 841 | default: { | |
| 842 | G(L)->mt[ttypenv(obj)] = mt; | |
| 843 | break; | |
| 844 | } | |
| 845 | } | |
| 846 | L->top--; | |
| 847 | lua_unlock(L); | |
| 848 | return 1; | |
| 813 | TValue *obj; | |
| 814 | Table *mt; | |
| 815 | lua_lock(L); | |
| 816 | api_checknelems(L, 1); | |
| 817 | obj = index2addr(L, objindex); | |
| 818 | if (ttisnil(L->top - 1)) | |
| 819 | mt = NULL; | |
| 820 | else { | |
| 821 | api_check(L, ttistable(L->top - 1), "table expected"); | |
| 822 | mt = hvalue(L->top - 1); | |
| 823 | } | |
| 824 | switch (ttypenv(obj)) { | |
| 825 | case LUA_TTABLE: { | |
| 826 | hvalue(obj)->metatable = mt; | |
| 827 | if (mt) { | |
| 828 | luaC_objbarrierback(L, gcvalue(obj), mt); | |
| 829 | luaC_checkfinalizer(L, gcvalue(obj), mt); | |
| 830 | } | |
| 831 | break; | |
| 832 | } | |
| 833 | case LUA_TUSERDATA: { | |
| 834 | uvalue(obj)->metatable = mt; | |
| 835 | if (mt) { | |
| 836 | luaC_objbarrier(L, rawuvalue(obj), mt); | |
| 837 | luaC_checkfinalizer(L, gcvalue(obj), mt); | |
| 838 | } | |
| 839 | break; | |
| 840 | } | |
| 841 | default: { | |
| 842 | G(L)->mt[ttypenv(obj)] = mt; | |
| 843 | break; | |
| 844 | } | |
| 845 | } | |
| 846 | L->top--; | |
| 847 | lua_unlock(L); | |
| 848 | return 1; | |
| 849 | 849 | } |
| 850 | 850 | |
| 851 | 851 | |
| 852 | 852 | LUA_API void lua_setuservalue (lua_State *L, int idx) { |
| 853 | StkId o; | |
| 854 | lua_lock(L); | |
| 855 | api_checknelems(L, 1); | |
| 856 | o = index2addr(L, idx); | |
| 857 | api_check(L, ttisuserdata(o), "userdata expected"); | |
| 858 | if (ttisnil(L->top - 1)) | |
| 859 | uvalue(o)->env = NULL; | |
| 860 | else { | |
| 861 | api_check(L, ttistable(L->top - 1), "table expected"); | |
| 862 | uvalue(o)->env = hvalue(L->top - 1); | |
| 863 | luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); | |
| 864 | } | |
| 865 | L->top--; | |
| 866 | lua_unlock(L); | |
| 853 | StkId o; | |
| 854 | lua_lock(L); | |
| 855 | api_checknelems(L, 1); | |
| 856 | o = index2addr(L, idx); | |
| 857 | api_check(L, ttisuserdata(o), "userdata expected"); | |
| 858 | if (ttisnil(L->top - 1)) | |
| 859 | uvalue(o)->env = NULL; | |
| 860 | else { | |
| 861 | api_check(L, ttistable(L->top - 1), "table expected"); | |
| 862 | uvalue(o)->env = hvalue(L->top - 1); | |
| 863 | luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); | |
| 864 | } | |
| 865 | L->top--; | |
| 866 | lua_unlock(L); | |
| 867 | 867 | } |
| 868 | 868 | |
| 869 | 869 | |
| r31373 | r31374 | |
| 873 | 873 | |
| 874 | 874 | |
| 875 | 875 | #define checkresults(L,na,nr) \ |
| 876 | ||
| 876 | api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na)), \ | |
| 877 | 877 | "results from function overflow current stack size") |
| 878 | 878 | |
| 879 | 879 | |
| 880 | 880 | LUA_API int lua_getctx (lua_State *L, int *ctx) { |
| 881 | if (L->ci->callstatus & CIST_YIELDED) { | |
| 882 | if (ctx) *ctx = L->ci->u.c.ctx; | |
| 883 | return L->ci->u.c.status; | |
| 884 | } | |
| 885 | else return LUA_OK; | |
| 881 | if (L->ci->callstatus & CIST_YIELDED) { | |
| 882 | if (ctx) *ctx = L->ci->u.c.ctx; | |
| 883 | return L->ci->u.c.status; | |
| 884 | } | |
| 885 | else return LUA_OK; | |
| 886 | 886 | } |
| 887 | 887 | |
| 888 | 888 | |
| 889 | 889 | LUA_API void lua_callk (lua_State *L, int nargs, int nresults, int ctx, |
| 890 | lua_CFunction k) { | |
| 891 | StkId func; | |
| 892 | lua_lock(L); | |
| 893 | api_check(L, k == NULL || !isLua(L->ci), | |
| 894 | "cannot use continuations inside hooks"); | |
| 895 | api_checknelems(L, nargs+1); | |
| 896 | api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); | |
| 897 | checkresults(L, nargs, nresults); | |
| 898 | func = L->top - (nargs+1); | |
| 899 | if (k != NULL && L->nny == 0) { /* need to prepare continuation? */ | |
| 900 | L->ci->u.c.k = k; /* save continuation */ | |
| 901 | L->ci->u.c.ctx = ctx; /* save context */ | |
| 902 | luaD_call(L, func, nresults, 1); /* do the call */ | |
| 903 | } | |
| 904 | else /* no continuation or no yieldable */ | |
| 905 | luaD_call(L, func, nresults, 0); /* just do the call */ | |
| 906 | adjustresults(L, nresults); | |
| 907 | lua_unlock(L); | |
| 890 | lua_CFunction k) { | |
| 891 | StkId func; | |
| 892 | lua_lock(L); | |
| 893 | api_check(L, k == NULL || !isLua(L->ci), | |
| 894 | "cannot use continuations inside hooks"); | |
| 895 | api_checknelems(L, nargs+1); | |
| 896 | api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); | |
| 897 | checkresults(L, nargs, nresults); | |
| 898 | func = L->top - (nargs+1); | |
| 899 | if (k != NULL && L->nny == 0) { /* need to prepare continuation? */ | |
| 900 | L->ci->u.c.k = k; /* save continuation */ | |
| 901 | L->ci->u.c.ctx = ctx; /* save context */ | |
| 902 | luaD_call(L, func, nresults, 1); /* do the call */ | |
| 903 | } | |
| 904 | else /* no continuation or no yieldable */ | |
| 905 | luaD_call(L, func, nresults, 0); /* just do the call */ | |
| 906 | adjustresults(L, nresults); | |
| 907 | lua_unlock(L); | |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | |
| r31373 | r31374 | |
| 913 | 913 | ** Execute a protected call. |
| 914 | 914 | */ |
| 915 | 915 | struct CallS { /* data to `f_call' */ |
| 916 | StkId func; | |
| 917 | int nresults; | |
| 916 | StkId func; | |
| 917 | int nresults; | |
| 918 | 918 | }; |
| 919 | 919 | |
| 920 | 920 | |
| 921 | 921 | static void f_call (lua_State *L, void *ud) { |
| 922 | struct CallS *c = cast(struct CallS *, ud); | |
| 923 | luaD_call(L, c->func, c->nresults, 0); | |
| 922 | struct CallS *c = cast(struct CallS *, ud); | |
| 923 | luaD_call(L, c->func, c->nresults, 0); | |
| 924 | 924 | } |
| 925 | 925 | |
| 926 | 926 | |
| 927 | 927 | |
| 928 | 928 | LUA_API int lua_pcallk (lua_State *L, int nargs, int nresults, int errfunc, |
| 929 | int ctx, lua_CFunction k) { | |
| 930 | struct CallS c; | |
| 931 | int status; | |
| 932 | ptrdiff_t func; | |
| 933 | lua_lock(L); | |
| 934 | api_check(L, k == NULL || !isLua(L->ci), | |
| 935 | "cannot use continuations inside hooks"); | |
| 936 | api_checknelems(L, nargs+1); | |
| 937 | api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); | |
| 938 | checkresults(L, nargs, nresults); | |
| 939 | if (errfunc == 0) | |
| 940 | func = 0; | |
| 941 | else { | |
| 942 | StkId o = index2addr(L, errfunc); | |
| 943 | api_checkstackindex(L, errfunc, o); | |
| 944 | func = savestack(L, o); | |
| 945 | } | |
| 946 | c.func = L->top - (nargs+1); /* function to be called */ | |
| 947 | if (k == NULL || L->nny > 0) { /* no continuation or no yieldable? */ | |
| 948 | c.nresults = nresults; /* do a 'conventional' protected call */ | |
| 949 | status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); | |
| 950 | } | |
| 951 | else { /* prepare continuation (call is already protected by 'resume') */ | |
| 952 | CallInfo *ci = L->ci; | |
| 953 | ci->u.c.k = k; /* save continuation */ | |
| 954 | ci->u.c.ctx = ctx; /* save context */ | |
| 955 | /* save information for error recovery */ | |
| 956 | ci->extra = savestack(L, c.func); | |
| 957 | ci->u.c.old_allowhook = L->allowhook; | |
| 958 | ci->u.c.old_errfunc = L->errfunc; | |
| 959 | L->errfunc = func; | |
| 960 | /* mark that function may do error recovery */ | |
| 961 | ci->callstatus |= CIST_YPCALL; | |
| 962 | luaD_call(L, c.func, nresults, 1); /* do the call */ | |
| 963 | ci->callstatus &= ~CIST_YPCALL; | |
| 964 | L->errfunc = ci->u.c.old_errfunc; | |
| 965 | status = LUA_OK; /* if it is here, there were no errors */ | |
| 966 | } | |
| 967 | adjustresults(L, nresults); | |
| 968 | lua_unlock(L); | |
| 969 | return status; | |
| 929 | int ctx, lua_CFunction k) { | |
| 930 | struct CallS c; | |
| 931 | int status; | |
| 932 | ptrdiff_t func; | |
| 933 | lua_lock(L); | |
| 934 | api_check(L, k == NULL || !isLua(L->ci), | |
| 935 | "cannot use continuations inside hooks"); | |
| 936 | api_checknelems(L, nargs+1); | |
| 937 | api_check(L, L->status == LUA_OK, "cannot do calls on non-normal thread"); | |
| 938 | checkresults(L, nargs, nresults); | |
| 939 | if (errfunc == 0) | |
| 940 | func = 0; | |
| 941 | else { | |
| 942 | StkId o = index2addr(L, errfunc); | |
| 943 | api_checkstackindex(L, errfunc, o); | |
| 944 | func = savestack(L, o); | |
| 945 | } | |
| 946 | c.func = L->top - (nargs+1); /* function to be called */ | |
| 947 | if (k == NULL || L->nny > 0) { /* no continuation or no yieldable? */ | |
| 948 | c.nresults = nresults; /* do a 'conventional' protected call */ | |
| 949 | status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); | |
| 950 | } | |
| 951 | else { /* prepare continuation (call is already protected by 'resume') */ | |
| 952 | CallInfo *ci = L->ci; | |
| 953 | ci->u.c.k = k; /* save continuation */ | |
| 954 | ci->u.c.ctx = ctx; /* save context */ | |
| 955 | /* save information for error recovery */ | |
| 956 | ci->extra = savestack(L, c.func); | |
| 957 | ci->u.c.old_allowhook = L->allowhook; | |
| 958 | ci->u.c.old_errfunc = L->errfunc; | |
| 959 | L->errfunc = func; | |
| 960 | /* mark that function may do error recovery */ | |
| 961 | ci->callstatus |= CIST_YPCALL; | |
| 962 | luaD_call(L, c.func, nresults, 1); /* do the call */ | |
| 963 | ci->callstatus &= ~CIST_YPCALL; | |
| 964 | L->errfunc = ci->u.c.old_errfunc; | |
| 965 | status = LUA_OK; /* if it is here, there were no errors */ | |
| 966 | } | |
| 967 | adjustresults(L, nresults); | |
| 968 | lua_unlock(L); | |
| 969 | return status; | |
| 970 | 970 | } |
| 971 | 971 | |
| 972 | 972 | |
| 973 | 973 | LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, |
| 974 | const char *chunkname, const char *mode) { | |
| 975 | ZIO z; | |
| 976 | int status; | |
| 977 | lua_lock(L); | |
| 978 | if (!chunkname) chunkname = "?"; | |
| 979 | luaZ_init(L, &z, reader, data); | |
| 980 | status = luaD_protectedparser(L, &z, chunkname, mode); | |
| 981 | if (status == LUA_OK) { /* no errors? */ | |
| 982 | LClosure *f = clLvalue(L->top - 1); /* get newly created function */ | |
| 983 | if (f->nupvalues == 1) { /* does it have one upvalue? */ | |
| 984 | /* get global table from registry */ | |
| 985 | Table *reg = hvalue(&G(L)->l_registry); | |
| 986 | const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS); | |
| 987 | /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */ | |
| 988 | setobj(L, f->upvals[0]->v, gt); | |
| 989 | luaC_barrier(L, f->upvals[0], gt); | |
| 990 | } | |
| 991 | } | |
| 992 | lua_unlock(L); | |
| 993 | return status; | |
| 974 | const char *chunkname, const char *mode) { | |
| 975 | ZIO z; | |
| 976 | int status; | |
| 977 | lua_lock(L); | |
| 978 | if (!chunkname) chunkname = "?"; | |
| 979 | luaZ_init(L, &z, reader, data); | |
| 980 | status = luaD_protectedparser(L, &z, chunkname, mode); | |
| 981 | if (status == LUA_OK) { /* no errors? */ | |
| 982 | LClosure *f = clLvalue(L->top - 1); /* get newly created function */ | |
| 983 | if (f->nupvalues == 1) { /* does it have one upvalue? */ | |
| 984 | /* get global table from registry */ | |
| 985 | Table *reg = hvalue(&G(L)->l_registry); | |
| 986 | const TValue *gt = luaH_getint(reg, LUA_RIDX_GLOBALS); | |
| 987 | /* set global table as 1st upvalue of 'f' (may be LUA_ENV) */ | |
| 988 | setobj(L, f->upvals[0]->v, gt); | |
| 989 | luaC_barrier(L, f->upvals[0], gt); | |
| 990 | } | |
| 991 | } | |
| 992 | lua_unlock(L); | |
| 993 | return status; | |
| 994 | 994 | } |
| 995 | 995 | |
| 996 | 996 | |
| 997 | 997 | LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { |
| 998 | int status; | |
| 999 | TValue *o; | |
| 1000 | lua_lock(L); | |
| 1001 | api_checknelems(L, 1); | |
| 1002 | o = L->top - 1; | |
| 1003 | if (isLfunction(o)) | |
| 1004 | status = luaU_dump(L, getproto(o), writer, data, 0); | |
| 1005 | else | |
| 1006 | status = 1; | |
| 1007 | lua_unlock(L); | |
| 1008 | return status; | |
| 998 | int status; | |
| 999 | TValue *o; | |
| 1000 | lua_lock(L); | |
| 1001 | api_checknelems(L, 1); | |
| 1002 | o = L->top - 1; | |
| 1003 | if (isLfunction(o)) | |
| 1004 | status = luaU_dump(L, getproto(o), writer, data, 0); | |
| 1005 | else | |
| 1006 | status = 1; | |
| 1007 | lua_unlock(L); | |
| 1008 | return status; | |
| 1009 | 1009 | } |
| 1010 | 1010 | |
| 1011 | 1011 | |
| 1012 | 1012 | LUA_API int lua_status (lua_State *L) { |
| 1013 | ||
| 1013 | return L->status; | |
| 1014 | 1014 | } |
| 1015 | 1015 | |
| 1016 | 1016 | |
| r31373 | r31374 | |
| 1019 | 1019 | */ |
| 1020 | 1020 | |
| 1021 | 1021 | LUA_API int lua_gc (lua_State *L, int what, int data) { |
| 1022 | int res = 0; | |
| 1023 | global_State *g; | |
| 1024 | lua_lock(L); | |
| 1025 | g = G(L); | |
| 1026 | switch (what) { | |
| 1027 | case LUA_GCSTOP: { | |
| 1028 | g->gcrunning = 0; | |
| 1029 | break; | |
| 1030 | } | |
| 1031 | case LUA_GCRESTART: { | |
| 1032 | luaE_setdebt(g, 0); | |
| 1033 | g->gcrunning = 1; | |
| 1034 | break; | |
| 1035 | } | |
| 1036 | case LUA_GCCOLLECT: { | |
| 1037 | luaC_fullgc(L, 0); | |
| 1038 | break; | |
| 1039 | } | |
| 1040 | case LUA_GCCOUNT: { | |
| 1041 | /* GC values are expressed in Kbytes: #bytes/2^10 */ | |
| 1042 | res = cast_int(gettotalbytes(g) >> 10); | |
| 1043 | break; | |
| 1044 | } | |
| 1045 | case LUA_GCCOUNTB: { | |
| 1046 | res = cast_int(gettotalbytes(g) & 0x3ff); | |
| 1047 | break; | |
| 1048 | } | |
| 1049 | case LUA_GCSTEP: { | |
| 1050 | if (g->gckind == KGC_GEN) { /* generational mode? */ | |
| 1051 | res = (g->GCestimate == 0); /* true if it will do major collection */ | |
| 1052 | luaC_forcestep(L); /* do a single step */ | |
| 1053 | } | |
| 1054 | else { | |
| 1055 | lu_mem debt = cast(lu_mem, data) * 1024 - GCSTEPSIZE; | |
| 1056 | if (g->gcrunning) | |
| 1057 | debt += g->GCdebt; /* include current debt */ | |
| 1058 | luaE_setdebt(g, debt); | |
| 1059 | luaC_forcestep(L); | |
| 1060 | if (g->gcstate == GCSpause) /* end of cycle? */ | |
| 1061 | res = 1; /* signal it */ | |
| 1062 | } | |
| 1063 | break; | |
| 1064 | } | |
| 1065 | case LUA_GCSETPAUSE: { | |
| 1066 | res = g->gcpause; | |
| 1067 | g->gcpause = data; | |
| 1068 | break; | |
| 1069 | } | |
| 1070 | case LUA_GCSETMAJORINC: { | |
| 1071 | res = g->gcmajorinc; | |
| 1072 | g->gcmajorinc = data; | |
| 1073 | break; | |
| 1074 | } | |
| 1075 | case LUA_GCSETSTEPMUL: { | |
| 1076 | res = g->gcstepmul; | |
| 1077 | g->gcstepmul = data; | |
| 1078 | break; | |
| 1079 | } | |
| 1080 | case LUA_GCISRUNNING: { | |
| 1081 | res = g->gcrunning; | |
| 1082 | break; | |
| 1083 | } | |
| 1084 | case LUA_GCGEN: { /* change collector to generational mode */ | |
| 1085 | luaC_changemode(L, KGC_GEN); | |
| 1086 | break; | |
| 1087 | } | |
| 1088 | case LUA_GCINC: { /* change collector to incremental mode */ | |
| 1089 | luaC_changemode(L, KGC_NORMAL); | |
| 1090 | break; | |
| 1091 | } | |
| 1092 | default: res = -1; /* invalid option */ | |
| 1093 | } | |
| 1094 | lua_unlock(L); | |
| 1095 | return res; | |
| 1022 | int res = 0; | |
| 1023 | global_State *g; | |
| 1024 | lua_lock(L); | |
| 1025 | g = G(L); | |
| 1026 | switch (what) { | |
| 1027 | case LUA_GCSTOP: { | |
| 1028 | g->gcrunning = 0; | |
| 1029 | break; | |
| 1030 | } | |
| 1031 | case LUA_GCRESTART: { | |
| 1032 | luaE_setdebt(g, 0); | |
| 1033 | g->gcrunning = 1; | |
| 1034 | break; | |
| 1035 | } | |
| 1036 | case LUA_GCCOLLECT: { | |
| 1037 | luaC_fullgc(L, 0); | |
| 1038 | break; | |
| 1039 | } | |
| 1040 | case LUA_GCCOUNT: { | |
| 1041 | /* GC values are expressed in Kbytes: #bytes/2^10 */ | |
| 1042 | res = cast_int(gettotalbytes(g) >> 10); | |
| 1043 | break; | |
| 1044 | } | |
| 1045 | case LUA_GCCOUNTB: { | |
| 1046 | res = cast_int(gettotalbytes(g) & 0x3ff); | |
| 1047 | break; | |
| 1048 | } | |
| 1049 | case LUA_GCSTEP: { | |
| 1050 | if (g->gckind == KGC_GEN) { /* generational mode? */ | |
| 1051 | res = (g->GCestimate == 0); /* true if it will do major collection */ | |
| 1052 | luaC_forcestep(L); /* do a single step */ | |
| 1053 | } | |
| 1054 | else { | |
| 1055 | lu_mem debt = cast(lu_mem, data) * 1024 - GCSTEPSIZE; | |
| 1056 | if (g->gcrunning) | |
| 1057 | debt += g->GCdebt; /* include current debt */ | |
| 1058 | luaE_setdebt(g, debt); | |
| 1059 | luaC_forcestep(L); | |
| 1060 | if (g->gcstate == GCSpause) /* end of cycle? */ | |
| 1061 | res = 1; /* signal it */ | |
| 1062 | } | |
| 1063 | break; | |
| 1064 | } | |
| 1065 | case LUA_GCSETPAUSE: { | |
| 1066 | res = g->gcpause; | |
| 1067 | g->gcpause = data; | |
| 1068 | break; | |
| 1069 | } | |
| 1070 | case LUA_GCSETMAJORINC: { | |
| 1071 | res = g->gcmajorinc; | |
| 1072 | g->gcmajorinc = data; | |
| 1073 | break; | |
| 1074 | } | |
| 1075 | case LUA_GCSETSTEPMUL: { | |
| 1076 | res = g->gcstepmul; | |
| 1077 | g->gcstepmul = data; | |
| 1078 | break; | |
| 1079 | } | |
| 1080 | case LUA_GCISRUNNING: { | |
| 1081 | res = g->gcrunning; | |
| 1082 | break; | |
| 1083 | } | |
| 1084 | case LUA_GCGEN: { /* change collector to generational mode */ | |
| 1085 | luaC_changemode(L, KGC_GEN); | |
| 1086 | break; | |
| 1087 | } | |
| 1088 | case LUA_GCINC: { /* change collector to incremental mode */ | |
| 1089 | luaC_changemode(L, KGC_NORMAL); | |
| 1090 | break; | |
| 1091 | } | |
| 1092 | default: res = -1; /* invalid option */ | |
| 1093 | } | |
| 1094 | lua_unlock(L); | |
| 1095 | return res; | |
| 1096 | 1096 | } |
| 1097 | 1097 | |
| 1098 | 1098 | |
| r31373 | r31374 | |
| 1103 | 1103 | |
| 1104 | 1104 | |
| 1105 | 1105 | LUA_API int lua_error (lua_State *L) { |
| 1106 | lua_lock(L); | |
| 1107 | api_checknelems(L, 1); | |
| 1108 | luaG_errormsg(L); | |
| 1109 | /* code unreachable; will unlock when control actually leaves the kernel */ | |
| 1110 | return 0; /* to avoid warnings */ | |
| 1106 | lua_lock(L); | |
| 1107 | api_checknelems(L, 1); | |
| 1108 | luaG_errormsg(L); | |
| 1109 | /* code unreachable; will unlock when control actually leaves the kernel */ | |
| 1110 | return 0; /* to avoid warnings */ | |
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | 1113 | |
| 1114 | 1114 | LUA_API int lua_next (lua_State *L, int idx) { |
| 1115 | StkId t; | |
| 1116 | int more; | |
| 1117 | lua_lock(L); | |
| 1118 | t = index2addr(L, idx); | |
| 1119 | api_check(L, ttistable(t), "table expected"); | |
| 1120 | more = luaH_next(L, hvalue(t), L->top - 1); | |
| 1121 | if (more) { | |
| 1122 | api_incr_top(L); | |
| 1123 | } | |
| 1124 | else /* no more elements */ | |
| 1125 | L->top -= 1; /* remove key */ | |
| 1126 | lua_unlock(L); | |
| 1127 | return more; | |
| 1115 | StkId t; | |
| 1116 | int more; | |
| 1117 | lua_lock(L); | |
| 1118 | t = index2addr(L, idx); | |
| 1119 | api_check(L, ttistable(t), "table expected"); | |
| 1120 | more = luaH_next(L, hvalue(t), L->top - 1); | |
| 1121 | if (more) { | |
| 1122 | api_incr_top(L); | |
| 1123 | } | |
| 1124 | else /* no more elements */ | |
| 1125 | L->top -= 1; /* remove key */ | |
| 1126 | lua_unlock(L); | |
| 1127 | return more; | |
| 1128 | 1128 | } |
| 1129 | 1129 | |
| 1130 | 1130 | |
| 1131 | 1131 | LUA_API void lua_concat (lua_State *L, int n) { |
| 1132 | lua_lock(L); | |
| 1133 | api_checknelems(L, n); | |
| 1134 | if (n >= 2) { | |
| 1135 | luaC_checkGC(L); | |
| 1136 | luaV_concat(L, n); | |
| 1137 | } | |
| 1138 | else if (n == 0) { /* push empty string */ | |
| 1139 | setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); | |
| 1140 | api_incr_top(L); | |
| 1141 | } | |
| 1142 | /* else n == 1; nothing to do */ | |
| 1143 | lua_unlock(L); | |
| 1132 | lua_lock(L); | |
| 1133 | api_checknelems(L, n); | |
| 1134 | if (n >= 2) { | |
| 1135 | luaC_checkGC(L); | |
| 1136 | luaV_concat(L, n); | |
| 1137 | } | |
| 1138 | else if (n == 0) { /* push empty string */ | |
| 1139 | setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); | |
| 1140 | api_incr_top(L); | |
| 1141 | } | |
| 1142 | /* else n == 1; nothing to do */ | |
| 1143 | lua_unlock(L); | |
| 1144 | 1144 | } |
| 1145 | 1145 | |
| 1146 | 1146 | |
| 1147 | 1147 | LUA_API void lua_len (lua_State *L, int idx) { |
| 1148 | StkId t; | |
| 1149 | lua_lock(L); | |
| 1150 | t = index2addr(L, idx); | |
| 1151 | luaV_objlen(L, L->top, t); | |
| 1152 | api_incr_top(L); | |
| 1153 | lua_unlock(L); | |
| 1148 | StkId t; | |
| 1149 | lua_lock(L); | |
| 1150 | t = index2addr(L, idx); | |
| 1151 | luaV_objlen(L, L->top, t); | |
| 1152 | api_incr_top(L); | |
| 1153 | lua_unlock(L); | |
| 1154 | 1154 | } |
| 1155 | 1155 | |
| 1156 | 1156 | |
| 1157 | 1157 | LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) { |
| 1158 | lua_Alloc f; | |
| 1159 | lua_lock(L); | |
| 1160 | if (ud) *ud = G(L)->ud; | |
| 1161 | f = G(L)->frealloc; | |
| 1162 | lua_unlock(L); | |
| 1163 | return f; | |
| 1158 | lua_Alloc f; | |
| 1159 | lua_lock(L); | |
| 1160 | if (ud) *ud = G(L)->ud; | |
| 1161 | f = G(L)->frealloc; | |
| 1162 | lua_unlock(L); | |
| 1163 | return f; | |
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | |
| 1167 | 1167 | LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) { |
| 1168 | lua_lock(L); | |
| 1169 | G(L)->ud = ud; | |
| 1170 | G(L)->frealloc = f; | |
| 1171 | lua_unlock(L); | |
| 1168 | lua_lock(L); | |
| 1169 | G(L)->ud = ud; | |
| 1170 | G(L)->frealloc = f; | |
| 1171 | lua_unlock(L); | |
| 1172 | 1172 | } |
| 1173 | 1173 | |
| 1174 | 1174 | |
| 1175 | 1175 | LUA_API void *lua_newuserdata (lua_State *L, size_t size) { |
| 1176 | Udata *u; | |
| 1177 | lua_lock(L); | |
| 1178 | luaC_checkGC(L); | |
| 1179 | u = luaS_newudata(L, size, NULL); | |
| 1180 | setuvalue(L, L->top, u); | |
| 1181 | api_incr_top(L); | |
| 1182 | lua_unlock(L); | |
| 1183 | return u + 1; | |
| 1176 | Udata *u; | |
| 1177 | lua_lock(L); | |
| 1178 | luaC_checkGC(L); | |
| 1179 | u = luaS_newudata(L, size, NULL); | |
| 1180 | setuvalue(L, L->top, u); | |
| 1181 | api_incr_top(L); | |
| 1182 | lua_unlock(L); | |
| 1183 | return u + 1; | |
| 1184 | 1184 | } |
| 1185 | 1185 | |
| 1186 | 1186 | |
| 1187 | 1187 | |
| 1188 | 1188 | static const char *aux_upvalue (StkId fi, int n, TValue **val, |
| 1189 | GCObject **owner) { | |
| 1190 | switch (ttype(fi)) { | |
| 1191 | case LUA_TCCL: { /* C closure */ | |
| 1192 | CClosure *f = clCvalue(fi); | |
| 1193 | if (!(1 <= n && n <= f->nupvalues)) return NULL; | |
| 1194 | *val = &f->upvalue[n-1]; | |
| 1195 | if (owner) *owner = obj2gco(f); | |
| 1196 | return ""; | |
| 1197 | } | |
| 1198 | case LUA_TLCL: { /* Lua closure */ | |
| 1199 | LClosure *f = clLvalue(fi); | |
| 1200 | TString *name; | |
| 1201 | Proto *p = f->p; | |
| 1202 | if (!(1 <= n && n <= p->sizeupvalues)) return NULL; | |
| 1203 | *val = f->upvals[n-1]->v; | |
| 1204 | if (owner) *owner = obj2gco(f->upvals[n - 1]); | |
| 1205 | name = p->upvalues[n-1].name; | |
| 1206 | return (name == NULL) ? "" : getstr(name); | |
| 1207 | } | |
| 1208 | default: return NULL; /* not a closure */ | |
| 1209 | } | |
| 1189 | GCObject **owner) { | |
| 1190 | switch (ttype(fi)) { | |
| 1191 | case LUA_TCCL: { /* C closure */ | |
| 1192 | CClosure *f = clCvalue(fi); | |
| 1193 | if (!(1 <= n && n <= f->nupvalues)) return NULL; | |
| 1194 | *val = &f->upvalue[n-1]; | |
| 1195 | if (owner) *owner = obj2gco(f); | |
| 1196 | return ""; | |
| 1197 | } | |
| 1198 | case LUA_TLCL: { /* Lua closure */ | |
| 1199 | LClosure *f = clLvalue(fi); | |
| 1200 | TString *name; | |
| 1201 | Proto *p = f->p; | |
| 1202 | if (!(1 <= n && n <= p->sizeupvalues)) return NULL; | |
| 1203 | *val = f->upvals[n-1]->v; | |
| 1204 | if (owner) *owner = obj2gco(f->upvals[n - 1]); | |
| 1205 | name = p->upvalues[n-1].name; | |
| 1206 | return (name == NULL) ? "" : getstr(name); | |
| 1207 | } | |
| 1208 | default: return NULL; /* not a closure */ | |
| 1209 | } | |
| 1210 | 1210 | } |
| 1211 | 1211 | |
| 1212 | 1212 | |
| 1213 | 1213 | LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { |
| 1214 | const char *name; | |
| 1215 | TValue *val = NULL; /* to avoid warnings */ | |
| 1216 | lua_lock(L); | |
| 1217 | name = aux_upvalue(index2addr(L, funcindex), n, &val, NULL); | |
| 1218 | if (name) { | |
| 1219 | setobj2s(L, L->top, val); | |
| 1220 | api_incr_top(L); | |
| 1221 | } | |
| 1222 | lua_unlock(L); | |
| 1223 | return name; | |
| 1214 | const char *name; | |
| 1215 | TValue *val = NULL; /* to avoid warnings */ | |
| 1216 | lua_lock(L); | |
| 1217 | name = aux_upvalue(index2addr(L, funcindex), n, &val, NULL); | |
| 1218 | if (name) { | |
| 1219 | setobj2s(L, L->top, val); | |
| 1220 | api_incr_top(L); | |
| 1221 | } | |
| 1222 | lua_unlock(L); | |
| 1223 | return name; | |
| 1224 | 1224 | } |
| 1225 | 1225 | |
| 1226 | 1226 | |
| 1227 | 1227 | LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { |
| 1228 | const char *name; | |
| 1229 | TValue *val = NULL; /* to avoid warnings */ | |
| 1230 | GCObject *owner = NULL; /* to avoid warnings */ | |
| 1231 | StkId fi; | |
| 1232 | lua_lock(L); | |
| 1233 | fi = index2addr(L, funcindex); | |
| 1234 | api_checknelems(L, 1); | |
| 1235 | name = aux_upvalue(fi, n, &val, &owner); | |
| 1236 | if (name) { | |
| 1237 | L->top--; | |
| 1238 | setobj(L, val, L->top); | |
| 1239 | luaC_barrier(L, owner, L->top); | |
| 1240 | } | |
| 1241 | lua_unlock(L); | |
| 1242 | return name; | |
| 1228 | const char *name; | |
| 1229 | TValue *val = NULL; /* to avoid warnings */ | |
| 1230 | GCObject *owner = NULL; /* to avoid warnings */ | |
| 1231 | StkId fi; | |
| 1232 | lua_lock(L); | |
| 1233 | fi = index2addr(L, funcindex); | |
| 1234 | api_checknelems(L, 1); | |
| 1235 | name = aux_upvalue(fi, n, &val, &owner); | |
| 1236 | if (name) { | |
| 1237 | L->top--; | |
| 1238 | setobj(L, val, L->top); | |
| 1239 | luaC_barrier(L, owner, L->top); | |
| 1240 | } | |
| 1241 | lua_unlock(L); | |
| 1242 | return name; | |
| 1243 | 1243 | } |
| 1244 | 1244 | |
| 1245 | 1245 | |
| 1246 | 1246 | static UpVal **getupvalref (lua_State *L, int fidx, int n, LClosure **pf) { |
| 1247 | LClosure *f; | |
| 1248 | StkId fi = index2addr(L, fidx); | |
| 1249 | api_check(L, ttisLclosure(fi), "Lua function expected"); | |
| 1250 | f = clLvalue(fi); | |
| 1251 | api_check(L, (1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index"); | |
| 1252 | if (pf) *pf = f; | |
| 1253 | return &f->upvals[n - 1]; /* get its upvalue pointer */ | |
| 1247 | LClosure *f; | |
| 1248 | StkId fi = index2addr(L, fidx); | |
| 1249 | api_check(L, ttisLclosure(fi), "Lua function expected"); | |
| 1250 | f = clLvalue(fi); | |
| 1251 | api_check(L, (1 <= n && n <= f->p->sizeupvalues), "invalid upvalue index"); | |
| 1252 | if (pf) *pf = f; | |
| 1253 | return &f->upvals[n - 1]; /* get its upvalue pointer */ | |
| 1254 | 1254 | } |
| 1255 | 1255 | |
| 1256 | 1256 | |
| 1257 | 1257 | LUA_API void *lua_upvalueid (lua_State *L, int fidx, int n) { |
| 1258 | StkId fi = index2addr(L, fidx); | |
| 1259 | switch (ttype(fi)) { | |
| 1260 | case LUA_TLCL: { /* lua closure */ | |
| 1261 | return *getupvalref(L, fidx, n, NULL); | |
| 1262 | } | |
| 1263 | case LUA_TCCL: { /* C closure */ | |
| 1264 | CClosure *f = clCvalue(fi); | |
| 1265 | api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index"); | |
| 1266 | return &f->upvalue[n - 1]; | |
| 1267 | } | |
| 1268 | default: { | |
| 1269 | api_check(L, 0, "closure expected"); | |
| 1270 | return NULL; | |
| 1271 | } | |
| 1272 | } | |
| 1258 | StkId fi = index2addr(L, fidx); | |
| 1259 | switch (ttype(fi)) { | |
| 1260 | case LUA_TLCL: { /* lua closure */ | |
| 1261 | return *getupvalref(L, fidx, n, NULL); | |
| 1262 | } | |
| 1263 | case LUA_TCCL: { /* C closure */ | |
| 1264 | CClosure *f = clCvalue(fi); | |
| 1265 | api_check(L, 1 <= n && n <= f->nupvalues, "invalid upvalue index"); | |
| 1266 | return &f->upvalue[n - 1]; | |
| 1267 | } | |
| 1268 | default: { | |
| 1269 | api_check(L, 0, "closure expected"); | |
| 1270 | return NULL; | |
| 1271 | } | |
| 1272 | } | |
| 1273 | 1273 | } |
| 1274 | 1274 | |
| 1275 | 1275 | |
| 1276 | 1276 | LUA_API void lua_upvaluejoin (lua_State *L, int fidx1, int n1, |
| 1277 | int fidx2, int n2) { | |
| 1278 | LClosure *f1; | |
| 1279 | UpVal **up1 = getupvalref(L, fidx1, n1, &f1); | |
| 1280 | UpVal **up2 = getupvalref(L, fidx2, n2, NULL); | |
| 1281 | *up1 = *up2; | |
| 1282 | luaC_objbarrier(L, f1, *up2); | |
| 1277 | int fidx2, int n2) { | |
| 1278 | LClosure *f1; | |
| 1279 | UpVal **up1 = getupvalref(L, fidx1, n1, &f1); | |
| 1280 | UpVal **up2 = getupvalref(L, fidx2, n2, NULL); | |
| 1281 | *up1 = *up2; | |
| 1282 | luaC_objbarrier(L, f1, *up2); | |
| 1283 | 1283 | } |
| 1284 |
| r31373 | r31374 | |
|---|---|---|
| 26 | 26 | #include "lvm.h" |
| 27 | 27 | |
| 28 | 28 | |
| 29 | #define hasjumps(e) | |
| 29 | #define hasjumps(e) ((e)->t != (e)->f) | |
| 30 | 30 | |
| 31 | 31 | |
| 32 | 32 | static int isnumeral(expdesc *e) { |
| 33 | ||
| 33 | return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | |
| 37 | 37 | void luaK_nil (FuncState *fs, int from, int n) { |
| 38 | Instruction *previous; | |
| 39 | int l = from + n - 1; /* last register to set nil */ | |
| 40 | if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ | |
| 41 | previous = &fs->f->code[fs->pc-1]; | |
| 42 | if (GET_OPCODE(*previous) == OP_LOADNIL) { | |
| 43 | int pfrom = GETARG_A(*previous); | |
| 44 | int pl = pfrom + GETARG_B(*previous); | |
| 45 | if ((pfrom <= from && from <= pl + 1) || | |
| 46 | (from <= pfrom && pfrom <= l + 1)) { /* can connect both? */ | |
| 47 | if (pfrom < from) from = pfrom; /* from = min(from, pfrom) */ | |
| 48 | if (pl > l) l = pl; /* l = max(l, pl) */ | |
| 49 | SETARG_A(*previous, from); | |
| 50 | SETARG_B(*previous, l - from); | |
| 51 | return; | |
| 52 | } | |
| 53 | } /* else go through */ | |
| 54 | } | |
| 55 | luaK_codeABC(fs, OP_LOADNIL, from, n - 1, 0); /* else no optimization */ | |
| 38 | Instruction *previous; | |
| 39 | int l = from + n - 1; /* last register to set nil */ | |
| 40 | if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ | |
| 41 | previous = &fs->f->code[fs->pc-1]; | |
| 42 | if (GET_OPCODE(*previous) == OP_LOADNIL) { | |
| 43 | int pfrom = GETARG_A(*previous); | |
| 44 | int pl = pfrom + GETARG_B(*previous); | |
| 45 | if ((pfrom <= from && from <= pl + 1) || | |
| 46 | (from <= pfrom && pfrom <= l + 1)) { /* can connect both? */ | |
| 47 | if (pfrom < from) from = pfrom; /* from = min(from, pfrom) */ | |
| 48 | if (pl > l) l = pl; /* l = max(l, pl) */ | |
| 49 | SETARG_A(*previous, from); | |
| 50 | SETARG_B(*previous, l - from); | |
| 51 | return; | |
| 52 | } | |
| 53 | } /* else go through */ | |
| 54 | } | |
| 55 | luaK_codeABC(fs, OP_LOADNIL, from, n - 1, 0); /* else no optimization */ | |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | 58 | |
| 59 | 59 | int luaK_jump (FuncState *fs) { |
| 60 | int jpc = fs->jpc; /* save list of jumps to here */ | |
| 61 | int j; | |
| 62 | fs->jpc = NO_JUMP; | |
| 63 | j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP); | |
| 64 | luaK_concat(fs, &j, jpc); /* keep them on hold */ | |
| 65 | return j; | |
| 60 | int jpc = fs->jpc; /* save list of jumps to here */ | |
| 61 | int j; | |
| 62 | fs->jpc = NO_JUMP; | |
| 63 | j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP); | |
| 64 | luaK_concat(fs, &j, jpc); /* keep them on hold */ | |
| 65 | return j; | |
| 66 | 66 | } |
| 67 | 67 | |
| 68 | 68 | |
| 69 | 69 | void luaK_ret (FuncState *fs, int first, int nret) { |
| 70 | ||
| 70 | luaK_codeABC(fs, OP_RETURN, first, nret+1, 0); | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| 74 | 74 | static int condjump (FuncState *fs, OpCode op, int A, int B, int C) { |
| 75 | luaK_codeABC(fs, op, A, B, C); | |
| 76 | return luaK_jump(fs); | |
| 75 | luaK_codeABC(fs, op, A, B, C); | |
| 76 | return luaK_jump(fs); | |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | |
| 80 | 80 | static void fixjump (FuncState *fs, int pc, int dest) { |
| 81 | Instruction *jmp = &fs->f->code[pc]; | |
| 82 | int offset = dest-(pc+1); | |
| 83 | lua_assert(dest != NO_JUMP); | |
| 84 | if (abs(offset) > MAXARG_sBx) | |
| 85 | luaX_syntaxerror(fs->ls, "control structure too long"); | |
| 86 | SETARG_sBx(*jmp, offset); | |
| 81 | Instruction *jmp = &fs->f->code[pc]; | |
| 82 | int offset = dest-(pc+1); | |
| 83 | lua_assert(dest != NO_JUMP); | |
| 84 | if (abs(offset) > MAXARG_sBx) | |
| 85 | luaX_syntaxerror(fs->ls, "control structure too long"); | |
| 86 | SETARG_sBx(*jmp, offset); | |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | |
| r31373 | r31374 | |
| 92 | 92 | ** optimizations with consecutive instructions not in the same basic block). |
| 93 | 93 | */ |
| 94 | 94 | int luaK_getlabel (FuncState *fs) { |
| 95 | fs->lasttarget = fs->pc; | |
| 96 | return fs->pc; | |
| 95 | fs->lasttarget = fs->pc; | |
| 96 | return fs->pc; | |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | static int getjump (FuncState *fs, int pc) { |
| 101 | int offset = GETARG_sBx(fs->f->code[pc]); | |
| 102 | if (offset == NO_JUMP) /* point to itself represents end of list */ | |
| 103 | return NO_JUMP; /* end of list */ | |
| 104 | else | |
| 105 | return (pc+1)+offset; /* turn offset into absolute position */ | |
| 101 | int offset = GETARG_sBx(fs->f->code[pc]); | |
| 102 | if (offset == NO_JUMP) /* point to itself represents end of list */ | |
| 103 | return NO_JUMP; /* end of list */ | |
| 104 | else | |
| 105 | return (pc+1)+offset; /* turn offset into absolute position */ | |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | |
| 109 | 109 | static Instruction *getjumpcontrol (FuncState *fs, int pc) { |
| 110 | Instruction *pi = &fs->f->code[pc]; | |
| 111 | if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1)))) | |
| 112 | return pi-1; | |
| 113 | else | |
| 114 | return pi; | |
| 110 | Instruction *pi = &fs->f->code[pc]; | |
| 111 | if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1)))) | |
| 112 | return pi-1; | |
| 113 | else | |
| 114 | return pi; | |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | |
| r31373 | r31374 | |
| 120 | 120 | ** (or produce an inverted value) |
| 121 | 121 | */ |
| 122 | 122 | static int need_value (FuncState *fs, int list) { |
| 123 | for (; list != NO_JUMP; list = getjump(fs, list)) { | |
| 124 | Instruction i = *getjumpcontrol(fs, list); | |
| 125 | if (GET_OPCODE(i) != OP_TESTSET) return 1; | |
| 126 | } | |
| 127 | return 0; /* not found */ | |
| 123 | for (; list != NO_JUMP; list = getjump(fs, list)) { | |
| 124 | Instruction i = *getjumpcontrol(fs, list); | |
| 125 | if (GET_OPCODE(i) != OP_TESTSET) return 1; | |
| 126 | } | |
| 127 | return 0; /* not found */ | |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | |
| 131 | 131 | static int patchtestreg (FuncState *fs, int node, int reg) { |
| 132 | Instruction *i = getjumpcontrol(fs, node); | |
| 133 | if (GET_OPCODE(*i) != OP_TESTSET) | |
| 134 | return 0; /* cannot patch other instructions */ | |
| 135 | if (reg != NO_REG && reg != GETARG_B(*i)) | |
| 136 | SETARG_A(*i, reg); | |
| 137 | else /* no register to put value or register already has the value */ | |
| 138 | *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i)); | |
| 132 | Instruction *i = getjumpcontrol(fs, node); | |
| 133 | if (GET_OPCODE(*i) != OP_TESTSET) | |
| 134 | return 0; /* cannot patch other instructions */ | |
| 135 | if (reg != NO_REG && reg != GETARG_B(*i)) | |
| 136 | SETARG_A(*i, reg); | |
| 137 | else /* no register to put value or register already has the value */ | |
| 138 | *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i)); | |
| 139 | 139 | |
| 140 | ||
| 140 | return 1; | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | |
| 144 | 144 | static void removevalues (FuncState *fs, int list) { |
| 145 | for (; list != NO_JUMP; list = getjump(fs, list)) | |
| 146 | patchtestreg(fs, list, NO_REG); | |
| 145 | for (; list != NO_JUMP; list = getjump(fs, list)) | |
| 146 | patchtestreg(fs, list, NO_REG); | |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | 149 | |
| 150 | 150 | static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, |
| 151 | int dtarget) { | |
| 152 | while (list != NO_JUMP) { | |
| 153 | int next = getjump(fs, list); | |
| 154 | if (patchtestreg(fs, list, reg)) | |
| 155 | fixjump(fs, list, vtarget); | |
| 156 | else | |
| 157 | fixjump(fs, list, dtarget); /* jump to default target */ | |
| 158 | list = next; | |
| 159 | } | |
| 151 | int dtarget) { | |
| 152 | while (list != NO_JUMP) { | |
| 153 | int next = getjump(fs, list); | |
| 154 | if (patchtestreg(fs, list, reg)) | |
| 155 | fixjump(fs, list, vtarget); | |
| 156 | else | |
| 157 | fixjump(fs, list, dtarget); /* jump to default target */ | |
| 158 | list = next; | |
| 159 | } | |
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | |
| 163 | 163 | static void dischargejpc (FuncState *fs) { |
| 164 | patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc); | |
| 165 | fs->jpc = NO_JUMP; | |
| 164 | patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc); | |
| 165 | fs->jpc = NO_JUMP; | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | |
| 169 | 169 | void luaK_patchlist (FuncState *fs, int list, int target) { |
| 170 | if (target == fs->pc) | |
| 171 | luaK_patchtohere(fs, list); | |
| 172 | else { | |
| 173 | lua_assert(target < fs->pc); | |
| 174 | patchlistaux(fs, list, target, NO_REG, target); | |
| 175 | } | |
| 170 | if (target == fs->pc) | |
| 171 | luaK_patchtohere(fs, list); | |
| 172 | else { | |
| 173 | lua_assert(target < fs->pc); | |
| 174 | patchlistaux(fs, list, target, NO_REG, target); | |
| 175 | } | |
| 176 | 176 | } |
| 177 | 177 | |
| 178 | 178 | |
| 179 | 179 | LUAI_FUNC void luaK_patchclose (FuncState *fs, int list, int level) { |
| 180 | level++; /* argument is +1 to reserve 0 as non-op */ | |
| 181 | while (list != NO_JUMP) { | |
| 182 | int next = getjump(fs, list); | |
| 183 | lua_assert(GET_OPCODE(fs->f->code[list]) == OP_JMP && | |
| 184 | (GETARG_A(fs->f->code[list]) == 0 || | |
| 185 | GETARG_A(fs->f->code[list]) >= level)); | |
| 186 | SETARG_A(fs->f->code[list], level); | |
| 187 | list = next; | |
| 188 | } | |
| 180 | level++; /* argument is +1 to reserve 0 as non-op */ | |
| 181 | while (list != NO_JUMP) { | |
| 182 | int next = getjump(fs, list); | |
| 183 | lua_assert(GET_OPCODE(fs->f->code[list]) == OP_JMP && | |
| 184 | (GETARG_A(fs->f->code[list]) == 0 || | |
| 185 | GETARG_A(fs->f->code[list]) >= level)); | |
| 186 | SETARG_A(fs->f->code[list], level); | |
| 187 | list = next; | |
| 188 | } | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
| 192 | 192 | void luaK_patchtohere (FuncState *fs, int list) { |
| 193 | luaK_getlabel(fs); | |
| 194 | luaK_concat(fs, &fs->jpc, list); | |
| 193 | luaK_getlabel(fs); | |
| 194 | luaK_concat(fs, &fs->jpc, list); | |
| 195 | 195 | } |
| 196 | 196 | |
| 197 | 197 | |
| 198 | 198 | void luaK_concat (FuncState *fs, int *l1, int l2) { |
| 199 | if (l2 == NO_JUMP) return; | |
| 200 | else if (*l1 == NO_JUMP) | |
| 201 | *l1 = l2; | |
| 202 | else { | |
| 203 | int list = *l1; | |
| 204 | int next; | |
| 205 | while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */ | |
| 206 | list = next; | |
| 207 | fixjump(fs, list, l2); | |
| 208 | } | |
| 199 | if (l2 == NO_JUMP) return; | |
| 200 | else if (*l1 == NO_JUMP) | |
| 201 | *l1 = l2; | |
| 202 | else { | |
| 203 | int list = *l1; | |
| 204 | int next; | |
| 205 | while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */ | |
| 206 | list = next; | |
| 207 | fixjump(fs, list, l2); | |
| 208 | } | |
| 209 | 209 | } |
| 210 | 210 | |
| 211 | 211 | |
| 212 | 212 | static int luaK_code (FuncState *fs, Instruction i) { |
| 213 | Proto *f = fs->f; | |
| 214 | dischargejpc(fs); /* `pc' will change */ | |
| 215 | /* put new instruction in code array */ | |
| 216 | luaM_growvector(fs->ls->L, f->code, fs->pc, f->sizecode, Instruction, | |
| 217 | MAX_INT, "opcodes"); | |
| 218 | f->code[fs->pc] = i; | |
| 219 | /* save corresponding line information */ | |
| 220 | luaM_growvector(fs->ls->L, f->lineinfo, fs->pc, f->sizelineinfo, int, | |
| 221 | MAX_INT, "opcodes"); | |
| 222 | f->lineinfo[fs->pc] = fs->ls->lastline; | |
| 223 | return fs->pc++; | |
| 213 | Proto *f = fs->f; | |
| 214 | dischargejpc(fs); /* `pc' will change */ | |
| 215 | /* put new instruction in code array */ | |
| 216 | luaM_growvector(fs->ls->L, f->code, fs->pc, f->sizecode, Instruction, | |
| 217 | MAX_INT, "opcodes"); | |
| 218 | f->code[fs->pc] = i; | |
| 219 | /* save corresponding line information */ | |
| 220 | luaM_growvector(fs->ls->L, f->lineinfo, fs->pc, f->sizelineinfo, int, | |
| 221 | MAX_INT, "opcodes"); | |
| 222 | f->lineinfo[fs->pc] = fs->ls->lastline; | |
| 223 | return fs->pc++; | |
| 224 | 224 | } |
| 225 | 225 | |
| 226 | 226 | |
| 227 | 227 | int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) { |
| 228 | lua_assert(getOpMode(o) == iABC); | |
| 229 | lua_assert(getBMode(o) != OpArgN || b == 0); | |
| 230 | lua_assert(getCMode(o) != OpArgN || c == 0); | |
| 231 | lua_assert(a <= MAXARG_A && b <= MAXARG_B && c <= MAXARG_C); | |
| 232 | return luaK_code(fs, CREATE_ABC(o, a, b, c)); | |
| 228 | lua_assert(getOpMode(o) == iABC); | |
| 229 | lua_assert(getBMode(o) != OpArgN || b == 0); | |
| 230 | lua_assert(getCMode(o) != OpArgN || c == 0); | |
| 231 | lua_assert(a <= MAXARG_A && b <= MAXARG_B && c <= MAXARG_C); | |
| 232 | return luaK_code(fs, CREATE_ABC(o, a, b, c)); | |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | 235 | |
| 236 | 236 | int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) { |
| 237 | lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx); | |
| 238 | lua_assert(getCMode(o) == OpArgN); | |
| 239 | lua_assert(a <= MAXARG_A && bc <= MAXARG_Bx); | |
| 240 | return luaK_code(fs, CREATE_ABx(o, a, bc)); | |
| 237 | lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx); | |
| 238 | lua_assert(getCMode(o) == OpArgN); | |
| 239 | lua_assert(a <= MAXARG_A && bc <= MAXARG_Bx); | |
| 240 | return luaK_code(fs, CREATE_ABx(o, a, bc)); | |
| 241 | 241 | } |
| 242 | 242 | |
| 243 | 243 | |
| 244 | 244 | static int codeextraarg (FuncState *fs, int a) { |
| 245 | lua_assert(a <= MAXARG_Ax); | |
| 246 | return luaK_code(fs, CREATE_Ax(OP_EXTRAARG, a)); | |
| 245 | lua_assert(a <= MAXARG_Ax); | |
| 246 | return luaK_code(fs, CREATE_Ax(OP_EXTRAARG, a)); | |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | 249 | |
| 250 | 250 | int luaK_codek (FuncState *fs, int reg, int k) { |
| 251 | if (k <= MAXARG_Bx) | |
| 252 | return luaK_codeABx(fs, OP_LOADK, reg, k); | |
| 253 | else { | |
| 254 | int p = luaK_codeABx(fs, OP_LOADKX, reg, 0); | |
| 255 | codeextraarg(fs, k); | |
| 256 | return p; | |
| 257 | } | |
| 251 | if (k <= MAXARG_Bx) | |
| 252 | return luaK_codeABx(fs, OP_LOADK, reg, k); | |
| 253 | else { | |
| 254 | int p = luaK_codeABx(fs, OP_LOADKX, reg, 0); | |
| 255 | codeextraarg(fs, k); | |
| 256 | return p; | |
| 257 | } | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 | |
| 261 | 261 | void luaK_checkstack (FuncState *fs, int n) { |
| 262 | int newstack = fs->freereg + n; | |
| 263 | if (newstack > fs->f->maxstacksize) { | |
| 264 | if (newstack >= MAXSTACK) | |
| 265 | luaX_syntaxerror(fs->ls, "function or expression too complex"); | |
| 266 | fs->f->maxstacksize = cast_byte(newstack); | |
| 267 | } | |
| 262 | int newstack = fs->freereg + n; | |
| 263 | if (newstack > fs->f->maxstacksize) { | |
| 264 | if (newstack >= MAXSTACK) | |
| 265 | luaX_syntaxerror(fs->ls, "function or expression too complex"); | |
| 266 | fs->f->maxstacksize = cast_byte(newstack); | |
| 267 | } | |
| 268 | 268 | } |
| 269 | 269 | |
| 270 | 270 | |
| 271 | 271 | void luaK_reserveregs (FuncState *fs, int n) { |
| 272 | luaK_checkstack(fs, n); | |
| 273 | fs->freereg += n; | |
| 272 | luaK_checkstack(fs, n); | |
| 273 | fs->freereg += n; | |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
| 277 | 277 | static void freereg (FuncState *fs, int reg) { |
| 278 | if (!ISK(reg) && reg >= fs->nactvar) { | |
| 279 | fs->freereg--; | |
| 280 | lua_assert(reg == fs->freereg); | |
| 281 | } | |
| 278 | if (!ISK(reg) && reg >= fs->nactvar) { | |
| 279 | fs->freereg--; | |
| 280 | lua_assert(reg == fs->freereg); | |
| 281 | } | |
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | |
| 285 | 285 | static void freeexp (FuncState *fs, expdesc *e) { |
| 286 | if (e->k == VNONRELOC) | |
| 287 | freereg(fs, e->u.info); | |
| 286 | if (e->k == VNONRELOC) | |
| 287 | freereg(fs, e->u.info); | |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | 290 | |
| 291 | 291 | static int addk (FuncState *fs, TValue *key, TValue *v) { |
| 292 | lua_State *L = fs->ls->L; | |
| 293 | TValue *idx = luaH_set(L, fs->h, key); | |
| 294 | Proto *f = fs->f; | |
| 295 | int k, oldsize; | |
| 296 | if (ttisnumber(idx)) { | |
| 297 | lua_Number n = nvalue(idx); | |
| 298 | lua_number2int(k, n); | |
| 299 | if (luaV_rawequalobj(&f->k[k], v)) | |
| 300 | return k; | |
| 301 | /* else may be a collision (e.g., between 0.0 and "\0\0\0\0\0\0\0\0"); | |
| 302 | go through and create a new entry for this value */ | |
| 303 | } | |
| 304 | /* constant not found; create a new entry */ | |
| 305 | oldsize = f->sizek; | |
| 306 | k = fs->nk; | |
| 307 | /* numerical value does not need GC barrier; | |
| 308 | table has no metatable, so it does not need to invalidate cache */ | |
| 309 | setnvalue(idx, cast_num(k)); | |
| 310 | luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants"); | |
| 311 | while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); | |
| 312 | setobj(L, &f->k[k], v); | |
| 313 | fs->nk++; | |
| 314 | luaC_barrier(L, f, v); | |
| 315 | return k; | |
| 292 | lua_State *L = fs->ls->L; | |
| 293 | TValue *idx = luaH_set(L, fs->h, key); | |
| 294 | Proto *f = fs->f; | |
| 295 | int k, oldsize; | |
| 296 | if (ttisnumber(idx)) { | |
| 297 | lua_Number n = nvalue(idx); | |
| 298 | lua_number2int(k, n); | |
| 299 | if (luaV_rawequalobj(&f->k[k], v)) | |
| 300 | return k; | |
| 301 | /* else may be a collision (e.g., between 0.0 and "\0\0\0\0\0\0\0\0"); | |
| 302 | go through and create a new entry for this value */ | |
| 303 | } | |
| 304 | /* constant not found; create a new entry */ | |
| 305 | oldsize = f->sizek; | |
| 306 | k = fs->nk; | |
| 307 | /* numerical value does not need GC barrier; | |
| 308 | table has no metatable, so it does not need to invalidate cache */ | |
| 309 | setnvalue(idx, cast_num(k)); | |
| 310 | luaM_growvector(L, f->k, k, f->sizek, TValue, MAXARG_Ax, "constants"); | |
| 311 | while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); | |
| 312 | setobj(L, &f->k[k], v); | |
| 313 | fs->nk++; | |
| 314 | luaC_barrier(L, f, v); | |
| 315 | return k; | |
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | |
| 319 | 319 | int luaK_stringK (FuncState *fs, TString *s) { |
| 320 | TValue o; | |
| 321 | setsvalue(fs->ls->L, &o, s); | |
| 322 | return addk(fs, &o, &o); | |
| 320 | TValue o; | |
| 321 | setsvalue(fs->ls->L, &o, s); | |
| 322 | return addk(fs, &o, &o); | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | |
| 326 | 326 | int luaK_numberK (FuncState *fs, lua_Number r) { |
| 327 | int n; | |
| 328 | lua_State *L = fs->ls->L; | |
| 329 | TValue o; | |
| 330 | setnvalue(&o, r); | |
| 331 | if (r == 0 || luai_numisnan(NULL, r)) { /* handle -0 and NaN */ | |
| 332 | /* use raw representation as key to avoid numeric problems */ | |
| 333 | setsvalue(L, L->top++, luaS_newlstr(L, (char *)&r, sizeof(r))); | |
| 334 | n = addk(fs, L->top - 1, &o); | |
| 335 | L->top--; | |
| 336 | } | |
| 337 | else | |
| 338 | n = addk(fs, &o, &o); /* regular case */ | |
| 339 | return n; | |
| 327 | int n; | |
| 328 | lua_State *L = fs->ls->L; | |
| 329 | TValue o; | |
| 330 | setnvalue(&o, r); | |
| 331 | if (r == 0 || luai_numisnan(NULL, r)) { /* handle -0 and NaN */ | |
| 332 | /* use raw representation as key to avoid numeric problems */ | |
| 333 | setsvalue(L, L->top++, luaS_newlstr(L, (char *)&r, sizeof(r))); | |
| 334 | n = addk(fs, L->top - 1, &o); | |
| 335 | L->top--; | |
| 336 | } | |
| 337 | else | |
| 338 | n = addk(fs, &o, &o); /* regular case */ | |
| 339 | return n; | |
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | static int boolK (FuncState *fs, int b) { |
| 344 | TValue o; | |
| 345 | setbvalue(&o, b); | |
| 346 | return addk(fs, &o, &o); | |
| 344 | TValue o; | |
| 345 | setbvalue(&o, b); | |
| 346 | return addk(fs, &o, &o); | |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | |
| 350 | 350 | static int nilK (FuncState *fs) { |
| 351 | TValue k, v; | |
| 352 | setnilvalue(&v); | |
| 353 | /* cannot use nil as key; instead use table itself to represent nil */ | |
| 354 | sethvalue(fs->ls->L, &k, fs->h); | |
| 355 | return addk(fs, &k, &v); | |
| 351 | TValue k, v; | |
| 352 | setnilvalue(&v); | |
| 353 | /* cannot use nil as key; instead use table itself to represent nil */ | |
| 354 | sethvalue(fs->ls->L, &k, fs->h); | |
| 355 | return addk(fs, &k, &v); | |
| 356 | 356 | } |
| 357 | 357 | |
| 358 | 358 | |
| 359 | 359 | void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { |
| 360 | if (e->k == VCALL) { /* expression is an open function call? */ | |
| 361 | SETARG_C(getcode(fs, e), nresults+1); | |
| 362 | } | |
| 363 | else if (e->k == VVARARG) { | |
| 364 | SETARG_B(getcode(fs, e), nresults+1); | |
| 365 | SETARG_A(getcode(fs, e), fs->freereg); | |
| 366 | luaK_reserveregs(fs, 1); | |
| 367 | } | |
| 360 | if (e->k == VCALL) { /* expression is an open function call? */ | |
| 361 | SETARG_C(getcode(fs, e), nresults+1); | |
| 362 | } | |
| 363 | else if (e->k == VVARARG) { | |
| 364 | SETARG_B(getcode(fs, e), nresults+1); | |
| 365 | SETARG_A(getcode(fs, e), fs->freereg); | |
| 366 | luaK_reserveregs(fs, 1); | |
| 367 | } | |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | 370 | |
| 371 | 371 | void luaK_setoneret (FuncState *fs, expdesc *e) { |
| 372 | if (e->k == VCALL) { /* expression is an open function call? */ | |
| 373 | e->k = VNONRELOC; | |
| 374 | e->u.info = GETARG_A(getcode(fs, e)); | |
| 375 | } | |
| 376 | else if (e->k == VVARARG) { | |
| 377 | SETARG_B(getcode(fs, e), 2); | |
| 378 | e->k = VRELOCABLE; /* can relocate its simple result */ | |
| 379 | } | |
| 372 | if (e->k == VCALL) { /* expression is an open function call? */ | |
| 373 | e->k = VNONRELOC; | |
| 374 | e->u.info = GETARG_A(getcode(fs, e)); | |
| 375 | } | |
| 376 | else if (e->k == VVARARG) { | |
| 377 | SETARG_B(getcode(fs, e), 2); | |
| 378 | e->k = VRELOCABLE; /* can relocate its simple result */ | |
| 379 | } | |
| 380 | 380 | } |
| 381 | 381 | |
| 382 | 382 | |
| 383 | 383 | void luaK_dischargevars (FuncState *fs, expdesc *e) { |
| 384 | switch (e->k) { | |
| 385 | case VLOCAL: { | |
| 386 | e->k = VNONRELOC; | |
| 387 | break; | |
| 388 | } | |
| 389 | case VUPVAL: { | |
| 390 | e->u.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.info, 0); | |
| 391 | e->k = VRELOCABLE; | |
| 392 | break; | |
| 393 | } | |
| 394 | case VINDEXED: { | |
| 395 | OpCode op = OP_GETTABUP; /* assume 't' is in an upvalue */ | |
| 396 | freereg(fs, e->u.ind.idx); | |
| 397 | if (e->u.ind.vt == VLOCAL) { /* 't' is in a register? */ | |
| 398 | freereg(fs, e->u.ind.t); | |
| 399 | op = OP_GETTABLE; | |
| 400 | } | |
| 401 | e->u.info = luaK_codeABC(fs, op, 0, e->u.ind.t, e->u.ind.idx); | |
| 402 | e->k = VRELOCABLE; | |
| 403 | break; | |
| 404 | } | |
| 405 | case VVARARG: | |
| 406 | case VCALL: { | |
| 407 | luaK_setoneret(fs, e); | |
| 408 | break; | |
| 409 | } | |
| 410 | default: break; /* there is one value available (somewhere) */ | |
| 411 | } | |
| 384 | switch (e->k) { | |
| 385 | case VLOCAL: { | |
| 386 | e->k = VNONRELOC; | |
| 387 | break; | |
| 388 | } | |
| 389 | case VUPVAL: { | |
| 390 | e->u.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.info, 0); | |
| 391 | e->k = VRELOCABLE; | |
| 392 | break; | |
| 393 | } | |
| 394 | case VINDEXED: { | |
| 395 | OpCode op = OP_GETTABUP; /* assume 't' is in an upvalue */ | |
| 396 | freereg(fs, e->u.ind.idx); | |
| 397 | if (e->u.ind.vt == VLOCAL) { /* 't' is in a register? */ | |
| 398 | freereg(fs, e->u.ind.t); | |
| 399 | op = OP_GETTABLE; | |
| 400 | } | |
| 401 | e->u.info = luaK_codeABC(fs, op, 0, e->u.ind.t, e->u.ind.idx); | |
| 402 | e->k = VRELOCABLE; | |
| 403 | break; | |
| 404 | } | |
| 405 | case VVARARG: | |
| 406 | case VCALL: { | |
| 407 | luaK_setoneret(fs, e); | |
| 408 | break; | |
| 409 | } | |
| 410 | default: break; /* there is one value available (somewhere) */ | |
| 411 | } | |
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | |
| 415 | 415 | static int code_label (FuncState *fs, int A, int b, int jump) { |
| 416 | luaK_getlabel(fs); /* those instructions may be jump targets */ | |
| 417 | return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump); | |
| 416 | luaK_getlabel(fs); /* those instructions may be jump targets */ | |
| 417 | return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump); | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | |
| 421 | 421 | static void discharge2reg (FuncState *fs, expdesc *e, int reg) { |
| 422 | luaK_dischargevars(fs, e); | |
| 423 | switch (e->k) { | |
| 424 | case VNIL: { | |
| 425 | luaK_nil(fs, reg, 1); | |
| 426 | break; | |
| 427 | } | |
| 428 | case VFALSE: case VTRUE: { | |
| 429 | luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0); | |
| 430 | break; | |
| 431 | } | |
| 432 | case VK: { | |
| 433 | luaK_codek(fs, reg, e->u.info); | |
| 434 | break; | |
| 435 | } | |
| 436 | case VKNUM: { | |
| 437 | luaK_codek(fs, reg, luaK_numberK(fs, e->u.nval)); | |
| 438 | break; | |
| 439 | } | |
| 440 | case VRELOCABLE: { | |
| 441 | Instruction *pc = &getcode(fs, e); | |
| 442 | SETARG_A(*pc, reg); | |
| 443 | break; | |
| 444 | } | |
| 445 | case VNONRELOC: { | |
| 446 | if (reg != e->u.info) | |
| 447 | luaK_codeABC(fs, OP_MOVE, reg, e->u.info, 0); | |
| 448 | break; | |
| 449 | } | |
| 450 | default: { | |
| 451 | lua_assert(e->k == VVOID || e->k == VJMP); | |
| 452 | return; /* nothing to do... */ | |
| 453 | } | |
| 454 | } | |
| 455 | e->u.info = reg; | |
| 456 | e->k = VNONRELOC; | |
| 422 | luaK_dischargevars(fs, e); | |
| 423 | switch (e->k) { | |
| 424 | case VNIL: { | |
| 425 | luaK_nil(fs, reg, 1); | |
| 426 | break; | |
| 427 | } | |
| 428 | case VFALSE: case VTRUE: { | |
| 429 | luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0); | |
| 430 | break; | |
| 431 | } | |
| 432 | case VK: { | |
| 433 | luaK_codek(fs, reg, e->u.info); | |
| 434 | break; | |
| 435 | } | |
| 436 | case VKNUM: { | |
| 437 | luaK_codek(fs, reg, luaK_numberK(fs, e->u.nval)); | |
| 438 | break; | |
| 439 | } | |
| 440 | case VRELOCABLE: { | |
| 441 | Instruction *pc = &getcode(fs, e); | |
| 442 | SETARG_A(*pc, reg); | |
| 443 | break; | |
| 444 | } | |
| 445 | case VNONRELOC: { | |
| 446 | if (reg != e->u.info) | |
| 447 | luaK_codeABC(fs, OP_MOVE, reg, e->u.info, 0); | |
| 448 | break; | |
| 449 | } | |
| 450 | default: { | |
| 451 | lua_assert(e->k == VVOID || e->k == VJMP); | |
| 452 | return; /* nothing to do... */ | |
| 453 | } | |
| 454 | } | |
| 455 | e->u.info = reg; | |
| 456 | e->k = VNONRELOC; | |
| 457 | 457 | } |
| 458 | 458 | |
| 459 | 459 | |
| 460 | 460 | static void discharge2anyreg (FuncState *fs, expdesc *e) { |
| 461 | if (e->k != VNONRELOC) { | |
| 462 | luaK_reserveregs(fs, 1); | |
| 463 | discharge2reg(fs, e, fs->freereg-1); | |
| 464 | } | |
| 461 | if (e->k != VNONRELOC) { | |
| 462 | luaK_reserveregs(fs, 1); | |
| 463 | discharge2reg(fs, e, fs->freereg-1); | |
| 464 | } | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | |
| 468 | 468 | static void exp2reg (FuncState *fs, expdesc *e, int reg) { |
| 469 | discharge2reg(fs, e, reg); | |
| 470 | if (e->k == VJMP) | |
| 471 | luaK_concat(fs, &e->t, e->u.info); /* put this jump in `t' list */ | |
| 472 | if (hasjumps(e)) { | |
| 473 | int final; /* position after whole expression */ | |
| 474 | int p_f = NO_JUMP; /* position of an eventual LOAD false */ | |
| 475 | int p_t = NO_JUMP; /* position of an eventual LOAD true */ | |
| 476 | if (need_value(fs, e->t) || need_value(fs, e->f)) { | |
| 477 | int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); | |
| 478 | p_f = code_label(fs, reg, 0, 1); | |
| 479 | p_t = code_label(fs, reg, 1, 0); | |
| 480 | luaK_patchtohere(fs, fj); | |
| 481 | } | |
| 482 | final = luaK_getlabel(fs); | |
| 483 | patchlistaux(fs, e->f, final, reg, p_f); | |
| 484 | patchlistaux(fs, e->t, final, reg, p_t); | |
| 485 | } | |
| 486 | e->f = e->t = NO_JUMP; | |
| 487 | e->u.info = reg; | |
| 488 | e->k = VNONRELOC; | |
| 469 | discharge2reg(fs, e, reg); | |
| 470 | if (e->k == VJMP) | |
| 471 | luaK_concat(fs, &e->t, e->u.info); /* put this jump in `t' list */ | |
| 472 | if (hasjumps(e)) { | |
| 473 | int final; /* position after whole expression */ | |
| 474 | int p_f = NO_JUMP; /* position of an eventual LOAD false */ | |
| 475 | int p_t = NO_JUMP; /* position of an eventual LOAD true */ | |
| 476 | if (need_value(fs, e->t) || need_value(fs, e->f)) { | |
| 477 | int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); | |
| 478 | p_f = code_label(fs, reg, 0, 1); | |
| 479 | p_t = code_label(fs, reg, 1, 0); | |
| 480 | luaK_patchtohere(fs, fj); | |
| 481 | } | |
| 482 | final = luaK_getlabel(fs); | |
| 483 | patchlistaux(fs, e->f, final, reg, p_f); | |
| 484 | patchlistaux(fs, e->t, final, reg, p_t); | |
| 485 | } | |
| 486 | e->f = e->t = NO_JUMP; | |
| 487 | e->u.info = reg; | |
| 488 | e->k = VNONRELOC; | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | |
| 492 | 492 | void luaK_exp2nextreg (FuncState *fs, expdesc *e) { |
| 493 | luaK_dischargevars(fs, e); | |
| 494 | freeexp(fs, e); | |
| 495 | luaK_reserveregs(fs, 1); | |
| 496 | exp2reg(fs, e, fs->freereg - 1); | |
| 493 | luaK_dischargevars(fs, e); | |
| 494 | freeexp(fs, e); | |
| 495 | luaK_reserveregs(fs, 1); | |
| 496 | exp2reg(fs, e, fs->freereg - 1); | |
| 497 | 497 | } |
| 498 | 498 | |
| 499 | 499 | |
| 500 | 500 | int luaK_exp2anyreg (FuncState *fs, expdesc *e) { |
| 501 | luaK_dischargevars(fs, e); | |
| 502 | if (e->k == VNONRELOC) { | |
| 503 | if (!hasjumps(e)) return e->u.info; /* exp is already in a register */ | |
| 504 | if (e->u.info >= fs->nactvar) { /* reg. is not a local? */ | |
| 505 | exp2reg(fs, e, e->u.info); /* put value on it */ | |
| 506 | return e->u.info; | |
| 507 | } | |
| 508 | } | |
| 509 | luaK_exp2nextreg(fs, e); /* default */ | |
| 510 | return e->u.info; | |
| 501 | luaK_dischargevars(fs, e); | |
| 502 | if (e->k == VNONRELOC) { | |
| 503 | if (!hasjumps(e)) return e->u.info; /* exp is already in a register */ | |
| 504 | if (e->u.info >= fs->nactvar) { /* reg. is not a local? */ | |
| 505 | exp2reg(fs, e, e->u.info); /* put value on it */ | |
| 506 | return e->u.info; | |
| 507 | } | |
| 508 | } | |
| 509 | luaK_exp2nextreg(fs, e); /* default */ | |
| 510 | return e->u.info; | |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | |
| 514 | 514 | void luaK_exp2anyregup (FuncState *fs, expdesc *e) { |
| 515 | if (e->k != VUPVAL || hasjumps(e)) | |
| 516 | luaK_exp2anyreg(fs, e); | |
| 515 | if (e->k != VUPVAL || hasjumps(e)) | |
| 516 | luaK_exp2anyreg(fs, e); | |
| 517 | 517 | } |
| 518 | 518 | |
| 519 | 519 | |
| 520 | 520 | void luaK_exp2val (FuncState *fs, expdesc *e) { |
| 521 | if (hasjumps(e)) | |
| 522 | luaK_exp2anyreg(fs, e); | |
| 523 | else | |
| 524 | luaK_dischargevars(fs, e); | |
| 521 | if (hasjumps(e)) | |
| 522 | luaK_exp2anyreg(fs, e); | |
| 523 | else | |
| 524 | luaK_dischargevars(fs, e); | |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | |
| 528 | 528 | int luaK_exp2RK (FuncState *fs, expdesc *e) { |
| 529 | luaK_exp2val(fs, e); | |
| 530 | switch (e->k) { | |
| 531 | case VTRUE: | |
| 532 | case VFALSE: | |
| 533 | case VNIL: { | |
| 534 | if (fs->nk <= MAXINDEXRK) { /* constant fits in RK operand? */ | |
| 535 | e->u.info = (e->k == VNIL) ? nilK(fs) : boolK(fs, (e->k == VTRUE)); | |
| 536 | e->k = VK; | |
| 537 | return RKASK(e->u.info); | |
| 538 | } | |
| 539 | else break; | |
| 540 | } | |
| 541 | case VKNUM: { | |
| 542 | e->u.info = luaK_numberK(fs, e->u.nval); | |
| 543 | e->k = VK; | |
| 544 | /* go through */ | |
| 545 | } | |
| 546 | case VK: { | |
| 547 | if (e->u.info <= MAXINDEXRK) /* constant fits in argC? */ | |
| 548 | return RKASK(e->u.info); | |
| 549 | else break; | |
| 550 | } | |
| 551 | default: break; | |
| 552 | } | |
| 553 | /* not a constant in the right range: put it in a register */ | |
| 554 | return luaK_exp2anyreg(fs, e); | |
| 529 | luaK_exp2val(fs, e); | |
| 530 | switch (e->k) { | |
| 531 | case VTRUE: | |
| 532 | case VFALSE: | |
| 533 | case VNIL: { | |
| 534 | if (fs->nk <= MAXINDEXRK) { /* constant fits in RK operand? */ | |
| 535 | e->u.info = (e->k == VNIL) ? nilK(fs) : boolK(fs, (e->k == VTRUE)); | |
| 536 | e->k = VK; | |
| 537 | return RKASK(e->u.info); | |
| 538 | } | |
| 539 | else break; | |
| 540 | } | |
| 541 | case VKNUM: { | |
| 542 | e->u.info = luaK_numberK(fs, e->u.nval); | |
| 543 | e->k = VK; | |
| 544 | /* go through */ | |
| 545 | } | |
| 546 | case VK: { | |
| 547 | if (e->u.info <= MAXINDEXRK) /* constant fits in argC? */ | |
| 548 | return RKASK(e->u.info); | |
| 549 | else break; | |
| 550 | } | |
| 551 | default: break; | |
| 552 | } | |
| 553 | /* not a constant in the right range: put it in a register */ | |
| 554 | return luaK_exp2anyreg(fs, e); | |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | |
| 558 | 558 | void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { |
| 559 | switch (var->k) { | |
| 560 | case VLOCAL: { | |
| 561 | freeexp(fs, ex); | |
| 562 | exp2reg(fs, ex, var->u.info); | |
| 563 | return; | |
| 564 | } | |
| 565 | case VUPVAL: { | |
| 566 | int e = luaK_exp2anyreg(fs, ex); | |
| 567 | luaK_codeABC(fs, OP_SETUPVAL, e, var->u.info, 0); | |
| 568 | break; | |
| 569 | } | |
| 570 | case VINDEXED: { | |
| 571 | OpCode op = (var->u.ind.vt == VLOCAL) ? OP_SETTABLE : OP_SETTABUP; | |
| 572 | int e = luaK_exp2RK(fs, ex); | |
| 573 | luaK_codeABC(fs, op, var->u.ind.t, var->u.ind.idx, e); | |
| 574 | break; | |
| 575 | } | |
| 576 | default: { | |
| 577 | lua_assert(0); /* invalid var kind to store */ | |
| 578 | break; | |
| 579 | } | |
| 580 | } | |
| 581 | freeexp(fs, ex); | |
| 559 | switch (var->k) { | |
| 560 | case VLOCAL: { | |
| 561 | freeexp(fs, ex); | |
| 562 | exp2reg(fs, ex, var->u.info); | |
| 563 | return; | |
| 564 | } | |
| 565 | case VUPVAL: { | |
| 566 | int e = luaK_exp2anyreg(fs, ex); | |
| 567 | luaK_codeABC(fs, OP_SETUPVAL, e, var->u.info, 0); | |
| 568 | break; | |
| 569 | } | |
| 570 | case VINDEXED: { | |
| 571 | OpCode op = (var->u.ind.vt == VLOCAL) ? OP_SETTABLE : OP_SETTABUP; | |
| 572 | int e = luaK_exp2RK(fs, ex); | |
| 573 | luaK_codeABC(fs, op, var->u.ind.t, var->u.ind.idx, e); | |
| 574 | break; | |
| 575 | } | |
| 576 | default: { | |
| 577 | lua_assert(0); /* invalid var kind to store */ | |
| 578 | break; | |
| 579 | } | |
| 580 | } | |
| 581 | freeexp(fs, ex); | |
| 582 | 582 | } |
| 583 | 583 | |
| 584 | 584 | |
| 585 | 585 | void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { |
| 586 | int ereg; | |
| 587 | luaK_exp2anyreg(fs, e); | |
| 588 | ereg = e->u.info; /* register where 'e' was placed */ | |
| 589 | freeexp(fs, e); | |
| 590 | e->u.info = fs->freereg; /* base register for op_self */ | |
| 591 | e->k = VNONRELOC; | |
| 592 | luaK_reserveregs(fs, 2); /* function and 'self' produced by op_self */ | |
| 593 | luaK_codeABC(fs, OP_SELF, e->u.info, ereg, luaK_exp2RK(fs, key)); | |
| 594 | freeexp(fs, key); | |
| 586 | int ereg; | |
| 587 | luaK_exp2anyreg(fs, e); | |
| 588 | ereg = e->u.info; /* register where 'e' was placed */ | |
| 589 | freeexp(fs, e); | |
| 590 | e->u.info = fs->freereg; /* base register for op_self */ | |
| 591 | e->k = VNONRELOC; | |
| 592 | luaK_reserveregs(fs, 2); /* function and 'self' produced by op_self */ | |
| 593 | luaK_codeABC(fs, OP_SELF, e->u.info, ereg, luaK_exp2RK(fs, key)); | |
| 594 | freeexp(fs, key); | |
| 595 | 595 | } |
| 596 | 596 | |
| 597 | 597 | |
| 598 | 598 | static void invertjump (FuncState *fs, expdesc *e) { |
| 599 | Instruction *pc = getjumpcontrol(fs, e->u.info); | |
| 600 | lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET && | |
| 601 | GET_OPCODE(*pc) != OP_TEST); | |
| 602 | SETARG_A(*pc, !(GETARG_A(*pc))); | |
| 599 | Instruction *pc = getjumpcontrol(fs, e->u.info); | |
| 600 | lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET && | |
| 601 | GET_OPCODE(*pc) != OP_TEST); | |
| 602 | SETARG_A(*pc, !(GETARG_A(*pc))); | |
| 603 | 603 | } |
| 604 | 604 | |
| 605 | 605 | |
| 606 | 606 | static int jumponcond (FuncState *fs, expdesc *e, int cond) { |
| 607 | if (e->k == VRELOCABLE) { | |
| 608 | Instruction ie = getcode(fs, e); | |
| 609 | if (GET_OPCODE(ie) == OP_NOT) { | |
| 610 | fs->pc--; /* remove previous OP_NOT */ | |
| 611 | return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond); | |
| 612 | } | |
| 613 | /* else go through */ | |
| 614 | } | |
| 615 | discharge2anyreg(fs, e); | |
| 616 | freeexp(fs, e); | |
| 617 | return condjump(fs, OP_TESTSET, NO_REG, e->u.info, cond); | |
| 607 | if (e->k == VRELOCABLE) { | |
| 608 | Instruction ie = getcode(fs, e); | |
| 609 | if (GET_OPCODE(ie) == OP_NOT) { | |
| 610 | fs->pc--; /* remove previous OP_NOT */ | |
| 611 | return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond); | |
| 612 | } | |
| 613 | /* else go through */ | |
| 614 | } | |
| 615 | discharge2anyreg(fs, e); | |
| 616 | freeexp(fs, e); | |
| 617 | return condjump(fs, OP_TESTSET, NO_REG, e->u.info, cond); | |
| 618 | 618 | } |
| 619 | 619 | |
| 620 | 620 | |
| 621 | 621 | void luaK_goiftrue (FuncState *fs, expdesc *e) { |
| 622 | int pc; /* pc of last jump */ | |
| 623 | luaK_dischargevars(fs, e); | |
| 624 | switch (e->k) { | |
| 625 | case VJMP: { | |
| 626 | invertjump(fs, e); | |
| 627 | pc = e->u.info; | |
| 628 | break; | |
| 629 | } | |
| 630 | case VK: case VKNUM: case VTRUE: { | |
| 631 | pc = NO_JUMP; /* always true; do nothing */ | |
| 632 | break; | |
| 633 | } | |
| 634 | default: { | |
| 635 | pc = jumponcond(fs, e, 0); | |
| 636 | break; | |
| 637 | } | |
| 638 | } | |
| 639 | luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */ | |
| 640 | luaK_patchtohere(fs, e->t); | |
| 641 | e->t = NO_JUMP; | |
| 622 | int pc; /* pc of last jump */ | |
| 623 | luaK_dischargevars(fs, e); | |
| 624 | switch (e->k) { | |
| 625 | case VJMP: { | |
| 626 | invertjump(fs, e); | |
| 627 | pc = e->u.info; | |
| 628 | break; | |
| 629 | } | |
| 630 | case VK: case VKNUM: case VTRUE: { | |
| 631 | pc = NO_JUMP; /* always true; do nothing */ | |
| 632 | break; | |
| 633 | } | |
| 634 | default: { | |
| 635 | pc = jumponcond(fs, e, 0); | |
| 636 | break; | |
| 637 | } | |
| 638 | } | |
| 639 | luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */ | |
| 640 | luaK_patchtohere(fs, e->t); | |
| 641 | e->t = NO_JUMP; | |
| 642 | 642 | } |
| 643 | 643 | |
| 644 | 644 | |
| 645 | 645 | void luaK_goiffalse (FuncState *fs, expdesc *e) { |
| 646 | int pc; /* pc of last jump */ | |
| 647 | luaK_dischargevars(fs, e); | |
| 648 | switch (e->k) { | |
| 649 | case VJMP: { | |
| 650 | pc = e->u.info; | |
| 651 | break; | |
| 652 | } | |
| 653 | case VNIL: case VFALSE: { | |
| 654 | pc = NO_JUMP; /* always false; do nothing */ | |
| 655 | break; | |
| 656 | } | |
| 657 | default: { | |
| 658 | pc = jumponcond(fs, e, 1); | |
| 659 | break; | |
| 660 | } | |
| 661 | } | |
| 662 | luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */ | |
| 663 | luaK_patchtohere(fs, e->f); | |
| 664 | e->f = NO_JUMP; | |
| 646 | int pc; /* pc of last jump */ | |
| 647 | luaK_dischargevars(fs, e); | |
| 648 | switch (e->k) { | |
| 649 | case VJMP: { | |
| 650 | pc = e->u.info; | |
| 651 | break; | |
| 652 | } | |
| 653 | case VNIL: case VFALSE: { | |
| 654 | pc = NO_JUMP; /* always false; do nothing */ | |
| 655 | break; | |
| 656 | } | |
| 657 | default: { | |
| 658 | pc = jumponcond(fs, e, 1); | |
| 659 | break; | |
| 660 | } | |
| 661 | } | |
| 662 | luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */ | |
| 663 | luaK_patchtohere(fs, e->f); | |
| 664 | e->f = NO_JUMP; | |
| 665 | 665 | } |
| 666 | 666 | |
| 667 | 667 | |
| 668 | 668 | static void codenot (FuncState *fs, expdesc *e) { |
| 669 | luaK_dischargevars(fs, e); | |
| 670 | switch (e->k) { | |
| 671 | case VNIL: case VFALSE: { | |
| 672 | e->k = VTRUE; | |
| 673 | break; | |
| 674 | } | |
| 675 | case VK: case VKNUM: case VTRUE: { | |
| 676 | e->k = VFALSE; | |
| 677 | break; | |
| 678 | } | |
| 679 | case VJMP: { | |
| 680 | invertjump(fs, e); | |
| 681 | break; | |
| 682 | } | |
| 683 | case VRELOCABLE: | |
| 684 | case VNONRELOC: { | |
| 685 | discharge2anyreg(fs, e); | |
| 686 | freeexp(fs, e); | |
| 687 | e->u.info = luaK_codeABC(fs, OP_NOT, 0, e->u.info, 0); | |
| 688 | e->k = VRELOCABLE; | |
| 689 | break; | |
| 690 | } | |
| 691 | default: { | |
| 692 | lua_assert(0); /* cannot happen */ | |
| 693 | break; | |
| 694 | } | |
| 695 | } | |
| 696 | /* interchange true and false lists */ | |
| 697 | { int temp = e->f; e->f = e->t; e->t = temp; } | |
| 698 | removevalues(fs, e->f); | |
| 699 | removevalues(fs, e->t); | |
| 669 | luaK_dischargevars(fs, e); | |
| 670 | switch (e->k) { | |
| 671 | case VNIL: case VFALSE: { | |
| 672 | e->k = VTRUE; | |
| 673 | break; | |
| 674 | } | |
| 675 | case VK: case VKNUM: case VTRUE: { | |
| 676 | e->k = VFALSE; | |
| 677 | break; | |
| 678 | } | |
| 679 | case VJMP: { | |
| 680 | invertjump(fs, e); | |
| 681 | break; | |
| 682 | } | |
| 683 | case VRELOCABLE: | |
| 684 | case VNONRELOC: { | |
| 685 | discharge2anyreg(fs, e); | |
| 686 | freeexp(fs, e); | |
| 687 | e->u.info = luaK_codeABC(fs, OP_NOT, 0, e->u.info, 0); | |
| 688 | e->k = VRELOCABLE; | |
| 689 | break; | |
| 690 | } | |
| 691 | default: { | |
| 692 | lua_assert(0); /* cannot happen */ | |
| 693 | break; | |
| 694 | } | |
| 695 | } | |
| 696 | /* interchange true and false lists */ | |
| 697 | { int temp = e->f; e->f = e->t; e->t = temp; } | |
| 698 | removevalues(fs, e->f); | |
| 699 | removevalues(fs, e->t); | |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | 702 | |
| 703 | 703 | void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { |
| 704 | lua_assert(!hasjumps(t)); | |
| 705 | t->u.ind.t = t->u.info; | |
| 706 | t->u.ind.idx = luaK_exp2RK(fs, k); | |
| 707 | t->u.ind.vt = (t->k == VUPVAL) ? VUPVAL | |
| 708 | : check_exp(vkisinreg(t->k), VLOCAL); | |
| 709 | t->k = VINDEXED; | |
| 704 | lua_assert(!hasjumps(t)); | |
| 705 | t->u.ind.t = t->u.info; | |
| 706 | t->u.ind.idx = luaK_exp2RK(fs, k); | |
| 707 | t->u.ind.vt = (t->k == VUPVAL) ? VUPVAL | |
| 708 | : check_exp(vkisinreg(t->k), VLOCAL); | |
| 709 | t->k = VINDEXED; | |
| 710 | 710 | } |
| 711 | 711 | |
| 712 | 712 | |
| 713 | 713 | static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { |
| 714 | lua_Number r; | |
| 715 | if (!isnumeral(e1) || !isnumeral(e2)) return 0; | |
| 716 | if ((op == OP_DIV || op == OP_MOD) && e2->u.nval == 0) | |
| 717 | return 0; /* do not attempt to divide by 0 */ | |
| 718 | r = luaO_arith(op - OP_ADD + LUA_OPADD, e1->u.nval, e2->u.nval); | |
| 719 | e1->u.nval = r; | |
| 720 | return 1; | |
| 714 | lua_Number r; | |
| 715 | if (!isnumeral(e1) || !isnumeral(e2)) return 0; | |
| 716 | if ((op == OP_DIV || op == OP_MOD) && e2->u.nval == 0) | |
| 717 | return 0; /* do not attempt to divide by 0 */ | |
| 718 | r = luaO_arith(op - OP_ADD + LUA_OPADD, e1->u.nval, e2->u.nval); | |
| 719 | e1->u.nval = r; | |
| 720 | return 1; | |
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | |
| 724 | 724 | static void codearith (FuncState *fs, OpCode op, |
| 725 | expdesc *e1, expdesc *e2, int line) { | |
| 726 | if (constfolding(op, e1, e2)) | |
| 727 | return; | |
| 728 | else { | |
| 729 | int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; | |
| 730 | int o1 = luaK_exp2RK(fs, e1); | |
| 731 | if (o1 > o2) { | |
| 732 | freeexp(fs, e1); | |
| 733 | freeexp(fs, e2); | |
| 734 | } | |
| 735 | else { | |
| 736 | freeexp(fs, e2); | |
| 737 | freeexp(fs, e1); | |
| 738 | } | |
| 739 | e1->u.info = luaK_codeABC(fs, op, 0, o1, o2); | |
| 740 | e1->k = VRELOCABLE; | |
| 741 | luaK_fixline(fs, line); | |
| 742 | } | |
| 725 | expdesc *e1, expdesc *e2, int line) { | |
| 726 | if (constfolding(op, e1, e2)) | |
| 727 | return; | |
| 728 | else { | |
| 729 | int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; | |
| 730 | int o1 = luaK_exp2RK(fs, e1); | |
| 731 | if (o1 > o2) { | |
| 732 | freeexp(fs, e1); | |
| 733 | freeexp(fs, e2); | |
| 734 | } | |
| 735 | else { | |
| 736 | freeexp(fs, e2); | |
| 737 | freeexp(fs, e1); | |
| 738 | } | |
| 739 | e1->u.info = luaK_codeABC(fs, op, 0, o1, o2); | |
| 740 | e1->k = VRELOCABLE; | |
| 741 | luaK_fixline(fs, line); | |
| 742 | } | |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | 745 | |
| 746 | 746 | static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, |
| 747 | expdesc *e2) { | |
| 748 | int o1 = luaK_exp2RK(fs, e1); | |
| 749 | int o2 = luaK_exp2RK(fs, e2); | |
| 750 | freeexp(fs, e2); | |
| 751 | freeexp(fs, e1); | |
| 752 | if (cond == 0 && op != OP_EQ) { | |
| 753 | int temp; /* exchange args to replace by `<' or `<=' */ | |
| 754 | temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ | |
| 755 | cond = 1; | |
| 756 | } | |
| 757 | e1->u.info = condjump(fs, op, cond, o1, o2); | |
| 758 | e1->k = VJMP; | |
| 747 | expdesc *e2) { | |
| 748 | int o1 = luaK_exp2RK(fs, e1); | |
| 749 | int o2 = luaK_exp2RK(fs, e2); | |
| 750 | freeexp(fs, e2); | |
| 751 | freeexp(fs, e1); | |
| 752 | if (cond == 0 && op != OP_EQ) { | |
| 753 | int temp; /* exchange args to replace by `<' or `<=' */ | |
| 754 | temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ | |
| 755 | cond = 1; | |
| 756 | } | |
| 757 | e1->u.info = condjump(fs, op, cond, o1, o2); | |
| 758 | e1->k = VJMP; | |
| 759 | 759 | } |
| 760 | 760 | |
| 761 | 761 | |
| 762 | 762 | void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e, int line) { |
| 763 | expdesc e2; | |
| 764 | e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; | |
| 765 | switch (op) { | |
| 766 | case OPR_MINUS: { | |
| 767 | if (isnumeral(e)) /* minus constant? */ | |
| 768 | e->u.nval = luai_numunm(NULL, e->u.nval); /* fold it */ | |
| 769 | else { | |
| 770 | luaK_exp2anyreg(fs, e); | |
| 771 | codearith(fs, OP_UNM, e, &e2, line); | |
| 772 | } | |
| 773 | break; | |
| 774 | } | |
| 775 | case OPR_NOT: codenot(fs, e); break; | |
| 776 | case OPR_LEN: { | |
| 777 | luaK_exp2anyreg(fs, e); /* cannot operate on constants */ | |
| 778 | codearith(fs, OP_LEN, e, &e2, line); | |
| 779 | break; | |
| 780 | } | |
| 781 | default: lua_assert(0); | |
| 782 | } | |
| 763 | expdesc e2; | |
| 764 | e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; | |
| 765 | switch (op) { | |
| 766 | case OPR_MINUS: { | |
| 767 | if (isnumeral(e)) /* minus constant? */ | |
| 768 | e->u.nval = luai_numunm(NULL, e->u.nval); /* fold it */ | |
| 769 | else { | |
| 770 | luaK_exp2anyreg(fs, e); | |
| 771 | codearith(fs, OP_UNM, e, &e2, line); | |
| 772 | } | |
| 773 | break; | |
| 774 | } | |
| 775 | case OPR_NOT: codenot(fs, e); break; | |
| 776 | case OPR_LEN: { | |
| 777 | luaK_exp2anyreg(fs, e); /* cannot operate on constants */ | |
| 778 | codearith(fs, OP_LEN, e, &e2, line); | |
| 779 | break; | |
| 780 | } | |
| 781 | default: lua_assert(0); | |
| 782 | } | |
| 783 | 783 | } |
| 784 | 784 | |
| 785 | 785 | |
| 786 | 786 | void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { |
| 787 | switch (op) { | |
| 788 | case OPR_AND: { | |
| 789 | luaK_goiftrue(fs, v); | |
| 790 | break; | |
| 791 | } | |
| 792 | case OPR_OR: { | |
| 793 | luaK_goiffalse(fs, v); | |
| 794 | break; | |
| 795 | } | |
| 796 | case OPR_CONCAT: { | |
| 797 | luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ | |
| 798 | break; | |
| 799 | } | |
| 800 | case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: | |
| 801 | case OPR_MOD: case OPR_POW: { | |
| 802 | if (!isnumeral(v)) luaK_exp2RK(fs, v); | |
| 803 | break; | |
| 804 | } | |
| 805 | default: { | |
| 806 | luaK_exp2RK(fs, v); | |
| 807 | break; | |
| 808 | } | |
| 809 | } | |
| 787 | switch (op) { | |
| 788 | case OPR_AND: { | |
| 789 | luaK_goiftrue(fs, v); | |
| 790 | break; | |
| 791 | } | |
| 792 | case OPR_OR: { | |
| 793 | luaK_goiffalse(fs, v); | |
| 794 | break; | |
| 795 | } | |
| 796 | case OPR_CONCAT: { | |
| 797 | luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ | |
| 798 | break; | |
| 799 | } | |
| 800 | case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: | |
| 801 | case OPR_MOD: case OPR_POW: { | |
| 802 | if (!isnumeral(v)) luaK_exp2RK(fs, v); | |
| 803 | break; | |
| 804 | } | |
| 805 | default: { | |
| 806 | luaK_exp2RK(fs, v); | |
| 807 | break; | |
| 808 | } | |
| 809 | } | |
| 810 | 810 | } |
| 811 | 811 | |
| 812 | 812 | |
| 813 | 813 | void luaK_posfix (FuncState *fs, BinOpr op, |
| 814 | expdesc *e1, expdesc *e2, int line) { | |
| 815 | switch (op) { | |
| 816 | case OPR_AND: { | |
| 817 | lua_assert(e1->t == NO_JUMP); /* list must be closed */ | |
| 818 | luaK_dischargevars(fs, e2); | |
| 819 | luaK_concat(fs, &e2->f, e1->f); | |
| 820 | *e1 = *e2; | |
| 821 | break; | |
| 822 | } | |
| 823 | case OPR_OR: { | |
| 824 | lua_assert(e1->f == NO_JUMP); /* list must be closed */ | |
| 825 | luaK_dischargevars(fs, e2); | |
| 826 | luaK_concat(fs, &e2->t, e1->t); | |
| 827 | *e1 = *e2; | |
| 828 | break; | |
| 829 | } | |
| 830 | case OPR_CONCAT: { | |
| 831 | luaK_exp2val(fs, e2); | |
| 832 | if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) { | |
| 833 | lua_assert(e1->u.info == GETARG_B(getcode(fs, e2))-1); | |
| 834 | freeexp(fs, e1); | |
| 835 | SETARG_B(getcode(fs, e2), e1->u.info); | |
| 836 | e1->k = VRELOCABLE; e1->u.info = e2->u.info; | |
| 837 | } | |
| 838 | else { | |
| 839 | luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ | |
| 840 | codearith(fs, OP_CONCAT, e1, e2, line); | |
| 841 | } | |
| 842 | break; | |
| 843 | } | |
| 844 | case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: | |
| 845 | case OPR_MOD: case OPR_POW: { | |
| 846 | codearith(fs, cast(OpCode, op - OPR_ADD + OP_ADD), e1, e2, line); | |
| 847 | break; | |
| 848 | } | |
| 849 | case OPR_EQ: case OPR_LT: case OPR_LE: { | |
| 850 | codecomp(fs, cast(OpCode, op - OPR_EQ + OP_EQ), 1, e1, e2); | |
| 851 | break; | |
| 852 | } | |
| 853 | case OPR_NE: case OPR_GT: case OPR_GE: { | |
| 854 | codecomp(fs, cast(OpCode, op - OPR_NE + OP_EQ), 0, e1, e2); | |
| 855 | break; | |
| 856 | } | |
| 857 | default: lua_assert(0); | |
| 858 | } | |
| 814 | expdesc *e1, expdesc *e2, int line) { | |
| 815 | switch (op) { | |
| 816 | case OPR_AND: { | |
| 817 | lua_assert(e1->t == NO_JUMP); /* list must be closed */ | |
| 818 | luaK_dischargevars(fs, e2); | |
| 819 | luaK_concat(fs, &e2->f, e1->f); | |
| 820 | *e1 = *e2; | |
| 821 | break; | |
| 822 | } | |
| 823 | case OPR_OR: { | |
| 824 | lua_assert(e1->f == NO_JUMP); /* list must be closed */ | |
| 825 | luaK_dischargevars(fs, e2); | |
| 826 | luaK_concat(fs, &e2->t, e1->t); | |
| 827 | *e1 = *e2; | |
| 828 | break; | |
| 829 | } | |
| 830 | case OPR_CONCAT: { | |
| 831 | luaK_exp2val(fs, e2); | |
| 832 | if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) { | |
| 833 | lua_assert(e1->u.info == GETARG_B(getcode(fs, e2))-1); | |
| 834 | freeexp(fs, e1); | |
| 835 | SETARG_B(getcode(fs, e2), e1->u.info); | |
| 836 | e1->k = VRELOCABLE; e1->u.info = e2->u.info; | |
| 837 | } | |
| 838 | else { | |
| 839 | luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ | |
| 840 | codearith(fs, OP_CONCAT, e1, e2, line); | |
| 841 | } | |
| 842 | break; | |
| 843 | } | |
| 844 | case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: | |
| 845 | case OPR_MOD: case OPR_POW: { | |
| 846 | codearith(fs, cast(OpCode, op - OPR_ADD + OP_ADD), e1, e2, line); | |
| 847 | break; | |
| 848 | } | |
| 849 | case OPR_EQ: case OPR_LT: case OPR_LE: { | |
| 850 | codecomp(fs, cast(OpCode, op - OPR_EQ + OP_EQ), 1, e1, e2); | |
| 851 | break; | |
| 852 | } | |
| 853 | case OPR_NE: case OPR_GT: case OPR_GE: { | |
| 854 | codecomp(fs, cast(OpCode, op - OPR_NE + OP_EQ), 0, e1, e2); | |
| 855 | break; | |
| 856 | } | |
| 857 | default: lua_assert(0); | |
| 858 | } | |
| 859 | 859 | } |
| 860 | 860 | |
| 861 | 861 | |
| 862 | 862 | void luaK_fixline (FuncState *fs, int line) { |
| 863 | ||
| 863 | fs->f->lineinfo[fs->pc - 1] = line; | |
| 864 | 864 | } |
| 865 | 865 | |
| 866 | 866 | |
| 867 | 867 | void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { |
| 868 | int c = (nelems - 1)/LFIELDS_PER_FLUSH + 1; | |
| 869 | int b = (tostore == LUA_MULTRET) ? 0 : tostore; | |
| 870 | lua_assert(tostore != 0); | |
| 871 | if (c <= MAXARG_C) | |
| 872 | luaK_codeABC(fs, OP_SETLIST, base, b, c); | |
| 873 | else if (c <= MAXARG_Ax) { | |
| 874 | luaK_codeABC(fs, OP_SETLIST, base, b, 0); | |
| 875 | codeextraarg(fs, c); | |
| 876 | } | |
| 877 | else | |
| 878 | luaX_syntaxerror(fs->ls, "constructor too long"); | |
| 879 | fs->freereg = base + 1; /* free registers with list values */ | |
| 868 | int c = (nelems - 1)/LFIELDS_PER_FLUSH + 1; | |
| 869 | int b = (tostore == LUA_MULTRET) ? 0 : tostore; | |
| 870 | lua_assert(tostore != 0); | |
| 871 | if (c <= MAXARG_C) | |
| 872 | luaK_codeABC(fs, OP_SETLIST, base, b, c); | |
| 873 | else if (c <= MAXARG_Ax) { | |
| 874 | luaK_codeABC(fs, OP_SETLIST, base, b, 0); | |
| 875 | codeextraarg(fs, c); | |
| 876 | } | |
| 877 | else | |
| 878 | luaX_syntaxerror(fs->ls, "constructor too long"); | |
| 879 | fs->freereg = base + 1; /* free registers with list values */ | |
| 880 | 880 | } |
| 881 |
| r31373 | r31374 | |
|---|---|---|
| 102 | 102 | |
| 103 | 103 | /* Return the current wall-clock time */ |
| 104 | 104 | static sqlite3_int64 timeOfDay(void){ |
| 105 | static sqlite3_vfs *clockVfs = 0; | |
| 106 | sqlite3_int64 t; | |
| 107 | if( clockVfs==0 ) clockVfs = sqlite3_vfs_find(0); | |
| 108 | if( clockVfs->iVersion>=1 && clockVfs->xCurrentTimeInt64!=0 ){ | |
| 109 | clockVfs->xCurrentTimeInt64(clockVfs, &t); | |
| 110 | }else{ | |
| 111 | double r; | |
| 112 | clockVfs->xCurrentTime(clockVfs, &r); | |
| 113 | t = (sqlite3_int64)(r*86400000.0); | |
| 114 | } | |
| 115 | return t; | |
| 105 | static sqlite3_vfs *clockVfs = 0; | |
| 106 | sqlite3_int64 t; | |
| 107 | if( clockVfs==0 ) clockVfs = sqlite3_vfs_find(0); | |
| 108 | if( clockVfs->iVersion>=1 && clockVfs->xCurrentTimeInt64!=0 ){ | |
| 109 | clockVfs->xCurrentTimeInt64(clockVfs, &t); | |
| 110 | }else{ | |
| 111 | double r; | |
| 112 | clockVfs->xCurrentTime(clockVfs, &r); | |
| 113 | t = (sqlite3_int64)(r*86400000.0); | |
| 114 | } | |
| 115 | return t; | |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | #if !defined(_WIN32) && !defined(WIN32) && !defined(_WRS_KERNEL) \ |
| 119 | ||
| 119 | && !defined(__minux) | |
| 120 | 120 | #include <sys/time.h> |
| 121 | 121 | #include <sys/resource.h> |
| 122 | 122 | |
| r31373 | r31374 | |
| 128 | 128 | ** Begin timing an operation |
| 129 | 129 | */ |
| 130 | 130 | static void beginTimer(void){ |
| 131 | if( enableTimer ){ | |
| 132 | getrusage(RUSAGE_SELF, &sBegin); | |
| 133 | iBegin = timeOfDay(); | |
| 134 | } | |
| 131 | if( enableTimer ){ | |
| 132 | getrusage(RUSAGE_SELF, &sBegin); | |
| 133 | iBegin = timeOfDay(); | |
| 134 | } | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /* Return the difference of two time_structs in seconds */ |
| 138 | 138 | static double timeDiff(struct timeval *pStart, struct timeval *pEnd){ |
| 139 | return (pEnd->tv_usec - pStart->tv_usec)*0.000001 + | |
| 140 | (double)(pEnd->tv_sec - pStart->tv_sec); | |
| 139 | return (pEnd->tv_usec - pStart->tv_usec)*0.000001 + | |
| 140 | (double)(pEnd->tv_sec - pStart->tv_sec); | |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /* |
| 144 | 144 | ** Print the timing results. |
| 145 | 145 | */ |
| 146 | 146 | static void endTimer(void){ |
| 147 | if( enableTimer ){ | |
| 148 | struct rusage sEnd; | |
| 149 | sqlite3_int64 iEnd = timeOfDay(); | |
| 150 | getrusage(RUSAGE_SELF, &sEnd); | |
| 151 | printf("Run Time: real %.3f user %f sys %f\n", | |
| 152 | (iEnd - iBegin)*0.001, | |
| 153 | timeDiff(&sBegin.ru_utime, &sEnd.ru_utime), | |
| 154 | timeDiff(&sBegin.ru_stime, &sEnd.ru_stime)); | |
| 155 | } | |
| 147 | if( enableTimer ){ | |
| 148 | struct rusage sEnd; | |
| 149 | sqlite3_int64 iEnd = timeOfDay(); | |
| 150 | getrusage(RUSAGE_SELF, &sEnd); | |
| 151 | printf("Run Time: real %.3f user %f sys %f\n", | |
| 152 | (iEnd - iBegin)*0.001, | |
| 153 | timeDiff(&sBegin.ru_utime, &sEnd.ru_utime), | |
| 154 | timeDiff(&sBegin.ru_stime, &sEnd.ru_stime)); | |
| 155 | } | |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | #define BEGIN_TIMER beginTimer() |
| r31373 | r31374 | |
| 176 | 176 | ** support found (or found previously). |
| 177 | 177 | */ |
| 178 | 178 | static int hasTimer(void){ |
| 179 | if( getProcessTimesAddr ){ | |
| 180 | return 1; | |
| 181 | } else { | |
| 182 | /* GetProcessTimes() isn't supported in WIN95 and some other Windows versions. | |
| 183 | ** See if the version we are running on has it, and if it does, save off | |
| 184 | ** a pointer to it and the current process handle. | |
| 185 | */ | |
| 186 | hProcess = GetCurrentProcess(); | |
| 187 | if( hProcess ){ | |
| 188 | HINSTANCE hinstLib = LoadLibrary(TEXT("Kernel32.dll")); | |
| 189 | if( NULL != hinstLib ){ | |
| 190 | getProcessTimesAddr = (GETPROCTIMES) GetProcAddress(hinstLib, "GetProcessTimes"); | |
| 191 | if( NULL != getProcessTimesAddr ){ | |
| 192 | return 1; | |
| 193 | } | |
| 194 | FreeLibrary(hinstLib); | |
| 195 | } | |
| 196 | } | |
| 197 | } | |
| 198 | return 0; | |
| 179 | if( getProcessTimesAddr ){ | |
| 180 | return 1; | |
| 181 | } else { | |
| 182 | /* GetProcessTimes() isn't supported in WIN95 and some other Windows versions. | |
| 183 | ** See if the version we are running on has it, and if it does, save off | |
| 184 | ** a pointer to it and the current process handle. | |
| 185 | */ | |
| 186 | hProcess = GetCurrentProcess(); | |
| 187 | if( hProcess ){ | |
| 188 | HINSTANCE hinstLib = LoadLibrary(TEXT("Kernel32.dll")); | |
| 189 | if( NULL != hinstLib ){ | |
| 190 | getProcessTimesAddr = (GETPROCTIMES) GetProcAddress(hinstLib, "GetProcessTimes"); | |
| 191 | if( NULL != getProcessTimesAddr ){ | |
| 192 | return 1; | |
| 193 | } | |
| 194 | FreeLibrary(hinstLib); | |
| 195 | } | |
| 196 | } | |
| 197 | } | |
| 198 | return 0; | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | /* |
| 202 | 202 | ** Begin timing an operation |
| 203 | 203 | */ |
| 204 | 204 | static void beginTimer(void){ |
| 205 | if( enableTimer && getProcessTimesAddr ){ | |
| 206 | FILETIME ftCreation, ftExit; | |
| 207 | getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelBegin, &ftUserBegin); | |
| 208 | ftWallBegin = timeOfDay(); | |
| 209 | } | |
| 205 | if( enableTimer && getProcessTimesAddr ){ | |
| 206 | FILETIME ftCreation, ftExit; | |
| 207 | getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelBegin, &ftUserBegin); | |
| 208 | ftWallBegin = timeOfDay(); | |
| 209 | } | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | /* Return the difference of two FILETIME structs in seconds */ |
| 213 | 213 | static double timeDiff(FILETIME *pStart, FILETIME *pEnd){ |
| 214 | sqlite_int64 i64Start = *((sqlite_int64 *) pStart); | |
| 215 | sqlite_int64 i64End = *((sqlite_int64 *) pEnd); | |
| 216 | return (double) ((i64End - i64Start) / 10000000.0); | |
| 214 | sqlite_int64 i64Start = *((sqlite_int64 *) pStart); | |
| 215 | sqlite_int64 i64End = *((sqlite_int64 *) pEnd); | |
| 216 | return (double) ((i64End - i64Start) / 10000000.0); | |
| 217 | 217 | } |
| 218 | 218 | |
| 219 | 219 | /* |
| 220 | 220 | ** Print the timing results. |
| 221 | 221 | */ |
| 222 | 222 | static void endTimer(void){ |
| 223 | if( enableTimer && getProcessTimesAddr){ | |
| 224 | FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd; | |
| 225 | sqlite3_int64 ftWallEnd = timeOfDay(); | |
| 226 | getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd); | |
| 227 | printf("Run Time: real %.3f user %f sys %f\n", | |
| 228 | (ftWallEnd - ftWallBegin)*0.001, | |
| 229 | timeDiff(&ftUserBegin, &ftUserEnd), | |
| 230 | timeDiff(&ftKernelBegin, &ftKernelEnd)); | |
| 231 | } | |
| 223 | if( enableTimer && getProcessTimesAddr){ | |
| 224 | FILETIME ftCreation, ftExit, ftKernelEnd, ftUserEnd; | |
| 225 | sqlite3_int64 ftWallEnd = timeOfDay(); | |
| 226 | getProcessTimesAddr(hProcess, &ftCreation, &ftExit, &ftKernelEnd, &ftUserEnd); | |
| 227 | printf("Run Time: real %.3f user %f sys %f\n", | |
| 228 | (ftWallEnd - ftWallBegin)*0.001, | |
| 229 | timeDiff(&ftUserBegin, &ftUserEnd), | |
| 230 | timeDiff(&ftKernelBegin, &ftKernelEnd)); | |
| 231 | } | |
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | #define BEGIN_TIMER beginTimer() |
| r31373 | r31374 | |
| 236 | 236 | #define HAS_TIMER hasTimer() |
| 237 | 237 | |
| 238 | 238 | #else |
| 239 | #define BEGIN_TIMER | |
| 239 | #define BEGIN_TIMER | |
| 240 | 240 | #define END_TIMER |
| 241 | 241 | #define HAS_TIMER 0 |
| 242 | 242 | #endif |
| r31373 | r31374 | |
| 298 | 298 | */ |
| 299 | 299 | #ifdef SQLITE_ENABLE_IOTRACE |
| 300 | 300 | static void iotracePrintf(const char *zFormat, ...){ |
| 301 | va_list ap; | |
| 302 | char *z; | |
| 303 | if( iotrace==0 ) return; | |
| 304 | va_start(ap, zFormat); | |
| 305 | z = sqlite3_vmprintf(zFormat, ap); | |
| 306 | va_end(ap); | |
| 307 | fprintf(iotrace, "%s", z); | |
| 308 | sqlite3_free(z); | |
| 301 | va_list ap; | |
| 302 | char *z; | |
| 303 | if( iotrace==0 ) return; | |
| 304 | va_start(ap, zFormat); | |
| 305 | z = sqlite3_vmprintf(zFormat, ap); | |
| 306 | va_end(ap); | |
| 307 | fprintf(iotrace, "%s", z); | |
| 308 | sqlite3_free(z); | |
| 309 | 309 | } |
| 310 | 310 | #endif |
| 311 | 311 | |
| r31373 | r31374 | |
| 314 | 314 | ** Determines if a string is a number of not. |
| 315 | 315 | */ |
| 316 | 316 | static int isNumber(const char *z, int *realnum){ |
| 317 | if( *z=='-' || *z=='+' ) z++; | |
| 318 | if( !IsDigit(*z) ){ | |
| 319 | return 0; | |
| 320 | } | |
| 321 | z++; | |
| 322 | if( realnum ) *realnum = 0; | |
| 323 | while( IsDigit(*z) ){ z++; } | |
| 324 | if( *z=='.' ){ | |
| 325 | z++; | |
| 326 | if( !IsDigit(*z) ) return 0; | |
| 327 | while( IsDigit(*z) ){ z++; } | |
| 328 | if( realnum ) *realnum = 1; | |
| 329 | } | |
| 330 | if( *z=='e' || *z=='E' ){ | |
| 331 | z++; | |
| 332 | if( *z=='+' || *z=='-' ) z++; | |
| 333 | if( !IsDigit(*z) ) return 0; | |
| 334 | while( IsDigit(*z) ){ z++; } | |
| 335 | if( realnum ) *realnum = 1; | |
| 336 | } | |
| 337 | return *z==0; | |
| 317 | if( *z=='-' || *z=='+' ) z++; | |
| 318 | if( !IsDigit(*z) ){ | |
| 319 | return 0; | |
| 320 | } | |
| 321 | z++; | |
| 322 | if( realnum ) *realnum = 0; | |
| 323 | while( IsDigit(*z) ){ z++; } | |
| 324 | if( *z=='.' ){ | |
| 325 | z++; | |
| 326 | if( !IsDigit(*z) ) return 0; | |
| 327 | while( IsDigit(*z) ){ z++; } | |
| 328 | if( realnum ) *realnum = 1; | |
| 329 | } | |
| 330 | if( *z=='e' || *z=='E' ){ | |
| 331 | z++; | |
| 332 | if( *z=='+' || *z=='-' ) z++; | |
| 333 | if( !IsDigit(*z) ) return 0; | |
| 334 | while( IsDigit(*z) ){ z++; } | |
| 335 | if( realnum ) *realnum = 1; | |
| 336 | } | |
| 337 | return *z==0; | |
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /* |
| 341 | ** A global char* and an SQL function to access its current value | |
| 342 | ** from within an SQL statement. This program used to use the | |
| 341 | ** A global char* and an SQL function to access its current value | |
| 342 | ** from within an SQL statement. This program used to use the | |
| 343 | 343 | ** sqlite_exec_printf() API to substitue a string into an SQL statement. |
| 344 | 344 | ** The correct way to do this with sqlite3 is to use the bind API, but |
| 345 | 345 | ** since the shell is built around the callback paradigm it would be a lot |
| r31373 | r31374 | |
| 347 | 347 | */ |
| 348 | 348 | static const char *zShellStatic = 0; |
| 349 | 349 | static void shellstaticFunc( |
| 350 | sqlite3_context *context, | |
| 351 | int argc, | |
| 352 | sqlite3_value **argv | |
| 350 | sqlite3_context *context, | |
| 351 | int argc, | |
| 352 | sqlite3_value **argv | |
| 353 | 353 | ){ |
| 354 | assert( 0==argc ); | |
| 355 | assert( zShellStatic ); | |
| 356 | UNUSED_PARAMETER(argc); | |
| 357 | UNUSED_PARAMETER(argv); | |
| 358 | sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC); | |
| 354 | assert( 0==argc ); | |
| 355 | assert( zShellStatic ); | |
| 356 | UNUSED_PARAMETER(argc); | |
| 357 | UNUSED_PARAMETER(argv); | |
| 358 | sqlite3_result_text(context, zShellStatic, -1, SQLITE_STATIC); | |
| 359 | 359 | } |
| 360 | 360 | |
| 361 | 361 | |
| r31373 | r31374 | |
| 369 | 369 | ** a previous call to this routine that may be reused. |
| 370 | 370 | */ |
| 371 | 371 | static char *local_getline(char *zLine, FILE *in){ |
| 372 | int nLine = zLine==0 ? 0 : 100; | |
| 373 | int n = 0; | |
| 372 | int nLine = zLine==0 ? 0 : 100; | |
| 373 | int n = 0; | |
| 374 | 374 | |
| 375 | while( 1 ){ | |
| 376 | if( n+100>nLine ){ | |
| 377 | nLine = nLine*2 + 100; | |
| 378 | zLine = (char*)realloc(zLine, nLine); | |
| 379 | if( zLine==0 ) return 0; | |
| 380 | } | |
| 381 | if( fgets(&zLine[n], nLine - n, in)==0 ){ | |
| 382 | if( n==0 ){ | |
| 383 | free(zLine); | |
| 384 | return 0; | |
| 385 | } | |
| 386 | zLine[n] = 0; | |
| 387 | break; | |
| 388 | } | |
| 389 | while( zLine[n] ) n++; | |
| 390 | if( n>0 && zLine[n-1]=='\n' ){ | |
| 391 | n--; | |
| 392 | if( n>0 && zLine[n-1]=='\r' ) n--; | |
| 393 | zLine[n] = 0; | |
| 394 | break; | |
| 395 | } | |
| 396 | } | |
| 397 | return zLine; | |
| 375 | while( 1 ){ | |
| 376 | if( n+100>nLine ){ | |
| 377 | nLine = nLine*2 + 100; | |
| 378 | zLine = (char*)realloc(zLine, nLine); | |
| 379 | if( zLine==0 ) return 0; | |
| 380 | } | |
| 381 | if( fgets(&zLine[n], nLine - n, in)==0 ){ | |
| 382 | if( n==0 ){ | |
| 383 | free(zLine); | |
| 384 | return 0; | |
| 385 | } | |
| 386 | zLine[n] = 0; | |
| 387 | break; | |
| 388 | } | |
| 389 | while( zLine[n] ) n++; | |
| 390 | if( n>0 && zLine[n-1]=='\n' ){ | |
| 391 | n--; | |
| 392 | if( n>0 && zLine[n-1]=='\r' ) n--; | |
| 393 | zLine[n] = 0; | |
| 394 | break; | |
| 395 | } | |
| 396 | } | |
| 397 | return zLine; | |
| 398 | 398 | } |
| 399 | 399 | |
| 400 | 400 | /* |
| r31373 | r31374 | |
| 412 | 412 | ** zPrior argument for reuse. |
| 413 | 413 | */ |
| 414 | 414 | static char *one_input_line(FILE *in, char *zPrior, int isContinuation){ |
| 415 | char *zPrompt; | |
| 416 | char *zResult; | |
| 417 | if( in!=0 ){ | |
| 418 | zResult = local_getline(zPrior, in); | |
| 419 | }else{ | |
| 420 | zPrompt = isContinuation ? continuePrompt : mainPrompt; | |
| 415 | char *zPrompt; | |
| 416 | char *zResult; | |
| 417 | if( in!=0 ){ | |
| 418 | zResult = local_getline(zPrior, in); | |
| 419 | }else{ | |
| 420 | zPrompt = isContinuation ? continuePrompt : mainPrompt; | |
| 421 | 421 | #if defined(HAVE_READLINE) |
| 422 | free(zPrior); | |
| 423 | zResult = readline(zPrompt); | |
| 424 | if( zResult && *zResult ) add_history(zResult); | |
| 422 | free(zPrior); | |
| 423 | zResult = readline(zPrompt); | |
| 424 | if( zResult && *zResult ) add_history(zResult); | |
| 425 | 425 | #else |
| 426 | printf("%s", zPrompt); | |
| 427 | fflush(stdout); | |
| 428 | zResult = local_getline(zPrior, stdin); | |
| 426 | printf("%s", zPrompt); | |
| 427 | fflush(stdout); | |
| 428 | zResult = local_getline(zPrior, stdin); | |
| 429 | 429 | #endif |
| 430 | } | |
| 431 | return zResult; | |
| 430 | } | |
| 431 | return zResult; | |
| 432 | 432 | } |
| 433 | 433 | |
| 434 | 434 | struct previous_mode_data { |
| 435 | int valid; /* Is there legit data in here? */ | |
| 436 | int mode; | |
| 437 | int showHeader; | |
| 438 | int colWidth[100]; | |
| 435 | int valid; /* Is there legit data in here? */ | |
| 436 | int mode; | |
| 437 | int showHeader; | |
| 438 | int colWidth[100]; | |
| 439 | 439 | }; |
| 440 | 440 | |
| 441 | 441 | /* |
| r31373 | r31374 | |
| 444 | 444 | ** state and mode information. |
| 445 | 445 | */ |
| 446 | 446 | struct callback_data { |
| 447 | sqlite3 *db; /* The database */ | |
| 448 | int echoOn; /* True to echo input commands */ | |
| 449 | int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL statement */ | |
| 450 | int statsOn; /* True to display memory stats before each finalize */ | |
| 451 | int cnt; /* Number of records displayed so far */ | |
| 452 | FILE *out; /* Write results here */ | |
| 453 | FILE *traceOut; /* Output for sqlite3_trace() */ | |
| 454 | int nErr; /* Number of errors seen */ | |
| 455 | int mode; /* An output mode setting */ | |
| 456 | int writableSchema; /* True if PRAGMA writable_schema=ON */ | |
| 457 | int showHeader; /* True to show column names in List or Column mode */ | |
| 458 | char *zDestTable; /* Name of destination table when MODE_Insert */ | |
| 459 | char separator[20]; /* Separator character for MODE_List */ | |
| 460 | int colWidth[100]; /* Requested width of each column when in column mode*/ | |
| 461 | int actualWidth[100]; /* Actual width of each column */ | |
| 462 | char nullvalue[20]; /* The text to print when a NULL comes back from | |
| 447 | sqlite3 *db; /* The database */ | |
| 448 | int echoOn; /* True to echo input commands */ | |
| 449 | int autoEQP; /* Run EXPLAIN QUERY PLAN prior to seach SQL statement */ | |
| 450 | int statsOn; /* True to display memory stats before each finalize */ | |
| 451 | int cnt; /* Number of records displayed so far */ | |
| 452 | FILE *out; /* Write results here */ | |
| 453 | FILE *traceOut; /* Output for sqlite3_trace() */ | |
| 454 | int nErr; /* Number of errors seen */ | |
| 455 | int mode; /* An output mode setting */ | |
| 456 | int writableSchema; /* True if PRAGMA writable_schema=ON */ | |
| 457 | int showHeader; /* True to show column names in List or Column mode */ | |
| 458 | char *zDestTable; /* Name of destination table when MODE_Insert */ | |
| 459 | char separator[20]; /* Separator character for MODE_List */ | |
| 460 | int colWidth[100]; /* Requested width of each column when in column mode*/ | |
| 461 | int actualWidth[100]; /* Actual width of each column */ | |
| 462 | char nullvalue[20]; /* The text to print when a NULL comes back from | |
| 463 | 463 | ** the database */ |
| 464 | struct previous_mode_data explainPrev; | |
| 465 | /* Holds the mode information just before | |
| 466 | ** .explain ON */ | |
| 467 | char outfile[FILENAME_MAX]; /* Filename for *out */ | |
| 468 | const char *zDbFilename; /* name of the database file */ | |
| 469 | char *zFreeOnClose; /* Filename to free when closing */ | |
| 470 | const char *zVfs; /* Name of VFS to use */ | |
| 471 | sqlite3_stmt *pStmt; /* Current statement if any. */ | |
| 472 | FILE *pLog; /* Write log output here */ | |
| 473 | int *aiIndent; /* Array of indents used in MODE_Explain */ | |
| 474 | int nIndent; /* Size of array aiIndent[] */ | |
| 475 | int iIndent; /* Index of current op in aiIndent[] */ | |
| 464 | struct previous_mode_data explainPrev; | |
| 465 | /* Holds the mode information just before | |
| 466 | ** .explain ON */ | |
| 467 | char outfile[FILENAME_MAX]; /* Filename for *out */ | |
| 468 | const char *zDbFilename; /* name of the database file */ | |
| 469 | char *zFreeOnClose; /* Filename to free when closing */ | |
| 470 | const char *zVfs; /* Name of VFS to use */ | |
| 471 | sqlite3_stmt *pStmt; /* Current statement if any. */ | |
| 472 | FILE *pLog; /* Write log output here */ | |
| 473 | int *aiIndent; /* Array of indents used in MODE_Explain */ | |
| 474 | int nIndent; /* Size of array aiIndent[] */ | |
| 475 | int iIndent; /* Index of current op in aiIndent[] */ | |
| 476 | 476 | }; |
| 477 | 477 | |
| 478 | 478 | /* |
| r31373 | r31374 | |
| 489 | 489 | #define MODE_Explain 8 /* Like MODE_Column, but do not truncate data */ |
| 490 | 490 | |
| 491 | 491 | static const char *modeDescr[] = { |
| 492 | "line", | |
| 493 | "column", | |
| 494 | "list", | |
| 495 | "semi", | |
| 496 | "html", | |
| 497 | "insert", | |
| 498 | "tcl", | |
| 499 | "csv", | |
| 500 | "explain", | |
| 492 | "line", | |
| 493 | "column", | |
| 494 | "list", | |
| 495 | "semi", | |
| 496 | "html", | |
| 497 | "insert", | |
| 498 | "tcl", | |
| 499 | "csv", | |
| 500 | "explain", | |
| 501 | 501 | }; |
| 502 | 502 | |
| 503 | 503 | /* |
| r31373 | r31374 | |
| 510 | 510 | ** lower 30 bits of a 32-bit signed integer. |
| 511 | 511 | */ |
| 512 | 512 | static int strlen30(const char *z){ |
| 513 | const char *z2 = z; | |
| 514 | while( *z2 ){ z2++; } | |
| 515 | return 0x3fffffff & (int)(z2 - z); | |
| 513 | const char *z2 = z; | |
| 514 | while( *z2 ){ z2++; } | |
| 515 | return 0x3fffffff & (int)(z2 - z); | |
| 516 | 516 | } |
| 517 | 517 | |
| 518 | 518 | /* |
| 519 | 519 | ** A callback for the sqlite3_log() interface. |
| 520 | 520 | */ |
| 521 | 521 | static void shellLog(void *pArg, int iErrCode, const char *zMsg){ |
| 522 | struct callback_data *p = (struct callback_data*)pArg; | |
| 523 | if( p->pLog==0 ) return; | |
| 524 | fprintf(p->pLog, "(%d) %s\n", iErrCode, zMsg); | |
| 525 | fflush(p->pLog); | |
| 522 | struct callback_data *p = (struct callback_data*)pArg; | |
| 523 | if( p->pLog==0 ) return; | |
| 524 | fprintf(p->pLog, "(%d) %s\n", iErrCode, zMsg); | |
| 525 | fflush(p->pLog); | |
| 526 | 526 | } |
| 527 | 527 | |
| 528 | 528 | /* |
| 529 | 529 | ** Output the given string as a hex-encoded blob (eg. X'1234' ) |
| 530 | 530 | */ |
| 531 | 531 | static void output_hex_blob(FILE *out, const void *pBlob, int nBlob){ |
| 532 | int i; | |
| 533 | char *zBlob = (char *)pBlob; | |
| 534 | fprintf(out,"X'"); | |
| 535 | for(i=0; i<nBlob; i++){ fprintf(out,"%02x",zBlob[i]&0xff); } | |
| 536 | fprintf(out,"'"); | |
| 532 | int i; | |
| 533 | char *zBlob = (char *)pBlob; | |
| 534 | fprintf(out,"X'"); | |
| 535 | for(i=0; i<nBlob; i++){ fprintf(out,"%02x",zBlob[i]&0xff); } | |
| 536 | fprintf(out,"'"); | |
| 537 | 537 | } |
| 538 | 538 | |
| 539 | 539 | /* |
| 540 | 540 | ** Output the given string as a quoted string using SQL quoting conventions. |
| 541 | 541 | */ |
| 542 | 542 | static void output_quoted_string(FILE *out, const char *z){ |
| 543 | int i; | |
| 544 | int nSingle = 0; | |
| 545 | for(i=0; z[i]; i++){ | |
| 546 | if( z[i]=='\'' ) nSingle++; | |
| 547 | } | |
| 548 | if( nSingle==0 ){ | |
| 549 | fprintf(out,"'%s'",z); | |
| 550 | }else{ | |
| 551 | fprintf(out,"'"); | |
| 552 | while( *z ){ | |
| 553 | for(i=0; z[i] && z[i]!='\''; i++){} | |
| 554 | if( i==0 ){ | |
| 555 | fprintf(out,"''"); | |
| 556 | z++; | |
| 557 | }else if( z[i]=='\'' ){ | |
| 558 | fprintf(out,"%.*s''",i,z); | |
| 559 | z += i+1; | |
| 560 | }else{ | |
| 561 | fprintf(out,"%s",z); | |
| 562 | break; | |
| 563 | } | |
| 564 | } | |
| 565 | fprintf(out,"'"); | |
| 566 | } | |
| 543 | int i; | |
| 544 | int nSingle = 0; | |
| 545 | for(i=0; z[i]; i++){ | |
| 546 | if( z[i]=='\'' ) nSingle++; | |
| 547 | } | |
| 548 | if( nSingle==0 ){ | |
| 549 | fprintf(out,"'%s'",z); | |
| 550 | }else{ | |
| 551 | fprintf(out,"'"); | |
| 552 | while( *z ){ | |
| 553 | for(i=0; z[i] && z[i]!='\''; i++){} | |
| 554 | if( i==0 ){ | |
| 555 | fprintf(out,"''"); | |
| 556 | z++; | |
| 557 | }else if( z[i]=='\'' ){ | |
| 558 | fprintf(out,"%.*s''",i,z); | |
| 559 | z += i+1; | |
| 560 | }else{ | |
| 561 | fprintf(out,"%s",z); | |
| 562 | break; | |
| 563 | } | |
| 564 | } | |
| 565 | fprintf(out,"'"); | |
| 566 | } | |
| 567 | 567 | } |
| 568 | 568 | |
| 569 | 569 | /* |
| 570 | 570 | ** Output the given string as a quoted according to C or TCL quoting rules. |
| 571 | 571 | */ |
| 572 | 572 | static void output_c_string(FILE *out, const char *z){ |
| 573 | unsigned int c; | |
| 574 | fputc('"', out); | |
| 575 | while( (c = *(z++))!=0 ){ | |
| 576 | if( c=='\\' ){ | |
| 577 | fputc(c, out); | |
| 578 | fputc(c, out); | |
| 579 | }else if( c=='"' ){ | |
| 580 | fputc('\\', out); | |
| 581 | fputc('"', out); | |
| 582 | }else if( c=='\t' ){ | |
| 583 | fputc('\\', out); | |
| 584 | fputc('t', out); | |
| 585 | }else if( c=='\n' ){ | |
| 586 | fputc('\\', out); | |
| 587 | fputc('n', out); | |
| 588 | }else if( c=='\r' ){ | |
| 589 | fputc('\\', out); | |
| 590 | fputc('r', out); | |
| 591 | }else if( !isprint(c&0xff) ){ | |
| 592 | fprintf(out, "\\%03o", c&0xff); | |
| 593 | }else{ | |
| 594 | fputc(c, out); | |
| 595 | } | |
| 596 | } | |
| 597 | fputc('"', out); | |
| 573 | unsigned int c; | |
| 574 | fputc('"', out); | |
| 575 | while( (c = *(z++))!=0 ){ | |
| 576 | if( c=='\\' ){ | |
| 577 | fputc(c, out); | |
| 578 | fputc(c, out); | |
| 579 | }else if( c=='"' ){ | |
| 580 | fputc('\\', out); | |
| 581 | fputc('"', out); | |
| 582 | }else if( c=='\t' ){ | |
| 583 | fputc('\\', out); | |
| 584 | fputc('t', out); | |
| 585 | }else if( c=='\n' ){ | |
| 586 | fputc('\\', out); | |
| 587 | fputc('n', out); | |
| 588 | }else if( c=='\r' ){ | |
| 589 | fputc('\\', out); | |
| 590 | fputc('r', out); | |
| 591 | }else if( !isprint(c&0xff) ){ | |
| 592 | fprintf(out, "\\%03o", c&0xff); | |
| 593 | }else{ | |
| 594 | fputc(c, out); | |
| 595 | } | |
| 596 | } | |
| 597 | fputc('"', out); | |
| 598 | 598 | } |
| 599 | 599 | |
| 600 | 600 | /* |
| r31373 | r31374 | |
| 602 | 602 | ** HTML escaped. |
| 603 | 603 | */ |
| 604 | 604 | static void output_html_string(FILE *out, const char *z){ |
| 605 | int i; | |
| 606 | if( z==0 ) z = ""; | |
| 607 | while( *z ){ | |
| 608 | for(i=0; z[i] | |
| 609 | && z[i]!='<' | |
| 610 | && z[i]!='&' | |
| 611 | && z[i]!='>' | |
| 612 | && z[i]!='\"' | |
| 613 | && z[i]!='\''; | |
| 614 | i++){} | |
| 615 | if( i>0 ){ | |
| 616 | fprintf(out,"%.*s",i,z); | |
| 617 | } | |
| 618 | if( z[i]=='<' ){ | |
| 619 | fprintf(out,"<"); | |
| 620 | }else if( z[i]=='&' ){ | |
| 621 | fprintf(out,"&"); | |
| 622 | }else if( z[i]=='>' ){ | |
| 623 | fprintf(out,">"); | |
| 624 | }else if( z[i]=='\"' ){ | |
| 625 | fprintf(out,"""); | |
| 626 | }else if( z[i]=='\'' ){ | |
| 627 | fprintf(out,"'"); | |
| 628 | }else{ | |
| 629 | break; | |
| 630 | } | |
| 631 | z += i + 1; | |
| 632 | } | |
| 605 | int i; | |
| 606 | if( z==0 ) z = ""; | |
| 607 | while( *z ){ | |
| 608 | for(i=0; z[i] | |
| 609 | && z[i]!='<' | |
| 610 | && z[i]!='&' | |
| 611 | && z[i]!='>' | |
| 612 | && z[i]!='\"' | |
| 613 | && z[i]!='\''; | |
| 614 | i++){} | |
| 615 | if( i>0 ){ | |
| 616 | fprintf(out,"%.*s",i,z); | |
| 617 | } | |
| 618 | if( z[i]=='<' ){ | |
| 619 | fprintf(out,"<"); | |
| 620 | }else if( z[i]=='&' ){ | |
| 621 | fprintf(out,"&"); | |
| 622 | }else if( z[i]=='>' ){ | |
| 623 | fprintf(out,">"); | |
| 624 | }else if( z[i]=='\"' ){ | |
| 625 | fprintf(out,"""); | |
| 626 | }else if( z[i]=='\'' ){ | |
| 627 | fprintf(out,"'"); | |
| 628 | }else{ | |
| 629 | break; | |
| 630 | } | |
| 631 | z += i + 1; | |
| 632 | } | |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | 635 | /* |
| r31373 | r31374 | |
| 637 | 637 | ** array, then the string must be quoted for CSV. |
| 638 | 638 | */ |
| 639 | 639 | static const char needCsvQuote[] = { |
| 640 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 641 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 642 | 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 643 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 644 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 645 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 646 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 647 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, | |
| 648 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 649 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 650 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 651 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 652 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 653 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 654 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 655 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 640 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 641 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 642 | 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 643 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 644 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 645 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 646 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, | |
| 647 | 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, | |
| 648 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 649 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 650 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 651 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 652 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 653 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 654 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 655 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, | |
| 656 | 656 | }; |
| 657 | 657 | |
| 658 | 658 | /* |
| r31373 | r31374 | |
| 661 | 661 | ** the null value. Strings are quoted if necessary. |
| 662 | 662 | */ |
| 663 | 663 | static void output_csv(struct callback_data *p, const char *z, int bSep){ |
| 664 | FILE *out = p->out; | |
| 665 | if( z==0 ){ | |
| 666 | fprintf(out,"%s",p->nullvalue); | |
| 667 | }else{ | |
| 668 | int i; | |
| 669 | int nSep = strlen30(p->separator); | |
| 670 | for(i=0; z[i]; i++){ | |
| 671 | if( needCsvQuote[((unsigned char*)z)[i]] | |
| 672 | || (z[i]==p->separator[0] && | |
| 673 | (nSep==1 || memcmp(z, p->separator, nSep)==0)) ){ | |
| 674 | i = 0; | |
| 675 | break; | |
| 676 | } | |
| 677 | } | |
| 678 | if( i==0 ){ | |
| 679 | putc('"', out); | |
| 680 | for(i=0; z[i]; i++){ | |
| 681 | if( z[i]=='"' ) putc('"', out); | |
| 682 | putc(z[i], out); | |
| 683 | } | |
| 684 | putc('"', out); | |
| 685 | }else{ | |
| 686 | fprintf(out, "%s", z); | |
| 687 | } | |
| 688 | } | |
| 689 | if( bSep ){ | |
| 690 | fprintf(p->out, "%s", p->separator); | |
| 691 | } | |
| 664 | FILE *out = p->out; | |
| 665 | if( z==0 ){ | |
| 666 | fprintf(out,"%s",p->nullvalue); | |
| 667 | }else{ | |
| 668 | int i; | |
| 669 | int nSep = strlen30(p->separator); | |
| 670 | for(i=0; z[i]; i++){ | |
| 671 | if( needCsvQuote[((unsigned char*)z)[i]] | |
| 672 | || (z[i]==p->separator[0] && | |
| 673 | (nSep==1 || memcmp(z, p->separator, nSep)==0)) ){ | |
| 674 | i = 0; | |
| 675 | break; | |
| 676 | } | |
| 677 | } | |
| 678 | if( i==0 ){ | |
| 679 | putc('"', out); | |
| 680 | for(i=0; z[i]; i++){ | |
| 681 | if( z[i]=='"' ) putc('"', out); | |
| 682 | putc(z[i], out); | |
| 683 | } | |
| 684 | putc('"', out); | |
| 685 | }else{ | |
| 686 | fprintf(out, "%s", z); | |
| 687 | } | |
| 688 | } | |
| 689 | if( bSep ){ | |
| 690 | fprintf(p->out, "%s", p->separator); | |
| 691 | } | |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | #ifdef SIGINT |
| r31373 | r31374 | |
| 696 | 696 | ** This routine runs when the user presses Ctrl-C |
| 697 | 697 | */ |
| 698 | 698 | static void interrupt_handler(int NotUsed){ |
| 699 | UNUSED_PARAMETER(NotUsed); | |
| 700 | seenInterrupt = 1; | |
| 701 | if( db ) sqlite3_interrupt(db); | |
| 699 | UNUSED_PARAMETER(NotUsed); | |
| 700 | seenInterrupt = 1; | |
| 701 | if( db ) sqlite3_interrupt(db); | |
| 702 | 702 | } |
| 703 | 703 | #endif |
| 704 | 704 | |
| r31373 | r31374 | |
| 707 | 707 | ** invokes for each row of a query result. |
| 708 | 708 | */ |
| 709 | 709 | static int shell_callback(void *pArg, int nArg, char **azArg, char **azCol, int *aiType){ |
| 710 | int i; | |
| 711 | struct callback_data *p = (struct callback_data*)pArg; | |
| 710 | int i; | |
| 711 | struct callback_data *p = (struct callback_data*)pArg; | |
| 712 | 712 | |
| 713 | switch( p->mode ){ | |
| 714 | case MODE_Line: { | |
| 715 | int w = 5; | |
| 716 | if( azArg==0 ) break; | |
| 717 | for(i=0; i<nArg; i++){ | |
| 718 | int len = strlen30(azCol[i] ? azCol[i] : ""); | |
| 719 | if( len>w ) w = len; | |
| 720 | } | |
| 721 | if( p->cnt++>0 ) fprintf(p->out,"\n"); | |
| 722 | for(i=0; i<nArg; i++){ | |
| 723 | fprintf(p->out,"%*s = %s\n", w, azCol[i], | |
| 724 | azArg[i] ? azArg[i] : p->nullvalue); | |
| 725 | } | |
| 726 | break; | |
| 727 | } | |
| 728 | case MODE_Explain: | |
| 729 | case MODE_Column: { | |
| 730 | if( p->cnt++==0 ){ | |
| 731 | for(i=0; i<nArg; i++){ | |
| 732 | int w, n; | |
| 733 | if( i<ArraySize(p->colWidth) ){ | |
| 734 | w = p->colWidth[i]; | |
| 735 | }else{ | |
| 736 | w = 0; | |
| 737 | } | |
| 738 | if( w==0 ){ | |
| 739 | w = strlen30(azCol[i] ? azCol[i] : ""); | |
| 740 | if( w<10 ) w = 10; | |
| 741 | n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullvalue); | |
| 742 | if( w<n ) w = n; | |
| 743 | } | |
| 744 | if( i<ArraySize(p->actualWidth) ){ | |
| 745 | p->actualWidth[i] = w; | |
| 746 | } | |
| 747 | if( p->showHeader ){ | |
| 748 | if( w<0 ){ | |
| 749 | fprintf(p->out,"%*.*s%s",-w,-w,azCol[i], i==nArg-1 ? "\n": " "); | |
| 750 | }else{ | |
| 751 | fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " "); | |
| 752 | } | |
| 753 | } | |
| 754 | } | |
| 755 | if( p->showHeader ){ | |
| 756 | for(i=0; i<nArg; i++){ | |
| 757 | int w; | |
| 758 | if( i<ArraySize(p->actualWidth) ){ | |
| 759 | w = p->actualWidth[i]; | |
| 760 | if( w<0 ) w = -w; | |
| 761 | }else{ | |
| 762 | w = 10; | |
| 763 | } | |
| 764 | fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------" | |
| 765 | "----------------------------------------------------------", | |
| 766 | i==nArg-1 ? "\n": " "); | |
| 767 | } | |
| 768 | } | |
| 769 | } | |
| 770 | if( azArg==0 ) break; | |
| 771 | for(i=0; i<nArg; i++){ | |
| 772 | int w; | |
| 773 | if( i<ArraySize(p->actualWidth) ){ | |
| 774 | w = p->actualWidth[i]; | |
| 775 | }else{ | |
| 776 | w = 10; | |
| 777 | } | |
| 778 | if( p->mode==MODE_Explain && azArg[i] && strlen30(azArg[i])>w ){ | |
| 779 | w = strlen30(azArg[i]); | |
| 780 | } | |
| 781 | if( i==1 && p->aiIndent && p->pStmt ){ | |
| 782 | if( p->iIndent<p->nIndent ){ | |
| 783 | fprintf(p->out, "%*.s", p->aiIndent[p->iIndent], ""); | |
| 784 | } | |
| 785 | p->iIndent++; | |
| 786 | } | |
| 787 | if( w<0 ){ | |
| 788 | fprintf(p->out,"%*.*s%s",-w,-w, | |
| 789 | azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); | |
| 790 | }else{ | |
| 791 | fprintf(p->out,"%-*.*s%s",w,w, | |
| 792 | azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); | |
| 793 | } | |
| 794 | } | |
| 795 | break; | |
| 796 | } | |
| 797 | case MODE_Semi: | |
| 798 | case MODE_List: { | |
| 799 | if( p->cnt++==0 && p->showHeader ){ | |
| 800 | for(i=0; i<nArg; i++){ | |
| 801 | fprintf(p->out,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator); | |
| 802 | } | |
| 803 | } | |
| 804 | if( azArg==0 ) break; | |
| 805 | for(i=0; i<nArg; i++){ | |
| 806 | char *z = azArg[i]; | |
| 807 | if( z==0 ) z = p->nullvalue; | |
| 808 | fprintf(p->out, "%s", z); | |
| 809 | if( i<nArg-1 ){ | |
| 810 | fprintf(p->out, "%s", p->separator); | |
| 811 | }else if( p->mode==MODE_Semi ){ | |
| 812 | fprintf(p->out, ";\n"); | |
| 813 | }else{ | |
| 814 | fprintf(p->out, "\n"); | |
| 815 | } | |
| 816 | } | |
| 817 | break; | |
| 818 | } | |
| 819 | case MODE_Html: { | |
| 820 | if( p->cnt++==0 && p->showHeader ){ | |
| 821 | fprintf(p->out,"<TR>"); | |
| 822 | for(i=0; i<nArg; i++){ | |
| 823 | fprintf(p->out,"<TH>"); | |
| 824 | output_html_string(p->out, azCol[i]); | |
| 825 | fprintf(p->out,"</TH>\n"); | |
| 826 | } | |
| 827 | fprintf(p->out,"</TR>\n"); | |
| 828 | } | |
| 829 | if( azArg==0 ) break; | |
| 830 | fprintf(p->out,"<TR>"); | |
| 831 | for(i=0; i<nArg; i++){ | |
| 832 | fprintf(p->out,"<TD>"); | |
| 833 | output_html_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); | |
| 834 | fprintf(p->out,"</TD>\n"); | |
| 835 | } | |
| 836 | fprintf(p->out,"</TR>\n"); | |
| 837 | break; | |
| 838 | } | |
| 839 | case MODE_Tcl: { | |
| 840 | if( p->cnt++==0 && p->showHeader ){ | |
| 841 | for(i=0; i<nArg; i++){ | |
| 842 | output_c_string(p->out,azCol[i] ? azCol[i] : ""); | |
| 843 | if(i<nArg-1) fprintf(p->out, "%s", p->separator); | |
| 844 | } | |
| 845 | fprintf(p->out,"\n"); | |
| 846 | } | |
| 847 | if( azArg==0 ) break; | |
| 848 | for(i=0; i<nArg; i++){ | |
| 849 | output_c_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); | |
| 850 | if(i<nArg-1) fprintf(p->out, "%s", p->separator); | |
| 851 | } | |
| 852 | fprintf(p->out,"\n"); | |
| 853 | break; | |
| 854 | } | |
| 855 | case MODE_Csv: { | |
| 856 | if( p->cnt++==0 && p->showHeader ){ | |
| 857 | for(i=0; i<nArg; i++){ | |
| 858 | output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1); | |
| 859 | } | |
| 860 | fprintf(p->out,"\n"); | |
| 861 | } | |
| 862 | if( azArg==0 ) break; | |
| 863 | for(i=0; i<nArg; i++){ | |
| 864 | output_csv(p, azArg[i], i<nArg-1); | |
| 865 | } | |
| 866 | fprintf(p->out,"\n"); | |
| 867 | break; | |
| 868 | } | |
| 869 | case MODE_Insert: { | |
| 870 | p->cnt++; | |
| 871 | if( azArg==0 ) break; | |
| 872 | fprintf(p->out,"INSERT INTO %s VALUES(",p->zDestTable); | |
| 873 | for(i=0; i<nArg; i++){ | |
| 874 | const char *zSep = i>0 ? ",": ""; | |
| 875 | if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){ | |
| 876 | fprintf(p->out,"%sNULL",zSep); | |
| 877 | }else if( aiType && aiType[i]==SQLITE_TEXT ){ | |
| 878 | if( zSep[0] ) fprintf(p->out,"%s",zSep); | |
| 879 | output_quoted_string(p->out, azArg[i]); | |
| 880 | }else if( aiType && (aiType[i]==SQLITE_INTEGER || aiType[i]==SQLITE_FLOAT) ){ | |
| 881 | fprintf(p->out,"%s%s",zSep, azArg[i]); | |
| 882 | }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){ | |
| 883 | const void *pBlob = sqlite3_column_blob(p->pStmt, i); | |
| 884 | int nBlob = sqlite3_column_bytes(p->pStmt, i); | |
| 885 | if( zSep[0] ) fprintf(p->out,"%s",zSep); | |
| 886 | output_hex_blob(p->out, pBlob, nBlob); | |
| 887 | }else if( isNumber(azArg[i], 0) ){ | |
| 888 | fprintf(p->out,"%s%s",zSep, azArg[i]); | |
| 889 | }else{ | |
| 890 | if( zSep[0] ) fprintf(p->out,"%s",zSep); | |
| 891 | output_quoted_string(p->out, azArg[i]); | |
| 892 | } | |
| 893 | } | |
| 894 | fprintf(p->out,");\n"); | |
| 895 | break; | |
| 896 | } | |
| 897 | } | |
| 898 | return 0; | |
| 713 | switch( p->mode ){ | |
| 714 | case MODE_Line: { | |
| 715 | int w = 5; | |
| 716 | if( azArg==0 ) break; | |
| 717 | for(i=0; i<nArg; i++){ | |
| 718 | int len = strlen30(azCol[i] ? azCol[i] : ""); | |
| 719 | if( len>w ) w = len; | |
| 720 | } | |
| 721 | if( p->cnt++>0 ) fprintf(p->out,"\n"); | |
| 722 | for(i=0; i<nArg; i++){ | |
| 723 | fprintf(p->out,"%*s = %s\n", w, azCol[i], | |
| 724 | azArg[i] ? azArg[i] : p->nullvalue); | |
| 725 | } | |
| 726 | break; | |
| 727 | } | |
| 728 | case MODE_Explain: | |
| 729 | case MODE_Column: { | |
| 730 | if( p->cnt++==0 ){ | |
| 731 | for(i=0; i<nArg; i++){ | |
| 732 | int w, n; | |
| 733 | if( i<ArraySize(p->colWidth) ){ | |
| 734 | w = p->colWidth[i]; | |
| 735 | }else{ | |
| 736 | w = 0; | |
| 737 | } | |
| 738 | if( w==0 ){ | |
| 739 | w = strlen30(azCol[i] ? azCol[i] : ""); | |
| 740 | if( w<10 ) w = 10; | |
| 741 | n = strlen30(azArg && azArg[i] ? azArg[i] : p->nullvalue); | |
| 742 | if( w<n ) w = n; | |
| 743 | } | |
| 744 | if( i<ArraySize(p->actualWidth) ){ | |
| 745 | p->actualWidth[i] = w; | |
| 746 | } | |
| 747 | if( p->showHeader ){ | |
| 748 | if( w<0 ){ | |
| 749 | fprintf(p->out,"%*.*s%s",-w,-w,azCol[i], i==nArg-1 ? "\n": " "); | |
| 750 | }else{ | |
| 751 | fprintf(p->out,"%-*.*s%s",w,w,azCol[i], i==nArg-1 ? "\n": " "); | |
| 752 | } | |
| 753 | } | |
| 754 | } | |
| 755 | if( p->showHeader ){ | |
| 756 | for(i=0; i<nArg; i++){ | |
| 757 | int w; | |
| 758 | if( i<ArraySize(p->actualWidth) ){ | |
| 759 | w = p->actualWidth[i]; | |
| 760 | if( w<0 ) w = -w; | |
| 761 | }else{ | |
| 762 | w = 10; | |
| 763 | } | |
| 764 | fprintf(p->out,"%-*.*s%s",w,w,"-----------------------------------" | |
| 765 | "----------------------------------------------------------", | |
| 766 | i==nArg-1 ? "\n": " "); | |
| 767 | } | |
| 768 | } | |
| 769 | } | |
| 770 | if( azArg==0 ) break; | |
| 771 | for(i=0; i<nArg; i++){ | |
| 772 | int w; | |
| 773 | if( i<ArraySize(p->actualWidth) ){ | |
| 774 | w = p->actualWidth[i]; | |
| 775 | }else{ | |
| 776 | w = 10; | |
| 777 | } | |
| 778 | if( p->mode==MODE_Explain && azArg[i] && strlen30(azArg[i])>w ){ | |
| 779 | w = strlen30(azArg[i]); | |
| 780 | } | |
| 781 | if( i==1 && p->aiIndent && p->pStmt ){ | |
| 782 | if( p->iIndent<p->nIndent ){ | |
| 783 | fprintf(p->out, "%*.s", p->aiIndent[p->iIndent], ""); | |
| 784 | } | |
| 785 | p->iIndent++; | |
| 786 | } | |
| 787 | if( w<0 ){ | |
| 788 | fprintf(p->out,"%*.*s%s",-w,-w, | |
| 789 | azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); | |
| 790 | }else{ | |
| 791 | fprintf(p->out,"%-*.*s%s",w,w, | |
| 792 | azArg[i] ? azArg[i] : p->nullvalue, i==nArg-1 ? "\n": " "); | |
| 793 | } | |
| 794 | } | |
| 795 | break; | |
| 796 | } | |
| 797 | case MODE_Semi: | |
| 798 | case MODE_List: { | |
| 799 | if( p->cnt++==0 && p->showHeader ){ | |
| 800 | for(i=0; i<nArg; i++){ | |
| 801 | fprintf(p->out,"%s%s",azCol[i], i==nArg-1 ? "\n" : p->separator); | |
| 802 | } | |
| 803 | } | |
| 804 | if( azArg==0 ) break; | |
| 805 | for(i=0; i<nArg; i++){ | |
| 806 | char *z = azArg[i]; | |
| 807 | if( z==0 ) z = p->nullvalue; | |
| 808 | fprintf(p->out, "%s", z); | |
| 809 | if( i<nArg-1 ){ | |
| 810 | fprintf(p->out, "%s", p->separator); | |
| 811 | }else if( p->mode==MODE_Semi ){ | |
| 812 | fprintf(p->out, ";\n"); | |
| 813 | }else{ | |
| 814 | fprintf(p->out, "\n"); | |
| 815 | } | |
| 816 | } | |
| 817 | break; | |
| 818 | } | |
| 819 | case MODE_Html: { | |
| 820 | if( p->cnt++==0 && p->showHeader ){ | |
| 821 | fprintf(p->out,"<TR>"); | |
| 822 | for(i=0; i<nArg; i++){ | |
| 823 | fprintf(p->out,"<TH>"); | |
| 824 | output_html_string(p->out, azCol[i]); | |
| 825 | fprintf(p->out,"</TH>\n"); | |
| 826 | } | |
| 827 | fprintf(p->out,"</TR>\n"); | |
| 828 | } | |
| 829 | if( azArg==0 ) break; | |
| 830 | fprintf(p->out,"<TR>"); | |
| 831 | for(i=0; i<nArg; i++){ | |
| 832 | fprintf(p->out,"<TD>"); | |
| 833 | output_html_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); | |
| 834 | fprintf(p->out,"</TD>\n"); | |
| 835 | } | |
| 836 | fprintf(p->out,"</TR>\n"); | |
| 837 | break; | |
| 838 | } | |
| 839 | case MODE_Tcl: { | |
| 840 | if( p->cnt++==0 && p->showHeader ){ | |
| 841 | for(i=0; i<nArg; i++){ | |
| 842 | output_c_string(p->out,azCol[i] ? azCol[i] : ""); | |
| 843 | if(i<nArg-1) fprintf(p->out, "%s", p->separator); | |
| 844 | } | |
| 845 | fprintf(p->out,"\n"); | |
| 846 | } | |
| 847 | if( azArg==0 ) break; | |
| 848 | for(i=0; i<nArg; i++){ | |
| 849 | output_c_string(p->out, azArg[i] ? azArg[i] : p->nullvalue); | |
| 850 | if(i<nArg-1) fprintf(p->out, "%s", p->separator); | |
| 851 | } | |
| 852 | fprintf(p->out,"\n"); | |
| 853 | break; | |
| 854 | } | |
| 855 | case MODE_Csv: { | |
| 856 | if( p->cnt++==0 && p->showHeader ){ | |
| 857 | for(i=0; i<nArg; i++){ | |
| 858 | output_csv(p, azCol[i] ? azCol[i] : "", i<nArg-1); | |
| 859 | } | |
| 860 | fprintf(p->out,"\n"); | |
| 861 | } | |
| 862 | if( azArg==0 ) break; | |
| 863 | for(i=0; i<nArg; i++){ | |
| 864 | output_csv(p, azArg[i], i<nArg-1); | |
| 865 | } | |
| 866 | fprintf(p->out,"\n"); | |
| 867 | break; | |
| 868 | } | |
| 869 | case MODE_Insert: { | |
| 870 | p->cnt++; | |
| 871 | if( azArg==0 ) break; | |
| 872 | fprintf(p->out,"INSERT INTO %s VALUES(",p->zDestTable); | |
| 873 | for(i=0; i<nArg; i++){ | |
| 874 | const char *zSep = i>0 ? ",": ""; | |
| 875 | if( (azArg[i]==0) || (aiType && aiType[i]==SQLITE_NULL) ){ | |
| 876 | fprintf(p->out,"%sNULL",zSep); | |
| 877 | }else if( aiType && aiType[i]==SQLITE_TEXT ){ | |
| 878 | if( zSep[0] ) fprintf(p->out,"%s",zSep); | |
| 879 | output_quoted_string(p->out, azArg[i]); | |
| 880 | }else if( aiType && (aiType[i]==SQLITE_INTEGER || aiType[i]==SQLITE_FLOAT) ){ | |
| 881 | fprintf(p->out,"%s%s",zSep, azArg[i]); | |
| 882 | }else if( aiType && aiType[i]==SQLITE_BLOB && p->pStmt ){ | |
| 883 | const void *pBlob = sqlite3_column_blob(p->pStmt, i); | |
| 884 | int nBlob = sqlite3_column_bytes(p->pStmt, i); | |
| 885 | if( zSep[0] ) fprintf(p->out,"%s",zSep); | |
| 886 | output_hex_blob(p->out, pBlob, nBlob); | |
| 887 | }else if( isNumber(azArg[i], 0) ){ | |
| 888 | fprintf(p->out,"%s%s",zSep, azArg[i]); | |
| 889 | }else{ | |
| 890 | if( zSep[0] ) fprintf(p->out,"%s",zSep); | |
| 891 | output_quoted_string(p->out, azArg[i]); | |
| 892 | } | |
| 893 | } | |
| 894 | fprintf(p->out,");\n"); | |
| 895 | break; | |
| 896 | } | |
| 897 | } | |
| 898 | return 0; | |
| 899 | 899 | } |
| 900 | 900 | |
| 901 | 901 | /* |
| r31373 | r31374 | |
| 903 | 903 | ** invokes for each row of a query result. |
| 904 | 904 | */ |
| 905 | 905 | static int callback(void *pArg, int nArg, char **azArg, char **azCol){ |
| 906 | /* since we don't have type info, call the shell_callback with a NULL value */ | |
| 907 | return shell_callback(pArg, nArg, azArg, azCol, NULL); | |
| 906 | /* since we don't have type info, call the shell_callback with a NULL value */ | |
| 907 | return shell_callback(pArg, nArg, azArg, azCol, NULL); | |
| 908 | 908 | } |
| 909 | 909 | |
| 910 | 910 | /* |
| r31373 | r31374 | |
| 913 | 913 | ** table name. |
| 914 | 914 | */ |
| 915 | 915 | static void set_table_name(struct callback_data *p, const char *zName){ |
| 916 | int i, n; | |
| 917 | int needQuote; | |
| 918 | char *z; | |
| 916 | int i, n; | |
| 917 | int needQuote; | |
| 918 | char *z; | |
| 919 | 919 | |
| 920 | if( p->zDestTable ){ | |
| 921 | free(p->zDestTable); | |
| 922 | p->zDestTable = 0; | |
| 923 | } | |
| 924 | if( zName==0 ) return; | |
| 925 | needQuote = !isalpha((unsigned char)*zName) && *zName!='_'; | |
| 926 | for(i=n=0; zName[i]; i++, n++){ | |
| 927 | if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ){ | |
| 928 | needQuote = 1; | |
| 929 | if( zName[i]=='\'' ) n++; | |
| 930 | } | |
| 931 | } | |
| 932 | if( needQuote ) n += 2; | |
| 933 | z = p->zDestTable = (char*)malloc( n+1 ); | |
| 934 | if( z==0 ){ | |
| 935 | fprintf(stderr,"Error: out of memory\n"); | |
| 936 | exit(1); | |
| 937 | } | |
| 938 | n = 0; | |
| 939 | if( needQuote ) z[n++] = '\''; | |
| 940 | for(i=0; zName[i]; i++){ | |
| 941 | z[n++] = zName[i]; | |
| 942 | if( zName[i]=='\'' ) z[n++] = '\''; | |
| 943 | } | |
| 944 | if( needQuote ) z[n++] = '\''; | |
| 945 | z[n] = 0; | |
| 920 | if( p->zDestTable ){ | |
| 921 | free(p->zDestTable); | |
| 922 | p->zDestTable = 0; | |
| 923 | } | |
| 924 | if( zName==0 ) return; | |
| 925 | needQuote = !isalpha((unsigned char)*zName) && *zName!='_'; | |
| 926 | for(i=n=0; zName[i]; i++, n++){ | |
| 927 | if( !isalnum((unsigned char)zName[i]) && zName[i]!='_' ){ | |
| 928 | needQuote = 1; | |
| 929 | if( zName[i]=='\'' ) n++; | |
| 930 | } | |
| 931 | } | |
| 932 | if( needQuote ) n += 2; | |
| 933 | z = p->zDestTable = (char*)malloc( n+1 ); | |
| 934 | if( z==0 ){ | |
| 935 | fprintf(stderr,"Error: out of memory\n"); | |
| 936 | exit(1); | |
| 937 | } | |
| 938 | n = 0; | |
| 939 | if( needQuote ) z[n++] = '\''; | |
| 940 | for(i=0; zName[i]; i++){ | |
| 941 | z[n++] = zName[i]; | |
| 942 | if( zName[i]=='\'' ) z[n++] = '\''; | |
| 943 | } | |
| 944 | if( needQuote ) z[n++] = '\''; | |
| 945 | z[n] = 0; | |
| 946 | 946 | } |
| 947 | 947 | |
| 948 | 948 | /* zIn is either a pointer to a NULL-terminated string in memory obtained |
| r31373 | r31374 | |
| 950 | 950 | ** added to zIn, and the result returned in memory obtained from malloc(). |
| 951 | 951 | ** zIn, if it was not NULL, is freed. |
| 952 | 952 | ** |
| 953 | ** If the third argument, quote, is not '\0', then it is used as a | |
| 953 | ** If the third argument, quote, is not '\0', then it is used as a | |
| 954 | 954 | ** quote character for zAppend. |
| 955 | 955 | */ |
| 956 | 956 | static char *appendText(char *zIn, char const *zAppend, char quote){ |
| 957 | int len; | |
| 958 | int i; | |
| 959 | int nAppend = strlen30(zAppend); | |
| 960 | int nIn = (zIn?strlen30(zIn):0); | |
| 957 | int len; | |
| 958 | int i; | |
| 959 | int nAppend = strlen30(zAppend); | |
| 960 | int nIn = (zIn?strlen30(zIn):0); | |
| 961 | 961 | |
| 962 | len = nAppend+nIn+1; | |
| 963 | if( quote ){ | |
| 964 | len += 2; | |
| 965 | for(i=0; i<nAppend; i++){ | |
| 966 | if( zAppend[i]==quote ) len++; | |
| 967 | } | |
| 968 | } | |
| 962 | len = nAppend+nIn+1; | |
| 963 | if( quote ){ | |
| 964 | len += 2; | |
| 965 | for(i=0; i<nAppend; i++){ | |
| 966 | if( zAppend[i]==quote ) len++; | |
| 967 | } | |
| 968 | } | |
| 969 | 969 | |
| 970 | zIn = (char *)realloc(zIn, len); | |
| 971 | if( !zIn ){ | |
| 972 | return 0; | |
| 973 | } | |
| 970 | zIn = (char *)realloc(zIn, len); | |
| 971 | if( !zIn ){ | |
| 972 | return 0; | |
| 973 | } | |
| 974 | 974 | |
| 975 | if( quote ){ | |
| 976 | char *zCsr = &zIn[nIn]; | |
| 977 | *zCsr++ = quote; | |
| 978 | for(i=0; i<nAppend; i++){ | |
| 979 | *zCsr++ = zAppend[i]; | |
| 980 | if( zAppend[i]==quote ) *zCsr++ = quote; | |
| 981 | } | |
| 982 | *zCsr++ = quote; | |
| 983 | *zCsr++ = '\0'; | |
| 984 | assert( (zCsr-zIn)==len ); | |
| 985 | }else{ | |
| 986 | memcpy(&zIn[nIn], zAppend, nAppend); | |
| 987 | zIn[len-1] = '\0'; | |
| 988 | } | |
| 975 | if( quote ){ | |
| 976 | char *zCsr = &zIn[nIn]; | |
| 977 | *zCsr++ = quote; | |
| 978 | for(i=0; i<nAppend; i++){ | |
| 979 | *zCsr++ = zAppend[i]; | |
| 980 | if( zAppend[i]==quote ) *zCsr++ = quote; | |
| 981 | } | |
| 982 | *zCsr++ = quote; | |
| 983 | *zCsr++ = '\0'; | |
| 984 | assert( (zCsr-zIn)==len ); | |
| 985 | }else{ | |
| 986 | memcpy(&zIn[nIn], zAppend, nAppend); | |
| 987 | zIn[len-1] = '\0'; | |
| 988 | } | |
| 989 | 989 | |
| 990 | ||
| 990 | return zIn; | |
| 991 | 991 | } |
| 992 | 992 | |
| 993 | 993 | |
| r31373 | r31374 | |
| 997 | 997 | ** semicolon terminator to the end of that line. |
| 998 | 998 | ** |
| 999 | 999 | ** If the number of columns is 1 and that column contains text "--" |
| 1000 | ** then write the semicolon on a separate line. That way, if a | |
| 1000 | ** then write the semicolon on a separate line. That way, if a | |
| 1001 | 1001 | ** "--" comment occurs at the end of the statement, the comment |
| 1002 | 1002 | ** won't consume the semicolon terminator. |
| 1003 | 1003 | */ |
| 1004 | 1004 | static int run_table_dump_query( |
| 1005 | struct callback_data *p, /* Query context */ | |
| 1006 | const char *zSelect, /* SELECT statement to extract content */ | |
| 1007 | const char *zFirstRow /* Print before first row, if not NULL */ | |
| 1005 | struct callback_data *p, /* Query context */ | |
| 1006 | const char *zSelect, /* SELECT statement to extract content */ | |
| 1007 | const char *zFirstRow /* Print before first row, if not NULL */ | |
| 1008 | 1008 | ){ |
| 1009 | sqlite3_stmt *pSelect; | |
| 1010 | int rc; | |
| 1011 | int nResult; | |
| 1012 | int i; | |
| 1013 | const char *z; | |
| 1014 | rc = sqlite3_prepare_v2(p->db, zSelect, -1, &pSelect, 0); | |
| 1015 | if( rc!=SQLITE_OK || !pSelect ){ | |
| 1016 | fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); | |
| 1017 | if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; | |
| 1018 | return rc; | |
| 1019 | } | |
| 1020 | rc = sqlite3_step(pSelect); | |
| 1021 | nResult = sqlite3_column_count(pSelect); | |
| 1022 | while( rc==SQLITE_ROW ){ | |
| 1023 | if( zFirstRow ){ | |
| 1024 | fprintf(p->out, "%s", zFirstRow); | |
| 1025 | zFirstRow = 0; | |
| 1026 | } | |
| 1027 | z = (const char*)sqlite3_column_text(pSelect, 0); | |
| 1028 | fprintf(p->out, "%s", z); | |
| 1029 | for(i=1; i<nResult; i++){ | |
| 1030 | fprintf(p->out, ",%s", sqlite3_column_text(pSelect, i)); | |
| 1031 | } | |
| 1032 | if( z==0 ) z = ""; | |
| 1033 | while( z[0] && (z[0]!='-' || z[1]!='-') ) z++; | |
| 1034 | if( z[0] ){ | |
| 1035 | fprintf(p->out, "\n;\n"); | |
| 1036 | }else{ | |
| 1037 | fprintf(p->out, ";\n"); | |
| 1038 | } | |
| 1039 | rc = sqlite3_step(pSelect); | |
| 1040 | } | |
| 1041 | rc = sqlite3_finalize(pSelect); | |
| 1042 | if( rc!=SQLITE_OK ){ | |
| 1043 | fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); | |
| 1044 | if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; | |
| 1045 | } | |
| 1046 | return rc; | |
| 1009 | sqlite3_stmt *pSelect; | |
| 1010 | int rc; | |
| 1011 | int nResult; | |
| 1012 | int i; | |
| 1013 | const char *z; | |
| 1014 | rc = sqlite3_prepare_v2(p->db, zSelect, -1, &pSelect, 0); | |
| 1015 | if( rc!=SQLITE_OK || !pSelect ){ | |
| 1016 | fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); | |
| 1017 | if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; | |
| 1018 | return rc; | |
| 1019 | } | |
| 1020 | rc = sqlite3_step(pSelect); | |
| 1021 | nResult = sqlite3_column_count(pSelect); | |
| 1022 | while( rc==SQLITE_ROW ){ | |
| 1023 | if( zFirstRow ){ | |
| 1024 | fprintf(p->out, "%s", zFirstRow); | |
| 1025 | zFirstRow = 0; | |
| 1026 | } | |
| 1027 | z = (const char*)sqlite3_column_text(pSelect, 0); | |
| 1028 | fprintf(p->out, "%s", z); | |
| 1029 | for(i=1; i<nResult; i++){ | |
| 1030 | fprintf(p->out, ",%s", sqlite3_column_text(pSelect, i)); | |
| 1031 | } | |
| 1032 | if( z==0 ) z = ""; | |
| 1033 | while( z[0] && (z[0]!='-' || z[1]!='-') ) z++; | |
| 1034 | if( z[0] ){ | |
| 1035 | fprintf(p->out, "\n;\n"); | |
| 1036 | }else{ | |
| 1037 | fprintf(p->out, ";\n"); | |
| 1038 | } | |
| 1039 | rc = sqlite3_step(pSelect); | |
| 1040 | } | |
| 1041 | rc = sqlite3_finalize(pSelect); | |
| 1042 | if( rc!=SQLITE_OK ){ | |
| 1043 | fprintf(p->out, "/**** ERROR: (%d) %s *****/\n", rc, sqlite3_errmsg(p->db)); | |
| 1044 | if( (rc&0xff)!=SQLITE_CORRUPT ) p->nErr++; | |
| 1045 | } | |
| 1046 | return rc; | |
| 1047 | 1047 | } |
| 1048 | 1048 | |
| 1049 | 1049 | /* |
| 1050 | 1050 | ** Allocate space and save off current error string. |
| 1051 | 1051 | */ |
| 1052 | 1052 | static char *save_err_msg( |
| 1053 | ||
| 1053 | sqlite3 *db /* Database to query */ | |
| 1054 | 1054 | ){ |
| 1055 | int nErrMsg = 1+strlen30(sqlite3_errmsg(db)); | |
| 1056 | char *zErrMsg = (char*)sqlite3_malloc(nErrMsg); | |
| 1057 | if( zErrMsg ){ | |
| 1058 | memcpy(zErrMsg, sqlite3_errmsg(db), nErrMsg); | |
| 1059 | } | |
| 1060 | return zErrMsg; | |
| 1055 | int nErrMsg = 1+strlen30(sqlite3_errmsg(db)); | |
| 1056 | char *zErrMsg = (char*)sqlite3_malloc(nErrMsg); | |
| 1057 | if( zErrMsg ){ | |
| 1058 | memcpy(zErrMsg, sqlite3_errmsg(db), nErrMsg); | |
| 1059 | } | |
| 1060 | return zErrMsg; | |
| 1061 | 1061 | } |
| 1062 | 1062 | |
| 1063 | 1063 | /* |
| 1064 | 1064 | ** Display memory stats. |
| 1065 | 1065 | */ |
| 1066 | 1066 | static int display_stats( |
| 1067 | sqlite3 *db, /* Database to query */ | |
| 1068 | struct callback_data *pArg, /* Pointer to struct callback_data */ | |
| 1069 | int bReset /* True to reset the stats */ | |
| 1067 | sqlite3 *db, /* Database to query */ | |
| 1068 | struct callback_data *pArg, /* Pointer to struct callback_data */ | |
| 1069 | int bReset /* True to reset the stats */ | |
| 1070 | 1070 | ){ |
| 1071 | int iCur; | |
| 1072 | int iHiwtr; | |
| 1071 | int iCur; | |
| 1072 | int iHiwtr; | |
| 1073 | 1073 | |
| 1074 | if( pArg && pArg->out ){ | |
| 1075 | ||
| 1076 | iHiwtr = iCur = -1; | |
| 1077 | sqlite3_status(SQLITE_STATUS_MEMORY_USED, &iCur, &iHiwtr, bReset); | |
| 1078 | fprintf(pArg->out, "Memory Used: %d (max %d) bytes\n", iCur, iHiwtr); | |
| 1079 | iHiwtr = iCur = -1; | |
| 1080 | sqlite3_status(SQLITE_STATUS_MALLOC_COUNT, &iCur, &iHiwtr, bReset); | |
| 1081 | fprintf(pArg->out, "Number of Outstanding Allocations: %d (max %d)\n", iCur, iHiwtr); | |
| 1074 | if( pArg && pArg->out ){ | |
| 1075 | iHiwtr = iCur = -1; | |
| 1076 | sqlite3_status(SQLITE_STATUS_MEMORY_USED, &iCur, &iHiwtr, bReset); | |
| 1077 | fprintf(pArg->out, "Memory Used: %d (max %d) bytes\n", iCur, iHiwtr); | |
| 1078 | iHiwtr = iCur = -1; | |
| 1079 | sqlite3_status(SQLITE_STATUS_MALLOC_COUNT, &iCur, &iHiwtr, bReset); | |
| 1080 | fprintf(pArg->out, "Number of Outstanding Allocations: %d (max %d)\n", iCur, iHiwtr); | |
| 1082 | 1081 | /* |
| 1083 | 1082 | ** Not currently used by the CLI. |
| 1084 | 1083 | ** iHiwtr = iCur = -1; |
| 1085 | 1084 | ** sqlite3_status(SQLITE_STATUS_PAGECACHE_USED, &iCur, &iHiwtr, bReset); |
| 1086 | 1085 | ** fprintf(pArg->out, "Number of Pcache Pages Used: %d (max %d) pages\n", iCur, iHiwtr); |
| 1087 | 1086 | */ |
| 1088 | iHiwtr = iCur = -1; | |
| 1089 | sqlite3_status(SQLITE_STATUS_PAGECACHE_OVERFLOW, &iCur, &iHiwtr, bReset); | |
| 1090 | fprintf(pArg->out, "Number of Pcache Overflow Bytes: %d (max %d) bytes\n", iCur, iHiwtr); | |
| 1087 | iHiwtr = iCur = -1; | |
| 1088 | sqlite3_status(SQLITE_STATUS_PAGECACHE_OVERFLOW, &iCur, &iHiwtr, bReset); | |
| 1089 | fprintf(pArg->out, "Number of Pcache Overflow Bytes: %d (max %d) bytes\n", iCur, iHiwtr); | |
| 1091 | 1090 | /* |
| 1092 | 1091 | ** Not currently used by the CLI. |
| 1093 | 1092 | ** iHiwtr = iCur = -1; |
| 1094 | 1093 | ** sqlite3_status(SQLITE_STATUS_SCRATCH_USED, &iCur, &iHiwtr, bReset); |
| 1095 | 1094 | ** fprintf(pArg->out, "Number of Scratch Allocations Used: %d (max %d)\n", iCur, iHiwtr); |
| 1096 | 1095 | */ |
| 1097 | iHiwtr = iCur = -1; | |
| 1098 | sqlite3_status(SQLITE_STATUS_SCRATCH_OVERFLOW, &iCur, &iHiwtr, bReset); | |
| 1099 | fprintf(pArg->out, "Number of Scratch Overflow Bytes: %d (max %d) bytes\n", iCur, iHiwtr); | |
| 1100 | iHiwtr = iCur = -1; | |
| 1101 | sqlite3_status(SQLITE_STATUS_MALLOC_SIZE, &iCur, &iHiwtr, bReset); | |
| 1102 | fprintf(pArg->out, "Largest Allocation: %d bytes\n", iHiwtr); | |
| 1103 | iHiwtr = iCur = -1; | |
| 1104 | sqlite3_status(SQLITE_STATUS_PAGECACHE_SIZE, &iCur, &iHiwtr, bReset); | |
| 1105 | fprintf(pArg->out, "Largest Pcache Allocation: %d bytes\n", iHiwtr); | |
| 1106 | iHiwtr = iCur = -1; | |
| 1107 | sqlite3_status(SQLITE_STATUS_SCRATCH_SIZE, &iCur, &iHiwtr, bReset); | |
| 1108 | fprintf(pArg->out, "Largest Scratch Allocation: %d bytes\n", iHiwtr); | |
| 1096 | iHiwtr = iCur = -1; | |
| 1097 | sqlite3_status(SQLITE_STATUS_SCRATCH_OVERFLOW, &iCur, &iHiwtr, bReset); | |
| 1098 | fprintf(pArg->out, "Number of Scratch Overflow Bytes: %d (max %d) bytes\n", iCur, iHiwtr); | |
| 1099 | iHiwtr = iCur = -1; | |
| 1100 | sqlite3_status(SQLITE_STATUS_MALLOC_SIZE, &iCur, &iHiwtr, bReset); | |
| 1101 | fprintf(pArg->out, "Largest Allocation: %d bytes\n", iHiwtr); | |
| 1102 | iHiwtr = iCur = -1; | |
| 1103 | sqlite3_status(SQLITE_STATUS_PAGECACHE_SIZE, &iCur, &iHiwtr, bReset); | |
| 1104 | fprintf(pArg->out, "Largest Pcache Allocation: %d bytes\n", iHiwtr); | |
| 1105 | iHiwtr = iCur = -1; | |
| 1106 | sqlite3_status(SQLITE_STATUS_SCRATCH_SIZE, &iCur, &iHiwtr, bReset); | |
| 1107 | fprintf(pArg->out, "Largest Scratch Allocation: %d bytes\n", iHiwtr); | |
| 1109 | 1108 | #ifdef YYTRACKMAXSTACKDEPTH |
| 1110 | iHiwtr = iCur = -1; | |
| 1111 | sqlite3_status(SQLITE_STATUS_PARSER_STACK, &iCur, &iHiwtr, bReset); | |
| 1112 | fprintf(pArg->out, "Deepest Parser Stack: %d (max %d)\n", iCur, iHiwtr); | |
| 1109 | iHiwtr = iCur = -1; | |
| 1110 | sqlite3_status(SQLITE_STATUS_PARSER_STACK, &iCur, &iHiwtr, bReset); | |
| 1111 | fprintf(pArg->out, "Deepest Parser Stack: %d (max %d)\n", iCur, iHiwtr); | |
| 1113 | 1112 | #endif |
| 1114 | ||
| 1113 | } | |
| 1115 | 1114 | |
| 1116 | if( pArg && pArg->out && db ){ | |
| 1117 | iHiwtr = iCur = -1; | |
| 1118 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_USED, &iCur, &iHiwtr, bReset); | |
| 1119 | fprintf(pArg->out, "Lookaside Slots Used: %d (max %d)\n", iCur, iHiwtr); | |
| 1120 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_HIT, &iCur, &iHiwtr, bReset); | |
| 1121 | fprintf(pArg->out, "Successful lookaside attempts: %d\n", iHiwtr); | |
| 1122 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, &iCur, &iHiwtr, bReset); | |
| 1123 | fprintf(pArg->out, "Lookaside failures due to size: %d\n", iHiwtr); | |
| 1124 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, &iCur, &iHiwtr, bReset); | |
| 1125 | fprintf(pArg->out, "Lookaside failures due to OOM: %d\n", iHiwtr); | |
| 1126 | iHiwtr = iCur = -1; | |
| 1127 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_USED, &iCur, &iHiwtr, bReset); | |
| 1128 | fprintf(pArg->out, "Pager Heap Usage: %d bytes\n", iCur); iHiwtr = iCur = -1; | |
| 1129 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_HIT, &iCur, &iHiwtr, 1); | |
| 1130 | fprintf(pArg->out, "Page cache hits: %d\n", iCur); | |
| 1131 | iHiwtr = iCur = -1; | |
| 1132 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_MISS, &iCur, &iHiwtr, 1); | |
| 1133 | fprintf(pArg->out, "Page cache misses: %d\n", iCur); | |
| 1134 | iHiwtr = iCur = -1; | |
| 1135 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_WRITE, &iCur, &iHiwtr, 1); | |
| 1136 | fprintf(pArg->out, "Page cache writes: %d\n", iCur); | |
| 1137 | iHiwtr = iCur = -1; | |
| 1138 | sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, &iCur, &iHiwtr, bReset); | |
| 1139 | fprintf(pArg->out, "Schema Heap Usage: %d bytes\n", iCur); | |
| 1140 | iHiwtr = iCur = -1; | |
| 1141 | sqlite3_db_status(db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHiwtr, bReset); | |
| 1142 | fprintf(pArg->out, "Statement Heap/Lookaside Usage: %d bytes\n", iCur); | |
| 1143 | } | |
| 1115 | if( pArg && pArg->out && db ){ | |
| 1116 | iHiwtr = iCur = -1; | |
| 1117 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_USED, &iCur, &iHiwtr, bReset); | |
| 1118 | fprintf(pArg->out, "Lookaside Slots Used: %d (max %d)\n", iCur, iHiwtr); | |
| 1119 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_HIT, &iCur, &iHiwtr, bReset); | |
| 1120 | fprintf(pArg->out, "Successful lookaside attempts: %d\n", iHiwtr); | |
| 1121 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_SIZE, &iCur, &iHiwtr, bReset); | |
| 1122 | fprintf(pArg->out, "Lookaside failures due to size: %d\n", iHiwtr); | |
| 1123 | sqlite3_db_status(db, SQLITE_DBSTATUS_LOOKASIDE_MISS_FULL, &iCur, &iHiwtr, bReset); | |
| 1124 | fprintf(pArg->out, "Lookaside failures due to OOM: %d\n", iHiwtr); | |
| 1125 | iHiwtr = iCur = -1; | |
| 1126 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_USED, &iCur, &iHiwtr, bReset); | |
| 1127 | fprintf(pArg->out, "Pager Heap Usage: %d bytes\n", iCur); iHiwtr = iCur = -1; | |
| 1128 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_HIT, &iCur, &iHiwtr, 1); | |
| 1129 | fprintf(pArg->out, "Page cache hits: %d\n", iCur); | |
| 1130 | iHiwtr = iCur = -1; | |
| 1131 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_MISS, &iCur, &iHiwtr, 1); | |
| 1132 | fprintf(pArg->out, "Page cache misses: %d\n", iCur); | |
| 1133 | iHiwtr = iCur = -1; | |
| 1134 | sqlite3_db_status(db, SQLITE_DBSTATUS_CACHE_WRITE, &iCur, &iHiwtr, 1); | |
| 1135 | fprintf(pArg->out, "Page cache writes: %d\n", iCur); | |
| 1136 | iHiwtr = iCur = -1; | |
| 1137 | sqlite3_db_status(db, SQLITE_DBSTATUS_SCHEMA_USED, &iCur, &iHiwtr, bReset); | |
| 1138 | fprintf(pArg->out, "Schema Heap Usage: %d bytes\n", iCur); | |
| 1139 | iHiwtr = iCur = -1; | |
| 1140 | sqlite3_db_status(db, SQLITE_DBSTATUS_STMT_USED, &iCur, &iHiwtr, bReset); | |
| 1141 | fprintf(pArg->out, "Statement Heap/Lookaside Usage: %d bytes\n", iCur); | |
| 1142 | } | |
| 1144 | 1143 | |
| 1145 | if( pArg && pArg->out && db && pArg->pStmt ){ | |
| 1146 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FULLSCAN_STEP, bReset); | |
| 1147 | fprintf(pArg->out, "Fullscan Steps: %d\n", iCur); | |
| 1148 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_SORT, bReset); | |
| 1149 | fprintf(pArg->out, "Sort Operations: %d\n", iCur); | |
| 1150 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_AUTOINDEX, bReset); | |
| 1151 | fprintf(pArg->out, "Autoindex Inserts: %d\n", iCur); | |
| 1152 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset); | |
| 1153 | fprintf(pArg->out, "Virtual Machine Steps: %d\n", iCur); | |
| 1154 | } | |
| 1144 | if( pArg && pArg->out && db && pArg->pStmt ){ | |
| 1145 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_FULLSCAN_STEP, bReset); | |
| 1146 | fprintf(pArg->out, "Fullscan Steps: %d\n", iCur); | |
| 1147 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_SORT, bReset); | |
| 1148 | fprintf(pArg->out, "Sort Operations: %d\n", iCur); | |
| 1149 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_AUTOINDEX, bReset); | |
| 1150 | fprintf(pArg->out, "Autoindex Inserts: %d\n", iCur); | |
| 1151 | iCur = sqlite3_stmt_status(pArg->pStmt, SQLITE_STMTSTATUS_VM_STEP, bReset); | |
| 1152 | fprintf(pArg->out, "Virtual Machine Steps: %d\n", iCur); | |
| 1153 | } | |
| 1155 | 1154 | |
| 1156 | ||
| 1155 | return 0; | |
| 1157 | 1156 | } |
| 1158 | 1157 | |
| 1159 | 1158 | /* |
| r31373 | r31374 | |
| 1163 | 1162 | ** Otherwise, return zero. |
| 1164 | 1163 | */ |
| 1165 | 1164 | static int str_in_array(const char *zStr, const char **azArray){ |
| 1166 | int i; | |
| 1167 | for(i=0; azArray[i]; i++){ | |
| 1168 | if( 0==strcmp(zStr, azArray[i]) ) return 1; | |
| 1169 | } | |
| 1170 | return 0; | |
| 1165 | int i; | |
| 1166 | for(i=0; azArray[i]; i++){ | |
| 1167 | if( 0==strcmp(zStr, azArray[i]) ) return 1; | |
| 1168 | } | |
| 1169 | return 0; | |
| 1171 | 1170 | } |
| 1172 | 1171 | |
| 1173 | 1172 | /* |
| 1174 | 1173 | ** If compiled statement pSql appears to be an EXPLAIN statement, allocate |
| 1175 | 1174 | ** and populate the callback_data.aiIndent[] array with the number of |
| 1176 | ** spaces each opcode should be indented before it is output. | |
| 1175 | ** spaces each opcode should be indented before it is output. | |
| 1177 | 1176 | ** |
| 1178 | 1177 | ** The indenting rules are: |
| 1179 | 1178 | ** |
| r31373 | r31374 | |
| 1189 | 1188 | ** and "Goto" by 2 spaces. |
| 1190 | 1189 | */ |
| 1191 | 1190 | static void explain_data_prepare(struct callback_data *p, sqlite3_stmt *pSql){ |
| 1192 | const char *zSql; /* The text of the SQL statement */ | |
| 1193 | const char *z; /* Used to check if this is an EXPLAIN */ | |
| 1194 | int *abYield = 0; /* True if op is an OP_Yield */ | |
| 1195 | int nAlloc = 0; /* Allocated size of p->aiIndent[], abYield */ | |
| 1196 | int iOp; /* Index of operation in p->aiIndent[] */ | |
| 1191 | const char *zSql; /* The text of the SQL statement */ | |
| 1192 | const char *z; /* Used to check if this is an EXPLAIN */ | |
| 1193 | int *abYield = 0; /* True if op is an OP_Yield */ | |
| 1194 | int nAlloc = 0; /* Allocated size of p->aiIndent[], abYield */ | |
| 1195 | int iOp; /* Index of operation in p->aiIndent[] */ | |
| 1197 | 1196 | |
| 1198 | const char *azNext[] = { "Next", "Prev", "VPrev", "VNext", "SorterNext", 0 }; | |
| 1199 | const char *azYield[] = { "Yield", "SeekLt", "SeekGt", "RowSetRead", "Rewind", 0 }; | |
| 1200 | const char *azGoto[] = { "Goto", 0 }; | |
| 1197 | const char *azNext[] = { "Next", "Prev", "VPrev", "VNext", "SorterNext", 0 }; | |
| 1198 | const char *azYield[] = { "Yield", "SeekLt", "SeekGt", "RowSetRead", "Rewind", 0 }; | |
| 1199 | const char *azGoto[] = { "Goto", 0 }; | |
| 1201 | 1200 | |
| 1202 | /* Try to figure out if this is really an EXPLAIN statement. If this | |
| 1203 | ** cannot be verified, return early. */ | |
| 1204 | zSql = sqlite3_sql(pSql); | |
| 1205 | if( zSql==0 ) return; | |
| 1206 | for(z=zSql; *z==' ' || *z=='\t' || *z=='\n' || *z=='\f' || *z=='\r'; z++); | |
| 1207 | if( sqlite3_strnicmp(z, "explain", 7) ) return; | |
| 1201 | /* Try to figure out if this is really an EXPLAIN statement. If this | |
| 1202 | ** cannot be verified, return early. */ | |
| 1203 | zSql = sqlite3_sql(pSql); | |
| 1204 | if( zSql==0 ) return; | |
| 1205 | for(z=zSql; *z==' ' || *z=='\t' || *z=='\n' || *z=='\f' || *z=='\r'; z++); | |
| 1206 | if( sqlite3_strnicmp(z, "explain", 7) ) return; | |
| 1208 | 1207 | |
| 1209 | for(iOp=0; SQLITE_ROW==sqlite3_step(pSql); iOp++){ | |
| 1210 | int i; | |
| 1211 | int iAddr = sqlite3_column_int(pSql, 0); | |
| 1212 | const char *zOp = (const char*)sqlite3_column_text(pSql, 1); | |
| 1208 | for(iOp=0; SQLITE_ROW==sqlite3_step(pSql); iOp++){ | |
| 1209 | int i; | |
| 1210 | int iAddr = sqlite3_column_int(pSql, 0); | |
| 1211 | const char *zOp = (const char*)sqlite3_column_text(pSql, 1); | |
| 1213 | 1212 | |
| 1214 | /* Set p2 to the P2 field of the current opcode. Then, assuming that | |
| 1215 | ** p2 is an instruction address, set variable p2op to the index of that | |
| 1216 | ** instruction in the aiIndent[] array. p2 and p2op may be different if | |
| 1217 | ** the current instruction is part of a sub-program generated by an | |
| 1218 | ** SQL trigger or foreign key. */ | |
| 1219 | int p2 = sqlite3_column_int(pSql, 3); | |
| 1220 | int p2op = (p2 + (iOp-iAddr)); | |
| 1213 | /* Set p2 to the P2 field of the current opcode. Then, assuming that | |
| 1214 | ** p2 is an instruction address, set variable p2op to the index of that | |
| 1215 | ** instruction in the aiIndent[] array. p2 and p2op may be different if | |
| 1216 | ** the current instruction is part of a sub-program generated by an | |
| 1217 | ** SQL trigger or foreign key. */ | |
| 1218 | int p2 = sqlite3_column_int(pSql, 3); | |
| 1219 | int p2op = (p2 + (iOp-iAddr)); | |
| 1221 | 1220 | |
| 1222 | /* Grow the p->aiIndent array as required */ | |
| 1223 | if( iOp>=nAlloc ){ | |
| 1224 | nAlloc += 100; | |
| 1225 | p->aiIndent = (int*)sqlite3_realloc(p->aiIndent, nAlloc*sizeof(int)); | |
| 1226 | abYield = (int*)sqlite3_realloc(abYield, nAlloc*sizeof(int)); | |
| 1227 | } | |
| 1228 | abYield[iOp] = str_in_array(zOp, azYield); | |
| 1229 | p->aiIndent[iOp] = 0; | |
| 1230 | p->nIndent = iOp+1; | |
| 1221 | /* Grow the p->aiIndent array as required */ | |
| 1222 | if( iOp>=nAlloc ){ | |
| 1223 | nAlloc += 100; | |
| 1224 | p->aiIndent = (int*)sqlite3_realloc(p->aiIndent, nAlloc*sizeof(int)); | |
| 1225 | abYield = (int*)sqlite3_realloc(abYield, nAlloc*sizeof(int)); | |
| 1226 | } | |
| 1227 | abYield[iOp] = str_in_array(zOp, azYield); | |
| 1228 | p->aiIndent[iOp] = 0; | |
| 1229 | p->nIndent = iOp+1; | |
| 1231 | 1230 | |
| 1232 | if( str_in_array(zOp, azNext) ){ | |
| 1233 | for(i=p2op; i<iOp; i++) p->aiIndent[i] += 2; | |
| 1234 | } | |
| 1235 | if( str_in_array(zOp, azGoto) && p2op<p->nIndent | |
| 1236 | && (abYield[p2op] || sqlite3_column_int(pSql, 2)) | |
| 1237 | ){ | |
| 1238 | for(i=p2op+1; i<iOp; i++) p->aiIndent[i] += 2; | |
| 1239 | } | |
| 1240 | } | |
| 1231 | if( str_in_array(zOp, azNext) ){ | |
| 1232 | for(i=p2op; i<iOp; i++) p->aiIndent[i] += 2; | |
| 1233 | } | |
| 1234 | if( str_in_array(zOp, azGoto) && p2op<p->nIndent | |
| 1235 | && (abYield[p2op] || sqlite3_column_int(pSql, 2)) | |
| 1236 | ){ | |
| 1237 | for(i=p2op+1; i<iOp; i++) p->aiIndent[i] += 2; | |
| 1238 | } | |
| 1239 | } | |
| 1241 | 1240 | |
| 1242 | p->iIndent = 0; | |
| 1243 | sqlite3_free(abYield); | |
| 1244 | sqlite3_reset(pSql); | |
| 1241 | p->iIndent = 0; | |
| 1242 | sqlite3_free(abYield); | |
| 1243 | sqlite3_reset(pSql); | |
| 1245 | 1244 | } |
| 1246 | 1245 | |
| 1247 | 1246 | /* |
| 1248 | 1247 | ** Free the array allocated by explain_data_prepare(). |
| 1249 | 1248 | */ |
| 1250 | 1249 | static void explain_data_delete(struct callback_data *p){ |
| 1251 | sqlite3_free(p->aiIndent); | |
| 1252 | p->aiIndent = 0; | |
| 1253 | p->nIndent = 0; | |
| 1254 | p->iIndent = 0; | |
| 1250 | sqlite3_free(p->aiIndent); | |
| 1251 | p->aiIndent = 0; | |
| 1252 | p->nIndent = 0; | |
| 1253 | p->iIndent = 0; | |
| 1255 | 1254 | } |
| 1256 | 1255 | |
| 1257 | 1256 | /* |
| 1258 | ** Execute a statement or set of statements. Print | |
| 1259 | ** any result rows/columns depending on the current mode | |
| 1257 | ** Execute a statement or set of statements. Print | |
| 1258 | ** any result rows/columns depending on the current mode | |
| 1260 | 1259 | ** set via the supplied callback. |
| 1261 | 1260 | ** |
| 1262 | ** This is very similar to SQLite's built-in sqlite3_exec() | |
| 1263 | ** function except it takes a slightly different callback | |
| 1261 | ** This is very similar to SQLite's built-in sqlite3_exec() | |
| 1262 | ** function except it takes a slightly different callback | |
| 1264 | 1263 | ** and callback data argument. |
| 1265 | 1264 | */ |
| 1266 | 1265 | static int shell_exec( |
| 1267 | sqlite3 *db, /* An open database */ | |
| 1268 | const char *zSql, /* SQL to be evaluated */ | |
| 1269 | int (*xCallback)(void*,int,char**,char**,int*), /* Callback function */ | |
| 1270 | /* (not the same as sqlite3_exec) */ | |
| 1271 | struct callback_data *pArg, /* Pointer to struct callback_data */ | |
| 1272 | char **pzErrMsg /* Error msg written here */ | |
| 1266 | sqlite3 *db, /* An open database */ | |
| 1267 | const char *zSql, /* SQL to be evaluated */ | |
| 1268 | int (*xCallback)(void*,int,char**,char**,int*), /* Callback function */ | |
| 1269 | /* (not the same as sqlite3_exec) */ | |
| 1270 | struct callback_data *pArg, /* Pointer to struct callback_data */ | |
| 1271 | char **pzErrMsg /* Error msg written here */ | |
| 1273 | 1272 | ){ |
| 1274 | sqlite3_stmt *pStmt = NULL; /* Statement to execute. */ | |
| 1275 | int rc = SQLITE_OK; /* Return Code */ | |
| 1276 | int rc2; | |
| 1277 | const char *zLeftover; /* Tail of unprocessed SQL */ | |
| 1273 | sqlite3_stmt *pStmt = NULL; /* Statement to execute. */ | |
| 1274 | int rc = SQLITE_OK; /* Return Code */ | |
| 1275 | int rc2; | |
| 1276 | const char *zLeftover; /* Tail of unprocessed SQL */ | |
| 1278 | 1277 | |
| 1279 | if( pzErrMsg ){ | |
| 1280 | *pzErrMsg = NULL; | |
| 1281 | } | |
| 1278 | if( pzErrMsg ){ | |
| 1279 | *pzErrMsg = NULL; | |
| 1280 | } | |
| 1282 | 1281 | |
| 1283 | while( zSql[0] && (SQLITE_OK == rc) ){ | |
| 1284 | rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover); | |
| 1285 | if( SQLITE_OK != rc ){ | |
| 1286 | if( pzErrMsg ){ | |
| 1287 | *pzErrMsg = save_err_msg(db); | |
| 1288 | } | |
| 1289 | }else{ | |
| 1290 | if( !pStmt ){ | |
| 1291 | /* this happens for a comment or white-space */ | |
| 1292 | zSql = zLeftover; | |
| 1293 | while( IsSpace(zSql[0]) ) zSql++; | |
| 1294 | continue; | |
| 1295 | } | |
| 1282 | while( zSql[0] && (SQLITE_OK == rc) ){ | |
| 1283 | rc = sqlite3_prepare_v2(db, zSql, -1, &pStmt, &zLeftover); | |
| 1284 | if( SQLITE_OK != rc ){ | |
| 1285 | if( pzErrMsg ){ | |
| 1286 | *pzErrMsg = save_err_msg(db); | |
| 1287 | } | |
| 1288 | }else{ | |
| 1289 | if( !pStmt ){ | |
| 1290 | /* this happens for a comment or white-space */ | |
| 1291 | zSql = zLeftover; | |
| 1292 | while( IsSpace(zSql[0]) ) zSql++; | |
| 1293 | continue; | |
| 1294 | } | |
| 1296 | 1295 | |
| 1297 | /* save off the prepared statment handle and reset row count */ | |
| 1298 | if( pArg ){ | |
| 1299 | pArg->pStmt = pStmt; | |
| 1300 | pArg->cnt = 0; | |
| 1301 | } | |
| 1296 | /* save off the prepared statment handle and reset row count */ | |
| 1297 | if( pArg ){ | |
| 1298 | pArg->pStmt = pStmt; | |
| 1299 | pArg->cnt = 0; | |
| 1300 | } | |
| 1302 | 1301 | |
| 1303 | /* echo the sql statement if echo on */ | |
| 1304 | if( pArg && pArg->echoOn ){ | |
| 1305 | const char *zStmtSql = sqlite3_sql(pStmt); | |
| 1306 | fprintf(pArg->out, "%s\n", zStmtSql ? zStmtSql : zSql); | |
| 1307 | } | |
| 1302 | /* echo the sql statement if echo on */ | |
| 1303 | if( pArg && pArg->echoOn ){ | |
| 1304 | const char *zStmtSql = sqlite3_sql(pStmt); | |
| 1305 | fprintf(pArg->out, "%s\n", zStmtSql ? zStmtSql : zSql); | |
| 1306 | } | |
| 1308 | 1307 | |
| 1309 | /* Show the EXPLAIN QUERY PLAN if .eqp is on */ | |
| 1310 | if( pArg && pArg->autoEQP ){ | |
| 1311 | sqlite3_stmt *pExplain; | |
| 1312 | char *zEQP = sqlite3_mprintf("EXPLAIN QUERY PLAN %s", sqlite3_sql(pStmt)); | |
| 1313 | rc = sqlite3_prepare_v2(db, zEQP, -1, &pExplain, 0); | |
| 1314 | if( rc==SQLITE_OK ){ | |
| 1315 | while( sqlite3_step(pExplain)==SQLITE_ROW ){ | |
| 1316 | fprintf(pArg->out,"--EQP-- %d,", sqlite3_column_int(pExplain, 0)); | |
| 1317 | fprintf(pArg->out,"%d,", sqlite3_column_int(pExplain, 1)); | |
| 1318 | fprintf(pArg->out,"%d,", sqlite3_column_int(pExplain, 2)); | |
| 1319 | fprintf(pArg->out,"%s\n", sqlite3_column_text(pExplain, 3)); | |
| 1320 | } | |
| 1321 | } | |
| 1322 | sqlite3_finalize(pExplain); | |
| 1323 | sqlite3_free(zEQP); | |
| 1324 | } | |
| 1308 | /* Show the EXPLAIN QUERY PLAN if .eqp is on */ | |
| 1309 | if( pArg && pArg->autoEQP ){ | |
| 1310 | sqlite3_stmt *pExplain; | |
| 1311 | char *zEQP = sqlite3_mprintf("EXPLAIN QUERY PLAN %s", sqlite3_sql(pStmt)); | |
| 1312 | rc = sqlite3_prepare_v2(db, zEQP, -1, &pExplain, 0); | |
| 1313 | if( rc==SQLITE_OK ){ | |
| 1314 | while( sqlite3_step(pExplain)==SQLITE_ROW ){ | |
| 1315 | fprintf(pArg->out,"--EQP-- %d,", sqlite3_column_int(pExplain, 0)); | |
| 1316 | fprintf(pArg->out,"%d,", sqlite3_column_int(pExplain, 1)); | |
| 1317 | fprintf(pArg->out,"%d,", sqlite3_column_int(pExplain, 2)); | |
| 1318 | fprintf(pArg->out,"%s\n", sqlite3_column_text(pExplain, 3)); | |
| 1319 | } | |
| 1320 | } | |
| 1321 | sqlite3_finalize(pExplain); | |
| 1322 | sqlite3_free(zEQP); | |
| 1323 | } | |
| 1325 | 1324 | |
| 1326 | /* Output TESTCTRL_EXPLAIN text of requested */ | |
| 1327 | if( pArg && pArg->mode==MODE_Explain ){ | |
| 1328 | const char *zExplain = 0; | |
| 1329 | sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain); | |
| 1330 | if( zExplain && zExplain[0] ){ | |
| 1331 | fprintf(pArg->out, "%s", zExplain); | |
| 1332 | } | |
| 1333 | } | |
| 1325 | /* Output TESTCTRL_EXPLAIN text of requested */ | |
| 1326 | if( pArg && pArg->mode==MODE_Explain ){ | |
| 1327 | const char *zExplain = 0; | |
| 1328 | sqlite3_test_control(SQLITE_TESTCTRL_EXPLAIN_STMT, pStmt, &zExplain); | |
| 1329 | if( zExplain && zExplain[0] ){ | |
| 1330 | fprintf(pArg->out, "%s", zExplain); | |
| 1331 | } | |
| 1332 | } | |
| 1334 | 1333 | |
| 1335 | /* If the shell is currently in ".explain" mode, gather the extra | |
| 1336 | ** data required to add indents to the output.*/ | |
| 1337 | if( pArg && pArg->mode==MODE_Explain ){ | |
| 1338 | explain_data_prepare(pArg, pStmt); | |
| 1339 | } | |
| 1334 | /* If the shell is currently in ".explain" mode, gather the extra | |
| 1335 | ** data required to add indents to the output.*/ | |
| 1336 | if( pArg && pArg->mode==MODE_Explain ){ | |
| 1337 | explain_data_prepare(pArg, pStmt); | |
| 1338 | } | |
| 1340 | 1339 | |
| 1341 | /* perform the first step. this will tell us if we | |
| 1342 | ** have a result set or not and how wide it is. | |
| 1343 | */ | |
| 1344 | rc = sqlite3_step(pStmt); | |
| 1345 | /* if we have a result set... */ | |
| 1346 | if( SQLITE_ROW == rc ){ | |
| 1347 | /* if we have a callback... */ | |
| 1348 | if( xCallback ){ | |
| 1349 | /* allocate space for col name ptr, value ptr, and type */ | |
| 1350 | int nCol = sqlite3_column_count(pStmt); | |
| 1351 | void *pData = sqlite3_malloc(3*nCol*sizeof(const char*) + 1); | |
| 1352 | if( !pData ){ | |
| 1353 | rc = SQLITE_NOMEM; | |
| 1354 | }else{ | |
| 1355 | char **azCols = (char **)pData; /* Names of result columns */ | |
| 1356 | char **azVals = &azCols[nCol]; /* Results */ | |
| 1357 | int *aiTypes = (int *)&azVals[nCol]; /* Result types */ | |
| 1358 | int i, x; | |
| 1359 | assert(sizeof(int) <= sizeof(char *)); | |
| 1360 | /* save off ptrs to column names */ | |
| 1361 | for(i=0; i<nCol; i++){ | |
| 1362 | azCols[i] = (char *)sqlite3_column_name(pStmt, i); | |
| 1363 | } | |
| 1364 | do{ | |
| 1365 | /* extract the data and data types */ | |
| 1366 | for(i=0; i<nCol; i++){ | |
| 1367 | aiTypes[i] = x = sqlite3_column_type(pStmt, i); | |
| 1368 | if( x==SQLITE_BLOB && pArg && pArg->mode==MODE_Insert ){ | |
| 1369 | azVals[i] = ""; | |
| 1370 | }else{ | |
| 1371 | azVals[i] = (char*)sqlite3_column_text(pStmt, i); | |
| 1372 | } | |
| 1373 | if( !azVals[i] && (aiTypes[i]!=SQLITE_NULL) ){ | |
| 1374 | rc = SQLITE_NOMEM; | |
| 1375 | break; /* from for */ | |
| 1376 | } | |
| 1377 | } /* end for */ | |
| 1340 | /* perform the first step. this will tell us if we | |
| 1341 | ** have a result set or not and how wide it is. | |
| 1342 | */ | |
| 1343 | rc = sqlite3_step(pStmt); | |
| 1344 | /* if we have a result set... */ | |
| 1345 | if( SQLITE_ROW == rc ){ | |
| 1346 | /* if we have a callback... */ | |
| 1347 | if( xCallback ){ | |
| 1348 | /* allocate space for col name ptr, value ptr, and type */ | |
| 1349 | int nCol = sqlite3_column_count(pStmt); | |
| 1350 | void *pData = sqlite3_malloc(3*nCol*sizeof(const char*) + 1); | |
| 1351 | if( !pData ){ | |
| 1352 | rc = SQLITE_NOMEM; | |
| 1353 | }else{ | |
| 1354 | char **azCols = (char **)pData; /* Names of result columns */ | |
| 1355 | char **azVals = &azCols[nCol]; /* Results */ | |
| 1356 | int *aiTypes = (int *)&azVals[nCol]; /* Result types */ | |
| 1357 | int i, x; | |
| 1358 | assert(sizeof(int) <= sizeof(char *)); | |
| 1359 | /* save off ptrs to column names */ | |
| 1360 | for(i=0; i<nCol; i++){ | |
| 1361 | azCols[i] = (char *)sqlite3_column_name(pStmt, i); | |
| 1362 | } | |
| 1363 | do{ | |
| 1364 | /* extract the data and data types */ | |
| 1365 | for(i=0; i<nCol; i++){ | |
| 1366 | aiTypes[i] = x = sqlite3_column_type(pStmt, i); | |
| 1367 | if( x==SQLITE_BLOB && pArg && pArg->mode==MODE_Insert ){ | |
| 1368 | azVals[i] = ""; | |
| 1369 | }else{ | |
| 1370 | azVals[i] = (char*)sqlite3_column_text(pStmt, i); | |
| 1371 | } | |
| 1372 | if( !azVals[i] && (aiTypes[i]!=SQLITE_NULL) ){ | |
| 1373 | rc = SQLITE_NOMEM; | |
| 1374 | break; /* from for */ | |
| 1375 | } | |
| 1376 | } /* end for */ | |
| 1378 | 1377 | |
| 1379 | /* if data and types extracted successfully... */ | |
| 1380 | if( SQLITE_ROW == rc ){ | |
| 1381 | /* call the supplied callback with the result row data */ | |
| 1382 | if( xCallback(pArg, nCol, azVals, azCols, aiTypes) ){ | |
| 1383 | rc = SQLITE_ABORT; | |
| 1384 | }else{ | |
| 1385 | rc = sqlite3_step(pStmt); | |
| 1386 | } | |
| 1387 | } | |
| 1388 | } while( SQLITE_ROW == rc ); | |
| 1389 | sqlite3_free(pData); | |
| 1390 | } | |
| 1391 | }else{ | |
| 1392 | do{ | |
| 1393 | rc = sqlite3_step(pStmt); | |
| 1394 | } while( rc == SQLITE_ROW ); | |
| 1395 | } | |
| 1396 | } | |
| 1378 | /* if data and types extracted successfully... */ | |
| 1379 | if( SQLITE_ROW == rc ){ | |
| 1380 | /* call the supplied callback with the result row data */ | |
| 1381 | if( xCallback(pArg, nCol, azVals, azCols, aiTypes) ){ | |
| 1382 | rc = SQLITE_ABORT; | |
| 1383 | }else{ | |
| 1384 | rc = sqlite3_step(pStmt); | |
| 1385 | } | |
| 1386 | } | |
| 1387 | } while( SQLITE_ROW == rc ); | |
| 1388 | sqlite3_free(pData); | |
| 1389 | } | |
| 1390 | }else{ | |
| 1391 | do{ | |
| 1392 | rc = sqlite3_step(pStmt); | |
| 1393 | } while( rc == SQLITE_ROW ); | |
| 1394 | } | |
| 1395 | } | |
| 1397 | 1396 | |
| 1398 | ||
| 1397 | explain_data_delete(pArg); | |
| 1399 | 1398 | |
| 1400 | /* print usage stats if stats on */ | |
| 1401 | if( pArg && pArg->statsOn ){ | |
| 1402 | display_stats(db, pArg, 0); | |
| 1403 | } | |
| 1399 | /* print usage stats if stats on */ | |
| 1400 | if( pArg && pArg->statsOn ){ | |
| 1401 | display_stats(db, pArg, 0); | |
| 1402 | } | |
| 1404 | 1403 | |
| 1405 | /* Finalize the statement just executed. If this fails, save a | |
| 1406 | ** copy of the error message. Otherwise, set zSql to point to the | |
| 1407 | ** next statement to execute. */ | |
| 1408 | rc2 = sqlite3_finalize(pStmt); | |
| 1409 | if( rc!=SQLITE_NOMEM ) rc = rc2; | |
| 1410 | if( rc==SQLITE_OK ){ | |
| 1411 | zSql = zLeftover; | |
| 1412 | while( IsSpace(zSql[0]) ) zSql++; | |
| 1413 | }else if( pzErrMsg ){ | |
| 1414 | *pzErrMsg = save_err_msg(db); | |
| 1415 | } | |
| 1404 | /* Finalize the statement just executed. If this fails, save a | |
| 1405 | ** copy of the error message. Otherwise, set zSql to point to the | |
| 1406 | ** next statement to execute. */ | |
| 1407 | rc2 = sqlite3_finalize(pStmt); | |
| 1408 | if( rc!=SQLITE_NOMEM ) rc = rc2; | |
| 1409 | if( rc==SQLITE_OK ){ | |
| 1410 | zSql = zLeftover; | |
| 1411 | while( IsSpace(zSql[0]) ) zSql++; | |
| 1412 | }else if( pzErrMsg ){ | |
| 1413 | *pzErrMsg = save_err_msg(db); | |
| 1414 | } | |
| 1416 | 1415 | |
| 1417 | /* clear saved stmt handle */ | |
| 1418 | if( pArg ){ | |
| 1419 | pArg->pStmt = NULL; | |
| 1420 | } | |
| 1421 | } | |
| 1422 | } /* end while */ | |
| 1416 | /* clear saved stmt handle */ | |
| 1417 | if( pArg ){ | |
| 1418 | pArg->pStmt = NULL; | |
| 1419 | } | |
| 1420 | } | |
| 1421 | } /* end while */ | |
| 1423 | 1422 | |
| 1424 | ||
| 1423 | return rc; | |
| 1425 | 1424 | } |
| 1426 | 1425 | |
| 1427 | 1426 | |
| r31373 | r31374 | |
| 1432 | 1431 | ** This routine should print text sufficient to recreate the table. |
| 1433 | 1432 | */ |
| 1434 | 1433 | static int dump_callback(void *pArg, int nArg, char **azArg, char **azCol){ |
| 1435 | int rc; | |
| 1436 | const char *zTable; | |
| 1437 | const char *zType; | |
| 1438 | const char *zSql; | |
| 1439 | const char *zPrepStmt = 0; | |
| 1440 | struct callback_data *p = (struct callback_data *)pArg; | |
| 1434 | int rc; | |
| 1435 | const char *zTable; | |
| 1436 | const char *zType; | |
| 1437 | const char *zSql; | |
| 1438 | const char *zPrepStmt = 0; | |
| 1439 | struct callback_data *p = (struct callback_data *)pArg; | |
| 1441 | 1440 | |
| 1442 | UNUSED_PARAMETER(azCol); | |
| 1443 | if( nArg!=3 ) return 1; | |
| 1444 | zTable = azArg[0]; | |
| 1445 | zType = azArg[1]; | |
| 1446 | zSql = azArg[2]; | |
| 1447 | ||
| 1448 | if( strcmp(zTable, "sqlite_sequence")==0 ){ | |
| 1449 | zPrepStmt = "DELETE FROM sqlite_sequence;\n"; | |
| 1450 | }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 ){ | |
| 1451 | fprintf(p->out, "ANALYZE sqlite_master;\n"); | |
| 1452 | }else if( strncmp(zTable, "sqlite_", 7)==0 ){ | |
| 1453 | return 0; | |
| 1454 | }else if( strncmp(zSql, "CREATE VIRTUAL TABLE", 20)==0 ){ | |
| 1455 | char *zIns; | |
| 1456 | if( !p->writableSchema ){ | |
| 1457 | fprintf(p->out, "PRAGMA writable_schema=ON;\n"); | |
| 1458 | p->writableSchema = 1; | |
| 1459 | } | |
| 1460 | zIns = sqlite3_mprintf( | |
| 1461 | "INSERT INTO sqlite_master(type,name,tbl_name,rootpage,sql)" | |
| 1462 | "VALUES('table','%q','%q',0,'%q');", | |
| 1463 | zTable, zTable, zSql); | |
| 1464 | fprintf(p->out, "%s\n", zIns); | |
| 1465 | sqlite3_free(zIns); | |
| 1466 | return 0; | |
| 1467 | }else{ | |
| 1468 | fprintf(p->out, "%s;\n", zSql); | |
| 1469 | } | |
| 1441 | UNUSED_PARAMETER(azCol); | |
| 1442 | if( nArg!=3 ) return 1; | |
| 1443 | zTable = azArg[0]; | |
| 1444 | zType = azArg[1]; | |
| 1445 | zSql = azArg[2]; | |
| 1470 | 1446 | |
| 1471 | if( strcmp(zType, "table")==0 ){ | |
| 1472 | sqlite3_stmt *pTableInfo = 0; | |
| 1473 | char *zSelect = 0; | |
| 1474 | char *zTableInfo = 0; | |
| 1475 | char *zTmp = 0; | |
| 1476 | int nRow = 0; | |
| 1477 | ||
| 1478 | zTableInfo = appendText(zTableInfo, "PRAGMA table_info(", 0); | |
| 1479 | zTableInfo = appendText(zTableInfo, zTable, '"'); | |
| 1480 | zTableInfo = appendText(zTableInfo, ");", 0); | |
| 1447 | if( strcmp(zTable, "sqlite_sequence")==0 ){ | |
| 1448 | zPrepStmt = "DELETE FROM sqlite_sequence;\n"; | |
| 1449 | }else if( sqlite3_strglob("sqlite_stat?", zTable)==0 ){ | |
| 1450 | fprintf(p->out, "ANALYZE sqlite_master;\n"); | |
| 1451 | }else if( strncmp(zTable, "sqlite_", 7)==0 ){ | |
| 1452 | return 0; | |
| 1453 | }else if( strncmp(zSql, "CREATE VIRTUAL TABLE", 20)==0 ){ | |
| 1454 | char *zIns; | |
| 1455 | if( !p->writableSchema ){ | |
| 1456 | fprintf(p->out, "PRAGMA writable_schema=ON;\n"); | |
| 1457 | p->writableSchema = 1; | |
| 1458 | } | |
| 1459 | zIns = sqlite3_mprintf( | |
| 1460 | "INSERT INTO sqlite_master(type,name,tbl_name,rootpage,sql)" | |
| 1461 | "VALUES('table','%q','%q',0,'%q');", | |
| 1462 | zTable, zTable, zSql); | |
| 1463 | fprintf(p->out, "%s\n", zIns); | |
| 1464 | sqlite3_free(zIns); | |
| 1465 | return 0; | |
| 1466 | }else{ | |
| 1467 | fprintf(p->out, "%s;\n", zSql); | |
| 1468 | } | |
| 1481 | 1469 | |
| 1482 | rc = sqlite3_prepare_v2(p->db, zTableInfo, -1, &pTableInfo, 0); | |
| 1483 | free(zTableInfo); | |
| 1484 | if( rc!=SQLITE_OK || !pTableInfo ){ | |
| 1485 | return 1; | |
| 1486 | } | |
| 1470 | if( strcmp(zType, "table")==0 ){ | |
| 1471 | sqlite3_stmt *pTableInfo = 0; | |
| 1472 | char *zSelect = 0; | |
| 1473 | char *zTableInfo = 0; | |
| 1474 | char *zTmp = 0; | |
| 1475 | int nRow = 0; | |
| 1487 | 1476 | |
| 1488 | zSelect = appendText(zSelect, "SELECT 'INSERT INTO ' || ", 0); | |
| 1489 | /* Always quote the table name, even if it appears to be pure ascii, | |
| 1490 | ** in case it is a keyword. Ex: INSERT INTO "table" ... */ | |
| 1491 | zTmp = appendText(zTmp, zTable, '"'); | |
| 1492 | if( zTmp ){ | |
| 1493 | zSelect = appendText(zSelect, zTmp, '\''); | |
| 1494 | free(zTmp); | |
| 1495 | } | |
| 1496 | zSelect = appendText(zSelect, " || ' VALUES(' || ", 0); | |
| 1497 | rc = sqlite3_step(pTableInfo); | |
| 1498 | while( rc==SQLITE_ROW ){ | |
| 1499 | const char *zText = (const char *)sqlite3_column_text(pTableInfo, 1); | |
| 1500 | zSelect = appendText(zSelect, "quote(", 0); | |
| 1501 | zSelect = appendText(zSelect, zText, '"'); | |
| 1502 | rc = sqlite3_step(pTableInfo); | |
| 1503 | if( rc==SQLITE_ROW ){ | |
| 1504 | zSelect = appendText(zSelect, "), ", 0); | |
| 1505 | }else{ | |
| 1506 | zSelect = appendText(zSelect, ") ", 0); | |
| 1507 | } | |
| 1508 | nRow++; | |
| 1509 | } | |
| 1510 | rc = sqlite3_finalize(pTableInfo); | |
| 1511 | if( rc!=SQLITE_OK || nRow==0 ){ | |
| 1512 | free(zSelect); | |
| 1513 | return 1; | |
| 1514 | } | |
| 1515 | zSelect = appendText(zSelect, "|| ')' FROM ", 0); | |
| 1516 | zSelect = appendText(zSelect, zTable, '"'); | |
| 1477 | zTableInfo = appendText(zTableInfo, "PRAGMA table_info(", 0); | |
| 1478 | zTableInfo = appendText(zTableInfo, zTable, '"'); | |
| 1479 | zTableInfo = appendText(zTableInfo, ");", 0); | |
| 1517 | 1480 | |
| 1518 | rc = run_table_dump_query(p, zSelect, zPrepStmt); | |
| 1519 | if( rc==SQLITE_CORRUPT ){ | |
| 1520 | zSelect = appendText(zSelect, " ORDER BY rowid DESC", 0); | |
| 1521 | run_table_dump_query(p, zSelect, 0); | |
| 1522 | } | |
| 1523 | free(zSelect); | |
| 1524 | } | |
| 1525 | return 0; | |
| 1481 | rc = sqlite3_prepare_v2(p->db, zTableInfo, -1, &pTableInfo, 0); | |
| 1482 | free(zTableInfo); | |
| 1483 | if( rc!=SQLITE_OK || !pTableInfo ){ | |
| 1484 | return 1; | |
| 1485 | } | |
| 1486 | ||
| 1487 | zSelect = appendText(zSelect, "SELECT 'INSERT INTO ' || ", 0); | |
| 1488 | /* Always quote the table name, even if it appears to be pure ascii, | |
| 1489 | ** in case it is a keyword. Ex: INSERT INTO "table" ... */ | |
| 1490 | zTmp = appendText(zTmp, zTable, '"'); | |
| 1491 | if( zTmp ){ | |
| 1492 | zSelect = appendText(zSelect, zTmp, '\''); | |
| 1493 | free(zTmp); | |
| 1494 | } | |
| 1495 | zSelect = appendText(zSelect, " || ' VALUES(' || ", 0); | |
| 1496 | rc = sqlite3_step(pTableInfo); | |
| 1497 | while( rc==SQLITE_ROW ){ | |
| 1498 | const char *zText = (const char *)sqlite3_column_text(pTableInfo, 1); | |
| 1499 | zSelect = appendText(zSelect, "quote(", 0); | |
| 1500 | zSelect = appendText(zSelect, zText, '"'); | |
| 1501 | rc = sqlite3_step(pTableInfo); | |
| 1502 | if( rc==SQLITE_ROW ){ | |
| 1503 | zSelect = appendText(zSelect, "), ", 0); | |
| 1504 | }else{ | |
| 1505 | zSelect = appendText(zSelect, ") ", 0); | |
| 1506 | } | |
| 1507 | nRow++; | |
| 1508 | } | |
| 1509 | rc = sqlite3_finalize(pTableInfo); | |
| 1510 | if( rc!=SQLITE_OK || nRow==0 ){ | |
| 1511 | free(zSelect); | |
| 1512 | return 1; | |
| 1513 | } | |
| 1514 | zSelect = appendText(zSelect, "|| ')' FROM ", 0); | |
| 1515 | zSelect = appendText(zSelect, zTable, '"'); | |
| 1516 | ||
| 1517 | rc = run_table_dump_query(p, zSelect, zPrepStmt); | |
| 1518 | if( rc==SQLITE_CORRUPT ){ | |
| 1519 | zSelect = appendText(zSelect, " ORDER BY rowid DESC", 0); | |
| 1520 | run_table_dump_query(p, zSelect, 0); | |
| 1521 | } | |
| 1522 | free(zSelect); | |
| 1523 | } | |
| 1524 | return 0; | |
| 1526 | 1525 | } |
| 1527 | 1526 | |
| 1528 | 1527 | /* |
| r31373 | r31374 | |
| 1533 | 1532 | ** "ORDER BY rowid DESC" to the end. |
| 1534 | 1533 | */ |
| 1535 | 1534 | static int run_schema_dump_query( |
| 1536 | struct callback_data *p, | |
| 1537 | const char *zQuery | |
| 1535 | struct callback_data *p, | |
| 1536 | const char *zQuery | |
| 1538 | 1537 | ){ |
| 1539 | int rc; | |
| 1540 | char *zErr = 0; | |
| 1541 | rc = sqlite3_exec(p->db, zQuery, dump_callback, p, &zErr); | |
| 1542 | if( rc==SQLITE_CORRUPT ){ | |
| 1543 | char *zQ2; | |
| 1544 | int len = strlen30(zQuery); | |
| 1545 | fprintf(p->out, "/****** CORRUPTION ERROR *******/\n"); | |
| 1546 | if( zErr ){ | |
| 1547 | fprintf(p->out, "/****** %s ******/\n", zErr); | |
| 1548 | sqlite3_free(zErr); | |
| 1549 | zErr = 0; | |
| 1550 | } | |
| 1551 | zQ2 = (char *)malloc( len+100 ); | |
| 1552 | if( zQ2==0 ) return rc; | |
| 1553 | sqlite3_snprintf(len+100, zQ2, "%s ORDER BY rowid DESC", zQuery); | |
| 1554 | rc = sqlite3_exec(p->db, zQ2, dump_callback, p, &zErr); | |
| 1555 | if( rc ){ | |
| 1556 | fprintf(p->out, "/****** ERROR: %s ******/\n", zErr); | |
| 1557 | }else{ | |
| 1558 | rc = SQLITE_CORRUPT; | |
| 1559 | } | |
| 1560 | sqlite3_free(zErr); | |
| 1561 | free(zQ2); | |
| 1562 | } | |
| 1563 | return rc; | |
| 1538 | int rc; | |
| 1539 | char *zErr = 0; | |
| 1540 | rc = sqlite3_exec(p->db, zQuery, dump_callback, p, &zErr); | |
| 1541 | if( rc==SQLITE_CORRUPT ){ | |
| 1542 | char *zQ2; | |
| 1543 | int len = strlen30(zQuery); | |
| 1544 | fprintf(p->out, "/****** CORRUPTION ERROR *******/\n"); | |
| 1545 | if( zErr ){ | |
| 1546 | fprintf(p->out, "/****** %s ******/\n", zErr); | |
| 1547 | sqlite3_free(zErr); | |
| 1548 | zErr = 0; | |
| 1549 | } | |
| 1550 | zQ2 = (char *)malloc( len+100 ); | |
| 1551 | if( zQ2==0 ) return rc; | |
| 1552 | sqlite3_snprintf(len+100, zQ2, "%s ORDER BY rowid DESC", zQuery); | |
| 1553 | rc = sqlite3_exec(p->db, zQ2, dump_callback, p, &zErr); | |
| 1554 | if( rc ){ | |
| 1555 | fprintf(p->out, "/****** ERROR: %s ******/\n", zErr); | |
| 1556 | }else{ | |
| 1557 | rc = SQLITE_CORRUPT; | |
| 1558 | } | |
| 1559 | sqlite3_free(zErr); | |
| 1560 | free(zQ2); | |
| 1561 | } | |
| 1562 | return rc; | |
| 1564 | 1563 | } |
| 1565 | 1564 | |
| 1566 | 1565 | /* |
| 1567 | 1566 | ** Text of a help message |
| 1568 | 1567 | */ |
| 1569 | 1568 | static char zHelp[] = |
| 1570 | ".backup ?DB? FILE Backup DB (default \"main\") to FILE\n" | |
| 1571 | ".bail ON|OFF Stop after hitting an error. Default OFF\n" | |
| 1572 | ".clone NEWDB Clone data into NEWDB from the existing database\n" | |
| 1573 | ".databases List names and files of attached databases\n" | |
| 1574 | ".dump ?TABLE? ... Dump the database in an SQL text format\n" | |
| 1575 | " If TABLE specified, only dump tables matching\n" | |
| 1576 | " LIKE pattern TABLE.\n" | |
| 1577 | ".echo ON|OFF Turn command echo on or off\n" | |
| 1578 | ".exit Exit this program\n" | |
| 1579 | ".explain ?ON|OFF? Turn output mode suitable for EXPLAIN on or off.\n" | |
| 1580 | " With no args, it turns EXPLAIN on.\n" | |
| 1581 | ".header(s) ON|OFF Turn display of headers on or off\n" | |
| 1582 | ".help Show this message\n" | |
| 1583 | ".import FILE TABLE Import data from FILE into TABLE\n" | |
| 1584 | ".indices ?TABLE? Show names of all indices\n" | |
| 1585 | " If TABLE specified, only show indices for tables\n" | |
| 1586 | " matching LIKE pattern TABLE.\n" | |
| 1569 | ".backup ?DB? FILE Backup DB (default \"main\") to FILE\n" | |
| 1570 | ".bail ON|OFF Stop after hitting an error. Default OFF\n" | |
| 1571 | ".clone NEWDB Clone data into NEWDB from the existing database\n" | |
| 1572 | ".databases List names and files of attached databases\n" | |
| 1573 | ".dump ?TABLE? ... Dump the database in an SQL text format\n" | |
| 1574 | " If TABLE specified, only dump tables matching\n" | |
| 1575 | " LIKE pattern TABLE.\n" | |
| 1576 | ".echo ON|OFF Turn command echo on or off\n" | |
| 1577 | ".exit Exit this program\n" | |
| 1578 | ".explain ?ON|OFF? Turn output mode suitable for EXPLAIN on or off.\n" | |
| 1579 | " With no args, it turns EXPLAIN on.\n" | |
| 1580 | ".header(s) ON|OFF Turn display of headers on or off\n" | |
| 1581 | ".help Show this message\n" | |
| 1582 | ".import FILE TABLE Import data from FILE into TABLE\n" | |
| 1583 | ".indices ?TABLE? Show names of all indices\n" | |
| 1584 | " If TABLE specified, only show indices for tables\n" | |
| 1585 | " matching LIKE pattern TABLE.\n" | |
| 1587 | 1586 | #ifdef SQLITE_ENABLE_IOTRACE |
| 1588 | ||
| 1587 | ".iotrace FILE Enable I/O diagnostic logging to FILE\n" | |
| 1589 | 1588 | #endif |
| 1590 | 1589 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 1591 | ||
| 1590 | ".load FILE ?ENTRY? Load an extension library\n" | |
| 1592 | 1591 | #endif |
| 1593 | ".log FILE|off Turn logging on or off. FILE can be stderr/stdout\n" | |
| 1594 | ".mode MODE ?TABLE? Set output mode where MODE is one of:\n" | |
| 1595 | " csv Comma-separated values\n" | |
| 1596 | " column Left-aligned columns. (See .width)\n" | |
| 1597 | " html HTML <table> code\n" | |
| 1598 | " insert SQL insert statements for TABLE\n" | |
| 1599 | " line One value per line\n" | |
| 1600 | " list Values delimited by .separator string\n" | |
| 1601 | " tabs Tab-separated values\n" | |
| 1602 | " tcl TCL list elements\n" | |
| 1603 | ".nullvalue STRING Use STRING in place of NULL values\n" | |
| 1604 | ".open ?FILENAME? Close existing database and reopen FILENAME\n" | |
| 1605 | ".output FILENAME Send output to FILENAME\n" | |
| 1606 | ".output stdout Send output to the screen\n" | |
| 1607 | ".print STRING... Print literal STRING\n" | |
| 1608 | ".prompt MAIN CONTINUE Replace the standard prompts\n" | |
| 1609 | ".quit Exit this program\n" | |
| 1610 | ".read FILENAME Execute SQL in FILENAME\n" | |
| 1611 | ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE\n" | |
| 1612 | ".save FILE Write in-memory database into FILE\n" | |
| 1613 | ".schema ?TABLE? Show the CREATE statements\n" | |
| 1614 | " If TABLE specified, only show tables matching\n" | |
| 1615 | " LIKE pattern TABLE.\n" | |
| 1616 | ".separator STRING Change separator used by output mode and .import\n" | |
| 1617 | ".show Show the current values for various settings\n" | |
| 1618 | ".stats ON|OFF Turn stats on or off\n" | |
| 1619 | ".tables ?TABLE? List names of tables\n" | |
| 1620 | " If TABLE specified, only list tables matching\n" | |
| 1621 | " LIKE pattern TABLE.\n" | |
| 1622 | ".timeout MS Try opening locked tables for MS milliseconds\n" | |
| 1623 | ".trace FILE|off Output each SQL statement as it is run\n" | |
| 1624 | ".vfsname ?AUX? Print the name of the VFS stack\n" | |
| 1625 | ".width NUM1 NUM2 ... Set column widths for \"column\" mode\n" | |
| 1592 | ".log FILE|off Turn logging on or off. FILE can be stderr/stdout\n" | |
| 1593 | ".mode MODE ?TABLE? Set output mode where MODE is one of:\n" | |
| 1594 | " csv Comma-separated values\n" | |
| 1595 | " column Left-aligned columns. (See .width)\n" | |
| 1596 | " html HTML <table> code\n" | |
| 1597 | " insert SQL insert statements for TABLE\n" | |
| 1598 | " line One value per line\n" | |
| 1599 | " list Values delimited by .separator string\n" | |
| 1600 | " tabs Tab-separated values\n" | |
| 1601 | " tcl TCL list elements\n" | |
| 1602 | ".nullvalue STRING Use STRING in place of NULL values\n" | |
| 1603 | ".open ?FILENAME? Close existing database and reopen FILENAME\n" | |
| 1604 | ".output FILENAME Send output to FILENAME\n" | |
| 1605 | ".output stdout Send output to the screen\n" | |
| 1606 | ".print STRING... Print literal STRING\n" | |
| 1607 | ".prompt MAIN CONTINUE Replace the standard prompts\n" | |
| 1608 | ".quit Exit this program\n" | |
| 1609 | ".read FILENAME Execute SQL in FILENAME\n" | |
| 1610 | ".restore ?DB? FILE Restore content of DB (default \"main\") from FILE\n" | |
| 1611 | ".save FILE Write in-memory database into FILE\n" | |
| 1612 | ".schema ?TABLE? Show the CREATE statements\n" | |
| 1613 | " If TABLE specified, only show tables matching\n" | |
| 1614 | " LIKE pattern TABLE.\n" | |
| 1615 | ".separator STRING Change separator used by output mode and .import\n" | |
| 1616 | ".show Show the current values for various settings\n" | |
| 1617 | ".stats ON|OFF Turn stats on or off\n" | |
| 1618 | ".tables ?TABLE? List names of tables\n" | |
| 1619 | " If TABLE specified, only list tables matching\n" | |
| 1620 | " LIKE pattern TABLE.\n" | |
| 1621 | ".timeout MS Try opening locked tables for MS milliseconds\n" | |
| 1622 | ".trace FILE|off Output each SQL statement as it is run\n" | |
| 1623 | ".vfsname ?AUX? Print the name of the VFS stack\n" | |
| 1624 | ".width NUM1 NUM2 ... Set column widths for \"column\" mode\n" | |
| 1626 | 1625 | ; |
| 1627 | 1626 | |
| 1628 | 1627 | static char zTimerHelp[] = |
| 1629 | ||
| 1628 | ".timer ON|OFF Turn the CPU timer measurement on or off\n" | |
| 1630 | 1629 | ; |
| 1631 | 1630 | |
| 1632 | 1631 | /* Forward reference */ |
| r31373 | r31374 | |
| 1637 | 1636 | ** the database fails to open, print an error message and exit. |
| 1638 | 1637 | */ |
| 1639 | 1638 | static void open_db(struct callback_data *p, int keepAlive){ |
| 1640 | if( p->db==0 ){ | |
| 1641 | sqlite3_initialize(); | |
| 1642 | sqlite3_open(p->zDbFilename, &p->db); | |
| 1643 | db = p->db; | |
| 1644 | if( db && sqlite3_errcode(db)==SQLITE_OK ){ | |
| 1645 | sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0, | |
| 1646 | shellstaticFunc, 0, 0); | |
| 1647 | } | |
| 1648 | if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){ | |
| 1649 | fprintf(stderr,"Error: unable to open database \"%s\": %s\n", | |
| 1650 | p->zDbFilename, sqlite3_errmsg(db)); | |
| 1651 | if( keepAlive ) return; | |
| 1652 | exit(1); | |
| 1653 | } | |
| 1639 | if( p->db==0 ){ | |
| 1640 | sqlite3_initialize(); | |
| 1641 | sqlite3_open(p->zDbFilename, &p->db); | |
| 1642 | db = p->db; | |
| 1643 | if( db && sqlite3_errcode(db)==SQLITE_OK ){ | |
| 1644 | sqlite3_create_function(db, "shellstatic", 0, SQLITE_UTF8, 0, | |
| 1645 | shellstaticFunc, 0, 0); | |
| 1646 | } | |
| 1647 | if( db==0 || SQLITE_OK!=sqlite3_errcode(db) ){ | |
| 1648 | fprintf(stderr,"Error: unable to open database \"%s\": %s\n", | |
| 1649 | p->zDbFilename, sqlite3_errmsg(db)); | |
| 1650 | if( keepAlive ) return; | |
| 1651 | exit(1); | |
| 1652 | } | |
| 1654 | 1653 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 1655 | ||
| 1654 | sqlite3_enable_load_extension(p->db, 1); | |
| 1656 | 1655 | #endif |
| 1657 | ||
| 1656 | } | |
| 1658 | 1657 | } |
| 1659 | 1658 | |
| 1660 | 1659 | /* |
| r31373 | r31374 | |
| 1668 | 1667 | ** \\ -> backslash |
| 1669 | 1668 | */ |
| 1670 | 1669 | static void resolve_backslashes(char *z){ |
| 1671 | int i, j; | |
| 1672 | char c; | |
| 1673 | for(i=j=0; (c = z[i])!=0; i++, j++){ | |
| 1674 | if( c=='\\' ){ | |
| 1675 | c = z[++i]; | |
| 1676 | if( c=='n' ){ | |
| 1677 | c = '\n'; | |
| 1678 | }else if( c=='t' ){ | |
| 1679 | c = '\t'; | |
| 1680 | }else if( c=='r' ){ | |
| 1681 | c = '\r'; | |
| 1682 | }else if( c=='\\' ){ | |
| 1683 | c = '\\'; | |
| 1684 | }else if( c>='0' && c<='7' ){ | |
| 1685 | c -= '0'; | |
| 1686 | if( z[i+1]>='0' && z[i+1]<='7' ){ | |
| 1687 | i++; | |
| 1688 | c = (c<<3) + z[i] - '0'; | |
| 1689 | if( z[i+1]>='0' && z[i+1]<='7' ){ | |
| 1690 | i++; | |
| 1691 | c = (c<<3) + z[i] - '0'; | |
| 1692 | } | |
| 1693 | } | |
| 1694 | } | |
| 1695 | } | |
| 1696 | z[j] = c; | |
| 1697 | } | |
| 1698 | z[j] = 0; | |
| 1670 | int i, j; | |
| 1671 | char c; | |
| 1672 | for(i=j=0; (c = z[i])!=0; i++, j++){ | |
| 1673 | if( c=='\\' ){ | |
| 1674 | c = z[++i]; | |
| 1675 | if( c=='n' ){ | |
| 1676 | c = '\n'; | |
| 1677 | }else if( c=='t' ){ | |
| 1678 | c = '\t'; | |
| 1679 | }else if( c=='r' ){ | |
| 1680 | c = '\r'; | |
| 1681 | }else if( c=='\\' ){ | |
| 1682 | c = '\\'; | |
| 1683 | }else if( c>='0' && c<='7' ){ | |
| 1684 | c -= '0'; | |
| 1685 | if( z[i+1]>='0' && z[i+1]<='7' ){ | |
| 1686 | i++; | |
| 1687 | c = (c<<3) + z[i] - '0'; | |
| 1688 | if( z[i+1]>='0' && z[i+1]<='7' ){ | |
| 1689 | i++; | |
| 1690 | c = (c<<3) + z[i] - '0'; | |
| 1691 | } | |
| 1692 | } | |
| 1693 | } | |
| 1694 | } | |
| 1695 | z[j] = c; | |
| 1696 | } | |
| 1697 | z[j] = 0; | |
| 1699 | 1698 | } |
| 1700 | 1699 | |
| 1701 | 1700 | /* |
| r31373 | r31374 | |
| 1703 | 1702 | ** is not a hex digit. |
| 1704 | 1703 | */ |
| 1705 | 1704 | static int hexDigitValue(char c){ |
| 1706 | if( c>='0' && c<='9' ) return c - '0'; | |
| 1707 | if( c>='a' && c<='f' ) return c - 'a' + 10; | |
| 1708 | if( c>='A' && c<='F' ) return c - 'A' + 10; | |
| 1709 | return -1; | |
| 1705 | if( c>='0' && c<='9' ) return c - '0'; | |
| 1706 | if( c>='a' && c<='f' ) return c - 'a' + 10; | |
| 1707 | if( c>='A' && c<='F' ) return c - 'A' + 10; | |
| 1708 | return -1; | |
| 1710 | 1709 | } |
| 1711 | 1710 | |
| 1712 | 1711 | /* |
| 1713 | 1712 | ** Interpret zArg as an integer value, possibly with suffixes. |
| 1714 | 1713 | */ |
| 1715 | 1714 | static sqlite3_int64 integerValue(const char *zArg){ |
| 1716 | sqlite3_int64 v = 0; | |
| 1717 | static const struct { char *zSuffix; int iMult; } aMult[] = { | |
| 1718 | { "KiB", 1024 }, | |
| 1719 | { "MiB", 1024*1024 }, | |
| 1720 | { "GiB", 1024*1024*1024 }, | |
| 1721 | { "KB", 1000 }, | |
| 1722 | { "MB", 1000000 }, | |
| 1723 | { "GB", 1000000000 }, | |
| 1724 | { "K", 1000 }, | |
| 1725 | { "M", 1000000 }, | |
| 1726 | { "G", 1000000000 }, | |
| 1727 | }; | |
| 1728 | int i; | |
| 1729 | int isNeg = 0; | |
| 1730 | if( zArg[0]=='-' ){ | |
| 1731 | isNeg = 1; | |
| 1732 | zArg++; | |
| 1733 | }else if( zArg[0]=='+' ){ | |
| 1734 | zArg++; | |
| 1735 | } | |
| 1736 | if( zArg[0]=='0' && zArg[1]=='x' ){ | |
| 1737 | int x; | |
| 1738 | zArg += 2; | |
| 1739 | while( (x = hexDigitValue(zArg[0]))>=0 ){ | |
| 1740 | v = (v<<4) + x; | |
| 1741 | zArg++; | |
| 1742 | } | |
| 1743 | }else{ | |
| 1744 | while( IsDigit(zArg[0]) ){ | |
| 1745 | v = v*10 + zArg[0] - '0'; | |
| 1746 | zArg++; | |
| 1747 | } | |
| 1748 | } | |
| 1749 | for(i=0; i<ArraySize(aMult); i++){ | |
| 1750 | if( sqlite3_stricmp(aMult[i].zSuffix, zArg)==0 ){ | |
| 1751 | v *= aMult[i].iMult; | |
| 1752 | break; | |
| 1753 | } | |
| 1754 | } | |
| 1755 | return isNeg? -v : v; | |
| 1715 | sqlite3_int64 v = 0; | |
| 1716 | static const struct { char *zSuffix; int iMult; } aMult[] = { | |
| 1717 | { "KiB", 1024 }, | |
| 1718 | { "MiB", 1024*1024 }, | |
| 1719 | { "GiB", 1024*1024*1024 }, | |
| 1720 | { "KB", 1000 }, | |
| 1721 | { "MB", 1000000 }, | |
| 1722 | { "GB", 1000000000 }, | |
| 1723 | { "K", 1000 }, | |
| 1724 | { "M", 1000000 }, | |
| 1725 | { "G", 1000000000 }, | |
| 1726 | }; | |
| 1727 | int i; | |
| 1728 | int isNeg = 0; | |
| 1729 | if( zArg[0]=='-' ){ | |
| 1730 | isNeg = 1; | |
| 1731 | zArg++; | |
| 1732 | }else if( zArg[0]=='+' ){ | |
| 1733 | zArg++; | |
| 1734 | } | |
| 1735 | if( zArg[0]=='0' && zArg[1]=='x' ){ | |
| 1736 | int x; | |
| 1737 | zArg += 2; | |
| 1738 | while( (x = hexDigitValue(zArg[0]))>=0 ){ | |
| 1739 | v = (v<<4) + x; | |
| 1740 | zArg++; | |
| 1741 | } | |
| 1742 | }else{ | |
| 1743 | while( IsDigit(zArg[0]) ){ | |
| 1744 | v = v*10 + zArg[0] - '0'; | |
| 1745 | zArg++; | |
| 1746 | } | |
| 1747 | } | |
| 1748 | for(i=0; i<ArraySize(aMult); i++){ | |
| 1749 | if( sqlite3_stricmp(aMult[i].zSuffix, zArg)==0 ){ | |
| 1750 | v *= aMult[i].iMult; | |
| 1751 | break; | |
| 1752 | } | |
| 1753 | } | |
| 1754 | return isNeg? -v : v; | |
| 1756 | 1755 | } |
| 1757 | 1756 | |
| 1758 | 1757 | /* |
| r31373 | r31374 | |
| 1760 | 1759 | ** for TRUE and FALSE. Return the integer value if appropriate. |
| 1761 | 1760 | */ |
| 1762 | 1761 | static int booleanValue(char *zArg){ |
| 1763 | int i; | |
| 1764 | if( zArg[0]=='0' && zArg[1]=='x' ){ | |
| 1765 | for(i=2; hexDigitValue(zArg[i])>=0; i++){} | |
| 1766 | }else{ | |
| 1767 | for(i=0; zArg[i]>='0' && zArg[i]<='9'; i++){} | |
| 1768 | } | |
| 1769 | if( i>0 && zArg[i]==0 ) return (int)(integerValue(zArg) & 0xffffffff); | |
| 1770 | if( sqlite3_stricmp(zArg, "on")==0 || sqlite3_stricmp(zArg,"yes")==0 ){ | |
| 1771 | return 1; | |
| 1772 | } | |
| 1773 | if( sqlite3_stricmp(zArg, "off")==0 || sqlite3_stricmp(zArg,"no")==0 ){ | |
| 1774 | return 0; | |
| 1775 | } | |
| 1776 | fprintf(stderr, "ERROR: Not a boolean value: \"%s\". Assuming \"no\".\n", | |
| 1777 | zArg); | |
| 1778 | return 0; | |
| 1762 | int i; | |
| 1763 | if( zArg[0]=='0' && zArg[1]=='x' ){ | |
| 1764 | for(i=2; hexDigitValue(zArg[i])>=0; i++){} | |
| 1765 | }else{ | |
| 1766 | for(i=0; zArg[i]>='0' && zArg[i]<='9'; i++){} | |
| 1767 | } | |
| 1768 | if( i>0 && zArg[i]==0 ) return (int)(integerValue(zArg) & 0xffffffff); | |
| 1769 | if( sqlite3_stricmp(zArg, "on")==0 || sqlite3_stricmp(zArg,"yes")==0 ){ | |
| 1770 | return 1; | |
| 1771 | } | |
| 1772 | if( sqlite3_stricmp(zArg, "off")==0 || sqlite3_stricmp(zArg,"no")==0 ){ | |
| 1773 | return 0; | |
| 1774 | } | |
| 1775 | fprintf(stderr, "ERROR: Not a boolean value: \"%s\". Assuming \"no\".\n", | |
| 1776 | zArg); | |
| 1777 | return 0; | |
| 1779 | 1778 | } |
| 1780 | 1779 | |
| 1781 | 1780 | /* |
| 1782 | 1781 | ** Close an output file, assuming it is not stderr or stdout |
| 1783 | 1782 | */ |
| 1784 | 1783 | static void output_file_close(FILE *f){ |
| 1785 | ||
| 1784 | if( f && f!=stdout && f!=stderr ) fclose(f); | |
| 1786 | 1785 | } |
| 1787 | 1786 | |
| 1788 | 1787 | /* |
| 1789 | 1788 | ** Try to open an output file. The names "stdout" and "stderr" are |
| 1790 | ** recognized and do the right thing. NULL is returned if the output | |
| 1789 | ** recognized and do the right thing. NULL is returned if the output | |
| 1791 | 1790 | ** filename is "off". |
| 1792 | 1791 | */ |
| 1793 | 1792 | static FILE *output_file_open(const char *zFile){ |
| 1794 | FILE *f; | |
| 1795 | if( strcmp(zFile,"stdout")==0 ){ | |
| 1796 | f = stdout; | |
| 1797 | }else if( strcmp(zFile, "stderr")==0 ){ | |
| 1798 | f = stderr; | |
| 1799 | }else if( strcmp(zFile, "off")==0 ){ | |
| 1800 | f = 0; | |
| 1801 | }else{ | |
| 1802 | f = fopen(zFile, "wb"); | |
| 1803 | if( f==0 ){ | |
| 1804 | fprintf(stderr, "Error: cannot open \"%s\"\n", zFile); | |
| 1805 | } | |
| 1806 | } | |
| 1807 | return f; | |
| 1793 | FILE *f; | |
| 1794 | if( strcmp(zFile,"stdout")==0 ){ | |
| 1795 | f = stdout; | |
| 1796 | }else if( strcmp(zFile, "stderr")==0 ){ | |
| 1797 | f = stderr; | |
| 1798 | }else if( strcmp(zFile, "off")==0 ){ | |
| 1799 | f = 0; | |
| 1800 | }else{ | |
| 1801 | f = fopen(zFile, "wb"); | |
| 1802 | if( f==0 ){ | |
| 1803 | fprintf(stderr, "Error: cannot open \"%s\"\n", zFile); | |
| 1804 | } | |
| 1805 | } | |
| 1806 | return f; | |
| 1808 | 1807 | } |
| 1809 | 1808 | |
| 1810 | 1809 | /* |
| 1811 | 1810 | ** A routine for handling output from sqlite3_trace(). |
| 1812 | 1811 | */ |
| 1813 | 1812 | static void sql_trace_callback(void *pArg, const char *z){ |
| 1814 | FILE *f = (FILE*)pArg; | |
| 1815 | if( f ) fprintf(f, "%s\n", z); | |
| 1813 | FILE *f = (FILE*)pArg; | |
| 1814 | if( f ) fprintf(f, "%s\n", z); | |
| 1816 | 1815 | } |
| 1817 | 1816 | |
| 1818 | 1817 | /* |
| r31373 | r31374 | |
| 1820 | 1819 | ** a useful spot to set a debugger breakpoint. |
| 1821 | 1820 | */ |
| 1822 | 1821 | static void test_breakpoint(void){ |
| 1823 | static int nCall = 0; | |
| 1824 | nCall++; | |
| 1822 | static int nCall = 0; | |
| 1823 | nCall++; | |
| 1825 | 1824 | } |
| 1826 | 1825 | |
| 1827 | 1826 | /* |
| r31373 | r31374 | |
| 1829 | 1828 | */ |
| 1830 | 1829 | typedef struct CSVReader CSVReader; |
| 1831 | 1830 | struct CSVReader { |
| 1832 | const char *zFile; /* Name of the input file */ | |
| 1833 | FILE *in; /* Read the CSV text from this input stream */ | |
| 1834 | char *z; /* Accumulated text for a field */ | |
| 1835 | int n; /* Number of bytes in z */ | |
| 1836 | int nAlloc; /* Space allocated for z[] */ | |
| 1837 | int nLine; /* Current line number */ | |
| 1838 | int cTerm; /* Character that terminated the most recent field */ | |
| 1839 | int cSeparator; /* The separator character. (Usually ",") */ | |
| 1831 | const char *zFile; /* Name of the input file */ | |
| 1832 | FILE *in; /* Read the CSV text from this input stream */ | |
| 1833 | char *z; /* Accumulated text for a field */ | |
| 1834 | int n; /* Number of bytes in z */ | |
| 1835 | int nAlloc; /* Space allocated for z[] */ | |
| 1836 | int nLine; /* Current line number */ | |
| 1837 | int cTerm; /* Character that terminated the most recent field */ | |
| 1838 | int cSeparator; /* The separator character. (Usually ",") */ | |
| 1840 | 1839 | }; |
| 1841 | 1840 | |
| 1842 | 1841 | /* Append a single byte to z[] */ |
| 1843 | 1842 | static void csv_append_char(CSVReader *p, int c){ |
| 1844 | if( p->n+1>=p->nAlloc ){ | |
| 1845 | p->nAlloc += p->nAlloc + 100; | |
| 1846 | p->z = (char *)sqlite3_realloc(p->z, p->nAlloc); | |
| 1847 | if( p->z==0 ){ | |
| 1848 | fprintf(stderr, "out of memory\n"); | |
| 1849 | exit(1); | |
| 1850 | } | |
| 1851 | } | |
| 1852 | p->z[p->n++] = (char)c; | |
| 1843 | if( p->n+1>=p->nAlloc ){ | |
| 1844 | p->nAlloc += p->nAlloc + 100; | |
| 1845 | p->z = (char *)sqlite3_realloc(p->z, p->nAlloc); | |
| 1846 | if( p->z==0 ){ | |
| 1847 | fprintf(stderr, "out of memory\n"); | |
| 1848 | exit(1); | |
| 1849 | } | |
| 1850 | } | |
| 1851 | p->z[p->n++] = (char)c; | |
| 1853 | 1852 | } |
| 1854 | 1853 | |
| 1855 | 1854 | /* Read a single field of CSV text. Compatible with rfc4180 and extended |
| r31373 | r31374 | |
| 1865 | 1864 | ** + Report syntax errors on stderr |
| 1866 | 1865 | */ |
| 1867 | 1866 | static char *csv_read_one_field(CSVReader *p){ |
| 1868 | int c, pc, ppc; | |
| 1869 | int cSep = p->cSeparator; | |
| 1870 | p->n = 0; | |
| 1871 | c = fgetc(p->in); | |
| 1872 | if( c==EOF || seenInterrupt ){ | |
| 1873 | p->cTerm = EOF; | |
| 1874 | return 0; | |
| 1875 | } | |
| 1876 | if( c=='"' ){ | |
| 1877 | int startLine = p->nLine; | |
| 1878 | int cQuote = c; | |
| 1879 | pc = ppc = 0; | |
| 1880 | while( 1 ){ | |
| 1881 | c = fgetc(p->in); | |
| 1882 | if( c=='\n' ) p->nLine++; | |
| 1883 | if( c==cQuote ){ | |
| 1884 | if( pc==cQuote ){ | |
| 1885 | pc = 0; | |
| 1886 | continue; | |
| 1887 | } | |
| 1888 | } | |
| 1889 | if( (c==cSep && pc==cQuote) | |
| 1890 | || (c=='\n' && pc==cQuote) | |
| 1891 | || (c=='\n' && pc=='\r' && ppc==cQuote) | |
| 1892 | || (c==EOF && pc==cQuote) | |
| 1893 | ){ | |
| 1894 | do{ p->n--; }while( p->z[p->n]!=cQuote ); | |
| 1895 | p->cTerm = c; | |
| 1896 | break; | |
| 1897 | } | |
| 1898 | if( pc==cQuote && c!='\r' ){ | |
| 1899 | fprintf(stderr, "%s:%d: unescaped %c character\n", | |
| 1900 | p->zFile, p->nLine, cQuote); | |
| 1901 | } | |
| 1902 | if( c==EOF ){ | |
| 1903 | fprintf(stderr, "%s:%d: unterminated %c-quoted field\n", | |
| 1904 | p->zFile, startLine, cQuote); | |
| 1905 | p->cTerm = EOF; | |
| 1906 | break; | |
| 1907 | } | |
| 1908 | csv_append_char(p, c); | |
| 1909 | ppc = pc; | |
| 1910 | pc = c; | |
| 1911 | } | |
| 1912 | }else{ | |
| 1913 | while( c!=EOF && c!=cSep && c!='\n' ){ | |
| 1914 | csv_append_char(p, c); | |
| 1915 | c = fgetc(p->in); | |
| 1916 | } | |
| 1917 | if( c=='\n' ){ | |
| 1918 | p->nLine++; | |
| 1919 | if( p->n>0 && p->z[p->n-1]=='\r' ) p->n--; | |
| 1920 | } | |
| 1921 | p->cTerm = c; | |
| 1922 | } | |
| 1923 | if( p->z ) p->z[p->n] = 0; | |
| 1924 | return p->z; | |
| 1867 | int c, pc, ppc; | |
| 1868 | int cSep = p->cSeparator; | |
| 1869 | p->n = 0; | |
| 1870 | c = fgetc(p->in); | |
| 1871 | if( c==EOF || seenInterrupt ){ | |
| 1872 | p->cTerm = EOF; | |
| 1873 | return 0; | |
| 1874 | } | |
| 1875 | if( c=='"' ){ | |
| 1876 | int startLine = p->nLine; | |
| 1877 | int cQuote = c; | |
| 1878 | pc = ppc = 0; | |
| 1879 | while( 1 ){ | |
| 1880 | c = fgetc(p->in); | |
| 1881 | if( c=='\n' ) p->nLine++; | |
| 1882 | if( c==cQuote ){ | |
| 1883 | if( pc==cQuote ){ | |
| 1884 | pc = 0; | |
| 1885 | continue; | |
| 1886 | } | |
| 1887 | } | |
| 1888 | if( (c==cSep && pc==cQuote) | |
| 1889 | || (c=='\n' && pc==cQuote) | |
| 1890 | || (c=='\n' && pc=='\r' && ppc==cQuote) | |
| 1891 | || (c==EOF && pc==cQuote) | |
| 1892 | ){ | |
| 1893 | do{ p->n--; }while( p->z[p->n]!=cQuote ); | |
| 1894 | p->cTerm = c; | |
| 1895 | break; | |
| 1896 | } | |
| 1897 | if( pc==cQuote && c!='\r' ){ | |
| 1898 | fprintf(stderr, "%s:%d: unescaped %c character\n", | |
| 1899 | p->zFile, p->nLine, cQuote); | |
| 1900 | } | |
| 1901 | if( c==EOF ){ | |
| 1902 | fprintf(stderr, "%s:%d: unterminated %c-quoted field\n", | |
| 1903 | p->zFile, startLine, cQuote); | |
| 1904 | p->cTerm = EOF; | |
| 1905 | break; | |
| 1906 | } | |
| 1907 | csv_append_char(p, c); | |
| 1908 | ppc = pc; | |
| 1909 | pc = c; | |
| 1910 | } | |
| 1911 | }else{ | |
| 1912 | while( c!=EOF && c!=cSep && c!='\n' ){ | |
| 1913 | csv_append_char(p, c); | |
| 1914 | c = fgetc(p->in); | |
| 1915 | } | |
| 1916 | if( c=='\n' ){ | |
| 1917 | p->nLine++; | |
| 1918 | if( p->n>0 && p->z[p->n-1]=='\r' ) p->n--; | |
| 1919 | } | |
| 1920 | p->cTerm = c; | |
| 1921 | } | |
| 1922 | if( p->z ) p->z[p->n] = 0; | |
| 1923 | return p->z; | |
| 1925 | 1924 | } |
| 1926 | 1925 | |
| 1927 | 1926 | /* |
| r31373 | r31374 | |
| 1930 | 1929 | ** work for WITHOUT ROWID tables. |
| 1931 | 1930 | */ |
| 1932 | 1931 | static void tryToCloneData( |
| 1933 | struct callback_data *p, | |
| 1934 | sqlite3 *newDb, | |
| 1935 | const char *zTable | |
| 1932 | struct callback_data *p, | |
| 1933 | sqlite3 *newDb, | |
| 1934 | const char *zTable | |
| 1936 | 1935 | ){ |
| 1937 | sqlite3_stmt *pQuery = 0; | |
| 1938 | sqlite3_stmt *pInsert = 0; | |
| 1939 | char *zQuery = 0; | |
| 1940 | char *zInsert = 0; | |
| 1941 | int rc; | |
| 1942 | int i, j, n; | |
| 1943 | int nTable = (int)strlen(zTable); | |
| 1944 | int k = 0; | |
| 1945 | int cnt = 0; | |
| 1946 | const int spinRate = 10000; | |
| 1936 | sqlite3_stmt *pQuery = 0; | |
| 1937 | sqlite3_stmt *pInsert = 0; | |
| 1938 | char *zQuery = 0; | |
| 1939 | char *zInsert = 0; | |
| 1940 | int rc; | |
| 1941 | int i, j, n; | |
| 1942 | int nTable = (int)strlen(zTable); | |
| 1943 | int k = 0; | |
| 1944 | int cnt = 0; | |
| 1945 | const int spinRate = 10000; | |
| 1947 | 1946 | |
| 1948 | zQuery = sqlite3_mprintf("SELECT * FROM \"%w\"", zTable); | |
| 1949 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 1950 | if( rc ){ | |
| 1951 | fprintf(stderr, "Error %d: %s on [%s]\n", | |
| 1952 | sqlite3_extended_errcode(p->db), sqlite3_errmsg(p->db), | |
| 1953 | zQuery); | |
| 1954 | goto end_data_xfer; | |
| 1955 | } | |
| 1956 | n = sqlite3_column_count(pQuery); | |
| 1957 | zInsert = (char *)sqlite3_malloc(200 + nTable + n*3); | |
| 1958 | if( zInsert==0 ){ | |
| 1959 | fprintf(stderr, "out of memory\n"); | |
| 1960 | goto end_data_xfer; | |
| 1961 | } | |
| 1962 | sqlite3_snprintf(200+nTable,zInsert, | |
| 1963 | "INSERT OR IGNORE INTO \"%s\" VALUES(?", zTable); | |
| 1964 | i = (int)strlen(zInsert); | |
| 1965 | for(j=1; j<n; j++){ | |
| 1966 | memcpy(zInsert+i, ",?", 2); | |
| 1967 | i += 2; | |
| 1968 | } | |
| 1969 | memcpy(zInsert+i, ");", 3); | |
| 1970 | rc = sqlite3_prepare_v2(newDb, zInsert, -1, &pInsert, 0); | |
| 1971 | if( rc ){ | |
| 1972 | fprintf(stderr, "Error %d: %s on [%s]\n", | |
| 1973 | sqlite3_extended_errcode(newDb), sqlite3_errmsg(newDb), | |
| 1974 | zQuery); | |
| 1975 | goto end_data_xfer; | |
| 1976 | } | |
| 1977 | for(k=0; k<2; k++){ | |
| 1978 | while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){ | |
| 1979 | for(i=0; i<n; i++){ | |
| 1980 | switch( sqlite3_column_type(pQuery, i) ){ | |
| 1981 | case SQLITE_NULL: { | |
| 1982 | sqlite3_bind_null(pInsert, i+1); | |
| 1983 | break; | |
| 1984 | } | |
| 1985 | case SQLITE_INTEGER: { | |
| 1986 | sqlite3_bind_int64(pInsert, i+1, sqlite3_column_int64(pQuery,i)); | |
| 1987 | break; | |
| 1988 | } | |
| 1989 | case SQLITE_FLOAT: { | |
| 1990 | sqlite3_bind_double(pInsert, i+1, sqlite3_column_double(pQuery,i)); | |
| 1991 | break; | |
| 1992 | } | |
| 1993 | case SQLITE_TEXT: { | |
| 1994 | sqlite3_bind_text(pInsert, i+1, | |
| 1995 | (const char*)sqlite3_column_text(pQuery,i), | |
| 1996 | -1, SQLITE_STATIC); | |
| 1997 | break; | |
| 1998 | } | |
| 1999 | case SQLITE_BLOB: { | |
| 2000 | sqlite3_bind_blob(pInsert, i+1, sqlite3_column_blob(pQuery,i), | |
| 2001 | sqlite3_column_bytes(pQuery,i), | |
| 2002 | SQLITE_STATIC); | |
| 2003 | break; | |
| 2004 | } | |
| 2005 | } | |
| 2006 | } /* End for */ | |
| 2007 | rc = sqlite3_step(pInsert); | |
| 2008 | if( rc!=SQLITE_OK && rc!=SQLITE_ROW && rc!=SQLITE_DONE ){ | |
| 2009 | fprintf(stderr, "Error %d: %s\n", sqlite3_extended_errcode(newDb), | |
| 2010 | sqlite3_errmsg(newDb)); | |
| 2011 | } | |
| 2012 | sqlite3_reset(pInsert); | |
| 2013 | cnt++; | |
| 2014 | if( (cnt%spinRate)==0 ){ | |
| 2015 | printf("%c\b", "|/-\\"[(cnt/spinRate)%4]); | |
| 2016 | fflush(stdout); | |
| 2017 | } | |
| 2018 | } /* End while */ | |
| 2019 | if( rc==SQLITE_DONE ) break; | |
| 2020 | sqlite3_finalize(pQuery); | |
| 2021 | sqlite3_free(zQuery); | |
| 2022 | zQuery = sqlite3_mprintf("SELECT * FROM \"%w\" ORDER BY rowid DESC;", | |
| 2023 | zTable); | |
| 2024 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 2025 | if( rc ){ | |
| 2026 | fprintf(stderr, "Warning: cannot step \"%s\" backwards", zTable); | |
| 2027 | break; | |
| 2028 | } | |
| 2029 | } /* End for(k=0...) */ | |
| 1947 | zQuery = sqlite3_mprintf("SELECT * FROM \"%w\"", zTable); | |
| 1948 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 1949 | if( rc ){ | |
| 1950 | fprintf(stderr, "Error %d: %s on [%s]\n", | |
| 1951 | sqlite3_extended_errcode(p->db), sqlite3_errmsg(p->db), | |
| 1952 | zQuery); | |
| 1953 | goto end_data_xfer; | |
| 1954 | } | |
| 1955 | n = sqlite3_column_count(pQuery); | |
| 1956 | zInsert = (char *)sqlite3_malloc(200 + nTable + n*3); | |
| 1957 | if( zInsert==0 ){ | |
| 1958 | fprintf(stderr, "out of memory\n"); | |
| 1959 | goto end_data_xfer; | |
| 1960 | } | |
| 1961 | sqlite3_snprintf(200+nTable,zInsert, | |
| 1962 | "INSERT OR IGNORE INTO \"%s\" VALUES(?", zTable); | |
| 1963 | i = (int)strlen(zInsert); | |
| 1964 | for(j=1; j<n; j++){ | |
| 1965 | memcpy(zInsert+i, ",?", 2); | |
| 1966 | i += 2; | |
| 1967 | } | |
| 1968 | memcpy(zInsert+i, ");", 3); | |
| 1969 | rc = sqlite3_prepare_v2(newDb, zInsert, -1, &pInsert, 0); | |
| 1970 | if( rc ){ | |
| 1971 | fprintf(stderr, "Error %d: %s on [%s]\n", | |
| 1972 | sqlite3_extended_errcode(newDb), sqlite3_errmsg(newDb), | |
| 1973 | zQuery); | |
| 1974 | goto end_data_xfer; | |
| 1975 | } | |
| 1976 | for(k=0; k<2; k++){ | |
| 1977 | while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){ | |
| 1978 | for(i=0; i<n; i++){ | |
| 1979 | switch( sqlite3_column_type(pQuery, i) ){ | |
| 1980 | case SQLITE_NULL: { | |
| 1981 | sqlite3_bind_null(pInsert, i+1); | |
| 1982 | break; | |
| 1983 | } | |
| 1984 | case SQLITE_INTEGER: { | |
| 1985 | sqlite3_bind_int64(pInsert, i+1, sqlite3_column_int64(pQuery,i)); | |
| 1986 | break; | |
| 1987 | } | |
| 1988 | case SQLITE_FLOAT: { | |
| 1989 | sqlite3_bind_double(pInsert, i+1, sqlite3_column_double(pQuery,i)); | |
| 1990 | break; | |
| 1991 | } | |
| 1992 | case SQLITE_TEXT: { | |
| 1993 | sqlite3_bind_text(pInsert, i+1, | |
| 1994 | (const char*)sqlite3_column_text(pQuery,i), | |
| 1995 | -1, SQLITE_STATIC); | |
| 1996 | break; | |
| 1997 | } | |
| 1998 | case SQLITE_BLOB: { | |
| 1999 | sqlite3_bind_blob(pInsert, i+1, sqlite3_column_blob(pQuery,i), | |
| 2000 | sqlite3_column_bytes(pQuery,i), | |
| 2001 | SQLITE_STATIC); | |
| 2002 | break; | |
| 2003 | } | |
| 2004 | } | |
| 2005 | } /* End for */ | |
| 2006 | rc = sqlite3_step(pInsert); | |
| 2007 | if( rc!=SQLITE_OK && rc!=SQLITE_ROW && rc!=SQLITE_DONE ){ | |
| 2008 | fprintf(stderr, "Error %d: %s\n", sqlite3_extended_errcode(newDb), | |
| 2009 | sqlite3_errmsg(newDb)); | |
| 2010 | } | |
| 2011 | sqlite3_reset(pInsert); | |
| 2012 | cnt++; | |
| 2013 | if( (cnt%spinRate)==0 ){ | |
| 2014 | printf("%c\b", "|/-\\"[(cnt/spinRate)%4]); | |
| 2015 | fflush(stdout); | |
| 2016 | } | |
| 2017 | } /* End while */ | |
| 2018 | if( rc==SQLITE_DONE ) break; | |
| 2019 | sqlite3_finalize(pQuery); | |
| 2020 | sqlite3_free(zQuery); | |
| 2021 | zQuery = sqlite3_mprintf("SELECT * FROM \"%w\" ORDER BY rowid DESC;", | |
| 2022 | zTable); | |
| 2023 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 2024 | if( rc ){ | |
| 2025 | fprintf(stderr, "Warning: cannot step \"%s\" backwards", zTable); | |
| 2026 | break; | |
| 2027 | } | |
| 2028 | } /* End for(k=0...) */ | |
| 2030 | 2029 | |
| 2031 | 2030 | end_data_xfer: |
| 2032 | sqlite3_finalize(pQuery); | |
| 2033 | sqlite3_finalize(pInsert); | |
| 2034 | sqlite3_free(zQuery); | |
| 2035 | sqlite3_free(zInsert); | |
| 2031 | sqlite3_finalize(pQuery); | |
| 2032 | sqlite3_finalize(pInsert); | |
| 2033 | sqlite3_free(zQuery); | |
| 2034 | sqlite3_free(zInsert); | |
| 2036 | 2035 | } |
| 2037 | 2036 | |
| 2038 | 2037 | |
| r31373 | r31374 | |
| 2043 | 2042 | ** sqlite_master table, try again moving backwards. |
| 2044 | 2043 | */ |
| 2045 | 2044 | static void tryToCloneSchema( |
| 2046 | struct callback_data *p, | |
| 2047 | sqlite3 *newDb, | |
| 2048 | const char *zWhere, | |
| 2049 | void (*xForEach)(struct callback_data*,sqlite3*,const char*) | |
| 2045 | struct callback_data *p, | |
| 2046 | sqlite3 *newDb, | |
| 2047 | const char *zWhere, | |
| 2048 | void (*xForEach)(struct callback_data*,sqlite3*,const char*) | |
| 2050 | 2049 | ){ |
| 2051 | sqlite3_stmt *pQuery = 0; | |
| 2052 | char *zQuery = 0; | |
| 2053 | int rc; | |
| 2054 | const unsigned char *zName; | |
| 2055 | const unsigned char *zSql; | |
| 2056 | char *zErrMsg = 0; | |
| 2050 | sqlite3_stmt *pQuery = 0; | |
| 2051 | char *zQuery = 0; | |
| 2052 | int rc; | |
| 2053 | const unsigned char *zName; | |
| 2054 | const unsigned char *zSql; | |
| 2055 | char *zErrMsg = 0; | |
| 2057 | 2056 | |
| 2058 | zQuery = sqlite3_mprintf("SELECT name, sql FROM sqlite_master" | |
| 2059 | " WHERE %s", zWhere); | |
| 2060 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 2061 | if( rc ){ | |
| 2062 | fprintf(stderr, "Error: (%d) %s on [%s]\n", | |
| 2063 | sqlite3_extended_errcode(p->db), sqlite3_errmsg(p->db), | |
| 2064 | zQuery); | |
| 2065 | goto end_schema_xfer; | |
| 2066 | } | |
| 2067 | while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){ | |
| 2068 | zName = sqlite3_column_text(pQuery, 0); | |
| 2069 | zSql = sqlite3_column_text(pQuery, 1); | |
| 2070 | printf("%s... ", zName); fflush(stdout); | |
| 2071 | sqlite3_exec(newDb, (const char*)zSql, 0, 0, &zErrMsg); | |
| 2072 | if( zErrMsg ){ | |
| 2073 | fprintf(stderr, "Error: %s\nSQL: [%s]\n", zErrMsg, zSql); | |
| 2074 | sqlite3_free(zErrMsg); | |
| 2075 | zErrMsg = 0; | |
| 2076 | } | |
| 2077 | if( xForEach ){ | |
| 2078 | xForEach(p, newDb, (const char*)zName); | |
| 2079 | } | |
| 2080 | printf("done\n"); | |
| 2081 | } | |
| 2082 | if( rc!=SQLITE_DONE ){ | |
| 2083 | sqlite3_finalize(pQuery); | |
| 2084 | sqlite3_free(zQuery); | |
| 2085 | zQuery = sqlite3_mprintf("SELECT name, sql FROM sqlite_master" | |
| 2086 | " WHERE %s ORDER BY rowid DESC", zWhere); | |
| 2087 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 2088 | if( rc ){ | |
| 2089 | fprintf(stderr, "Error: (%d) %s on [%s]\n", | |
| 2090 | sqlite3_extended_errcode(p->db), sqlite3_errmsg(p->db), | |
| 2091 | zQuery); | |
| 2092 | goto end_schema_xfer; | |
| 2093 | } | |
| 2094 | while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){ | |
| 2095 | zName = sqlite3_column_text(pQuery, 0); | |
| 2096 | zSql = sqlite3_column_text(pQuery, 1); | |
| 2097 | printf("%s... ", zName); fflush(stdout); | |
| 2098 | sqlite3_exec(newDb, (const char*)zSql, 0, 0, &zErrMsg); | |
| 2099 | if( zErrMsg ){ | |
| 2100 | fprintf(stderr, "Error: %s\nSQL: [%s]\n", zErrMsg, zSql); | |
| 2101 | sqlite3_free(zErrMsg); | |
| 2102 | zErrMsg = 0; | |
| 2103 | } | |
| 2104 | if( xForEach ){ | |
| 2105 | xForEach(p, newDb, (const char*)zName); | |
| 2106 | } | |
| 2107 | printf("done\n"); | |
| 2108 | } | |
| 2109 | } | |
| 2057 | zQuery = sqlite3_mprintf("SELECT name, sql FROM sqlite_master" | |
| 2058 | " WHERE %s", zWhere); | |
| 2059 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 2060 | if( rc ){ | |
| 2061 | fprintf(stderr, "Error: (%d) %s on [%s]\n", | |
| 2062 | sqlite3_extended_errcode(p->db), sqlite3_errmsg(p->db), | |
| 2063 | zQuery); | |
| 2064 | goto end_schema_xfer; | |
| 2065 | } | |
| 2066 | while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){ | |
| 2067 | zName = sqlite3_column_text(pQuery, 0); | |
| 2068 | zSql = sqlite3_column_text(pQuery, 1); | |
| 2069 | printf("%s... ", zName); fflush(stdout); | |
| 2070 | sqlite3_exec(newDb, (const char*)zSql, 0, 0, &zErrMsg); | |
| 2071 | if( zErrMsg ){ | |
| 2072 | fprintf(stderr, "Error: %s\nSQL: [%s]\n", zErrMsg, zSql); | |
| 2073 | sqlite3_free(zErrMsg); | |
| 2074 | zErrMsg = 0; | |
| 2075 | } | |
| 2076 | if( xForEach ){ | |
| 2077 | xForEach(p, newDb, (const char*)zName); | |
| 2078 | } | |
| 2079 | printf("done\n"); | |
| 2080 | } | |
| 2081 | if( rc!=SQLITE_DONE ){ | |
| 2082 | sqlite3_finalize(pQuery); | |
| 2083 | sqlite3_free(zQuery); | |
| 2084 | zQuery = sqlite3_mprintf("SELECT name, sql FROM sqlite_master" | |
| 2085 | " WHERE %s ORDER BY rowid DESC", zWhere); | |
| 2086 | rc = sqlite3_prepare_v2(p->db, zQuery, -1, &pQuery, 0); | |
| 2087 | if( rc ){ | |
| 2088 | fprintf(stderr, "Error: (%d) %s on [%s]\n", | |
| 2089 | sqlite3_extended_errcode(p->db), sqlite3_errmsg(p->db), | |
| 2090 | zQuery); | |
| 2091 | goto end_schema_xfer; | |
| 2092 | } | |
| 2093 | while( (rc = sqlite3_step(pQuery))==SQLITE_ROW ){ | |
| 2094 | zName = sqlite3_column_text(pQuery, 0); | |
| 2095 | zSql = sqlite3_column_text(pQuery, 1); | |
| 2096 | printf("%s... ", zName); fflush(stdout); | |
| 2097 | sqlite3_exec(newDb, (const char*)zSql, 0, 0, &zErrMsg); | |
| 2098 | if( zErrMsg ){ | |
| 2099 | fprintf(stderr, "Error: %s\nSQL: [%s]\n", zErrMsg, zSql); | |
| 2100 | sqlite3_free(zErrMsg); | |
| 2101 | zErrMsg = 0; | |
| 2102 | } | |
| 2103 | if( xForEach ){ | |
| 2104 | xForEach(p, newDb, (const char*)zName); | |
| 2105 | } | |
| 2106 | printf("done\n"); | |
| 2107 | } | |
| 2108 | } | |
| 2110 | 2109 | end_schema_xfer: |
| 2111 | sqlite3_finalize(pQuery); | |
| 2112 | sqlite3_free(zQuery); | |
| 2110 | sqlite3_finalize(pQuery); | |
| 2111 | sqlite3_free(zQuery); | |
| 2113 | 2112 | } |
| 2114 | 2113 | |
| 2115 | 2114 | /* |
| r31373 | r31374 | |
| 2118 | 2117 | ** into zNewDb. |
| 2119 | 2118 | */ |
| 2120 | 2119 | static void tryToClone(struct callback_data *p, const char *zNewDb){ |
| 2121 | int rc; | |
| 2122 | sqlite3 *newDb = 0; | |
| 2123 | if( access(zNewDb,0)==0 ){ | |
| 2124 | fprintf(stderr, "File \"%s\" already exists.\n", zNewDb); | |
| 2125 | return; | |
| 2126 | } | |
| 2127 | rc = sqlite3_open(zNewDb, &newDb); | |
| 2128 | if( rc ){ | |
| 2129 | fprintf(stderr, "Cannot create output database: %s\n", | |
| 2130 | sqlite3_errmsg(newDb)); | |
| 2131 | }else{ | |
| 2132 | sqlite3_exec(newDb, "BEGIN EXCLUSIVE;", 0, 0, 0); | |
| 2133 | tryToCloneSchema(p, newDb, "type='table'", tryToCloneData); | |
| 2134 | tryToCloneSchema(p, newDb, "type!='table'", 0); | |
| 2135 | sqlite3_exec(newDb, "COMMIT;", 0, 0, 0); | |
| 2136 | } | |
| 2137 | sqlite3_close(newDb); | |
| 2120 | int rc; | |
| 2121 | sqlite3 *newDb = 0; | |
| 2122 | if( access(zNewDb,0)==0 ){ | |
| 2123 | fprintf(stderr, "File \"%s\" already exists.\n", zNewDb); | |
| 2124 | return; | |
| 2125 | } | |
| 2126 | rc = sqlite3_open(zNewDb, &newDb); | |
| 2127 | if( rc ){ | |
| 2128 | fprintf(stderr, "Cannot create output database: %s\n", | |
| 2129 | sqlite3_errmsg(newDb)); | |
| 2130 | }else{ | |
| 2131 | sqlite3_exec(newDb, "BEGIN EXCLUSIVE;", 0, 0, 0); | |
| 2132 | tryToCloneSchema(p, newDb, "type='table'", tryToCloneData); | |
| 2133 | tryToCloneSchema(p, newDb, "type!='table'", 0); | |
| 2134 | sqlite3_exec(newDb, "COMMIT;", 0, 0, 0); | |
| 2135 | } | |
| 2136 | sqlite3_close(newDb); | |
| 2138 | 2137 | } |
| 2139 | 2138 | |
| 2140 | 2139 | /* |
| r31373 | r31374 | |
| 2144 | 2143 | ** Return 1 on error, 2 to exit, and 0 otherwise. |
| 2145 | 2144 | */ |
| 2146 | 2145 | static int do_meta_command(char *zLine, struct callback_data *p){ |
| 2147 | int i = 1; | |
| 2148 | int nArg = 0; | |
| 2149 | int n, c; | |
| 2150 | int rc = 0; | |
| 2151 | char *azArg[50]; | |
| 2146 | int i = 1; | |
| 2147 | int nArg = 0; | |
| 2148 | int n, c; | |
| 2149 | int rc = 0; | |
| 2150 | char *azArg[50]; | |
| 2152 | 2151 | |
| 2153 | /* Parse the input line into tokens. | |
| 2154 | */ | |
| 2155 | while( zLine[i] && nArg<ArraySize(azArg) ){ | |
| 2156 | while( IsSpace(zLine[i]) ){ i++; } | |
| 2157 | if( zLine[i]==0 ) break; | |
| 2158 | if( zLine[i]=='\'' || zLine[i]=='"' ){ | |
| 2159 | int delim = zLine[i++]; | |
| 2160 | azArg[nArg++] = &zLine[i]; | |
| 2161 | while( zLine[i] && zLine[i]!=delim ){ | |
| 2162 | if( zLine[i]=='\\' && delim=='"' && zLine[i+1]!=0 ) i++; | |
| 2163 | i++; | |
| 2164 | } | |
| 2165 | if( zLine[i]==delim ){ | |
| 2166 | zLine[i++] = 0; | |
| 2167 | } | |
| 2168 | if( delim=='"' ) resolve_backslashes(azArg[nArg-1]); | |
| 2169 | }else{ | |
| 2170 | azArg[nArg++] = &zLine[i]; | |
| 2171 | while( zLine[i] && !IsSpace(zLine[i]) ){ i++; } | |
| 2172 | if( zLine[i] ) zLine[i++] = 0; | |
| 2173 | resolve_backslashes(azArg[nArg-1]); | |
| 2174 | } | |
| 2175 | } | |
| 2152 | /* Parse the input line into tokens. | |
| 2153 | */ | |
| 2154 | while( zLine[i] && nArg<ArraySize(azArg) ){ | |
| 2155 | while( IsSpace(zLine[i]) ){ i++; } | |
| 2156 | if( zLine[i]==0 ) break; | |
| 2157 | if( zLine[i]=='\'' || zLine[i]=='"' ){ | |
| 2158 | int delim = zLine[i++]; | |
| 2159 | azArg[nArg++] = &zLine[i]; | |
| 2160 | while( zLine[i] && zLine[i]!=delim ){ | |
| 2161 | if( zLine[i]=='\\' && delim=='"' && zLine[i+1]!=0 ) i++; | |
| 2162 | i++; | |
| 2163 | } | |
| 2164 | if( zLine[i]==delim ){ | |
| 2165 | zLine[i++] = 0; | |
| 2166 | } | |
| 2167 | if( delim=='"' ) resolve_backslashes(azArg[nArg-1]); | |
| 2168 | }else{ | |
| 2169 | azArg[nArg++] = &zLine[i]; | |
| 2170 | while( zLine[i] && !IsSpace(zLine[i]) ){ i++; } | |
| 2171 | if( zLine[i] ) zLine[i++] = 0; | |
| 2172 | resolve_backslashes(azArg[nArg-1]); | |
| 2173 | } | |
| 2174 | } | |
| 2176 | 2175 | |
| 2177 | /* Process the input line. | |
| 2178 | */ | |
| 2179 | if( nArg==0 ) return 0; /* no tokens, no error */ | |
| 2180 | n = strlen30(azArg[0]); | |
| 2181 | c = azArg[0][0]; | |
| 2182 | if( (c=='b' && n>=3 && strncmp(azArg[0], "backup", n)==0) | |
| 2183 | || (c=='s' && n>=3 && strncmp(azArg[0], "save", n)==0) | |
| 2184 | ){ | |
| 2185 | const char *zDestFile = 0; | |
| 2186 | const char *zDb = 0; | |
| 2187 | sqlite3 *pDest; | |
| 2188 | sqlite3_backup *pBackup; | |
| 2189 | int j; | |
| 2190 | for(j=1; j<nArg; j++){ | |
| 2191 | const char *z = azArg[j]; | |
| 2192 | if( z[0]=='-' ){ | |
| 2193 | while( z[0]=='-' ) z++; | |
| 2194 | /* No options to process at this time */ | |
| 2195 | { | |
| 2196 | fprintf(stderr, "unknown option: %s\n", azArg[j]); | |
| 2197 | return 1; | |
| 2198 | } | |
| 2199 | }else if( zDestFile==0 ){ | |
| 2200 | zDestFile = azArg[j]; | |
| 2201 | }else if( zDb==0 ){ | |
| 2202 | zDb = zDestFile; | |
| 2203 | zDestFile = azArg[j]; | |
| 2204 | }else{ | |
| 2205 | fprintf(stderr, "too many arguments to .backup\n"); | |
| 2206 | return 1; | |
| 2207 | } | |
| 2208 | } | |
| 2209 | if( zDestFile==0 ){ | |
| 2210 | fprintf(stderr, "missing FILENAME argument on .backup\n"); | |
| 2211 | return 1; | |
| 2212 | } | |
| 2213 | if( zDb==0 ) zDb = "main"; | |
| 2214 | rc = sqlite3_open(zDestFile, &pDest); | |
| 2215 | if( rc!=SQLITE_OK ){ | |
| 2216 | fprintf(stderr, "Error: cannot open \"%s\"\n", zDestFile); | |
| 2217 | sqlite3_close(pDest); | |
| 2218 | return 1; | |
| 2219 | } | |
| 2220 | open_db(p, 0); | |
| 2221 | pBackup = sqlite3_backup_init(pDest, "main", p->db, zDb); | |
| 2222 | if( pBackup==0 ){ | |
| 2223 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(pDest)); | |
| 2224 | sqlite3_close(pDest); | |
| 2225 | return 1; | |
| 2226 | } | |
| 2227 | while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK ){} | |
| 2228 | sqlite3_backup_finish(pBackup); | |
| 2229 | if( rc==SQLITE_DONE ){ | |
| 2230 | rc = 0; | |
| 2231 | }else{ | |
| 2232 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(pDest)); | |
| 2233 | rc = 1; | |
| 2234 | } | |
| 2235 | sqlite3_close(pDest); | |
| 2236 | }else | |
| 2176 | /* Process the input line. | |
| 2177 | */ | |
| 2178 | if( nArg==0 ) return 0; /* no tokens, no error */ | |
| 2179 | n = strlen30(azArg[0]); | |
| 2180 | c = azArg[0][0]; | |
| 2181 | if( (c=='b' && n>=3 && strncmp(azArg[0], "backup", n)==0) | |
| 2182 | || (c=='s' && n>=3 && strncmp(azArg[0], "save", n)==0) | |
| 2183 | ){ | |
| 2184 | const char *zDestFile = 0; | |
| 2185 | const char *zDb = 0; | |
| 2186 | sqlite3 *pDest; | |
| 2187 | sqlite3_backup *pBackup; | |
| 2188 | int j; | |
| 2189 | for(j=1; j<nArg; j++){ | |
| 2190 | const char *z = azArg[j]; | |
| 2191 | if( z[0]=='-' ){ | |
| 2192 | while( z[0]=='-' ) z++; | |
| 2193 | /* No options to process at this time */ | |
| 2194 | { | |
| 2195 | fprintf(stderr, "unknown option: %s\n", azArg[j]); | |
| 2196 | return 1; | |
| 2197 | } | |
| 2198 | }else if( zDestFile==0 ){ | |
| 2199 | zDestFile = azArg[j]; | |
| 2200 | }else if( zDb==0 ){ | |
| 2201 | zDb = zDestFile; | |
| 2202 | zDestFile = azArg[j]; | |
| 2203 | }else{ | |
| 2204 | fprintf(stderr, "too many arguments to .backup\n"); | |
| 2205 | return 1; | |
| 2206 | } | |
| 2207 | } | |
| 2208 | if( zDestFile==0 ){ | |
| 2209 | fprintf(stderr, "missing FILENAME argument on .backup\n"); | |
| 2210 | return 1; | |
| 2211 | } | |
| 2212 | if( zDb==0 ) zDb = "main"; | |
| 2213 | rc = sqlite3_open(zDestFile, &pDest); | |
| 2214 | if( rc!=SQLITE_OK ){ | |
| 2215 | fprintf(stderr, "Error: cannot open \"%s\"\n", zDestFile); | |
| 2216 | sqlite3_close(pDest); | |
| 2217 | return 1; | |
| 2218 | } | |
| 2219 | open_db(p, 0); | |
| 2220 | pBackup = sqlite3_backup_init(pDest, "main", p->db, zDb); | |
| 2221 | if( pBackup==0 ){ | |
| 2222 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(pDest)); | |
| 2223 | sqlite3_close(pDest); | |
| 2224 | return 1; | |
| 2225 | } | |
| 2226 | while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK ){} | |
| 2227 | sqlite3_backup_finish(pBackup); | |
| 2228 | if( rc==SQLITE_DONE ){ | |
| 2229 | rc = 0; | |
| 2230 | }else{ | |
| 2231 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(pDest)); | |
| 2232 | rc = 1; | |
| 2233 | } | |
| 2234 | sqlite3_close(pDest); | |
| 2235 | }else | |
| 2237 | 2236 | |
| 2238 | if( c=='b' && n>=3 && strncmp(azArg[0], "bail", n)==0 && nArg>1 && nArg<3 ){ | |
| 2239 | bail_on_error = booleanValue(azArg[1]); | |
| 2240 | }else | |
| 2237 | if( c=='b' && n>=3 && strncmp(azArg[0], "bail", n)==0 && nArg>1 && nArg<3 ){ | |
| 2238 | bail_on_error = booleanValue(azArg[1]); | |
| 2239 | }else | |
| 2241 | 2240 | |
| 2242 | /* The undocumented ".breakpoint" command causes a call to the no-op | |
| 2243 | ** routine named test_breakpoint(). | |
| 2244 | */ | |
| 2245 | if( c=='b' && n>=3 && strncmp(azArg[0], "breakpoint", n)==0 ){ | |
| 2246 | test_breakpoint(); | |
| 2247 | }else | |
| 2241 | /* The undocumented ".breakpoint" command causes a call to the no-op | |
| 2242 | ** routine named test_breakpoint(). | |
| 2243 | */ | |
| 2244 | if( c=='b' && n>=3 && strncmp(azArg[0], "breakpoint", n)==0 ){ | |
| 2245 | test_breakpoint(); | |
| 2246 | }else | |
| 2248 | 2247 | |
| 2249 | if( c=='c' && strncmp(azArg[0], "clone", n)==0 && nArg>1 && nArg<3 ){ | |
| 2250 | tryToClone(p, azArg[1]); | |
| 2251 | }else | |
| 2248 | if( c=='c' && strncmp(azArg[0], "clone", n)==0 && nArg>1 && nArg<3 ){ | |
| 2249 | tryToClone(p, azArg[1]); | |
| 2250 | }else | |
| 2252 | 2251 | |
| 2253 | if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 && nArg==1 ){ | |
| 2254 | struct callback_data data; | |
| 2255 | char *zErrMsg = 0; | |
| 2256 | open_db(p, 0); | |
| 2257 | memcpy(&data, p, sizeof(data)); | |
| 2258 | data.showHeader = 1; | |
| 2259 | data.mode = MODE_Column; | |
| 2260 | data.colWidth[0] = 3; | |
| 2261 | data.colWidth[1] = 15; | |
| 2262 | data.colWidth[2] = 58; | |
| 2263 | data.cnt = 0; | |
| 2264 | sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg); | |
| 2265 | if( zErrMsg ){ | |
| 2266 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 2267 | sqlite3_free(zErrMsg); | |
| 2268 | rc = 1; | |
| 2269 | } | |
| 2270 | }else | |
| 2252 | if( c=='d' && n>1 && strncmp(azArg[0], "databases", n)==0 && nArg==1 ){ | |
| 2253 | struct callback_data data; | |
| 2254 | char *zErrMsg = 0; | |
| 2255 | open_db(p, 0); | |
| 2256 | memcpy(&data, p, sizeof(data)); | |
| 2257 | data.showHeader = 1; | |
| 2258 | data.mode = MODE_Column; | |
| 2259 | data.colWidth[0] = 3; | |
| 2260 | data.colWidth[1] = 15; | |
| 2261 | data.colWidth[2] = 58; | |
| 2262 | data.cnt = 0; | |
| 2263 | sqlite3_exec(p->db, "PRAGMA database_list; ", callback, &data, &zErrMsg); | |
| 2264 | if( zErrMsg ){ | |
| 2265 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 2266 | sqlite3_free(zErrMsg); | |
| 2267 | rc = 1; | |
| 2268 | } | |
| 2269 | }else | |
| 2271 | 2270 | |
| 2272 | if( c=='d' && strncmp(azArg[0], "dump", n)==0 && nArg<3 ){ | |
| 2273 | open_db(p, 0); | |
| 2274 | /* When playing back a "dump", the content might appear in an order | |
| 2275 | ** which causes immediate foreign key constraints to be violated. | |
| 2276 | ** So disable foreign-key constraint enforcement to prevent problems. */ | |
| 2277 | fprintf(p->out, "PRAGMA foreign_keys=OFF;\n"); | |
| 2278 | fprintf(p->out, "BEGIN TRANSACTION;\n"); | |
| 2279 | p->writableSchema = 0; | |
| 2280 | sqlite3_exec(p->db, "SAVEPOINT dump; PRAGMA writable_schema=ON", 0, 0, 0); | |
| 2281 | p->nErr = 0; | |
| 2282 | if( nArg==1 ){ | |
| 2283 | run_schema_dump_query(p, | |
| 2284 | "SELECT name, type, sql FROM sqlite_master " | |
| 2285 | "WHERE sql NOT NULL AND type=='table' AND name!='sqlite_sequence'" | |
| 2286 | ); | |
| 2287 | run_schema_dump_query(p, | |
| 2288 | "SELECT name, type, sql FROM sqlite_master " | |
| 2289 | "WHERE name=='sqlite_sequence'" | |
| 2290 | ); | |
| 2291 | run_table_dump_query(p, | |
| 2292 | "SELECT sql FROM sqlite_master " | |
| 2293 | "WHERE sql NOT NULL AND type IN ('index','trigger','view')", 0 | |
| 2294 | ); | |
| 2295 | }else{ | |
| 2296 | int i; | |
| 2297 | for(i=1; i<nArg; i++){ | |
| 2298 | zShellStatic = azArg[i]; | |
| 2299 | run_schema_dump_query(p, | |
| 2300 | "SELECT name, type, sql FROM sqlite_master " | |
| 2301 | "WHERE tbl_name LIKE shellstatic() AND type=='table'" | |
| 2302 | " AND sql NOT NULL"); | |
| 2303 | run_table_dump_query(p, | |
| 2304 | "SELECT sql FROM sqlite_master " | |
| 2305 | "WHERE sql NOT NULL" | |
| 2306 | " AND type IN ('index','trigger','view')" | |
| 2307 | " AND tbl_name LIKE shellstatic()", 0 | |
| 2308 | ); | |
| 2309 | zShellStatic = 0; | |
| 2310 | } | |
| 2311 | } | |
| 2312 | if( p->writableSchema ){ | |
| 2313 | fprintf(p->out, "PRAGMA writable_schema=OFF;\n"); | |
| 2314 | p->writableSchema = 0; | |
| 2315 | } | |
| 2316 | sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0); | |
| 2317 | sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0); | |
| 2318 | fprintf(p->out, p->nErr ? "ROLLBACK; -- due to errors\n" : "COMMIT;\n"); | |
| 2319 | }else | |
| 2271 | if( c=='d' && strncmp(azArg[0], "dump", n)==0 && nArg<3 ){ | |
| 2272 | open_db(p, 0); | |
| 2273 | /* When playing back a "dump", the content might appear in an order | |
| 2274 | ** which causes immediate foreign key constraints to be violated. | |
| 2275 | ** So disable foreign-key constraint enforcement to prevent problems. */ | |
| 2276 | fprintf(p->out, "PRAGMA foreign_keys=OFF;\n"); | |
| 2277 | fprintf(p->out, "BEGIN TRANSACTION;\n"); | |
| 2278 | p->writableSchema = 0; | |
| 2279 | sqlite3_exec(p->db, "SAVEPOINT dump; PRAGMA writable_schema=ON", 0, 0, 0); | |
| 2280 | p->nErr = 0; | |
| 2281 | if( nArg==1 ){ | |
| 2282 | run_schema_dump_query(p, | |
| 2283 | "SELECT name, type, sql FROM sqlite_master " | |
| 2284 | "WHERE sql NOT NULL AND type=='table' AND name!='sqlite_sequence'" | |
| 2285 | ); | |
| 2286 | run_schema_dump_query(p, | |
| 2287 | "SELECT name, type, sql FROM sqlite_master " | |
| 2288 | "WHERE name=='sqlite_sequence'" | |
| 2289 | ); | |
| 2290 | run_table_dump_query(p, | |
| 2291 | "SELECT sql FROM sqlite_master " | |
| 2292 | "WHERE sql NOT NULL AND type IN ('index','trigger','view')", 0 | |
| 2293 | ); | |
| 2294 | }else{ | |
| 2295 | int i; | |
| 2296 | for(i=1; i<nArg; i++){ | |
| 2297 | zShellStatic = azArg[i]; | |
| 2298 | run_schema_dump_query(p, | |
| 2299 | "SELECT name, type, sql FROM sqlite_master " | |
| 2300 | "WHERE tbl_name LIKE shellstatic() AND type=='table'" | |
| 2301 | " AND sql NOT NULL"); | |
| 2302 | run_table_dump_query(p, | |
| 2303 | "SELECT sql FROM sqlite_master " | |
| 2304 | "WHERE sql NOT NULL" | |
| 2305 | " AND type IN ('index','trigger','view')" | |
| 2306 | " AND tbl_name LIKE shellstatic()", 0 | |
| 2307 | ); | |
| 2308 | zShellStatic = 0; | |
| 2309 | } | |
| 2310 | } | |
| 2311 | if( p->writableSchema ){ | |
| 2312 | fprintf(p->out, "PRAGMA writable_schema=OFF;\n"); | |
| 2313 | p->writableSchema = 0; | |
| 2314 | } | |
| 2315 | sqlite3_exec(p->db, "PRAGMA writable_schema=OFF;", 0, 0, 0); | |
| 2316 | sqlite3_exec(p->db, "RELEASE dump;", 0, 0, 0); | |
| 2317 | fprintf(p->out, p->nErr ? "ROLLBACK; -- due to errors\n" : "COMMIT;\n"); | |
| 2318 | }else | |
| 2320 | 2319 | |
| 2321 | if( c=='e' && strncmp(azArg[0], "echo", n)==0 && nArg>1 && nArg<3 ){ | |
| 2322 | p->echoOn = booleanValue(azArg[1]); | |
| 2323 | }else | |
| 2320 | if( c=='e' && strncmp(azArg[0], "echo", n)==0 && nArg>1 && nArg<3 ){ | |
| 2321 | p->echoOn = booleanValue(azArg[1]); | |
| 2322 | }else | |
| 2324 | 2323 | |
| 2325 | if( c=='e' && strncmp(azArg[0], "eqp", n)==0 && nArg>1 && nArg<3 ){ | |
| 2326 | p->autoEQP = booleanValue(azArg[1]); | |
| 2327 | }else | |
| 2324 | if( c=='e' && strncmp(azArg[0], "eqp", n)==0 && nArg>1 && nArg<3 ){ | |
| 2325 | p->autoEQP = booleanValue(azArg[1]); | |
| 2326 | }else | |
| 2328 | 2327 | |
| 2329 | if( c=='e' && strncmp(azArg[0], "exit", n)==0 ){ | |
| 2330 | if( nArg>1 && (rc = (int)integerValue(azArg[1]))!=0 ) exit(rc); | |
| 2331 | rc = 2; | |
| 2332 | }else | |
| 2328 | if( c=='e' && strncmp(azArg[0], "exit", n)==0 ){ | |
| 2329 | if( nArg>1 && (rc = (int)integerValue(azArg[1]))!=0 ) exit(rc); | |
| 2330 | rc = 2; | |
| 2331 | }else | |
| 2333 | 2332 | |
| 2334 | if( c=='e' && strncmp(azArg[0], "explain", n)==0 && nArg<3 ){ | |
| 2335 | int val = nArg>=2 ? booleanValue(azArg[1]) : 1; | |
| 2336 | if(val == 1) { | |
| 2337 | if(!p->explainPrev.valid) { | |
| 2338 | p->explainPrev.valid = 1; | |
| 2339 | p->explainPrev.mode = p->mode; | |
| 2340 | p->explainPrev.showHeader = p->showHeader; | |
| 2341 | memcpy(p->explainPrev.colWidth,p->colWidth,sizeof(p->colWidth)); | |
| 2342 | } | |
| 2343 | /* We could put this code under the !p->explainValid | |
| 2344 | ** condition so that it does not execute if we are already in | |
| 2345 | ** explain mode. However, always executing it allows us an easy | |
| 2346 | ** was to reset to explain mode in case the user previously | |
| 2347 | ** did an .explain followed by a .width, .mode or .header | |
| 2348 | ** command. | |
| 2349 | */ | |
| 2350 | p->mode = MODE_Explain; | |
| 2351 | p->showHeader = 1; | |
| 2352 | memset(p->colWidth,0,sizeof(p->colWidth)); | |
| 2353 | p->colWidth[0] = 4; /* addr */ | |
| 2354 | p->colWidth[1] = 13; /* opcode */ | |
| 2355 | p->colWidth[2] = 4; /* P1 */ | |
| 2356 | p->colWidth[3] = 4; /* P2 */ | |
| 2357 | p->colWidth[4] = 4; /* P3 */ | |
| 2358 | p->colWidth[5] = 13; /* P4 */ | |
| 2359 | p->colWidth[6] = 2; /* P5 */ | |
| 2360 | p->colWidth[7] = 13; /* Comment */ | |
| 2361 | }else if (p->explainPrev.valid) { | |
| 2362 | p->explainPrev.valid = 0; | |
| 2363 | p->mode = p->explainPrev.mode; | |
| 2364 | p->showHeader = p->explainPrev.showHeader; | |
| 2365 | memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth)); | |
| 2366 | } | |
| 2367 | }else | |
| 2333 | if( c=='e' && strncmp(azArg[0], "explain", n)==0 && nArg<3 ){ | |
| 2334 | int val = nArg>=2 ? booleanValue(azArg[1]) : 1; | |
| 2335 | if(val == 1) { | |
| 2336 | if(!p->explainPrev.valid) { | |
| 2337 | p->explainPrev.valid = 1; | |
| 2338 | p->explainPrev.mode = p->mode; | |
| 2339 | p->explainPrev.showHeader = p->showHeader; | |
| 2340 | memcpy(p->explainPrev.colWidth,p->colWidth,sizeof(p->colWidth)); | |
| 2341 | } | |
| 2342 | /* We could put this code under the !p->explainValid | |
| 2343 | ** condition so that it does not execute if we are already in | |
| 2344 | ** explain mode. However, always executing it allows us an easy | |
| 2345 | ** was to reset to explain mode in case the user previously | |
| 2346 | ** did an .explain followed by a .width, .mode or .header | |
| 2347 | ** command. | |
| 2348 | */ | |
| 2349 | p->mode = MODE_Explain; | |
| 2350 | p->showHeader = 1; | |
| 2351 | memset(p->colWidth,0,sizeof(p->colWidth)); | |
| 2352 | p->colWidth[0] = 4; /* addr */ | |
| 2353 | p->colWidth[1] = 13; /* opcode */ | |
| 2354 | p->colWidth[2] = 4; /* P1 */ | |
| 2355 | p->colWidth[3] = 4; /* P2 */ | |
| 2356 | p->colWidth[4] = 4; /* P3 */ | |
| 2357 | p->colWidth[5] = 13; /* P4 */ | |
| 2358 | p->colWidth[6] = 2; /* P5 */ | |
| 2359 | p->colWidth[7] = 13; /* Comment */ | |
| 2360 | }else if (p->explainPrev.valid) { | |
| 2361 | p->explainPrev.valid = 0; | |
| 2362 | p->mode = p->explainPrev.mode; | |
| 2363 | p->showHeader = p->explainPrev.showHeader; | |
| 2364 | memcpy(p->colWidth,p->explainPrev.colWidth,sizeof(p->colWidth)); | |
| 2365 | } | |
| 2366 | }else | |
| 2368 | 2367 | |
| 2369 | if( c=='h' && (strncmp(azArg[0], "header", n)==0 || | |
| 2370 | strncmp(azArg[0], "headers", n)==0) && nArg>1 && nArg<3 ){ | |
| 2371 | p->showHeader = booleanValue(azArg[1]); | |
| 2372 | }else | |
| 2368 | if( c=='h' && (strncmp(azArg[0], "header", n)==0 || | |
| 2369 | strncmp(azArg[0], "headers", n)==0) && nArg>1 && nArg<3 ){ | |
| 2370 | p->showHeader = booleanValue(azArg[1]); | |
| 2371 | }else | |
| 2373 | 2372 | |
| 2374 | if( c=='h' && strncmp(azArg[0], "help", n)==0 ){ | |
| 2375 | fprintf(stderr,"%s",zHelp); | |
| 2376 | if( HAS_TIMER ){ | |
| 2377 | fprintf(stderr,"%s",zTimerHelp); | |
| 2378 | } | |
| 2379 | }else | |
| 2373 | if( c=='h' && strncmp(azArg[0], "help", n)==0 ){ | |
| 2374 | fprintf(stderr,"%s",zHelp); | |
| 2375 | if( HAS_TIMER ){ | |
| 2376 | fprintf(stderr,"%s",zTimerHelp); | |
| 2377 | } | |
| 2378 | }else | |
| 2380 | 2379 | |
| 2381 | if( c=='i' && strncmp(azArg[0], "import", n)==0 && nArg==3 ){ | |
| 2382 | char *zTable = azArg[2]; /* Insert data into this table */ | |
| 2383 | char *zFile = azArg[1]; /* Name of file to extra content from */ | |
| 2384 | sqlite3_stmt *pStmt = NULL; /* A statement */ | |
| 2385 | int nCol; /* Number of columns in the table */ | |
| 2386 | int nByte; /* Number of bytes in an SQL string */ | |
| 2387 | int i, j; /* Loop counters */ | |
| 2388 | int needCommit; /* True to COMMIT or ROLLBACK at end */ | |
| 2389 | int nSep; /* Number of bytes in p->separator[] */ | |
| 2390 | char *zSql; /* An SQL statement */ | |
| 2391 | CSVReader sCsv; /* Reader context */ | |
| 2392 | int (*xCloser)(FILE*); /* Procedure to close th3 connection */ | |
| 2380 | if( c=='i' && strncmp(azArg[0], "import", n)==0 && nArg==3 ){ | |
| 2381 | char *zTable = azArg[2]; /* Insert data into this table */ | |
| 2382 | char *zFile = azArg[1]; /* Name of file to extra content from */ | |
| 2383 | sqlite3_stmt *pStmt = NULL; /* A statement */ | |
| 2384 | int nCol; /* Number of columns in the table */ | |
| 2385 | int nByte; /* Number of bytes in an SQL string */ | |
| 2386 | int i, j; /* Loop counters */ | |
| 2387 | int needCommit; /* True to COMMIT or ROLLBACK at end */ | |
| 2388 | int nSep; /* Number of bytes in p->separator[] */ | |
| 2389 | char *zSql; /* An SQL statement */ | |
| 2390 | CSVReader sCsv; /* Reader context */ | |
| 2391 | int (*xCloser)(FILE*); /* Procedure to close th3 connection */ | |
| 2393 | 2392 | |
| 2394 | seenInterrupt = 0; | |
| 2395 | memset(&sCsv, 0, sizeof(sCsv)); | |
| 2396 | open_db(p, 0); | |
| 2397 | nSep = strlen30(p->separator); | |
| 2398 | if( nSep==0 ){ | |
| 2399 | fprintf(stderr, "Error: non-null separator required for import\n"); | |
| 2400 | return 1; | |
| 2401 | } | |
| 2402 | if( nSep>1 ){ | |
| 2403 | fprintf(stderr, "Error: multi-character separators not allowed" | |
| 2404 | " for import\n"); | |
| 2405 | return 1; | |
| 2406 | } | |
| 2407 | sCsv.zFile = zFile; | |
| 2408 | sCsv.nLine = 1; | |
| 2409 | if( sCsv.zFile[0]=='|' ){ | |
| 2410 | sCsv.in = popen(sCsv.zFile+1, "r"); | |
| 2411 | sCsv.zFile = "<pipe>"; | |
| 2412 | xCloser = pclose; | |
| 2413 | }else{ | |
| 2414 | sCsv.in = fopen(sCsv.zFile, "rb"); | |
| 2415 | xCloser = fclose; | |
| 2416 | } | |
| 2417 | if( sCsv.in==0 ){ | |
| 2418 | fprintf(stderr, "Error: cannot open \"%s\"\n", zFile); | |
| 2419 | return 1; | |
| 2420 | } | |
| 2421 | sCsv.cSeparator = p->separator[0]; | |
| 2422 | zSql = sqlite3_mprintf("SELECT * FROM %s", zTable); | |
| 2423 | if( zSql==0 ){ | |
| 2424 | fprintf(stderr, "Error: out of memory\n"); | |
| 2425 | xCloser(sCsv.in); | |
| 2426 | return 1; | |
| 2427 | } | |
| 2428 | nByte = strlen30(zSql); | |
| 2429 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2430 | if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(db))==0 ){ | |
| 2431 | char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable); | |
| 2432 | char cSep = '('; | |
| 2433 | while( csv_read_one_field(&sCsv) ){ | |
| 2434 | zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCsv.z); | |
| 2435 | cSep = ','; | |
| 2436 | if( sCsv.cTerm!=sCsv.cSeparator ) break; | |
| 2437 | } | |
| 2438 | if( cSep=='(' ){ | |
| 2439 | sqlite3_free(zCreate); | |
| 2440 | sqlite3_free(sCsv.z); | |
| 2441 | xCloser(sCsv.in); | |
| 2442 | fprintf(stderr,"%s: empty file\n", sCsv.zFile); | |
| 2443 | return 1; | |
| 2444 | } | |
| 2445 | zCreate = sqlite3_mprintf("%z\n)", zCreate); | |
| 2446 | rc = sqlite3_exec(p->db, zCreate, 0, 0, 0); | |
| 2447 | sqlite3_free(zCreate); | |
| 2448 | if( rc ){ | |
| 2449 | fprintf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable, | |
| 2450 | sqlite3_errmsg(db)); | |
| 2451 | sqlite3_free(sCsv.z); | |
| 2452 | xCloser(sCsv.in); | |
| 2453 | return 1; | |
| 2454 | } | |
| 2455 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2456 | } | |
| 2457 | sqlite3_free(zSql); | |
| 2458 | if( rc ){ | |
| 2459 | if (pStmt) sqlite3_finalize(pStmt); | |
| 2460 | fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); | |
| 2461 | xCloser(sCsv.in); | |
| 2462 | return 1; | |
| 2463 | } | |
| 2464 | nCol = sqlite3_column_count(pStmt); | |
| 2465 | sqlite3_finalize(pStmt); | |
| 2466 | pStmt = 0; | |
| 2467 | if( nCol==0 ) return 0; /* no columns, no error */ | |
| 2468 | zSql = (char *)sqlite3_malloc( nByte*2 + 20 + nCol*2 ); | |
| 2469 | if( zSql==0 ){ | |
| 2470 | fprintf(stderr, "Error: out of memory\n"); | |
| 2471 | xCloser(sCsv.in); | |
| 2472 | return 1; | |
| 2473 | } | |
| 2474 | sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable); | |
| 2475 | j = strlen30(zSql); | |
| 2476 | for(i=1; i<nCol; i++){ | |
| 2477 | zSql[j++] = ','; | |
| 2478 | zSql[j++] = '?'; | |
| 2479 | } | |
| 2480 | zSql[j++] = ')'; | |
| 2481 | zSql[j] = 0; | |
| 2482 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2483 | sqlite3_free(zSql); | |
| 2484 | if( rc ){ | |
| 2485 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db)); | |
| 2486 | if (pStmt) sqlite3_finalize(pStmt); | |
| 2487 | xCloser(sCsv.in); | |
| 2488 | return 1; | |
| 2489 | } | |
| 2490 | needCommit = sqlite3_get_autocommit(db); | |
| 2491 | if( needCommit ) sqlite3_exec(db, "BEGIN", 0, 0, 0); | |
| 2492 | do{ | |
| 2493 | int startLine = sCsv.nLine; | |
| 2494 | for(i=0; i<nCol; i++){ | |
| 2495 | char *z = csv_read_one_field(&sCsv); | |
| 2496 | if( z==0 && i==0 ) break; | |
| 2497 | sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT); | |
| 2498 | if( i<nCol-1 && sCsv.cTerm!=sCsv.cSeparator ){ | |
| 2499 | fprintf(stderr, "%s:%d: expected %d columns but found %d - " | |
| 2500 | "filling the rest with NULL\n", | |
| 2501 | sCsv.zFile, startLine, nCol, i+1); | |
| 2502 | i++; | |
| 2503 | while( i<nCol ){ sqlite3_bind_null(pStmt, i); i++; } | |
| 2504 | } | |
| 2505 | } | |
| 2506 | if( sCsv.cTerm==sCsv.cSeparator ){ | |
| 2507 | do{ | |
| 2508 | csv_read_one_field(&sCsv); | |
| 2509 | i++; | |
| 2510 | }while( sCsv.cTerm==sCsv.cSeparator ); | |
| 2511 | fprintf(stderr, "%s:%d: expected %d columns but found %d - " | |
| 2512 | "extras ignored\n", | |
| 2513 | sCsv.zFile, startLine, nCol, i); | |
| 2514 | } | |
| 2515 | if( i>=nCol ){ | |
| 2516 | sqlite3_step(pStmt); | |
| 2517 | rc = sqlite3_reset(pStmt); | |
| 2518 | if( rc!=SQLITE_OK ){ | |
| 2519 | fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCsv.zFile, startLine, | |
| 2520 | sqlite3_errmsg(db)); | |
| 2521 | } | |
| 2522 | } | |
| 2523 | }while( sCsv.cTerm!=EOF ); | |
| 2393 | seenInterrupt = 0; | |
| 2394 | memset(&sCsv, 0, sizeof(sCsv)); | |
| 2395 | open_db(p, 0); | |
| 2396 | nSep = strlen30(p->separator); | |
| 2397 | if( nSep==0 ){ | |
| 2398 | fprintf(stderr, "Error: non-null separator required for import\n"); | |
| 2399 | return 1; | |
| 2400 | } | |
| 2401 | if( nSep>1 ){ | |
| 2402 | fprintf(stderr, "Error: multi-character separators not allowed" | |
| 2403 | " for import\n"); | |
| 2404 | return 1; | |
| 2405 | } | |
| 2406 | sCsv.zFile = zFile; | |
| 2407 | sCsv.nLine = 1; | |
| 2408 | if( sCsv.zFile[0]=='|' ){ | |
| 2409 | sCsv.in = popen(sCsv.zFile+1, "r"); | |
| 2410 | sCsv.zFile = "<pipe>"; | |
| 2411 | xCloser = pclose; | |
| 2412 | }else{ | |
| 2413 | sCsv.in = fopen(sCsv.zFile, "rb"); | |
| 2414 | xCloser = fclose; | |
| 2415 | } | |
| 2416 | if( sCsv.in==0 ){ | |
| 2417 | fprintf(stderr, "Error: cannot open \"%s\"\n", zFile); | |
| 2418 | return 1; | |
| 2419 | } | |
| 2420 | sCsv.cSeparator = p->separator[0]; | |
| 2421 | zSql = sqlite3_mprintf("SELECT * FROM %s", zTable); | |
| 2422 | if( zSql==0 ){ | |
| 2423 | fprintf(stderr, "Error: out of memory\n"); | |
| 2424 | xCloser(sCsv.in); | |
| 2425 | return 1; | |
| 2426 | } | |
| 2427 | nByte = strlen30(zSql); | |
| 2428 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2429 | if( rc && sqlite3_strglob("no such table: *", sqlite3_errmsg(db))==0 ){ | |
| 2430 | char *zCreate = sqlite3_mprintf("CREATE TABLE %s", zTable); | |
| 2431 | char cSep = '('; | |
| 2432 | while( csv_read_one_field(&sCsv) ){ | |
| 2433 | zCreate = sqlite3_mprintf("%z%c\n \"%s\" TEXT", zCreate, cSep, sCsv.z); | |
| 2434 | cSep = ','; | |
| 2435 | if( sCsv.cTerm!=sCsv.cSeparator ) break; | |
| 2436 | } | |
| 2437 | if( cSep=='(' ){ | |
| 2438 | sqlite3_free(zCreate); | |
| 2439 | sqlite3_free(sCsv.z); | |
| 2440 | xCloser(sCsv.in); | |
| 2441 | fprintf(stderr,"%s: empty file\n", sCsv.zFile); | |
| 2442 | return 1; | |
| 2443 | } | |
| 2444 | zCreate = sqlite3_mprintf("%z\n)", zCreate); | |
| 2445 | rc = sqlite3_exec(p->db, zCreate, 0, 0, 0); | |
| 2446 | sqlite3_free(zCreate); | |
| 2447 | if( rc ){ | |
| 2448 | fprintf(stderr, "CREATE TABLE %s(...) failed: %s\n", zTable, | |
| 2449 | sqlite3_errmsg(db)); | |
| 2450 | sqlite3_free(sCsv.z); | |
| 2451 | xCloser(sCsv.in); | |
| 2452 | return 1; | |
| 2453 | } | |
| 2454 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2455 | } | |
| 2456 | sqlite3_free(zSql); | |
| 2457 | if( rc ){ | |
| 2458 | if (pStmt) sqlite3_finalize(pStmt); | |
| 2459 | fprintf(stderr,"Error: %s\n", sqlite3_errmsg(db)); | |
| 2460 | xCloser(sCsv.in); | |
| 2461 | return 1; | |
| 2462 | } | |
| 2463 | nCol = sqlite3_column_count(pStmt); | |
| 2464 | sqlite3_finalize(pStmt); | |
| 2465 | pStmt = 0; | |
| 2466 | if( nCol==0 ) return 0; /* no columns, no error */ | |
| 2467 | zSql = (char *)sqlite3_malloc( nByte*2 + 20 + nCol*2 ); | |
| 2468 | if( zSql==0 ){ | |
| 2469 | fprintf(stderr, "Error: out of memory\n"); | |
| 2470 | xCloser(sCsv.in); | |
| 2471 | return 1; | |
| 2472 | } | |
| 2473 | sqlite3_snprintf(nByte+20, zSql, "INSERT INTO \"%w\" VALUES(?", zTable); | |
| 2474 | j = strlen30(zSql); | |
| 2475 | for(i=1; i<nCol; i++){ | |
| 2476 | zSql[j++] = ','; | |
| 2477 | zSql[j++] = '?'; | |
| 2478 | } | |
| 2479 | zSql[j++] = ')'; | |
| 2480 | zSql[j] = 0; | |
| 2481 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2482 | sqlite3_free(zSql); | |
| 2483 | if( rc ){ | |
| 2484 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(db)); | |
| 2485 | if (pStmt) sqlite3_finalize(pStmt); | |
| 2486 | xCloser(sCsv.in); | |
| 2487 | return 1; | |
| 2488 | } | |
| 2489 | needCommit = sqlite3_get_autocommit(db); | |
| 2490 | if( needCommit ) sqlite3_exec(db, "BEGIN", 0, 0, 0); | |
| 2491 | do{ | |
| 2492 | int startLine = sCsv.nLine; | |
| 2493 | for(i=0; i<nCol; i++){ | |
| 2494 | char *z = csv_read_one_field(&sCsv); | |
| 2495 | if( z==0 && i==0 ) break; | |
| 2496 | sqlite3_bind_text(pStmt, i+1, z, -1, SQLITE_TRANSIENT); | |
| 2497 | if( i<nCol-1 && sCsv.cTerm!=sCsv.cSeparator ){ | |
| 2498 | fprintf(stderr, "%s:%d: expected %d columns but found %d - " | |
| 2499 | "filling the rest with NULL\n", | |
| 2500 | sCsv.zFile, startLine, nCol, i+1); | |
| 2501 | i++; | |
| 2502 | while( i<nCol ){ sqlite3_bind_null(pStmt, i); i++; } | |
| 2503 | } | |
| 2504 | } | |
| 2505 | if( sCsv.cTerm==sCsv.cSeparator ){ | |
| 2506 | do{ | |
| 2507 | csv_read_one_field(&sCsv); | |
| 2508 | i++; | |
| 2509 | }while( sCsv.cTerm==sCsv.cSeparator ); | |
| 2510 | fprintf(stderr, "%s:%d: expected %d columns but found %d - " | |
| 2511 | "extras ignored\n", | |
| 2512 | sCsv.zFile, startLine, nCol, i); | |
| 2513 | } | |
| 2514 | if( i>=nCol ){ | |
| 2515 | sqlite3_step(pStmt); | |
| 2516 | rc = sqlite3_reset(pStmt); | |
| 2517 | if( rc!=SQLITE_OK ){ | |
| 2518 | fprintf(stderr, "%s:%d: INSERT failed: %s\n", sCsv.zFile, startLine, | |
| 2519 | sqlite3_errmsg(db)); | |
| 2520 | } | |
| 2521 | } | |
| 2522 | }while( sCsv.cTerm!=EOF ); | |
| 2524 | 2523 | |
| 2525 | xCloser(sCsv.in); | |
| 2526 | sqlite3_free(sCsv.z); | |
| 2527 | sqlite3_finalize(pStmt); | |
| 2528 | if( needCommit ) sqlite3_exec(db, "COMMIT", 0, 0, 0); | |
| 2529 | }else | |
| 2524 | xCloser(sCsv.in); | |
| 2525 | sqlite3_free(sCsv.z); | |
| 2526 | sqlite3_finalize(pStmt); | |
| 2527 | if( needCommit ) sqlite3_exec(db, "COMMIT", 0, 0, 0); | |
| 2528 | }else | |
| 2530 | 2529 | |
| 2531 | if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg<3 ){ | |
| 2532 | struct callback_data data; | |
| 2533 | char *zErrMsg = 0; | |
| 2534 | open_db(p, 0); | |
| 2535 | memcpy(&data, p, sizeof(data)); | |
| 2536 | data.showHeader = 0; | |
| 2537 | data.mode = MODE_List; | |
| 2538 | if( nArg==1 ){ | |
| 2539 | rc = sqlite3_exec(p->db, | |
| 2540 | "SELECT name FROM sqlite_master " | |
| 2541 | "WHERE type='index' AND name NOT LIKE 'sqlite_%' " | |
| 2542 | "UNION ALL " | |
| 2543 | "SELECT name FROM sqlite_temp_master " | |
| 2544 | "WHERE type='index' " | |
| 2545 | "ORDER BY 1", | |
| 2546 | callback, &data, &zErrMsg | |
| 2547 | ); | |
| 2548 | }else{ | |
| 2549 | zShellStatic = azArg[1]; | |
| 2550 | rc = sqlite3_exec(p->db, | |
| 2551 | "SELECT name FROM sqlite_master " | |
| 2552 | "WHERE type='index' AND tbl_name LIKE shellstatic() " | |
| 2553 | "UNION ALL " | |
| 2554 | "SELECT name FROM sqlite_temp_master " | |
| 2555 | "WHERE type='index' AND tbl_name LIKE shellstatic() " | |
| 2556 | "ORDER BY 1", | |
| 2557 | callback, &data, &zErrMsg | |
| 2558 | ); | |
| 2559 | zShellStatic = 0; | |
| 2560 | } | |
| 2561 | if( zErrMsg ){ | |
| 2562 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 2563 | sqlite3_free(zErrMsg); | |
| 2564 | rc = 1; | |
| 2565 | }else if( rc != SQLITE_OK ){ | |
| 2566 | fprintf(stderr,"Error: querying sqlite_master and sqlite_temp_master\n"); | |
| 2567 | rc = 1; | |
| 2568 | } | |
| 2569 | }else | |
| 2530 | if( c=='i' && strncmp(azArg[0], "indices", n)==0 && nArg<3 ){ | |
| 2531 | struct callback_data data; | |
| 2532 | char *zErrMsg = 0; | |
| 2533 | open_db(p, 0); | |
| 2534 | memcpy(&data, p, sizeof(data)); | |
| 2535 | data.showHeader = 0; | |
| 2536 | data.mode = MODE_List; | |
| 2537 | if( nArg==1 ){ | |
| 2538 | rc = sqlite3_exec(p->db, | |
| 2539 | "SELECT name FROM sqlite_master " | |
| 2540 | "WHERE type='index' AND name NOT LIKE 'sqlite_%' " | |
| 2541 | "UNION ALL " | |
| 2542 | "SELECT name FROM sqlite_temp_master " | |
| 2543 | "WHERE type='index' " | |
| 2544 | "ORDER BY 1", | |
| 2545 | callback, &data, &zErrMsg | |
| 2546 | ); | |
| 2547 | }else{ | |
| 2548 | zShellStatic = azArg[1]; | |
| 2549 | rc = sqlite3_exec(p->db, | |
| 2550 | "SELECT name FROM sqlite_master " | |
| 2551 | "WHERE type='index' AND tbl_name LIKE shellstatic() " | |
| 2552 | "UNION ALL " | |
| 2553 | "SELECT name FROM sqlite_temp_master " | |
| 2554 | "WHERE type='index' AND tbl_name LIKE shellstatic() " | |
| 2555 | "ORDER BY 1", | |
| 2556 | callback, &data, &zErrMsg | |
| 2557 | ); | |
| 2558 | zShellStatic = 0; | |
| 2559 | } | |
| 2560 | if( zErrMsg ){ | |
| 2561 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 2562 | sqlite3_free(zErrMsg); | |
| 2563 | rc = 1; | |
| 2564 | }else if( rc != SQLITE_OK ){ | |
| 2565 | fprintf(stderr,"Error: querying sqlite_master and sqlite_temp_master\n"); | |
| 2566 | rc = 1; | |
| 2567 | } | |
| 2568 | }else | |
| 2570 | 2569 | |
| 2571 | 2570 | #ifdef SQLITE_ENABLE_IOTRACE |
| 2572 | if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){ | |
| 2573 | extern void (*sqlite3IoTrace)(const char*, ...); | |
| 2574 | if( iotrace && iotrace!=stdout ) fclose(iotrace); | |
| 2575 | iotrace = 0; | |
| 2576 | if( nArg<2 ){ | |
| 2577 | sqlite3IoTrace = 0; | |
| 2578 | }else if( strcmp(azArg[1], "-")==0 ){ | |
| 2579 | sqlite3IoTrace = iotracePrintf; | |
| 2580 | iotrace = stdout; | |
| 2581 | }else{ | |
| 2582 | iotrace = fopen(azArg[1], "w"); | |
| 2583 | if( iotrace==0 ){ | |
| 2584 | fprintf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); | |
| 2585 | sqlite3IoTrace = 0; | |
| 2586 | rc = 1; | |
| 2587 | }else{ | |
| 2588 | sqlite3IoTrace = iotracePrintf; | |
| 2589 | } | |
| 2590 | } | |
| 2591 | }else | |
| 2571 | if( c=='i' && strncmp(azArg[0], "iotrace", n)==0 ){ | |
| 2572 | extern void (*sqlite3IoTrace)(const char*, ...); | |
| 2573 | if( iotrace && iotrace!=stdout ) fclose(iotrace); | |
| 2574 | iotrace = 0; | |
| 2575 | if( nArg<2 ){ | |
| 2576 | sqlite3IoTrace = 0; | |
| 2577 | }else if( strcmp(azArg[1], "-")==0 ){ | |
| 2578 | sqlite3IoTrace = iotracePrintf; | |
| 2579 | iotrace = stdout; | |
| 2580 | }else{ | |
| 2581 | iotrace = fopen(azArg[1], "w"); | |
| 2582 | if( iotrace==0 ){ | |
| 2583 | fprintf(stderr, "Error: cannot open \"%s\"\n", azArg[1]); | |
| 2584 | sqlite3IoTrace = 0; | |
| 2585 | rc = 1; | |
| 2586 | }else{ | |
| 2587 | sqlite3IoTrace = iotracePrintf; | |
| 2588 | } | |
| 2589 | } | |
| 2590 | }else | |
| 2592 | 2591 | #endif |
| 2593 | 2592 | |
| 2594 | 2593 | #ifndef SQLITE_OMIT_LOAD_EXTENSION |
| 2595 | if( c=='l' && strncmp(azArg[0], "load", n)==0 && nArg>=2 ){ | |
| 2596 | const char *zFile, *zProc; | |
| 2597 | char *zErrMsg = 0; | |
| 2598 | zFile = azArg[1]; | |
| 2599 | zProc = nArg>=3 ? azArg[2] : 0; | |
| 2600 | open_db(p, 0); | |
| 2601 | rc = sqlite3_load_extension(p->db, zFile, zProc, &zErrMsg); | |
| 2602 | if( rc!=SQLITE_OK ){ | |
| 2603 | fprintf(stderr, "Error: %s\n", zErrMsg); | |
| 2604 | sqlite3_free(zErrMsg); | |
| 2605 | rc = 1; | |
| 2606 | } | |
| 2607 | }else | |
| 2594 | if( c=='l' && strncmp(azArg[0], "load", n)==0 && nArg>=2 ){ | |
| 2595 | const char *zFile, *zProc; | |
| 2596 | char *zErrMsg = 0; | |
| 2597 | zFile = azArg[1]; | |
| 2598 | zProc = nArg>=3 ? azArg[2] : 0; | |
| 2599 | open_db(p, 0); | |
| 2600 | rc = sqlite3_load_extension(p->db, zFile, zProc, &zErrMsg); | |
| 2601 | if( rc!=SQLITE_OK ){ | |
| 2602 | fprintf(stderr, "Error: %s\n", zErrMsg); | |
| 2603 | sqlite3_free(zErrMsg); | |
| 2604 | rc = 1; | |
| 2605 | } | |
| 2606 | }else | |
| 2608 | 2607 | #endif |
| 2609 | 2608 | |
| 2610 | if( c=='l' && strncmp(azArg[0], "log", n)==0 && nArg>=2 ){ | |
| 2611 | const char *zFile = azArg[1]; | |
| 2612 | output_file_close(p->pLog); | |
| 2613 | p->pLog = output_file_open(zFile); | |
| 2614 | }else | |
| 2609 | if( c=='l' && strncmp(azArg[0], "log", n)==0 && nArg>=2 ){ | |
| 2610 | const char *zFile = azArg[1]; | |
| 2611 | output_file_close(p->pLog); | |
| 2612 | p->pLog = output_file_open(zFile); | |
| 2613 | }else | |
| 2615 | 2614 | |
| 2616 | if( c=='m' && strncmp(azArg[0], "mode", n)==0 && nArg==2 ){ | |
| 2617 | int n2 = strlen30(azArg[1]); | |
| 2618 | if( (n2==4 && strncmp(azArg[1],"line",n2)==0) | |
| 2619 | || | |
| 2620 | (n2==5 && strncmp(azArg[1],"lines",n2)==0) ){ | |
| 2621 | p->mode = MODE_Line; | |
| 2622 | }else if( (n2==6 && strncmp(azArg[1],"column",n2)==0) | |
| 2623 | || | |
| 2624 | (n2==7 && strncmp(azArg[1],"columns",n2)==0) ){ | |
| 2625 | p->mode = MODE_Column; | |
| 2626 | }else if( n2==4 && strncmp(azArg[1],"list",n2)==0 ){ | |
| 2627 | p->mode = MODE_List; | |
| 2628 | }else if( n2==4 && strncmp(azArg[1],"html",n2)==0 ){ | |
| 2629 | p->mode = MODE_Html; | |
| 2630 | }else if( n2==3 && strncmp(azArg[1],"tcl",n2)==0 ){ | |
| 2631 | p->mode = MODE_Tcl; | |
| 2632 | sqlite3_snprintf(sizeof(p->separator), p->separator, " "); | |
| 2633 | }else if( n2==3 && strncmp(azArg[1],"csv",n2)==0 ){ | |
| 2634 | p->mode = MODE_Csv; | |
| 2635 | sqlite3_snprintf(sizeof(p->separator), p->separator, ","); | |
| 2636 | }else if( n2==4 && strncmp(azArg[1],"tabs",n2)==0 ){ | |
| 2637 | p->mode = MODE_List; | |
| 2638 | sqlite3_snprintf(sizeof(p->separator), p->separator, "\t"); | |
| 2639 | }else if( n2==6 && strncmp(azArg[1],"insert",n2)==0 ){ | |
| 2640 | p->mode = MODE_Insert; | |
| 2641 | set_table_name(p, "table"); | |
| 2642 | }else { | |
| 2643 | fprintf(stderr,"Error: mode should be one of: " | |
| 2644 | "column csv html insert line list tabs tcl\n"); | |
| 2645 | rc = 1; | |
| 2646 | } | |
| 2647 | }else | |
| 2615 | if( c=='m' && strncmp(azArg[0], "mode", n)==0 && nArg==2 ){ | |
| 2616 | int n2 = strlen30(azArg[1]); | |
| 2617 | if( (n2==4 && strncmp(azArg[1],"line",n2)==0) | |
| 2618 | || | |
| 2619 | (n2==5 && strncmp(azArg[1],"lines",n2)==0) ){ | |
| 2620 | p->mode = MODE_Line; | |
| 2621 | }else if( (n2==6 && strncmp(azArg[1],"column",n2)==0) | |
| 2622 | || | |
| 2623 | (n2==7 && strncmp(azArg[1],"columns",n2)==0) ){ | |
| 2624 | p->mode = MODE_Column; | |
| 2625 | }else if( n2==4 && strncmp(azArg[1],"list",n2)==0 ){ | |
| 2626 | p->mode = MODE_List; | |
| 2627 | }else if( n2==4 && strncmp(azArg[1],"html",n2)==0 ){ | |
| 2628 | p->mode = MODE_Html; | |
| 2629 | }else if( n2==3 && strncmp(azArg[1],"tcl",n2)==0 ){ | |
| 2630 | p->mode = MODE_Tcl; | |
| 2631 | sqlite3_snprintf(sizeof(p->separator), p->separator, " "); | |
| 2632 | }else if( n2==3 && strncmp(azArg[1],"csv",n2)==0 ){ | |
| 2633 | p->mode = MODE_Csv; | |
| 2634 | sqlite3_snprintf(sizeof(p->separator), p->separator, ","); | |
| 2635 | }else if( n2==4 && strncmp(azArg[1],"tabs",n2)==0 ){ | |
| 2636 | p->mode = MODE_List; | |
| 2637 | sqlite3_snprintf(sizeof(p->separator), p->separator, "\t"); | |
| 2638 | }else if( n2==6 && strncmp(azArg[1],"insert",n2)==0 ){ | |
| 2639 | p->mode = MODE_Insert; | |
| 2640 | set_table_name(p, "table"); | |
| 2641 | }else { | |
| 2642 | fprintf(stderr,"Error: mode should be one of: " | |
| 2643 | "column csv html insert line list tabs tcl\n"); | |
| 2644 | rc = 1; | |
| 2645 | } | |
| 2646 | }else | |
| 2648 | 2647 | |
| 2649 | if( c=='m' && strncmp(azArg[0], "mode", n)==0 && nArg==3 ){ | |
| 2650 | int n2 = strlen30(azArg[1]); | |
| 2651 | if( n2==6 && strncmp(azArg[1],"insert",n2)==0 ){ | |
| 2652 | p->mode = MODE_Insert; | |
| 2653 | set_table_name(p, azArg[2]); | |
| 2654 | }else { | |
| 2655 | fprintf(stderr, "Error: invalid arguments: " | |
| 2656 | " \"%s\". Enter \".help\" for help\n", azArg[2]); | |
| 2657 | rc = 1; | |
| 2658 | } | |
| 2659 | }else | |
| 2648 | if( c=='m' && strncmp(azArg[0], "mode", n)==0 && nArg==3 ){ | |
| 2649 | int n2 = strlen30(azArg[1]); | |
| 2650 | if( n2==6 && strncmp(azArg[1],"insert",n2)==0 ){ | |
| 2651 | p->mode = MODE_Insert; | |
| 2652 | set_table_name(p, azArg[2]); | |
| 2653 | }else { | |
| 2654 | fprintf(stderr, "Error: invalid arguments: " | |
| 2655 | " \"%s\". Enter \".help\" for help\n", azArg[2]); | |
| 2656 | rc = 1; | |
| 2657 | } | |
| 2658 | }else | |
| 2660 | 2659 | |
| 2661 | if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 && nArg==2 ) { | |
| 2662 | sqlite3_snprintf(sizeof(p->nullvalue), p->nullvalue, | |
| 2663 | "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]); | |
| 2664 | }else | |
| 2660 | if( c=='n' && strncmp(azArg[0], "nullvalue", n)==0 && nArg==2 ) { | |
| 2661 | sqlite3_snprintf(sizeof(p->nullvalue), p->nullvalue, | |
| 2662 | "%.*s", (int)ArraySize(p->nullvalue)-1, azArg[1]); | |
| 2663 | }else | |
| 2665 | 2664 | |
| 2666 | if( c=='o' && strncmp(azArg[0], "open", n)==0 && n>=2 ){ | |
| 2667 | sqlite3 *savedDb = p->db; | |
| 2668 | const char *zSavedFilename = p->zDbFilename; | |
| 2669 | char *zNewFilename = 0; | |
| 2670 | p->db = 0; | |
| 2671 | if( nArg>=2 ){ | |
| 2672 | p->zDbFilename = zNewFilename = sqlite3_mprintf("%s", azArg[1]); | |
| 2673 | } | |
| 2674 | open_db(p, 1); | |
| 2675 | if( p->db!=0 ){ | |
| 2676 | sqlite3_close(savedDb); | |
| 2677 | sqlite3_free(p->zFreeOnClose); | |
| 2678 | p->zFreeOnClose = zNewFilename; | |
| 2679 | }else{ | |
| 2680 | sqlite3_free(zNewFilename); | |
| 2681 | p->db = savedDb; | |
| 2682 | p->zDbFilename = zSavedFilename; | |
| 2683 | } | |
| 2684 | }else | |
| 2665 | if( c=='o' && strncmp(azArg[0], "open", n)==0 && n>=2 ){ | |
| 2666 | sqlite3 *savedDb = p->db; | |
| 2667 | const char *zSavedFilename = p->zDbFilename; | |
| 2668 | char *zNewFilename = 0; | |
| 2669 | p->db = 0; | |
| 2670 | if( nArg>=2 ){ | |
| 2671 | p->zDbFilename = zNewFilename = sqlite3_mprintf("%s", azArg[1]); | |
| 2672 | } | |
| 2673 | open_db(p, 1); | |
| 2674 | if( p->db!=0 ){ | |
| 2675 | sqlite3_close(savedDb); | |
| 2676 | sqlite3_free(p->zFreeOnClose); | |
| 2677 | p->zFreeOnClose = zNewFilename; | |
| 2678 | }else{ | |
| 2679 | sqlite3_free(zNewFilename); | |
| 2680 | p->db = savedDb; | |
| 2681 | p->zDbFilename = zSavedFilename; | |
| 2682 | } | |
| 2683 | }else | |
| 2685 | 2684 | |
| 2686 | if( c=='o' && strncmp(azArg[0], "output", n)==0 && nArg==2 ){ | |
| 2687 | if( p->outfile[0]=='|' ){ | |
| 2688 | pclose(p->out); | |
| 2689 | }else{ | |
| 2690 | output_file_close(p->out); | |
| 2691 | } | |
| 2692 | p->outfile[0] = 0; | |
| 2693 | if( azArg[1][0]=='|' ){ | |
| 2694 | p->out = popen(&azArg[1][1], "w"); | |
| 2695 | if( p->out==0 ){ | |
| 2696 | fprintf(stderr,"Error: cannot open pipe \"%s\"\n", &azArg[1][1]); | |
| 2697 | p->out = stdout; | |
| 2698 | rc = 1; | |
| 2699 | }else{ | |
| 2700 | sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", azArg[1]); | |
| 2701 | } | |
| 2702 | }else{ | |
| 2703 | p->out = output_file_open(azArg[1]); | |
| 2704 | if( p->out==0 ){ | |
| 2705 | if( strcmp(azArg[1],"off")!=0 ){ | |
| 2706 | fprintf(stderr,"Error: cannot write to \"%s\"\n", azArg[1]); | |
| 2707 | } | |
| 2708 | p->out = stdout; | |
| 2709 | rc = 1; | |
| 2710 | } else { | |
| 2711 | sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", azArg[1]); | |
| 2712 | } | |
| 2713 | } | |
| 2714 | }else | |
| 2685 | if( c=='o' && strncmp(azArg[0], "output", n)==0 && nArg==2 ){ | |
| 2686 | if( p->outfile[0]=='|' ){ | |
| 2687 | pclose(p->out); | |
| 2688 | }else{ | |
| 2689 | output_file_close(p->out); | |
| 2690 | } | |
| 2691 | p->outfile[0] = 0; | |
| 2692 | if( azArg[1][0]=='|' ){ | |
| 2693 | p->out = popen(&azArg[1][1], "w"); | |
| 2694 | if( p->out==0 ){ | |
| 2695 | fprintf(stderr,"Error: cannot open pipe \"%s\"\n", &azArg[1][1]); | |
| 2696 | p->out = stdout; | |
| 2697 | rc = 1; | |
| 2698 | }else{ | |
| 2699 | sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", azArg[1]); | |
| 2700 | } | |
| 2701 | }else{ | |
| 2702 | p->out = output_file_open(azArg[1]); | |
| 2703 | if( p->out==0 ){ | |
| 2704 | if( strcmp(azArg[1],"off")!=0 ){ | |
| 2705 | fprintf(stderr,"Error: cannot write to \"%s\"\n", azArg[1]); | |
| 2706 | } | |
| 2707 | p->out = stdout; | |
| 2708 | rc = 1; | |
| 2709 | } else { | |
| 2710 | sqlite3_snprintf(sizeof(p->outfile), p->outfile, "%s", azArg[1]); | |
| 2711 | } | |
| 2712 | } | |
| 2713 | }else | |
| 2715 | 2714 | |
| 2716 | if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){ | |
| 2717 | int i; | |
| 2718 | for(i=1; i<nArg; i++){ | |
| 2719 | if( i>1 ) fprintf(p->out, " "); | |
| 2720 | fprintf(p->out, "%s", azArg[i]); | |
| 2721 | } | |
| 2722 | fprintf(p->out, "\n"); | |
| 2723 | }else | |
| 2715 | if( c=='p' && n>=3 && strncmp(azArg[0], "print", n)==0 ){ | |
| 2716 | int i; | |
| 2717 | for(i=1; i<nArg; i++){ | |
| 2718 | if( i>1 ) fprintf(p->out, " "); | |
| 2719 | fprintf(p->out, "%s", azArg[i]); | |
| 2720 | } | |
| 2721 | fprintf(p->out, "\n"); | |
| 2722 | }else | |
| 2724 | 2723 | |
| 2725 | if( c=='p' && strncmp(azArg[0], "prompt", n)==0 && (nArg==2 || nArg==3)){ | |
| 2726 | if( nArg >= 2) { | |
| 2727 | strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1); | |
| 2728 | } | |
| 2729 | if( nArg >= 3) { | |
| 2730 | strncpy(continuePrompt,azArg[2],(int)ArraySize(continuePrompt)-1); | |
| 2731 | } | |
| 2732 | }else | |
| 2724 | if( c=='p' && strncmp(azArg[0], "prompt", n)==0 && (nArg==2 || nArg==3)){ | |
| 2725 | if( nArg >= 2) { | |
| 2726 | strncpy(mainPrompt,azArg[1],(int)ArraySize(mainPrompt)-1); | |
| 2727 | } | |
| 2728 | if( nArg >= 3) { | |
| 2729 | strncpy(continuePrompt,azArg[2],(int)ArraySize(continuePrompt)-1); | |
| 2730 | } | |
| 2731 | }else | |
| 2733 | 2732 | |
| 2734 | if( c=='q' && strncmp(azArg[0], "quit", n)==0 && nArg==1 ){ | |
| 2735 | rc = 2; | |
| 2736 | }else | |
| 2733 | if( c=='q' && strncmp(azArg[0], "quit", n)==0 && nArg==1 ){ | |
| 2734 | rc = 2; | |
| 2735 | }else | |
| 2737 | 2736 | |
| 2738 | if( c=='r' && n>=3 && strncmp(azArg[0], "read", n)==0 && nArg==2 ){ | |
| 2739 | FILE *alt = fopen(azArg[1], "rb"); | |
| 2740 | if( alt==0 ){ | |
| 2741 | fprintf(stderr,"Error: cannot open \"%s\"\n", azArg[1]); | |
| 2742 | rc = 1; | |
| 2743 | }else{ | |
| 2744 | rc = process_input(p, alt); | |
| 2745 | fclose(alt); | |
| 2746 | } | |
| 2747 | }else | |
| 2737 | if( c=='r' && n>=3 && strncmp(azArg[0], "read", n)==0 && nArg==2 ){ | |
| 2738 | FILE *alt = fopen(azArg[1], "rb"); | |
| 2739 | if( alt==0 ){ | |
| 2740 | fprintf(stderr,"Error: cannot open \"%s\"\n", azArg[1]); | |
| 2741 | rc = 1; | |
| 2742 | }else{ | |
| 2743 | rc = process_input(p, alt); | |
| 2744 | fclose(alt); | |
| 2745 | } | |
| 2746 | }else | |
| 2748 | 2747 | |
| 2749 | if( c=='r' && n>=3 && strncmp(azArg[0], "restore", n)==0 && nArg>1 && nArg<4){ | |
| 2750 | const char *zSrcFile; | |
| 2751 | const char *zDb; | |
| 2752 | sqlite3 *pSrc; | |
| 2753 | sqlite3_backup *pBackup; | |
| 2754 | int nTimeout = 0; | |
| 2748 | if( c=='r' && n>=3 && strncmp(azArg[0], "restore", n)==0 && nArg>1 && nArg<4){ | |
| 2749 | const char *zSrcFile; | |
| 2750 | const char *zDb; | |
| 2751 | sqlite3 *pSrc; | |
| 2752 | sqlite3_backup *pBackup; | |
| 2753 | int nTimeout = 0; | |
| 2755 | 2754 | |
| 2756 | if( nArg==2 ){ | |
| 2757 | zSrcFile = azArg[1]; | |
| 2758 | zDb = "main"; | |
| 2759 | }else{ | |
| 2760 | zSrcFile = azArg[2]; | |
| 2761 | zDb = azArg[1]; | |
| 2762 | } | |
| 2763 | rc = sqlite3_open(zSrcFile, &pSrc); | |
| 2764 | if( rc!=SQLITE_OK ){ | |
| 2765 | fprintf(stderr, "Error: cannot open \"%s\"\n", zSrcFile); | |
| 2766 | sqlite3_close(pSrc); | |
| 2767 | return 1; | |
| 2768 | } | |
| 2769 | open_db(p, 0); | |
| 2770 | pBackup = sqlite3_backup_init(p->db, zDb, pSrc, "main"); | |
| 2771 | if( pBackup==0 ){ | |
| 2772 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); | |
| 2773 | sqlite3_close(pSrc); | |
| 2774 | return 1; | |
| 2775 | } | |
| 2776 | while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK | |
| 2777 | || rc==SQLITE_BUSY ){ | |
| 2778 | if( rc==SQLITE_BUSY ){ | |
| 2779 | if( nTimeout++ >= 3 ) break; | |
| 2780 | sqlite3_sleep(100); | |
| 2781 | } | |
| 2782 | } | |
| 2783 | sqlite3_backup_finish(pBackup); | |
| 2784 | if( rc==SQLITE_DONE ){ | |
| 2785 | rc = 0; | |
| 2786 | }else if( rc==SQLITE_BUSY || rc==SQLITE_LOCKED ){ | |
| 2787 | fprintf(stderr, "Error: source database is busy\n"); | |
| 2788 | rc = 1; | |
| 2789 | }else{ | |
| 2790 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); | |
| 2791 | rc = 1; | |
| 2792 | } | |
| 2793 | sqlite3_close(pSrc); | |
| 2794 | }else | |
| 2755 | if( nArg==2 ){ | |
| 2756 | zSrcFile = azArg[1]; | |
| 2757 | zDb = "main"; | |
| 2758 | }else{ | |
| 2759 | zSrcFile = azArg[2]; | |
| 2760 | zDb = azArg[1]; | |
| 2761 | } | |
| 2762 | rc = sqlite3_open(zSrcFile, &pSrc); | |
| 2763 | if( rc!=SQLITE_OK ){ | |
| 2764 | fprintf(stderr, "Error: cannot open \"%s\"\n", zSrcFile); | |
| 2765 | sqlite3_close(pSrc); | |
| 2766 | return 1; | |
| 2767 | } | |
| 2768 | open_db(p, 0); | |
| 2769 | pBackup = sqlite3_backup_init(p->db, zDb, pSrc, "main"); | |
| 2770 | if( pBackup==0 ){ | |
| 2771 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); | |
| 2772 | sqlite3_close(pSrc); | |
| 2773 | return 1; | |
| 2774 | } | |
| 2775 | while( (rc = sqlite3_backup_step(pBackup,100))==SQLITE_OK | |
| 2776 | || rc==SQLITE_BUSY ){ | |
| 2777 | if( rc==SQLITE_BUSY ){ | |
| 2778 | if( nTimeout++ >= 3 ) break; | |
| 2779 | sqlite3_sleep(100); | |
| 2780 | } | |
| 2781 | } | |
| 2782 | sqlite3_backup_finish(pBackup); | |
| 2783 | if( rc==SQLITE_DONE ){ | |
| 2784 | rc = 0; | |
| 2785 | }else if( rc==SQLITE_BUSY || rc==SQLITE_LOCKED ){ | |
| 2786 | fprintf(stderr, "Error: source database is busy\n"); | |
| 2787 | rc = 1; | |
| 2788 | }else{ | |
| 2789 | fprintf(stderr, "Error: %s\n", sqlite3_errmsg(p->db)); | |
| 2790 | rc = 1; | |
| 2791 | } | |
| 2792 | sqlite3_close(pSrc); | |
| 2793 | }else | |
| 2795 | 2794 | |
| 2796 | if( c=='s' && strncmp(azArg[0], "schema", n)==0 && nArg<3 ){ | |
| 2797 | struct callback_data data; | |
| 2798 | char *zErrMsg = 0; | |
| 2799 | open_db(p, 0); | |
| 2800 | memcpy(&data, p, sizeof(data)); | |
| 2801 | data.showHeader = 0; | |
| 2802 | data.mode = MODE_Semi; | |
| 2803 | if( nArg>1 ){ | |
| 2804 | int i; | |
| 2805 | for(i=0; azArg[1][i]; i++) azArg[1][i] = ToLower(azArg[1][i]); | |
| 2806 | if( strcmp(azArg[1],"sqlite_master")==0 ){ | |
| 2807 | char *new_argv[2], *new_colv[2]; | |
| 2808 | new_argv[0] = "CREATE TABLE sqlite_master (\n" | |
| 2809 | " type text,\n" | |
| 2810 | " name text,\n" | |
| 2811 | " tbl_name text,\n" | |
| 2812 | " rootpage integer,\n" | |
| 2813 | " sql text\n" | |
| 2814 | ")"; | |
| 2815 | new_argv[1] = 0; | |
| 2816 | new_colv[0] = "sql"; | |
| 2817 | new_colv[1] = 0; | |
| 2818 | callback(&data, 1, new_argv, new_colv); | |
| 2819 | rc = SQLITE_OK; | |
| 2820 | }else if( strcmp(azArg[1],"sqlite_temp_master")==0 ){ | |
| 2821 | char *new_argv[2], *new_colv[2]; | |
| 2822 | new_argv[0] = "CREATE TEMP TABLE sqlite_temp_master (\n" | |
| 2823 | " type text,\n" | |
| 2824 | " name text,\n" | |
| 2825 | " tbl_name text,\n" | |
| 2826 | " rootpage integer,\n" | |
| 2827 | " sql text\n" | |
| 2828 | ")"; | |
| 2829 | new_argv[1] = 0; | |
| 2830 | new_colv[0] = "sql"; | |
| 2831 | new_colv[1] = 0; | |
| 2832 | callback(&data, 1, new_argv, new_colv); | |
| 2833 | rc = SQLITE_OK; | |
| 2834 | }else{ | |
| 2835 | zShellStatic = azArg[1]; | |
| 2836 | rc = sqlite3_exec(p->db, | |
| 2837 | "SELECT sql FROM " | |
| 2838 | " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" | |
| 2839 | " FROM sqlite_master UNION ALL" | |
| 2840 | " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " | |
| 2841 | "WHERE lower(tbl_name) LIKE shellstatic()" | |
| 2842 | " AND type!='meta' AND sql NOTNULL " | |
| 2843 | "ORDER BY rowid", | |
| 2844 | callback, &data, &zErrMsg); | |
| 2845 | zShellStatic = 0; | |
| 2846 | } | |
| 2847 | }else{ | |
| 2848 | rc = sqlite3_exec(p->db, | |
| 2849 | "SELECT sql FROM " | |
| 2850 | " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" | |
| 2851 | " FROM sqlite_master UNION ALL" | |
| 2852 | " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " | |
| 2853 | "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" | |
| 2854 | "ORDER BY rowid", | |
| 2855 | callback, &data, &zErrMsg | |
| 2856 | ); | |
| 2857 | } | |
| 2858 | if( zErrMsg ){ | |
| 2859 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 2860 | sqlite3_free(zErrMsg); | |
| 2861 | rc = 1; | |
| 2862 | }else if( rc != SQLITE_OK ){ | |
| 2863 | fprintf(stderr,"Error: querying schema information\n"); | |
| 2864 | rc = 1; | |
| 2865 | }else{ | |
| 2866 | rc = 0; | |
| 2867 | } | |
| 2868 | }else | |
| 2795 | if( c=='s' && strncmp(azArg[0], "schema", n)==0 && nArg<3 ){ | |
| 2796 | struct callback_data data; | |
| 2797 | char *zErrMsg = 0; | |
| 2798 | open_db(p, 0); | |
| 2799 | memcpy(&data, p, sizeof(data)); | |
| 2800 | data.showHeader = 0; | |
| 2801 | data.mode = MODE_Semi; | |
| 2802 | if( nArg>1 ){ | |
| 2803 | int i; | |
| 2804 | for(i=0; azArg[1][i]; i++) azArg[1][i] = ToLower(azArg[1][i]); | |
| 2805 | if( strcmp(azArg[1],"sqlite_master")==0 ){ | |
| 2806 | char *new_argv[2], *new_colv[2]; | |
| 2807 | new_argv[0] = "CREATE TABLE sqlite_master (\n" | |
| 2808 | " type text,\n" | |
| 2809 | " name text,\n" | |
| 2810 | " tbl_name text,\n" | |
| 2811 | " rootpage integer,\n" | |
| 2812 | " sql text\n" | |
| 2813 | ")"; | |
| 2814 | new_argv[1] = 0; | |
| 2815 | new_colv[0] = "sql"; | |
| 2816 | new_colv[1] = 0; | |
| 2817 | callback(&data, 1, new_argv, new_colv); | |
| 2818 | rc = SQLITE_OK; | |
| 2819 | }else if( strcmp(azArg[1],"sqlite_temp_master")==0 ){ | |
| 2820 | char *new_argv[2], *new_colv[2]; | |
| 2821 | new_argv[0] = "CREATE TEMP TABLE sqlite_temp_master (\n" | |
| 2822 | " type text,\n" | |
| 2823 | " name text,\n" | |
| 2824 | " tbl_name text,\n" | |
| 2825 | " rootpage integer,\n" | |
| 2826 | " sql text\n" | |
| 2827 | ")"; | |
| 2828 | new_argv[1] = 0; | |
| 2829 | new_colv[0] = "sql"; | |
| 2830 | new_colv[1] = 0; | |
| 2831 | callback(&data, 1, new_argv, new_colv); | |
| 2832 | rc = SQLITE_OK; | |
| 2833 | }else{ | |
| 2834 | zShellStatic = azArg[1]; | |
| 2835 | rc = sqlite3_exec(p->db, | |
| 2836 | "SELECT sql FROM " | |
| 2837 | " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" | |
| 2838 | " FROM sqlite_master UNION ALL" | |
| 2839 | " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " | |
| 2840 | "WHERE lower(tbl_name) LIKE shellstatic()" | |
| 2841 | " AND type!='meta' AND sql NOTNULL " | |
| 2842 | "ORDER BY rowid", | |
| 2843 | callback, &data, &zErrMsg); | |
| 2844 | zShellStatic = 0; | |
| 2845 | } | |
| 2846 | }else{ | |
| 2847 | rc = sqlite3_exec(p->db, | |
| 2848 | "SELECT sql FROM " | |
| 2849 | " (SELECT sql sql, type type, tbl_name tbl_name, name name, rowid x" | |
| 2850 | " FROM sqlite_master UNION ALL" | |
| 2851 | " SELECT sql, type, tbl_name, name, rowid FROM sqlite_temp_master) " | |
| 2852 | "WHERE type!='meta' AND sql NOTNULL AND name NOT LIKE 'sqlite_%'" | |
| 2853 | "ORDER BY rowid", | |
| 2854 | callback, &data, &zErrMsg | |
| 2855 | ); | |
| 2856 | } | |
| 2857 | if( zErrMsg ){ | |
| 2858 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 2859 | sqlite3_free(zErrMsg); | |
| 2860 | rc = 1; | |
| 2861 | }else if( rc != SQLITE_OK ){ | |
| 2862 | fprintf(stderr,"Error: querying schema information\n"); | |
| 2863 | rc = 1; | |
| 2864 | }else{ | |
| 2865 | rc = 0; | |
| 2866 | } | |
| 2867 | }else | |
| 2869 | 2868 | |
| 2870 | 2869 | #ifdef SQLITE_DEBUG |
| 2871 | /* Undocumented commands for internal testing. Subject to change | |
| 2872 | ** without notice. */ | |
| 2873 | if( c=='s' && n>=10 && strncmp(azArg[0], "selftest-", 9)==0 ){ | |
| 2874 | if( strncmp(azArg[0]+9, "boolean", n-9)==0 ){ | |
| 2875 | int i, v; | |
| 2876 | for(i=1; i<nArg; i++){ | |
| 2877 | v = booleanValue(azArg[i]); | |
| 2878 | fprintf(p->out, "%s: %d 0x%x\n", azArg[i], v, v); | |
| 2879 | } | |
| 2880 | } | |
| 2881 | if( strncmp(azArg[0]+9, "integer", n-9)==0 ){ | |
| 2882 | int i; sqlite3_int64 v; | |
| 2883 | for(i=1; i<nArg; i++){ | |
| 2884 | char zBuf[200]; | |
| 2885 | v = integerValue(azArg[i]); | |
| 2886 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%s: %lld 0x%llx\n", azArg[i], v, v); | |
| 2887 | fprintf(p->out, "%s", zBuf); | |
| 2888 | } | |
| 2889 | } | |
| 2890 | }else | |
| 2870 | /* Undocumented commands for internal testing. Subject to change | |
| 2871 | ** without notice. */ | |
| 2872 | if( c=='s' && n>=10 && strncmp(azArg[0], "selftest-", 9)==0 ){ | |
| 2873 | if( strncmp(azArg[0]+9, "boolean", n-9)==0 ){ | |
| 2874 | int i, v; | |
| 2875 | for(i=1; i<nArg; i++){ | |
| 2876 | v = booleanValue(azArg[i]); | |
| 2877 | fprintf(p->out, "%s: %d 0x%x\n", azArg[i], v, v); | |
| 2878 | } | |
| 2879 | } | |
| 2880 | if( strncmp(azArg[0]+9, "integer", n-9)==0 ){ | |
| 2881 | int i; sqlite3_int64 v; | |
| 2882 | for(i=1; i<nArg; i++){ | |
| 2883 | char zBuf[200]; | |
| 2884 | v = integerValue(azArg[i]); | |
| 2885 | sqlite3_snprintf(sizeof(zBuf), zBuf, "%s: %lld 0x%llx\n", azArg[i], v, v); | |
| 2886 | fprintf(p->out, "%s", zBuf); | |
| 2887 | } | |
| 2888 | } | |
| 2889 | }else | |
| 2891 | 2890 | #endif |
| 2892 | 2891 | |
| 2893 | if( c=='s' && strncmp(azArg[0], "separator", n)==0 && nArg==2 ){ | |
| 2894 | sqlite3_snprintf(sizeof(p->separator), p->separator, | |
| 2895 | "%.*s", (int)sizeof(p->separator)-1, azArg[1]); | |
| 2896 | }else | |
| 2892 | if( c=='s' && strncmp(azArg[0], "separator", n)==0 && nArg==2 ){ | |
| 2893 | sqlite3_snprintf(sizeof(p->separator), p->separator, | |
| 2894 | "%.*s", (int)sizeof(p->separator)-1, azArg[1]); | |
| 2895 | }else | |
| 2897 | 2896 | |
| 2898 | if( c=='s' && strncmp(azArg[0], "show", n)==0 && nArg==1 ){ | |
| 2899 | int i; | |
| 2900 | fprintf(p->out,"%9.9s: %s\n","echo", p->echoOn ? "on" : "off"); | |
| 2901 | fprintf(p->out,"%9.9s: %s\n","eqp", p->autoEQP ? "on" : "off"); | |
| 2902 | fprintf(p->out,"%9.9s: %s\n","explain", p->explainPrev.valid ? "on" :"off"); | |
| 2903 | fprintf(p->out,"%9.9s: %s\n","headers", p->showHeader ? "on" : "off"); | |
| 2904 | fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]); | |
| 2905 | fprintf(p->out,"%9.9s: ", "nullvalue"); | |
| 2906 | output_c_string(p->out, p->nullvalue); | |
| 2907 | fprintf(p->out, "\n"); | |
| 2908 | fprintf(p->out,"%9.9s: %s\n","output", | |
| 2909 | strlen30(p->outfile) ? p->outfile : "stdout"); | |
| 2910 | fprintf(p->out,"%9.9s: ", "separator"); | |
| 2911 | output_c_string(p->out, p->separator); | |
| 2912 | fprintf(p->out, "\n"); | |
| 2913 | fprintf(p->out,"%9.9s: %s\n","stats", p->statsOn ? "on" : "off"); | |
| 2914 | fprintf(p->out,"%9.9s: ","width"); | |
| 2915 | for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) { | |
| 2916 | fprintf(p->out,"%d ",p->colWidth[i]); | |
| 2917 | } | |
| 2918 | fprintf(p->out,"\n"); | |
| 2919 | }else | |
| 2897 | if( c=='s' && strncmp(azArg[0], "show", n)==0 && nArg==1 ){ | |
| 2898 | int i; | |
| 2899 | fprintf(p->out,"%9.9s: %s\n","echo", p->echoOn ? "on" : "off"); | |
| 2900 | fprintf(p->out,"%9.9s: %s\n","eqp", p->autoEQP ? "on" : "off"); | |
| 2901 | fprintf(p->out,"%9.9s: %s\n","explain", p->explainPrev.valid ? "on" :"off"); | |
| 2902 | fprintf(p->out,"%9.9s: %s\n","headers", p->showHeader ? "on" : "off"); | |
| 2903 | fprintf(p->out,"%9.9s: %s\n","mode", modeDescr[p->mode]); | |
| 2904 | fprintf(p->out,"%9.9s: ", "nullvalue"); | |
| 2905 | output_c_string(p->out, p->nullvalue); | |
| 2906 | fprintf(p->out, "\n"); | |
| 2907 | fprintf(p->out,"%9.9s: %s\n","output", | |
| 2908 | strlen30(p->outfile) ? p->outfile : "stdout"); | |
| 2909 | fprintf(p->out,"%9.9s: ", "separator"); | |
| 2910 | output_c_string(p->out, p->separator); | |
| 2911 | fprintf(p->out, "\n"); | |
| 2912 | fprintf(p->out,"%9.9s: %s\n","stats", p->statsOn ? "on" : "off"); | |
| 2913 | fprintf(p->out,"%9.9s: ","width"); | |
| 2914 | for (i=0;i<(int)ArraySize(p->colWidth) && p->colWidth[i] != 0;i++) { | |
| 2915 | fprintf(p->out,"%d ",p->colWidth[i]); | |
| 2916 | } | |
| 2917 | fprintf(p->out,"\n"); | |
| 2918 | }else | |
| 2920 | 2919 | |
| 2921 | if( c=='s' && strncmp(azArg[0], "stats", n)==0 && nArg>1 && nArg<3 ){ | |
| 2922 | p->statsOn = booleanValue(azArg[1]); | |
| 2923 | }else | |
| 2920 | if( c=='s' && strncmp(azArg[0], "stats", n)==0 && nArg>1 && nArg<3 ){ | |
| 2921 | p->statsOn = booleanValue(azArg[1]); | |
| 2922 | }else | |
| 2924 | 2923 | |
| 2925 | if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 && nArg<3 ){ | |
| 2926 | sqlite3_stmt *pStmt; | |
| 2927 | char **azResult; | |
| 2928 | int nRow, nAlloc; | |
| 2929 | char *zSql = 0; | |
| 2930 | int ii; | |
| 2931 | open_db(p, 0); | |
| 2932 | rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0); | |
| 2933 | if( rc ) return rc; | |
| 2934 | zSql = sqlite3_mprintf( | |
| 2935 | "SELECT name FROM sqlite_master" | |
| 2936 | " WHERE type IN ('table','view')" | |
| 2937 | " AND name NOT LIKE 'sqlite_%%'" | |
| 2938 | " AND name LIKE ?1"); | |
| 2939 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ | |
| 2940 | const char *zDbName = (const char*)sqlite3_column_text(pStmt, 1); | |
| 2941 | if( zDbName==0 || strcmp(zDbName,"main")==0 ) continue; | |
| 2942 | if( strcmp(zDbName,"temp")==0 ){ | |
| 2943 | zSql = sqlite3_mprintf( | |
| 2944 | "%z UNION ALL " | |
| 2945 | "SELECT 'temp.' || name FROM sqlite_temp_master" | |
| 2946 | " WHERE type IN ('table','view')" | |
| 2947 | " AND name NOT LIKE 'sqlite_%%'" | |
| 2948 | " AND name LIKE ?1", zSql); | |
| 2949 | }else{ | |
| 2950 | zSql = sqlite3_mprintf( | |
| 2951 | "%z UNION ALL " | |
| 2952 | "SELECT '%q.' || name FROM \"%w\".sqlite_master" | |
| 2953 | " WHERE type IN ('table','view')" | |
| 2954 | " AND name NOT LIKE 'sqlite_%%'" | |
| 2955 | " AND name LIKE ?1", zSql, zDbName, zDbName); | |
| 2956 | } | |
| 2957 | } | |
| 2958 | sqlite3_finalize(pStmt); | |
| 2959 | zSql = sqlite3_mprintf("%z ORDER BY 1", zSql); | |
| 2960 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2961 | sqlite3_free(zSql); | |
| 2962 | if( rc ) return rc; | |
| 2963 | nRow = nAlloc = 0; | |
| 2964 | azResult = 0; | |
| 2965 | if( nArg>1 ){ | |
| 2966 | sqlite3_bind_text(pStmt, 1, azArg[1], -1, SQLITE_TRANSIENT); | |
| 2967 | }else{ | |
| 2968 | sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC); | |
| 2969 | } | |
| 2970 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ | |
| 2971 | if( nRow>=nAlloc ){ | |
| 2972 | char **azNew; | |
| 2973 | int n = nAlloc*2 + 10; | |
| 2974 | azNew = (char **)sqlite3_realloc(azResult, sizeof(azResult[0])*n); | |
| 2975 | if( azNew==0 ){ | |
| 2976 | fprintf(stderr, "Error: out of memory\n"); | |
| 2977 | break; | |
| 2978 | } | |
| 2979 | nAlloc = n; | |
| 2980 | azResult = azNew; | |
| 2981 | } | |
| 2982 | azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0)); | |
| 2983 | if( azResult[nRow] ) nRow++; | |
| 2984 | } | |
| 2985 | sqlite3_finalize(pStmt); | |
| 2986 | if( nRow>0 ){ | |
| 2987 | int len, maxlen = 0; | |
| 2988 | int i, j; | |
| 2989 | int nPrintCol, nPrintRow; | |
| 2990 | for(i=0; i<nRow; i++){ | |
| 2991 | len = strlen30(azResult[i]); | |
| 2992 | if( len>maxlen ) maxlen = len; | |
| 2993 | } | |
| 2994 | nPrintCol = 80/(maxlen+2); | |
| 2995 | if( nPrintCol<1 ) nPrintCol = 1; | |
| 2996 | nPrintRow = (nRow + nPrintCol - 1)/nPrintCol; | |
| 2997 | for(i=0; i<nPrintRow; i++){ | |
| 2998 | for(j=i; j<nRow; j+=nPrintRow){ | |
| 2999 | const char *zSp = j<nPrintRow ? "" : " "; | |
| 3000 | fprintf(p->out, "%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : ""); | |
| 3001 | } | |
| 3002 | fprintf(p->out, "\n"); | |
| 3003 | } | |
| 3004 | } | |
| 3005 | for(ii=0; ii<nRow; ii++) sqlite3_free(azResult[ii]); | |
| 3006 | sqlite3_free(azResult); | |
| 3007 | }else | |
| 2924 | if( c=='t' && n>1 && strncmp(azArg[0], "tables", n)==0 && nArg<3 ){ | |
| 2925 | sqlite3_stmt *pStmt; | |
| 2926 | char **azResult; | |
| 2927 | int nRow, nAlloc; | |
| 2928 | char *zSql = 0; | |
| 2929 | int ii; | |
| 2930 | open_db(p, 0); | |
| 2931 | rc = sqlite3_prepare_v2(p->db, "PRAGMA database_list", -1, &pStmt, 0); | |
| 2932 | if( rc ) return rc; | |
| 2933 | zSql = sqlite3_mprintf( | |
| 2934 | "SELECT name FROM sqlite_master" | |
| 2935 | " WHERE type IN ('table','view')" | |
| 2936 | " AND name NOT LIKE 'sqlite_%%'" | |
| 2937 | " AND name LIKE ?1"); | |
| 2938 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ | |
| 2939 | const char *zDbName = (const char*)sqlite3_column_text(pStmt, 1); | |
| 2940 | if( zDbName==0 || strcmp(zDbName,"main")==0 ) continue; | |
| 2941 | if( strcmp(zDbName,"temp")==0 ){ | |
| 2942 | zSql = sqlite3_mprintf( | |
| 2943 | "%z UNION ALL " | |
| 2944 | "SELECT 'temp.' || name FROM sqlite_temp_master" | |
| 2945 | " WHERE type IN ('table','view')" | |
| 2946 | " AND name NOT LIKE 'sqlite_%%'" | |
| 2947 | " AND name LIKE ?1", zSql); | |
| 2948 | }else{ | |
| 2949 | zSql = sqlite3_mprintf( | |
| 2950 | "%z UNION ALL " | |
| 2951 | "SELECT '%q.' || name FROM \"%w\".sqlite_master" | |
| 2952 | " WHERE type IN ('table','view')" | |
| 2953 | " AND name NOT LIKE 'sqlite_%%'" | |
| 2954 | " AND name LIKE ?1", zSql, zDbName, zDbName); | |
| 2955 | } | |
| 2956 | } | |
| 2957 | sqlite3_finalize(pStmt); | |
| 2958 | zSql = sqlite3_mprintf("%z ORDER BY 1", zSql); | |
| 2959 | rc = sqlite3_prepare_v2(p->db, zSql, -1, &pStmt, 0); | |
| 2960 | sqlite3_free(zSql); | |
| 2961 | if( rc ) return rc; | |
| 2962 | nRow = nAlloc = 0; | |
| 2963 | azResult = 0; | |
| 2964 | if( nArg>1 ){ | |
| 2965 | sqlite3_bind_text(pStmt, 1, azArg[1], -1, SQLITE_TRANSIENT); | |
| 2966 | }else{ | |
| 2967 | sqlite3_bind_text(pStmt, 1, "%", -1, SQLITE_STATIC); | |
| 2968 | } | |
| 2969 | while( sqlite3_step(pStmt)==SQLITE_ROW ){ | |
| 2970 | if( nRow>=nAlloc ){ | |
| 2971 | char **azNew; | |
| 2972 | int n = nAlloc*2 + 10; | |
| 2973 | azNew = (char **)sqlite3_realloc(azResult, sizeof(azResult[0])*n); | |
| 2974 | if( azNew==0 ){ | |
| 2975 | fprintf(stderr, "Error: out of memory\n"); | |
| 2976 | break; | |
| 2977 | } | |
| 2978 | nAlloc = n; | |
| 2979 | azResult = azNew; | |
| 2980 | } | |
| 2981 | azResult[nRow] = sqlite3_mprintf("%s", sqlite3_column_text(pStmt, 0)); | |
| 2982 | if( azResult[nRow] ) nRow++; | |
| 2983 | } | |
| 2984 | sqlite3_finalize(pStmt); | |
| 2985 | if( nRow>0 ){ | |
| 2986 | int len, maxlen = 0; | |
| 2987 | int i, j; | |
| 2988 | int nPrintCol, nPrintRow; | |
| 2989 | for(i=0; i<nRow; i++){ | |
| 2990 | len = strlen30(azResult[i]); | |
| 2991 | if( len>maxlen ) maxlen = len; | |
| 2992 | } | |
| 2993 | nPrintCol = 80/(maxlen+2); | |
| 2994 | if( nPrintCol<1 ) nPrintCol = 1; | |
| 2995 | nPrintRow = (nRow + nPrintCol - 1)/nPrintCol; | |
| 2996 | for(i=0; i<nPrintRow; i++){ | |
| 2997 | for(j=i; j<nRow; j+=nPrintRow){ | |
| 2998 | const char *zSp = j<nPrintRow ? "" : " "; | |
| 2999 | fprintf(p->out, "%s%-*s", zSp, maxlen, azResult[j] ? azResult[j] : ""); | |
| 3000 | } | |
| 3001 | fprintf(p->out, "\n"); | |
| 3002 | } | |
| 3003 | } | |
| 3004 | for(ii=0; ii<nRow; ii++) sqlite3_free(azResult[ii]); | |
| 3005 | sqlite3_free(azResult); | |
| 3006 | }else | |
| 3008 | 3007 | |
| 3009 | if( c=='t' && n>=8 && strncmp(azArg[0], "testctrl", n)==0 && nArg>=2 ){ | |
| 3010 | static const struct { | |
| 3011 | const char *zCtrlName; /* Name of a test-control option */ | |
| 3012 | int ctrlCode; /* Integer code for that option */ | |
| 3013 | } aCtrl[] = { | |
| 3014 | { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE }, | |
| 3015 | { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE }, | |
| 3016 | { "prng_reset", SQLITE_TESTCTRL_PRNG_RESET }, | |
| 3017 | { "bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST }, | |
| 3018 | { "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL }, | |
| 3019 | { "benign_malloc_hooks", SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS }, | |
| 3020 | { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE }, | |
| 3021 | { "assert", SQLITE_TESTCTRL_ASSERT }, | |
| 3022 | { "always", SQLITE_TESTCTRL_ALWAYS }, | |
| 3023 | { "reserve", SQLITE_TESTCTRL_RESERVE }, | |
| 3024 | { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS }, | |
| 3025 | { "iskeyword", SQLITE_TESTCTRL_ISKEYWORD }, | |
| 3026 | { "scratchmalloc", SQLITE_TESTCTRL_SCRATCHMALLOC }, | |
| 3027 | }; | |
| 3028 | int testctrl = -1; | |
| 3029 | int rc = 0; | |
| 3030 | int i, n; | |
| 3031 | open_db(p, 0); | |
| 3008 | if( c=='t' && n>=8 && strncmp(azArg[0], "testctrl", n)==0 && nArg>=2 ){ | |
| 3009 | static const struct { | |
| 3010 | const char *zCtrlName; /* Name of a test-control option */ | |
| 3011 | int ctrlCode; /* Integer code for that option */ | |
| 3012 | } aCtrl[] = { | |
| 3013 | { "prng_save", SQLITE_TESTCTRL_PRNG_SAVE }, | |
| 3014 | { "prng_restore", SQLITE_TESTCTRL_PRNG_RESTORE }, | |
| 3015 | { "prng_reset", SQLITE_TESTCTRL_PRNG_RESET }, | |
| 3016 | { "bitvec_test", SQLITE_TESTCTRL_BITVEC_TEST }, | |
| 3017 | { "fault_install", SQLITE_TESTCTRL_FAULT_INSTALL }, | |
| 3018 | { "benign_malloc_hooks", SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS }, | |
| 3019 | { "pending_byte", SQLITE_TESTCTRL_PENDING_BYTE }, | |
| 3020 | { "assert", SQLITE_TESTCTRL_ASSERT }, | |
| 3021 | { "always", SQLITE_TESTCTRL_ALWAYS }, | |
| 3022 | { "reserve", SQLITE_TESTCTRL_RESERVE }, | |
| 3023 | { "optimizations", SQLITE_TESTCTRL_OPTIMIZATIONS }, | |
| 3024 | { "iskeyword", SQLITE_TESTCTRL_ISKEYWORD }, | |
| 3025 | { "scratchmalloc", SQLITE_TESTCTRL_SCRATCHMALLOC }, | |
| 3026 | }; | |
| 3027 | int testctrl = -1; | |
| 3028 | int rc = 0; | |
| 3029 | int i, n; | |
| 3030 | open_db(p, 0); | |
| 3032 | 3031 | |
| 3033 | /* convert testctrl text option to value. allow any unique prefix | |
| 3034 | ** of the option name, or a numerical value. */ | |
| 3035 | n = strlen30(azArg[1]); | |
| 3036 | for(i=0; i<(int)(sizeof(aCtrl)/sizeof(aCtrl[0])); i++){ | |
| 3037 | if( strncmp(azArg[1], aCtrl[i].zCtrlName, n)==0 ){ | |
| 3038 | if( testctrl<0 ){ | |
| 3039 | testctrl = aCtrl[i].ctrlCode; | |
| 3040 | }else{ | |
| 3041 | fprintf(stderr, "ambiguous option name: \"%s\"\n", azArg[1]); | |
| 3042 | testctrl = -1; | |
| 3043 | break; | |
| 3044 | } | |
| 3045 | } | |
| 3046 | } | |
| 3047 | if( testctrl<0 ) testctrl = (int)integerValue(azArg[1]); | |
| 3048 | if( (testctrl<SQLITE_TESTCTRL_FIRST) || (testctrl>SQLITE_TESTCTRL_LAST) ){ | |
| 3049 | fprintf(stderr,"Error: invalid testctrl option: %s\n", azArg[1]); | |
| 3050 | }else{ | |
| 3051 | switch(testctrl){ | |
| 3032 | /* convert testctrl text option to value. allow any unique prefix | |
| 3033 | ** of the option name, or a numerical value. */ | |
| 3034 | n = strlen30(azArg[1]); | |
| 3035 | for(i=0; i<(int)(sizeof(aCtrl)/sizeof(aCtrl[0])); i++){ | |
| 3036 | if( strncmp(azArg[1], aCtrl[i].zCtrlName, n)==0 ){ | |
| 3037 | if( testctrl<0 ){ | |
| 3038 | testctrl = aCtrl[i].ctrlCode; | |
| 3039 | }else{ | |
| 3040 | fprintf(stderr, "ambiguous option name: \"%s\"\n", azArg[1]); | |
| 3041 | testctrl = -1; | |
| 3042 | break; | |
| 3043 | } | |
| 3044 | } | |
| 3045 | } | |
| 3046 | if( testctrl<0 ) testctrl = (int)integerValue(azArg[1]); | |
| 3047 | if( (testctrl<SQLITE_TESTCTRL_FIRST) || (testctrl>SQLITE_TESTCTRL_LAST) ){ | |
| 3048 | fprintf(stderr,"Error: invalid testctrl option: %s\n", azArg[1]); | |
| 3049 | }else{ | |
| 3050 | switch(testctrl){ | |
| 3051 | /* sqlite3_test_control(int, db, int) */ | |
| 3052 | case SQLITE_TESTCTRL_OPTIMIZATIONS: | |
| 3053 | case SQLITE_TESTCTRL_RESERVE: | |
| 3054 | if( nArg==3 ){ | |
| 3055 | int opt = (int)strtol(azArg[2], 0, 0); | |
| 3056 | rc = sqlite3_test_control(testctrl, p->db, opt); | |
| 3057 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3058 | } else { | |
| 3059 | fprintf(stderr,"Error: testctrl %s takes a single int option\n", | |
| 3060 | azArg[1]); | |
| 3061 | } | |
| 3062 | break; | |
| 3052 | 3063 | |
| 3053 | /* sqlite3_test_control(int, db, int) */ | |
| 3054 | case SQLITE_TESTCTRL_OPTIMIZATIONS: | |
| 3055 | case SQLITE_TESTCTRL_RESERVE: | |
| 3056 | if( nArg==3 ){ | |
| 3057 | int opt = (int)strtol(azArg[2], 0, 0); | |
| 3058 | rc = sqlite3_test_control(testctrl, p->db, opt); | |
| 3059 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3060 | } else { | |
| 3061 | fprintf(stderr,"Error: testctrl %s takes a single int option\n", | |
| 3062 | azArg[1]); | |
| 3063 | } | |
| 3064 | break; | |
| 3064 | /* sqlite3_test_control(int) */ | |
| 3065 | case SQLITE_TESTCTRL_PRNG_SAVE: | |
| 3066 | case SQLITE_TESTCTRL_PRNG_RESTORE: | |
| 3067 | case SQLITE_TESTCTRL_PRNG_RESET: | |
| 3068 | if( nArg==2 ){ | |
| 3069 | rc = sqlite3_test_control(testctrl); | |
| 3070 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3071 | } else { | |
| 3072 | fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]); | |
| 3073 | } | |
| 3074 | break; | |
| 3065 | 3075 | |
| 3066 | /* sqlite3_test_control(int) */ | |
| 3067 | case SQLITE_TESTCTRL_PRNG_SAVE: | |
| 3068 | case SQLITE_TESTCTRL_PRNG_RESTORE: | |
| 3069 | case SQLITE_TESTCTRL_PRNG_RESET: | |
| 3070 | if( nArg==2 ){ | |
| 3071 | rc = sqlite3_test_control(testctrl); | |
| 3072 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3073 | } else { | |
| 3074 | fprintf(stderr,"Error: testctrl %s takes no options\n", azArg[1]); | |
| 3075 | } | |
| 3076 | break; | |
| 3076 | /* sqlite3_test_control(int, uint) */ | |
| 3077 | case SQLITE_TESTCTRL_PENDING_BYTE: | |
| 3078 | if( nArg==3 ){ | |
| 3079 | unsigned int opt = (unsigned int)integerValue(azArg[2]); | |
| 3080 | rc = sqlite3_test_control(testctrl, opt); | |
| 3081 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3082 | } else { | |
| 3083 | fprintf(stderr,"Error: testctrl %s takes a single unsigned" | |
| 3084 | " int option\n", azArg[1]); | |
| 3085 | } | |
| 3086 | break; | |
| 3077 | 3087 | |
| 3078 | /* sqlite3_test_control(int, uint) */ | |
| 3079 | case SQLITE_TESTCTRL_PENDING_BYTE: | |
| 3080 | if( nArg==3 ){ | |
| 3081 | unsigned int opt = (unsigned int)integerValue(azArg[2]); | |
| 3082 | rc = sqlite3_test_control(testctrl, opt); | |
| 3083 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3084 | } else { | |
| 3085 | fprintf(stderr,"Error: testctrl %s takes a single unsigned" | |
| 3086 | " int option\n", azArg[1]); | |
| 3087 | } | |
| 3088 | break; | |
| 3089 | ||
| 3090 | /* sqlite3_test_control(int, int) */ | |
| 3091 | case SQLITE_TESTCTRL_ASSERT: | |
| 3092 | case SQLITE_TESTCTRL_ALWAYS: | |
| 3093 | if( nArg==3 ){ | |
| 3094 | int opt = booleanValue(azArg[2]); | |
| 3095 | rc = sqlite3_test_control(testctrl, opt); | |
| 3096 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3097 | } else { | |
| 3098 | fprintf(stderr,"Error: testctrl %s takes a single int option\n", | |
| 3099 | azArg[1]); | |
| 3100 | } | |
| 3101 | break; | |
| 3088 | /* sqlite3_test_control(int, int) */ | |
| 3089 | case SQLITE_TESTCTRL_ASSERT: | |
| 3090 | case SQLITE_TESTCTRL_ALWAYS: | |
| 3091 | if( nArg==3 ){ | |
| 3092 | int opt = booleanValue(azArg[2]); | |
| 3093 | rc = sqlite3_test_control(testctrl, opt); | |
| 3094 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3095 | } else { | |
| 3096 | fprintf(stderr,"Error: testctrl %s takes a single int option\n", | |
| 3097 | azArg[1]); | |
| 3098 | } | |
| 3099 | break; | |
| 3102 | 3100 | |
| 3103 | ||
| 3101 | /* sqlite3_test_control(int, char *) */ | |
| 3104 | 3102 | #ifdef SQLITE_N_KEYWORD |
| 3105 | case SQLITE_TESTCTRL_ISKEYWORD: | |
| 3106 | if( nArg==3 ){ | |
| 3107 | const char *opt = azArg[2]; | |
| 3108 | rc = sqlite3_test_control(testctrl, opt); | |
| 3109 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3110 | } else { | |
| 3111 | fprintf(stderr,"Error: testctrl %s takes a single char * option\n", | |
| 3112 | azArg[1]); | |
| 3113 | } | |
| 3114 | break; | |
| 3103 | case SQLITE_TESTCTRL_ISKEYWORD: | |
| 3104 | if( nArg==3 ){ | |
| 3105 | const char *opt = azArg[2]; | |
| 3106 | rc = sqlite3_test_control(testctrl, opt); | |
| 3107 | fprintf(p->out, "%d (0x%08x)\n", rc, rc); | |
| 3108 | } else { | |
| 3109 | fprintf(stderr,"Error: testctrl %s takes a single char * option\n", | |
| 3110 | azArg[1]); | |
| 3111 | } | |
| 3112 | break; | |
| 3115 | 3113 | #endif |
| 3116 | 3114 | |
| 3117 | case SQLITE_TESTCTRL_BITVEC_TEST: | |
| 3118 | case SQLITE_TESTCTRL_FAULT_INSTALL: | |
| 3119 | case SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS: | |
| 3120 | case SQLITE_TESTCTRL_SCRATCHMALLOC: | |
| 3121 | default: | |
| 3122 | fprintf(stderr,"Error: CLI support for testctrl %s not implemented\n", | |
| 3123 | azArg[1]); | |
| 3124 | break; | |
| 3125 | } | |
| 3126 | } | |
| 3127 | }else | |
| 3115 | case SQLITE_TESTCTRL_BITVEC_TEST: | |
| 3116 | case SQLITE_TESTCTRL_FAULT_INSTALL: | |
| 3117 | case SQLITE_TESTCTRL_BENIGN_MALLOC_HOOKS: | |
| 3118 | case SQLITE_TESTCTRL_SCRATCHMALLOC: | |
| 3119 | default: | |
| 3120 | fprintf(stderr,"Error: CLI support for testctrl %s not implemented\n", | |
| 3121 | azArg[1]); | |
| 3122 | break; | |
| 3123 | } | |
| 3124 | } | |
| 3125 | }else | |
| 3128 | 3126 | |
| 3129 | if( c=='t' && n>4 && strncmp(azArg[0], "timeout", n)==0 && nArg==2 ){ | |
| 3130 | open_db(p, 0); | |
| 3131 | sqlite3_busy_timeout(p->db, (int)integerValue(azArg[1])); | |
| 3132 | }else | |
| 3133 | ||
| 3134 | if( HAS_TIMER && c=='t' && n>=5 && strncmp(azArg[0], "timer", n)==0 | |
| 3135 | && nArg==2 | |
| 3136 | ){ | |
| 3137 | enableTimer = booleanValue(azArg[1]); | |
| 3138 | }else | |
| 3139 | ||
| 3140 | if( c=='t' && strncmp(azArg[0], "trace", n)==0 && nArg>1 ){ | |
| 3141 | open_db(p, 0); | |
| 3142 | output_file_close(p->traceOut); | |
| 3143 | p->traceOut = output_file_open(azArg[1]); | |
| 3127 | if( c=='t' && n>4 && strncmp(azArg[0], "timeout", n)==0 && nArg==2 ){ | |
| 3128 | open_db(p, 0); | |
| 3129 | sqlite3_busy_timeout(p->db, (int)integerValue(azArg[1])); | |
| 3130 | }else | |
| 3131 | ||
| 3132 | if( HAS_TIMER && c=='t' && n>=5 && strncmp(azArg[0], "timer", n)==0 | |
| 3133 | && nArg==2 | |
| 3134 | ){ | |
| 3135 | enableTimer = booleanValue(azArg[1]); | |
| 3136 | }else | |
| 3137 | ||
| 3138 | if( c=='t' && strncmp(azArg[0], "trace", n)==0 && nArg>1 ){ | |
| 3139 | open_db(p, 0); | |
| 3140 | output_file_close(p->traceOut); | |
| 3141 | p->traceOut = output_file_open(azArg[1]); | |
| 3144 | 3142 | #if !defined(SQLITE_OMIT_TRACE) && !defined(SQLITE_OMIT_FLOATING_POINT) |
| 3145 | if( p->traceOut==0 ){ | |
| 3146 | sqlite3_trace(p->db, 0, 0); | |
| 3147 | }else{ | |
| 3148 | sqlite3_trace(p->db, sql_trace_callback, p->traceOut); | |
| 3149 | } | |
| 3143 | if( p->traceOut==0 ){ | |
| 3144 | sqlite3_trace(p->db, 0, 0); | |
| 3145 | }else{ | |
| 3146 | sqlite3_trace(p->db, sql_trace_callback, p->traceOut); | |
| 3147 | } | |
| 3150 | 3148 | #endif |
| 3151 | ||
| 3149 | }else | |
| 3152 | 3150 | |
| 3153 | if( c=='v' && strncmp(azArg[0], "version", n)==0 ){ | |
| 3154 | fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/, | |
| 3155 | sqlite3_libversion(), sqlite3_sourceid()); | |
| 3156 | }else | |
| 3151 | if( c=='v' && strncmp(azArg[0], "version", n)==0 ){ | |
| 3152 | fprintf(p->out, "SQLite %s %s\n" /*extra-version-info*/, | |
| 3153 | sqlite3_libversion(), sqlite3_sourceid()); | |
| 3154 | }else | |
| 3157 | 3155 | |
| 3158 | if( c=='v' && strncmp(azArg[0], "vfsname", n)==0 ){ | |
| 3159 | const char *zDbName = nArg==2 ? azArg[1] : "main"; | |
| 3160 | char *zVfsName = 0; | |
| 3161 | if( p->db ){ | |
| 3162 | sqlite3_file_control(p->db, zDbName, SQLITE_FCNTL_VFSNAME, &zVfsName); | |
| 3163 | if( zVfsName ){ | |
| 3164 | fprintf(p->out, "%s\n", zVfsName); | |
| 3165 | sqlite3_free(zVfsName); | |
| 3166 | } | |
| 3167 | } | |
| 3168 | }else | |
| 3156 | if( c=='v' && strncmp(azArg[0], "vfsname", n)==0 ){ | |
| 3157 | const char *zDbName = nArg==2 ? azArg[1] : "main"; | |
| 3158 | char *zVfsName = 0; | |
| 3159 | if( p->db ){ | |
| 3160 | sqlite3_file_control(p->db, zDbName, SQLITE_FCNTL_VFSNAME, &zVfsName); | |
| 3161 | if( zVfsName ){ | |
| 3162 | fprintf(p->out, "%s\n", zVfsName); | |
| 3163 | sqlite3_free(zVfsName); | |
| 3164 | } | |
| 3165 | } | |
| 3166 | }else | |
| 3169 | 3167 | |
| 3170 | 3168 | #if defined(SQLITE_DEBUG) && defined(SQLITE_ENABLE_WHERETRACE) |
| 3171 | if( c=='w' && strncmp(azArg[0], "wheretrace", n)==0 ){ | |
| 3172 | extern int sqlite3WhereTrace; | |
| 3173 | sqlite3WhereTrace = booleanValue(azArg[1]); | |
| 3174 | }else | |
| 3169 | if( c=='w' && strncmp(azArg[0], "wheretrace", n)==0 ){ | |
| 3170 | extern int sqlite3WhereTrace; | |
| 3171 | sqlite3WhereTrace = booleanValue(azArg[1]); | |
| 3172 | }else | |
| 3175 | 3173 | #endif |
| 3176 | 3174 | |
| 3177 | if( c=='w' && strncmp(azArg[0], "width", n)==0 && nArg>1 ){ | |
| 3178 | int j; | |
| 3179 | assert( nArg<=ArraySize(azArg) ); | |
| 3180 | for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){ | |
| 3181 | p->colWidth[j-1] = (int)integerValue(azArg[j]); | |
| 3182 | } | |
| 3183 | }else | |
| 3175 | if( c=='w' && strncmp(azArg[0], "width", n)==0 && nArg>1 ){ | |
| 3176 | int j; | |
| 3177 | assert( nArg<=ArraySize(azArg) ); | |
| 3178 | for(j=1; j<nArg && j<ArraySize(p->colWidth); j++){ | |
| 3179 | p->colWidth[j-1] = (int)integerValue(azArg[j]); | |
| 3180 | } | |
| 3181 | }else | |
| 3184 | 3182 | |
| 3185 | { | |
| 3186 | fprintf(stderr, "Error: unknown command or invalid arguments: " | |
| 3187 | " \"%s\". Enter \".help\" for help\n", azArg[0]); | |
| 3188 | rc = 1; | |
| 3189 | } | |
| 3183 | { | |
| 3184 | fprintf(stderr, "Error: unknown command or invalid arguments: " | |
| 3185 | " \"%s\". Enter \".help\" for help\n", azArg[0]); | |
| 3186 | rc = 1; | |
| 3187 | } | |
| 3190 | 3188 | |
| 3191 | ||
| 3189 | return rc; | |
| 3192 | 3190 | } |
| 3193 | 3191 | |
| 3194 | 3192 | /* |
| r31373 | r31374 | |
| 3196 | 3194 | ** of string z[]. |
| 3197 | 3195 | */ |
| 3198 | 3196 | static int line_contains_semicolon(const char *z, int N){ |
| 3199 | int i; | |
| 3200 | for(i=0; i<N; i++){ if( z[i]==';' ) return 1; } | |
| 3201 | return 0; | |
| 3197 | int i; | |
| 3198 | for(i=0; i<N; i++){ if( z[i]==';' ) return 1; } | |
| 3199 | return 0; | |
| 3202 | 3200 | } |
| 3203 | 3201 | |
| 3204 | 3202 | /* |
| 3205 | 3203 | ** Test to see if a line consists entirely of whitespace. |
| 3206 | 3204 | */ |
| 3207 | 3205 | static int _all_whitespace(const char *z){ |
| 3208 | for(; *z; z++){ | |
| 3209 | if( IsSpace(z[0]) ) continue; | |
| 3210 | if( *z=='/' && z[1]=='*' ){ | |
| 3211 | z += 2; | |
| 3212 | while( *z && (*z!='*' || z[1]!='/') ){ z++; } | |
| 3213 | if( *z==0 ) return 0; | |
| 3214 | z++; | |
| 3215 | continue; | |
| 3216 | } | |
| 3217 | if( *z=='-' && z[1]=='-' ){ | |
| 3218 | z += 2; | |
| 3219 | while( *z && *z!='\n' ){ z++; } | |
| 3220 | if( *z==0 ) return 1; | |
| 3221 | continue; | |
| 3222 | } | |
| 3223 | return 0; | |
| 3224 | } | |
| 3225 | return 1; | |
| 3206 | for(; *z; z++){ | |
| 3207 | if( IsSpace(z[0]) ) continue; | |
| 3208 | if( *z=='/' && z[1]=='*' ){ | |
| 3209 | z += 2; | |
| 3210 | while( *z && (*z!='*' || z[1]!='/') ){ z++; } | |
| 3211 | if( *z==0 ) return 0; | |
| 3212 | z++; | |
| 3213 | continue; | |
| 3214 | } | |
| 3215 | if( *z=='-' && z[1]=='-' ){ | |
| 3216 | z += 2; | |
| 3217 | while( *z && *z!='\n' ){ z++; } | |
| 3218 | if( *z==0 ) return 1; | |
| 3219 | continue; | |
| 3220 | } | |
| 3221 | return 0; | |
| 3222 | } | |
| 3223 | return 1; | |
| 3226 | 3224 | } |
| 3227 | 3225 | |
| 3228 | 3226 | /* |
| r31373 | r31374 | |
| 3231 | 3229 | ** as is the Oracle "/". |
| 3232 | 3230 | */ |
| 3233 | 3231 | static int line_is_command_terminator(const char *zLine){ |
| 3234 | while( IsSpace(zLine[0]) ){ zLine++; }; | |
| 3235 | if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ){ | |
| 3236 | return 1; /* Oracle */ | |
| 3237 | } | |
| 3238 | if( ToLower(zLine[0])=='g' && ToLower(zLine[1])=='o' | |
| 3239 | && _all_whitespace(&zLine[2]) ){ | |
| 3240 | return 1; /* SQL Server */ | |
| 3241 | } | |
| 3242 | return 0; | |
| 3232 | while( IsSpace(zLine[0]) ){ zLine++; }; | |
| 3233 | if( zLine[0]=='/' && _all_whitespace(&zLine[1]) ){ | |
| 3234 | return 1; /* Oracle */ | |
| 3235 | } | |
| 3236 | if( ToLower(zLine[0])=='g' && ToLower(zLine[1])=='o' | |
| 3237 | && _all_whitespace(&zLine[2]) ){ | |
| 3238 | return 1; /* SQL Server */ | |
| 3239 | } | |
| 3240 | return 0; | |
| 3243 | 3241 | } |
| 3244 | 3242 | |
| 3245 | 3243 | /* |
| r31373 | r31374 | |
| 3247 | 3245 | ** ends in the middle of a string literal or C-style comment. |
| 3248 | 3246 | */ |
| 3249 | 3247 | static int line_is_complete(char *zSql, int nSql){ |
| 3250 | int rc; | |
| 3251 | if( zSql==0 ) return 1; | |
| 3252 | zSql[nSql] = ';'; | |
| 3253 | zSql[nSql+1] = 0; | |
| 3254 | rc = sqlite3_complete(zSql); | |
| 3255 | zSql[nSql] = 0; | |
| 3256 | return rc; | |
| 3248 | int rc; | |
| 3249 | if( zSql==0 ) return 1; | |
| 3250 | zSql[nSql] = ';'; | |
| 3251 | zSql[nSql+1] = 0; | |
| 3252 | rc = sqlite3_complete(zSql); | |
| 3253 | zSql[nSql] = 0; | |
| 3254 | return rc; | |
| 3257 | 3255 | } |
| 3258 | 3256 | |
| 3259 | 3257 | /* |
| r31373 | r31374 | |
| 3266 | 3264 | ** Return the number of errors. |
| 3267 | 3265 | */ |
| 3268 | 3266 | static int process_input(struct callback_data *p, FILE *in){ |
| 3269 | char *zLine = 0; /* A single input line */ | |
| 3270 | char *zSql = 0; /* Accumulated SQL text */ | |
| 3271 | int nLine; /* Length of current line */ | |
| 3272 | int nSql = 0; /* Bytes of zSql[] used */ | |
| 3273 | int nAlloc = 0; /* Allocated zSql[] space */ | |
| 3274 | int nSqlPrior = 0; /* Bytes of zSql[] used by prior line */ | |
| 3275 | char *zErrMsg; /* Error message returned */ | |
| 3276 | int rc; /* Error code */ | |
| 3277 | int errCnt = 0; /* Number of errors seen */ | |
| 3278 | int lineno = 0; /* Current line number */ | |
| 3279 | int startline = 0; /* Line number for start of current input */ | |
| 3267 | char *zLine = 0; /* A single input line */ | |
| 3268 | char *zSql = 0; /* Accumulated SQL text */ | |
| 3269 | int nLine; /* Length of current line */ | |
| 3270 | int nSql = 0; /* Bytes of zSql[] used */ | |
| 3271 | int nAlloc = 0; /* Allocated zSql[] space */ | |
| 3272 | int nSqlPrior = 0; /* Bytes of zSql[] used by prior line */ | |
| 3273 | char *zErrMsg; /* Error message returned */ | |
| 3274 | int rc; /* Error code */ | |
| 3275 | int errCnt = 0; /* Number of errors seen */ | |
| 3276 | int lineno = 0; /* Current line number */ | |
| 3277 | int startline = 0; /* Line number for start of current input */ | |
| 3280 | 3278 | |
| 3281 | while( errCnt==0 || !bail_on_error || (in==0 && stdin_is_interactive) ){ | |
| 3282 | fflush(p->out); | |
| 3283 | zLine = one_input_line(in, zLine, nSql>0); | |
| 3284 | if( zLine==0 ){ | |
| 3285 | /* End of input */ | |
| 3286 | if( stdin_is_interactive ) printf("\n"); | |
| 3287 | break; | |
| 3288 | } | |
| 3289 | if( seenInterrupt ){ | |
| 3290 | if( in!=0 ) break; | |
| 3291 | seenInterrupt = 0; | |
| 3292 | } | |
| 3293 | lineno++; | |
| 3294 | if( nSql==0 && _all_whitespace(zLine) ){ | |
| 3295 | if( p->echoOn ) printf("%s\n", zLine); | |
| 3296 | continue; | |
| 3297 | } | |
| 3298 | if( zLine && zLine[0]=='.' && nSql==0 ){ | |
| 3299 | if( p->echoOn ) printf("%s\n", zLine); | |
| 3300 | rc = do_meta_command(zLine, p); | |
| 3301 | if( rc==2 ){ /* exit requested */ | |
| 3302 | break; | |
| 3303 | }else if( rc ){ | |
| 3304 | errCnt++; | |
| 3305 | } | |
| 3306 | continue; | |
| 3307 | } | |
| 3308 | if( line_is_command_terminator(zLine) && line_is_complete(zSql, nSql) ){ | |
| 3309 | memcpy(zLine,";",2); | |
| 3310 | } | |
| 3311 | nLine = strlen30(zLine); | |
| 3312 | if( nSql+nLine+2>=nAlloc ){ | |
| 3313 | nAlloc = nSql+nLine+100; | |
| 3314 | zSql = (char *)realloc(zSql, nAlloc); | |
| 3315 | if( zSql==0 ){ | |
| 3316 | fprintf(stderr, "Error: out of memory\n"); | |
| 3317 | exit(1); | |
| 3318 | } | |
| 3319 | } | |
| 3320 | nSqlPrior = nSql; | |
| 3321 | if( nSql==0 ){ | |
| 3322 | int i; | |
| 3323 | for(i=0; zLine[i] && IsSpace(zLine[i]); i++){} | |
| 3324 | assert( nAlloc>0 && zSql!=0 ); | |
| 3325 | memcpy(zSql, zLine+i, nLine+1-i); | |
| 3326 | startline = lineno; | |
| 3327 | nSql = nLine-i; | |
| 3328 | }else{ | |
| 3329 | zSql[nSql++] = '\n'; | |
| 3330 | memcpy(zSql+nSql, zLine, nLine+1); | |
| 3331 | nSql += nLine; | |
| 3332 | } | |
| 3333 | if( nSql && line_contains_semicolon(&zSql[nSqlPrior], nSql-nSqlPrior) | |
| 3334 | && sqlite3_complete(zSql) ){ | |
| 3335 | p->cnt = 0; | |
| 3336 | open_db(p, 0); | |
| 3337 | BEGIN_TIMER; | |
| 3338 | rc = shell_exec(p->db, zSql, shell_callback, p, &zErrMsg); | |
| 3339 | END_TIMER; | |
| 3340 | if( rc || zErrMsg ){ | |
| 3341 | char zPrefix[100]; | |
| 3342 | if( in!=0 || !stdin_is_interactive ){ | |
| 3343 | sqlite3_snprintf(sizeof(zPrefix), zPrefix, | |
| 3344 | "Error: near line %d:", startline); | |
| 3345 | }else{ | |
| 3346 | sqlite3_snprintf(sizeof(zPrefix), zPrefix, "Error:"); | |
| 3347 | } | |
| 3348 | if( zErrMsg!=0 ){ | |
| 3349 | fprintf(stderr, "%s %s\n", zPrefix, zErrMsg); | |
| 3350 | sqlite3_free(zErrMsg); | |
| 3351 | zErrMsg = 0; | |
| 3352 | }else{ | |
| 3353 | fprintf(stderr, "%s %s\n", zPrefix, sqlite3_errmsg(p->db)); | |
| 3354 | } | |
| 3355 | errCnt++; | |
| 3356 | } | |
| 3357 | nSql = 0; | |
| 3358 | }else if( nSql && _all_whitespace(zSql) ){ | |
| 3359 | if( p->echoOn ) printf("%s\n", zSql); | |
| 3360 | nSql = 0; | |
| 3361 | } | |
| 3362 | } | |
| 3363 | if( nSql ){ | |
| 3364 | if( !_all_whitespace(zSql) ){ | |
| 3365 | fprintf(stderr, "Error: incomplete SQL: %s\n", zSql); | |
| 3366 | } | |
| 3367 | free(zSql); | |
| 3368 | } | |
| 3369 | free(zLine); | |
| 3370 | return errCnt>0; | |
| 3279 | while( errCnt==0 || !bail_on_error || (in==0 && stdin_is_interactive) ){ | |
| 3280 | fflush(p->out); | |
| 3281 | zLine = one_input_line(in, zLine, nSql>0); | |
| 3282 | if( zLine==0 ){ | |
| 3283 | /* End of input */ | |
| 3284 | if( stdin_is_interactive ) printf("\n"); | |
| 3285 | break; | |
| 3286 | } | |
| 3287 | if( seenInterrupt ){ | |
| 3288 | if( in!=0 ) break; | |
| 3289 | seenInterrupt = 0; | |
| 3290 | } | |
| 3291 | lineno++; | |
| 3292 | if( nSql==0 && _all_whitespace(zLine) ){ | |
| 3293 | if( p->echoOn ) printf("%s\n", zLine); | |
| 3294 | continue; | |
| 3295 | } | |
| 3296 | if( zLine && zLine[0]=='.' && nSql==0 ){ | |
| 3297 | if( p->echoOn ) printf("%s\n", zLine); | |
| 3298 | rc = do_meta_command(zLine, p); | |
| 3299 | if( rc==2 ){ /* exit requested */ | |
| 3300 | break; | |
| 3301 | }else if( rc ){ | |
| 3302 | errCnt++; | |
| 3303 | } | |
| 3304 | continue; | |
| 3305 | } | |
| 3306 | if( line_is_command_terminator(zLine) && line_is_complete(zSql, nSql) ){ | |
| 3307 | memcpy(zLine,";",2); | |
| 3308 | } | |
| 3309 | nLine = strlen30(zLine); | |
| 3310 | if( nSql+nLine+2>=nAlloc ){ | |
| 3311 | nAlloc = nSql+nLine+100; | |
| 3312 | zSql = (char *)realloc(zSql, nAlloc); | |
| 3313 | if( zSql==0 ){ | |
| 3314 | fprintf(stderr, "Error: out of memory\n"); | |
| 3315 | exit(1); | |
| 3316 | } | |
| 3317 | } | |
| 3318 | nSqlPrior = nSql; | |
| 3319 | if( nSql==0 ){ | |
| 3320 | int i; | |
| 3321 | for(i=0; zLine[i] && IsSpace(zLine[i]); i++){} | |
| 3322 | assert( nAlloc>0 && zSql!=0 ); | |
| 3323 | memcpy(zSql, zLine+i, nLine+1-i); | |
| 3324 | startline = lineno; | |
| 3325 | nSql = nLine-i; | |
| 3326 | }else{ | |
| 3327 | zSql[nSql++] = '\n'; | |
| 3328 | memcpy(zSql+nSql, zLine, nLine+1); | |
| 3329 | nSql += nLine; | |
| 3330 | } | |
| 3331 | if( nSql && line_contains_semicolon(&zSql[nSqlPrior], nSql-nSqlPrior) | |
| 3332 | && sqlite3_complete(zSql) ){ | |
| 3333 | p->cnt = 0; | |
| 3334 | open_db(p, 0); | |
| 3335 | BEGIN_TIMER; | |
| 3336 | rc = shell_exec(p->db, zSql, shell_callback, p, &zErrMsg); | |
| 3337 | END_TIMER; | |
| 3338 | if( rc || zErrMsg ){ | |
| 3339 | char zPrefix[100]; | |
| 3340 | if( in!=0 || !stdin_is_interactive ){ | |
| 3341 | sqlite3_snprintf(sizeof(zPrefix), zPrefix, | |
| 3342 | "Error: near line %d:", startline); | |
| 3343 | }else{ | |
| 3344 | sqlite3_snprintf(sizeof(zPrefix), zPrefix, "Error:"); | |
| 3345 | } | |
| 3346 | if( zErrMsg!=0 ){ | |
| 3347 | fprintf(stderr, "%s %s\n", zPrefix, zErrMsg); | |
| 3348 | sqlite3_free(zErrMsg); | |
| 3349 | zErrMsg = 0; | |
| 3350 | }else{ | |
| 3351 | fprintf(stderr, "%s %s\n", zPrefix, sqlite3_errmsg(p->db)); | |
| 3352 | } | |
| 3353 | errCnt++; | |
| 3354 | } | |
| 3355 | nSql = 0; | |
| 3356 | }else if( nSql && _all_whitespace(zSql) ){ | |
| 3357 | if( p->echoOn ) printf("%s\n", zSql); | |
| 3358 | nSql = 0; | |
| 3359 | } | |
| 3360 | } | |
| 3361 | if( nSql ){ | |
| 3362 | if( !_all_whitespace(zSql) ){ | |
| 3363 | fprintf(stderr, "Error: incomplete SQL: %s\n", zSql); | |
| 3364 | } | |
| 3365 | free(zSql); | |
| 3366 | } | |
| 3367 | free(zLine); | |
| 3368 | return errCnt>0; | |
| 3371 | 3369 | } |
| 3372 | 3370 | |
| 3373 | 3371 | /* |
| r31373 | r31374 | |
| 3375 | 3373 | ** 0 return indicates an error of some kind. |
| 3376 | 3374 | */ |
| 3377 | 3375 | static char *find_home_dir(void){ |
| 3378 | static char *home_dir = NULL; | |
| 3379 | if( home_dir ) return home_dir; | |
| 3376 | static char *home_dir = NULL; | |
| 3377 | if( home_dir ) return home_dir; | |
| 3380 | 3378 | |
| 3381 | 3379 | #if !defined(_WIN32) && !defined(WIN32) && !defined(_WIN32_WCE) && !defined(__RTP__) && !defined(_WRS_KERNEL) |
| 3382 | { | |
| 3383 | struct passwd *pwent; | |
| 3384 | uid_t uid = getuid(); | |
| 3385 | if( (pwent=getpwuid(uid)) != NULL) { | |
| 3386 | home_dir = pwent->pw_dir; | |
| 3387 | } | |
| 3388 | } | |
| 3380 | { | |
| 3381 | struct passwd *pwent; | |
| 3382 | uid_t uid = getuid(); | |
| 3383 | if( (pwent=getpwuid(uid)) != NULL) { | |
| 3384 | home_dir = pwent->pw_dir; | |
| 3385 | } | |
| 3386 | } | |
| 3389 | 3387 | #endif |
| 3390 | 3388 | |
| 3391 | 3389 | #if defined(_WIN32_WCE) |
| 3392 | /* Windows CE (arm-wince-mingw32ce-gcc) does not provide getenv() | |
| 3393 | */ | |
| 3394 | home_dir = "/"; | |
| 3390 | /* Windows CE (arm-wince-mingw32ce-gcc) does not provide getenv() | |
| 3391 | */ | |
| 3392 | home_dir = "/"; | |
| 3395 | 3393 | #else |
| 3396 | 3394 | |
| 3397 | 3395 | #if defined(_WIN32) || defined(WIN32) |
| 3398 | if (!home_dir) { | |
| 3399 | home_dir = getenv("USERPROFILE"); | |
| 3400 | } | |
| 3396 | if (!home_dir) { | |
| 3397 | home_dir = getenv("USERPROFILE"); | |
| 3398 | } | |
| 3401 | 3399 | #endif |
| 3402 | 3400 | |
| 3403 | if (!home_dir) { | |
| 3404 | home_dir = getenv("HOME"); | |
| 3405 | } | |
| 3401 | if (!home_dir) { | |
| 3402 | home_dir = getenv("HOME"); | |
| 3403 | } | |
| 3406 | 3404 | |
| 3407 | 3405 | #if defined(_WIN32) || defined(WIN32) |
| 3408 | if (!home_dir) { | |
| 3409 | char *zDrive, *zPath; | |
| 3410 | int n; | |
| 3411 | zDrive = getenv("HOMEDRIVE"); | |
| 3412 | zPath = getenv("HOMEPATH"); | |
| 3413 | if( zDrive && zPath ){ | |
| 3414 | n = strlen30(zDrive) + strlen30(zPath) + 1; | |
| 3415 | home_dir = (char *)malloc( n ); | |
| 3416 | if( home_dir==0 ) return 0; | |
| 3417 | sqlite3_snprintf(n, home_dir, "%s%s", zDrive, zPath); | |
| 3418 | return home_dir; | |
| 3419 | } | |
| 3420 | home_dir = "c:\\"; | |
| 3421 | } | |
| 3406 | if (!home_dir) { | |
| 3407 | char *zDrive, *zPath; | |
| 3408 | int n; | |
| 3409 | zDrive = getenv("HOMEDRIVE"); | |
| 3410 | zPath = getenv("HOMEPATH"); | |
| 3411 | if( zDrive && zPath ){ | |
| 3412 | n = strlen30(zDrive) + strlen30(zPath) + 1; | |
| 3413 | home_dir = (char *)malloc( n ); | |
| 3414 | if( home_dir==0 ) return 0; | |
| 3415 | sqlite3_snprintf(n, home_dir, "%s%s", zDrive, zPath); | |
| 3416 | return home_dir; | |
| 3417 | } | |
| 3418 | home_dir = "c:\\"; | |
| 3419 | } | |
| 3422 | 3420 | #endif |
| 3423 | 3421 | |
| 3424 | 3422 | #endif /* !_WIN32_WCE */ |
| 3425 | 3423 | |
| 3426 | if( home_dir ){ | |
| 3427 | int n = strlen30(home_dir) + 1; | |
| 3428 | char *z = (char *)malloc( n ); | |
| 3429 | if( z ) memcpy(z, home_dir, n); | |
| 3430 | home_dir = z; | |
| 3431 | } | |
| 3424 | if( home_dir ){ | |
| 3425 | int n = strlen30(home_dir) + 1; | |
| 3426 | char *z = (char *)malloc( n ); | |
| 3427 | if( z ) memcpy(z, home_dir, n); | |
| 3428 | home_dir = z; | |
| 3429 | } | |
| 3432 | 3430 | |
| 3433 | ||
| 3431 | return home_dir; | |
| 3434 | 3432 | } |
| 3435 | 3433 | |
| 3436 | 3434 | /* |
| r31373 | r31374 | |
| 3440 | 3438 | ** Returns the number of errors. |
| 3441 | 3439 | */ |
| 3442 | 3440 | static int process_sqliterc( |
| 3443 | struct callback_data *p, /* Configuration data */ | |
| 3444 | const char *sqliterc_override /* Name of config file. NULL to use default */ | |
| 3441 | struct callback_data *p, /* Configuration data */ | |
| 3442 | const char *sqliterc_override /* Name of config file. NULL to use default */ | |
| 3445 | 3443 | ){ |
| 3446 | char *home_dir = NULL; | |
| 3447 | const char *sqliterc = sqliterc_override; | |
| 3448 | char *zBuf = 0; | |
| 3449 | FILE *in = NULL; | |
| 3450 | int rc = 0; | |
| 3444 | char *home_dir = NULL; | |
| 3445 | const char *sqliterc = sqliterc_override; | |
| 3446 | char *zBuf = 0; | |
| 3447 | FILE *in = NULL; | |
| 3448 | int rc = 0; | |
| 3451 | 3449 | |
| 3452 | if (sqliterc == NULL) { | |
| 3453 | home_dir = find_home_dir(); | |
| 3454 | if( home_dir==0 ){ | |
| 3450 | if (sqliterc == NULL) { | |
| 3451 | home_dir = find_home_dir(); | |
| 3452 | if( home_dir==0 ){ | |
| 3455 | 3453 | #if !defined(__RTP__) && !defined(_WRS_KERNEL) |
| 3456 | ||
| 3454 | fprintf(stderr,"%s: Error: cannot locate your home directory\n", Argv0); | |
| 3457 | 3455 | #endif |
| 3458 | return 1; | |
| 3459 | } | |
| 3460 | sqlite3_initialize(); | |
| 3461 | zBuf = sqlite3_mprintf("%s/.sqliterc",home_dir); | |
| 3462 | sqliterc = zBuf; | |
| 3463 | } | |
| 3464 | in = fopen(sqliterc,"rb"); | |
| 3465 | if( in ){ | |
| 3466 | if( stdin_is_interactive ){ | |
| 3467 | fprintf(stderr,"-- Loading resources from %s\n",sqliterc); | |
| 3468 | } | |
| 3469 | rc = process_input(p,in); | |
| 3470 | fclose(in); | |
| 3471 | } | |
| 3472 | sqlite3_free(zBuf); | |
| 3473 | return rc; | |
| 3456 | return 1; | |
| 3457 | } | |
| 3458 | sqlite3_initialize(); | |
| 3459 | zBuf = sqlite3_mprintf("%s/.sqliterc",home_dir); | |
| 3460 | sqliterc = zBuf; | |
| 3461 | } | |
| 3462 | in = fopen(sqliterc,"rb"); | |
| 3463 | if( in ){ | |
| 3464 | if( stdin_is_interactive ){ | |
| 3465 | fprintf(stderr,"-- Loading resources from %s\n",sqliterc); | |
| 3466 | } | |
| 3467 | rc = process_input(p,in); | |
| 3468 | fclose(in); | |
| 3469 | } | |
| 3470 | sqlite3_free(zBuf); | |
| 3471 | return rc; | |
| 3474 | 3472 | } |
| 3475 | 3473 | |
| 3476 | 3474 | /* |
| 3477 | 3475 | ** Show available command line options |
| 3478 | 3476 | */ |
| 3479 | static const char zOptions[] = | |
| 3480 | " -bail stop after hitting an error\n" | |
| 3481 | " -batch force batch I/O\n" | |
| 3482 | " -column set output mode to 'column'\n" | |
| 3483 | " -cmd COMMAND run \"COMMAND\" before reading stdin\n" | |
| 3484 | " -csv set output mode to 'csv'\n" | |
| 3485 | " -echo print commands before execution\n" | |
| 3486 | " -init FILENAME read/process named file\n" | |
| 3487 | " -[no]header turn headers on or off\n" | |
| 3477 | static const char zOptions[] = | |
| 3478 | " -bail stop after hitting an error\n" | |
| 3479 | " -batch force batch I/O\n" | |
| 3480 | " -column set output mode to 'column'\n" | |
| 3481 | " -cmd COMMAND run \"COMMAND\" before reading stdin\n" | |
| 3482 | " -csv set output mode to 'csv'\n" | |
| 3483 | " -echo print commands before execution\n" | |
| 3484 | " -init FILENAME read/process named file\n" | |
| 3485 | " -[no]header turn headers on or off\n" | |
| 3488 | 3486 | #if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5) |
| 3489 | ||
| 3487 | " -heap SIZE Size of heap for memsys3 or memsys5\n" | |
| 3490 | 3488 | #endif |
| 3491 | " -help show this message\n" | |
| 3492 | " -html set output mode to HTML\n" | |
| 3493 | " -interactive force interactive I/O\n" | |
| 3494 | " -line set output mode to 'line'\n" | |
| 3495 | " -list set output mode to 'list'\n" | |
| 3496 | " -mmap N default mmap size set to N\n" | |
| 3489 | " -help show this message\n" | |
| 3490 | " -html set output mode to HTML\n" | |
| 3491 | " -interactive force interactive I/O\n" | |
| 3492 | " -line set output mode to 'line'\n" | |
| 3493 | " -list set output mode to 'list'\n" | |
| 3494 | " -mmap N default mmap size set to N\n" | |
| 3497 | 3495 | #ifdef SQLITE_ENABLE_MULTIPLEX |
| 3498 | ||
| 3496 | " -multiplex enable the multiplexor VFS\n" | |
| 3499 | 3497 | #endif |
| 3500 | " -nullvalue TEXT set text string for NULL values. Default ''\n" | |
| 3501 | " -separator SEP set output field separator. Default: '|'\n" | |
| 3502 | " -stats print memory stats before each finalize\n" | |
| 3503 | " -version show SQLite version\n" | |
| 3504 | " -vfs NAME use NAME as the default VFS\n" | |
| 3498 | " -nullvalue TEXT set text string for NULL values. Default ''\n" | |
| 3499 | " -separator SEP set output field separator. Default: '|'\n" | |
| 3500 | " -stats print memory stats before each finalize\n" | |
| 3501 | " -version show SQLite version\n" | |
| 3502 | " -vfs NAME use NAME as the default VFS\n" | |
| 3505 | 3503 | #ifdef SQLITE_ENABLE_VFSTRACE |
| 3506 | ||
| 3504 | " -vfstrace enable tracing of all VFS calls\n" | |
| 3507 | 3505 | #endif |
| 3508 | 3506 | ; |
| 3509 | 3507 | static void usage(int showDetail){ |
| 3510 | fprintf(stderr, | |
| 3511 | "Usage: %s [OPTIONS] FILENAME [SQL]\n" | |
| 3512 | "FILENAME is the name of an SQLite database. A new database is created\n" | |
| 3513 | "if the file does not previously exist.\n", Argv0); | |
| 3514 | if( showDetail ){ | |
| 3515 | fprintf(stderr, "OPTIONS include:\n%s", zOptions); | |
| 3516 | }else{ | |
| 3517 | fprintf(stderr, "Use the -help option for additional information\n"); | |
| 3518 | } | |
| 3519 | exit(1); | |
| 3508 | fprintf(stderr, | |
| 3509 | "Usage: %s [OPTIONS] FILENAME [SQL]\n" | |
| 3510 | "FILENAME is the name of an SQLite database. A new database is created\n" | |
| 3511 | "if the file does not previously exist.\n", Argv0); | |
| 3512 | if( showDetail ){ | |
| 3513 | fprintf(stderr, "OPTIONS include:\n%s", zOptions); | |
| 3514 | }else{ | |
| 3515 | fprintf(stderr, "Use the -help option for additional information\n"); | |
| 3516 | } | |
| 3517 | exit(1); | |
| 3520 | 3518 | } |
| 3521 | 3519 | |
| 3522 | 3520 | /* |
| 3523 | 3521 | ** Initialize the state information in data |
| 3524 | 3522 | */ |
| 3525 | 3523 | static void main_init(struct callback_data *data) { |
| 3526 | memset(data, 0, sizeof(*data)); | |
| 3527 | data->mode = MODE_List; | |
| 3528 | memcpy(data->separator,"|", 2); | |
| 3529 | data->showHeader = 0; | |
| 3530 | sqlite3_config(SQLITE_CONFIG_URI, 1); | |
| 3531 | sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data); | |
| 3532 | sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite> "); | |
| 3533 | sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...> "); | |
| 3534 | sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); | |
| 3524 | memset(data, 0, sizeof(*data)); | |
| 3525 | data->mode = MODE_List; | |
| 3526 | memcpy(data->separator,"|", 2); | |
| 3527 | data->showHeader = 0; | |
| 3528 | sqlite3_config(SQLITE_CONFIG_URI, 1); | |
| 3529 | sqlite3_config(SQLITE_CONFIG_LOG, shellLog, data); | |
| 3530 | sqlite3_snprintf(sizeof(mainPrompt), mainPrompt,"sqlite> "); | |
| 3531 | sqlite3_snprintf(sizeof(continuePrompt), continuePrompt," ...> "); | |
| 3532 | sqlite3_config(SQLITE_CONFIG_SINGLETHREAD); | |
| 3535 | 3533 | } |
| 3536 | 3534 | |
| 3537 | 3535 | /* |
| r31373 | r31374 | |
| 3539 | 3537 | */ |
| 3540 | 3538 | #ifdef _WIN32 |
| 3541 | 3539 | static void printBold(const char *zText){ |
| 3542 | HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); | |
| 3543 | CONSOLE_SCREEN_BUFFER_INFO defaultScreenInfo; | |
| 3544 | GetConsoleScreenBufferInfo(out, &defaultScreenInfo); | |
| 3545 | SetConsoleTextAttribute(out, | |
| 3546 | FOREGROUND_RED|FOREGROUND_INTENSITY | |
| 3547 | ); | |
| 3548 | printf("%s", zText); | |
| 3549 | SetConsoleTextAttribute(out, defaultScreenInfo.wAttributes); | |
| 3540 | HANDLE out = GetStdHandle(STD_OUTPUT_HANDLE); | |
| 3541 | CONSOLE_SCREEN_BUFFER_INFO defaultScreenInfo; | |
| 3542 | GetConsoleScreenBufferInfo(out, &defaultScreenInfo); | |
| 3543 | SetConsoleTextAttribute(out, | |
| 3544 | FOREGROUND_RED|FOREGROUND_INTENSITY | |
| 3545 | ); | |
| 3546 | printf("%s", zText); | |
| 3547 | SetConsoleTextAttribute(out, defaultScreenInfo.wAttributes); | |
| 3550 | 3548 | } |
| 3551 | 3549 | #else |
| 3552 | 3550 | static void printBold(const char *zText){ |
| 3553 | ||
| 3551 | printf("\033[1m%s\033[0m", zText); | |
| 3554 | 3552 | } |
| 3555 | 3553 | #endif |
| 3556 | 3554 | |
| r31373 | r31374 | |
| 3559 | 3557 | ** is available. |
| 3560 | 3558 | */ |
| 3561 | 3559 | static char *cmdline_option_value(int argc, char **argv, int i){ |
| 3562 | if( i==argc ){ | |
| 3563 | fprintf(stderr, "%s: Error: missing argument to %s\n", | |
| 3564 | argv[0], argv[argc-1]); | |
| 3565 | exit(1); | |
| 3566 | } | |
| 3567 | return argv[i]; | |
| 3560 | if( i==argc ){ | |
| 3561 | fprintf(stderr, "%s: Error: missing argument to %s\n", | |
| 3562 | argv[0], argv[argc-1]); | |
| 3563 | exit(1); | |
| 3564 | } | |
| 3565 | return argv[i]; | |
| 3568 | 3566 | } |
| 3569 | 3567 | |
| 3570 | 3568 | int main(int argc, char **argv){ |
| 3571 | char *zErrMsg = 0; | |
| 3572 | struct callback_data data; | |
| 3573 | const char *zInitFile = 0; | |
| 3574 | char *zFirstCmd = 0; | |
| 3575 | int i; | |
| 3576 | int rc = 0; | |
| 3577 | int warnInmemoryDb = 0; | |
| 3569 | char *zErrMsg = 0; | |
| 3570 | struct callback_data data; | |
| 3571 | const char *zInitFile = 0; | |
| 3572 | char *zFirstCmd = 0; | |
| 3573 | int i; | |
| 3574 | int rc = 0; | |
| 3575 | int warnInmemoryDb = 0; | |
| 3578 | 3576 | |
| 3579 | 3577 | #if USE_SYSTEM_SQLITE+0!=1 |
| 3580 | if( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)!=0 ){ | |
| 3581 | fprintf(stderr, "SQLite header and source version mismatch\n%s\n%s\n", | |
| 3582 | sqlite3_sourceid(), SQLITE_SOURCE_ID); | |
| 3583 | exit(1); | |
| 3584 | } | |
| 3578 | if( strcmp(sqlite3_sourceid(),SQLITE_SOURCE_ID)!=0 ){ | |
| 3579 | fprintf(stderr, "SQLite header and source version mismatch\n%s\n%s\n", | |
| 3580 | sqlite3_sourceid(), SQLITE_SOURCE_ID); | |
| 3581 | exit(1); | |
| 3582 | } | |
| 3585 | 3583 | #endif |
| 3586 | Argv0 = argv[0]; | |
| 3587 | main_init(&data); | |
| 3588 | stdin_is_interactive = isatty(0); | |
| 3584 | Argv0 = argv[0]; | |
| 3585 | main_init(&data); | |
| 3586 | stdin_is_interactive = isatty(0); | |
| 3589 | 3587 | |
| 3590 | /* Make sure we have a valid signal handler early, before anything | |
| 3591 | ** else is done. | |
| 3592 | */ | |
| 3588 | /* Make sure we have a valid signal handler early, before anything | |
| 3589 | ** else is done. | |
| 3590 | */ | |
| 3593 | 3591 | #ifdef SIGINT |
| 3594 | ||
| 3592 | signal(SIGINT, interrupt_handler); | |
| 3595 | 3593 | #endif |
| 3596 | 3594 | |
| 3597 | /* Do an initial pass through the command-line argument to locate | |
| 3598 | ** the name of the database file, the name of the initialization file, | |
| 3599 | ** the size of the alternative malloc heap, | |
| 3600 | ** and the first command to execute. | |
| 3601 | */ | |
| 3602 | for(i=1; i<argc; i++){ | |
| 3603 | char *z; | |
| 3604 | z = argv[i]; | |
| 3605 | if( z[0]!='-' ){ | |
| 3606 | if( data.zDbFilename==0 ){ | |
| 3607 | data.zDbFilename = z; | |
| 3608 | continue; | |
| 3609 | } | |
| 3610 | if( zFirstCmd==0 ){ | |
| 3611 | zFirstCmd = z; | |
| 3612 | continue; | |
| 3613 | } | |
| 3614 | fprintf(stderr,"%s: Error: too many options: \"%s\"\n", Argv0, argv[i]); | |
| 3615 | fprintf(stderr,"Use -help for a list of options.\n"); | |
| 3616 | return 1; | |
| 3617 | } | |
| 3618 | if( z[1]=='-' ) z++; | |
| 3619 | if( strcmp(z,"-separator")==0 | |
| 3620 | || strcmp(z,"-nullvalue")==0 | |
| 3621 | || strcmp(z,"-cmd")==0 | |
| 3622 | ){ | |
| 3623 | (void)cmdline_option_value(argc, argv, ++i); | |
| 3624 | }else if( strcmp(z,"-init")==0 ){ | |
| 3625 | zInitFile = cmdline_option_value(argc, argv, ++i); | |
| 3626 | }else if( strcmp(z,"-batch")==0 ){ | |
| 3627 | /* Need to check for batch mode here to so we can avoid printing | |
| 3628 | ** informational messages (like from process_sqliterc) before | |
| 3629 | ** we do the actual processing of arguments later in a second pass. | |
| 3630 | */ | |
| 3631 | stdin_is_interactive = 0; | |
| 3632 | }else if( strcmp(z,"-heap")==0 ){ | |
| 3595 | /* Do an initial pass through the command-line argument to locate | |
| 3596 | ** the name of the database file, the name of the initialization file, | |
| 3597 | ** the size of the alternative malloc heap, | |
| 3598 | ** and the first command to execute. | |
| 3599 | */ | |
| 3600 | for(i=1; i<argc; i++){ | |
| 3601 | char *z; | |
| 3602 | z = argv[i]; | |
| 3603 | if( z[0]!='-' ){ | |
| 3604 | if( data.zDbFilename==0 ){ | |
| 3605 | data.zDbFilename = z; | |
| 3606 | continue; | |
| 3607 | } | |
| 3608 | if( zFirstCmd==0 ){ | |
| 3609 | zFirstCmd = z; | |
| 3610 | continue; | |
| 3611 | } | |
| 3612 | fprintf(stderr,"%s: Error: too many options: \"%s\"\n", Argv0, argv[i]); | |
| 3613 | fprintf(stderr,"Use -help for a list of options.\n"); | |
| 3614 | return 1; | |
| 3615 | } | |
| 3616 | if( z[1]=='-' ) z++; | |
| 3617 | if( strcmp(z,"-separator")==0 | |
| 3618 | || strcmp(z,"-nullvalue")==0 | |
| 3619 | || strcmp(z,"-cmd")==0 | |
| 3620 | ){ | |
| 3621 | (void)cmdline_option_value(argc, argv, ++i); | |
| 3622 | }else if( strcmp(z,"-init")==0 ){ | |
| 3623 | zInitFile = cmdline_option_value(argc, argv, ++i); | |
| 3624 | }else if( strcmp(z,"-batch")==0 ){ | |
| 3625 | /* Need to check for batch mode here to so we can avoid printing | |
| 3626 | ** informational messages (like from process_sqliterc) before | |
| 3627 | ** we do the actual processing of arguments later in a second pass. | |
| 3628 | */ | |
| 3629 | stdin_is_interactive = 0; | |
| 3630 | }else if( strcmp(z,"-heap")==0 ){ | |
| 3633 | 3631 | #if defined(SQLITE_ENABLE_MEMSYS3) || defined(SQLITE_ENABLE_MEMSYS5) |
| 3634 | const char *zSize; | |
| 3635 | sqlite3_int64 szHeap; | |
| 3632 | const char *zSize; | |
| 3633 | sqlite3_int64 szHeap; | |
| 3636 | 3634 | |
| 3637 | zSize = cmdline_option_value(argc, argv, ++i); | |
| 3638 | szHeap = integerValue(zSize); | |
| 3639 | if( szHeap>0x7fff0000 ) szHeap = 0x7fff0000; | |
| 3640 | sqlite3_config(SQLITE_CONFIG_HEAP, malloc((int)szHeap), (int)szHeap, 64); | |
| 3635 | zSize = cmdline_option_value(argc, argv, ++i); | |
| 3636 | szHeap = integerValue(zSize); | |
| 3637 | if( szHeap>0x7fff0000 ) szHeap = 0x7fff0000; | |
| 3638 | sqlite3_config(SQLITE_CONFIG_HEAP, malloc((int)szHeap), (int)szHeap, 64); | |
| 3641 | 3639 | #endif |
| 3642 | 3640 | #ifdef SQLITE_ENABLE_VFSTRACE |
| 3643 | }else if( strcmp(z,"-vfstrace")==0 ){ | |
| 3644 | extern int vfstrace_register( | |
| 3645 | const char *zTraceName, | |
| 3646 | const char *zOldVfsName, | |
| 3647 | int (*xOut)(const char*,void*), | |
| 3648 | void *pOutArg, | |
| 3649 | int makeDefault | |
| 3650 | ); | |
| 3651 | vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1); | |
| 3641 | }else if( strcmp(z,"-vfstrace")==0 ){ | |
| 3642 | extern int vfstrace_register( | |
| 3643 | const char *zTraceName, | |
| 3644 | const char *zOldVfsName, | |
| 3645 | int (*xOut)(const char*,void*), | |
| 3646 | void *pOutArg, | |
| 3647 | int makeDefault | |
| 3648 | ); | |
| 3649 | vfstrace_register("trace",0,(int(*)(const char*,void*))fputs,stderr,1); | |
| 3652 | 3650 | #endif |
| 3653 | 3651 | #ifdef SQLITE_ENABLE_MULTIPLEX |
| 3654 | }else if( strcmp(z,"-multiplex")==0 ){ | |
| 3655 | extern int sqlite3_multiple_initialize(const char*,int); | |
| 3656 | sqlite3_multiplex_initialize(0, 1); | |
| 3652 | }else if( strcmp(z,"-multiplex")==0 ){ | |
| 3653 | extern int sqlite3_multiple_initialize(const char*,int); | |
| 3654 | sqlite3_multiplex_initialize(0, 1); | |
| 3657 | 3655 | #endif |
| 3658 | }else if( strcmp(z,"-mmap")==0 ){ | |
| 3659 | sqlite3_int64 sz = integerValue(cmdline_option_value(argc,argv,++i)); | |
| 3660 | sqlite3_config(SQLITE_CONFIG_MMAP_SIZE, sz, sz); | |
| 3661 | }else if( strcmp(z,"-vfs")==0 ){ | |
| 3662 | sqlite3_vfs *pVfs = sqlite3_vfs_find(cmdline_option_value(argc,argv,++i)); | |
| 3663 | if( pVfs ){ | |
| 3664 | sqlite3_vfs_register(pVfs, 1); | |
| 3665 | }else{ | |
| 3666 | fprintf(stderr, "no such VFS: \"%s\"\n", argv[i]); | |
| 3667 | exit(1); | |
| 3668 | } | |
| 3669 | } | |
| 3670 | } | |
| 3671 | if( data.zDbFilename==0 ){ | |
| 3656 | }else if( strcmp(z,"-mmap")==0 ){ | |
| 3657 | sqlite3_int64 sz = integerValue(cmdline_option_value(argc,argv,++i)); | |
| 3658 | sqlite3_config(SQLITE_CONFIG_MMAP_SIZE, sz, sz); | |
| 3659 | }else if( strcmp(z,"-vfs")==0 ){ | |
| 3660 | sqlite3_vfs *pVfs = sqlite3_vfs_find(cmdline_option_value(argc,argv,++i)); | |
| 3661 | if( pVfs ){ | |
| 3662 | sqlite3_vfs_register(pVfs, 1); | |
| 3663 | }else{ | |
| 3664 | fprintf(stderr, "no such VFS: \"%s\"\n", argv[i]); | |
| 3665 | exit(1); | |
| 3666 | } | |
| 3667 | } | |
| 3668 | } | |
| 3669 | if( data.zDbFilename==0 ){ | |
| 3672 | 3670 | #ifndef SQLITE_OMIT_MEMORYDB |
| 3673 | data.zDbFilename = ":memory:"; | |
| 3674 | warnInmemoryDb = argc==1; | |
| 3671 | data.zDbFilename = ":memory:"; | |
| 3672 | warnInmemoryDb = argc==1; | |
| 3675 | 3673 | #else |
| 3676 | fprintf(stderr,"%s: Error: no database filename specified\n", Argv0); | |
| 3677 | return 1; | |
| 3674 | fprintf(stderr,"%s: Error: no database filename specified\n", Argv0); | |
| 3675 | return 1; | |
| 3678 | 3676 | #endif |
| 3679 | 3677 | #ifdef SQLITE_SHELL_DBNAME_PROC |
| 3680 | { extern void SQLITE_SHELL_DBNAME_PROC(const char**); | |
| 3681 | SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); | |
| 3682 | warnInmemoryDb = 0; } | |
| 3678 | { extern void SQLITE_SHELL_DBNAME_PROC(const char**); | |
| 3679 | SQLITE_SHELL_DBNAME_PROC(&data.zDbFilename); | |
| 3680 | warnInmemoryDb = 0; } | |
| 3683 | 3681 | #endif |
| 3684 | } | |
| 3685 | data.out = stdout; | |
| 3682 | } | |
| 3683 | data.out = stdout; | |
| 3686 | 3684 | |
| 3687 | /* Go ahead and open the database file if it already exists. If the | |
| 3688 | ** file does not exist, delay opening it. This prevents empty database | |
| 3689 | ** files from being created if a user mistypes the database name argument | |
| 3690 | ** to the sqlite command-line tool. | |
| 3691 | */ | |
| 3692 | if( access(data.zDbFilename, 0)==0 ){ | |
| 3693 | open_db(&data, 0); | |
| 3694 | } | |
| 3685 | /* Go ahead and open the database file if it already exists. If the | |
| 3686 | ** file does not exist, delay opening it. This prevents empty database | |
| 3687 | ** files from being created if a user mistypes the database name argument | |
| 3688 | ** to the sqlite command-line tool. | |
| 3689 | */ | |
| 3690 | if( access(data.zDbFilename, 0)==0 ){ | |
| 3691 | open_db(&data, 0); | |
| 3692 | } | |
| 3695 | 3693 | |
| 3696 | /* Process the initialization file if there is one. If no -init option | |
| 3697 | ** is given on the command line, look for a file named ~/.sqliterc and | |
| 3698 | ** try to process it. | |
| 3699 | */ | |
| 3700 | rc = process_sqliterc(&data,zInitFile); | |
| 3701 | if( rc>0 ){ | |
| 3702 | return rc; | |
| 3703 | } | |
| 3694 | /* Process the initialization file if there is one. If no -init option | |
| 3695 | ** is given on the command line, look for a file named ~/.sqliterc and | |
| 3696 | ** try to process it. | |
| 3697 | */ | |
| 3698 | rc = process_sqliterc(&data,zInitFile); | |
| 3699 | if( rc>0 ){ | |
| 3700 | return rc; | |
| 3701 | } | |
| 3704 | 3702 | |
| 3705 | /* Make a second pass through the command-line argument and set | |
| 3706 | ** options. This second pass is delayed until after the initialization | |
| 3707 | ** file is processed so that the command-line arguments will override | |
| 3708 | ** settings in the initialization file. | |
| 3709 | */ | |
| 3710 | for(i=1; i<argc; i++){ | |
| 3711 | char *z = argv[i]; | |
| 3712 | if( z[0]!='-' ) continue; | |
| 3713 | if( z[1]=='-' ){ z++; } | |
| 3714 | if( strcmp(z,"-init")==0 ){ | |
| 3715 | i++; | |
| 3716 | }else if( strcmp(z,"-html")==0 ){ | |
| 3717 | data.mode = MODE_Html; | |
| 3718 | }else if( strcmp(z,"-list")==0 ){ | |
| 3719 | data.mode = MODE_List; | |
| 3720 | }else if( strcmp(z,"-line")==0 ){ | |
| 3721 | data.mode = MODE_Line; | |
| 3722 | }else if( strcmp(z,"-column")==0 ){ | |
| 3723 | data.mode = MODE_Column; | |
| 3724 | }else if( strcmp(z,"-csv")==0 ){ | |
| 3725 | data.mode = MODE_Csv; | |
| 3726 | memcpy(data.separator,",",2); | |
| 3727 | }else if( strcmp(z,"-separator")==0 ){ | |
| 3728 | sqlite3_snprintf(sizeof(data.separator), data.separator, | |
| 3729 | "%s",cmdline_option_value(argc,argv,++i)); | |
| 3730 | }else if( strcmp(z,"-nullvalue")==0 ){ | |
| 3731 | sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, | |
| 3732 | "%s",cmdline_option_value(argc,argv,++i)); | |
| 3733 | }else if( strcmp(z,"-header")==0 ){ | |
| 3734 | data.showHeader = 1; | |
| 3735 | }else if( strcmp(z,"-noheader")==0 ){ | |
| 3736 | data.showHeader = 0; | |
| 3737 | }else if( strcmp(z,"-echo")==0 ){ | |
| 3738 | data.echoOn = 1; | |
| 3739 | }else if( strcmp(z,"-eqp")==0 ){ | |
| 3740 | data.autoEQP = 1; | |
| 3741 | }else if( strcmp(z,"-stats")==0 ){ | |
| 3742 | data.statsOn = 1; | |
| 3743 | }else if( strcmp(z,"-bail")==0 ){ | |
| 3744 | bail_on_error = 1; | |
| 3745 | }else if( strcmp(z,"-version")==0 ){ | |
| 3746 | printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid()); | |
| 3747 | return 0; | |
| 3748 | }else if( strcmp(z,"-interactive")==0 ){ | |
| 3749 | stdin_is_interactive = 1; | |
| 3750 | }else if( strcmp(z,"-batch")==0 ){ | |
| 3751 | stdin_is_interactive = 0; | |
| 3752 | }else if( strcmp(z,"-heap")==0 ){ | |
| 3753 | i++; | |
| 3754 | }else if( strcmp(z,"-mmap")==0 ){ | |
| 3755 | i++; | |
| 3756 | }else if( strcmp(z,"-vfs")==0 ){ | |
| 3757 | i++; | |
| 3703 | /* Make a second pass through the command-line argument and set | |
| 3704 | ** options. This second pass is delayed until after the initialization | |
| 3705 | ** file is processed so that the command-line arguments will override | |
| 3706 | ** settings in the initialization file. | |
| 3707 | */ | |
| 3708 | for(i=1; i<argc; i++){ | |
| 3709 | char *z = argv[i]; | |
| 3710 | if( z[0]!='-' ) continue; | |
| 3711 | if( z[1]=='-' ){ z++; } | |
| 3712 | if( strcmp(z,"-init")==0 ){ | |
| 3713 | i++; | |
| 3714 | }else if( strcmp(z,"-html")==0 ){ | |
| 3715 | data.mode = MODE_Html; | |
| 3716 | }else if( strcmp(z,"-list")==0 ){ | |
| 3717 | data.mode = MODE_List; | |
| 3718 | }else if( strcmp(z,"-line")==0 ){ | |
| 3719 | data.mode = MODE_Line; | |
| 3720 | }else if( strcmp(z,"-column")==0 ){ | |
| 3721 | data.mode = MODE_Column; | |
| 3722 | }else if( strcmp(z,"-csv")==0 ){ | |
| 3723 | data.mode = MODE_Csv; | |
| 3724 | memcpy(data.separator,",",2); | |
| 3725 | }else if( strcmp(z,"-separator")==0 ){ | |
| 3726 | sqlite3_snprintf(sizeof(data.separator), data.separator, | |
| 3727 | "%s",cmdline_option_value(argc,argv,++i)); | |
| 3728 | }else if( strcmp(z,"-nullvalue")==0 ){ | |
| 3729 | sqlite3_snprintf(sizeof(data.nullvalue), data.nullvalue, | |
| 3730 | "%s",cmdline_option_value(argc,argv,++i)); | |
| 3731 | }else if( strcmp(z,"-header")==0 ){ | |
| 3732 | data.showHeader = 1; | |
| 3733 | }else if( strcmp(z,"-noheader")==0 ){ | |
| 3734 | data.showHeader = 0; | |
| 3735 | }else if( strcmp(z,"-echo")==0 ){ | |
| 3736 | data.echoOn = 1; | |
| 3737 | }else if( strcmp(z,"-eqp")==0 ){ | |
| 3738 | data.autoEQP = 1; | |
| 3739 | }else if( strcmp(z,"-stats")==0 ){ | |
| 3740 | data.statsOn = 1; | |
| 3741 | }else if( strcmp(z,"-bail")==0 ){ | |
| 3742 | bail_on_error = 1; | |
| 3743 | }else if( strcmp(z,"-version")==0 ){ | |
| 3744 | printf("%s %s\n", sqlite3_libversion(), sqlite3_sourceid()); | |
| 3745 | return 0; | |
| 3746 | }else if( strcmp(z,"-interactive")==0 ){ | |
| 3747 | stdin_is_interactive = 1; | |
| 3748 | }else if( strcmp(z,"-batch")==0 ){ | |
| 3749 | stdin_is_interactive = 0; | |
| 3750 | }else if( strcmp(z,"-heap")==0 ){ | |
| 3751 | i++; | |
| 3752 | }else if( strcmp(z,"-mmap")==0 ){ | |
| 3753 | i++; | |
| 3754 | }else if( strcmp(z,"-vfs")==0 ){ | |
| 3755 | i++; | |
| 3758 | 3756 | #ifdef SQLITE_ENABLE_VFSTRACE |
| 3759 | }else if( strcmp(z,"-vfstrace")==0 ){ | |
| 3760 | i++; | |
| 3757 | }else if( strcmp(z,"-vfstrace")==0 ){ | |
| 3758 | i++; | |
| 3761 | 3759 | #endif |
| 3762 | 3760 | #ifdef SQLITE_ENABLE_MULTIPLEX |
| 3763 | }else if( strcmp(z,"-multiplex")==0 ){ | |
| 3764 | i++; | |
| 3761 | }else if( strcmp(z,"-multiplex")==0 ){ | |
| 3762 | i++; | |
| 3765 | 3763 | #endif |
| 3766 | }else if( strcmp(z,"-help")==0 ){ | |
| 3767 | usage(1); | |
| 3768 | }else if( strcmp(z,"-cmd")==0 ){ | |
| 3769 | if( i==argc-1 ) break; | |
| 3770 | z = cmdline_option_value(argc,argv,++i); | |
| 3771 | if( z[0]=='.' ){ | |
| 3772 | rc = do_meta_command(z, &data); | |
| 3773 | if( rc && bail_on_error ) return rc==2 ? 0 : rc; | |
| 3774 | }else{ | |
| 3775 | open_db(&data, 0); | |
| 3776 | rc = shell_exec(data.db, z, shell_callback, &data, &zErrMsg); | |
| 3777 | if( zErrMsg!=0 ){ | |
| 3778 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 3779 | if( bail_on_error ) return rc!=0 ? rc : 1; | |
| 3780 | }else if( rc!=0 ){ | |
| 3781 | fprintf(stderr,"Error: unable to process SQL \"%s\"\n", z); | |
| 3782 | if( bail_on_error ) return rc; | |
| 3783 | } | |
| 3784 | } | |
| 3785 | }else{ | |
| 3786 | fprintf(stderr,"%s: Error: unknown option: %s\n", Argv0, z); | |
| 3787 | fprintf(stderr,"Use -help for a list of options.\n"); | |
| 3788 | return 1; | |
| 3789 | } | |
| 3790 | } | |
| 3764 | }else if( strcmp(z,"-help")==0 ){ | |
| 3765 | usage(1); | |
| 3766 | }else if( strcmp(z,"-cmd")==0 ){ | |
| 3767 | if( i==argc-1 ) break; | |
| 3768 | z = cmdline_option_value(argc,argv,++i); | |
| 3769 | if( z[0]=='.' ){ | |
| 3770 | rc = do_meta_command(z, &data); | |
| 3771 | if( rc && bail_on_error ) return rc==2 ? 0 : rc; | |
| 3772 | }else{ | |
| 3773 | open_db(&data, 0); | |
| 3774 | rc = shell_exec(data.db, z, shell_callback, &data, &zErrMsg); | |
| 3775 | if( zErrMsg!=0 ){ | |
| 3776 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 3777 | if( bail_on_error ) return rc!=0 ? rc : 1; | |
| 3778 | }else if( rc!=0 ){ | |
| 3779 | fprintf(stderr,"Error: unable to process SQL \"%s\"\n", z); | |
| 3780 | if( bail_on_error ) return rc; | |
| 3781 | } | |
| 3782 | } | |
| 3783 | }else{ | |
| 3784 | fprintf(stderr,"%s: Error: unknown option: %s\n", Argv0, z); | |
| 3785 | fprintf(stderr,"Use -help for a list of options.\n"); | |
| 3786 | return 1; | |
| 3787 | } | |
| 3788 | } | |
| 3791 | 3789 | |
| 3792 | if( zFirstCmd ){ | |
| 3793 | /* Run just the command that follows the database name | |
| 3794 | */ | |
| 3795 | if( zFirstCmd[0]=='.' ){ | |
| 3796 | rc = do_meta_command(zFirstCmd, &data); | |
| 3797 | if( rc==2 ) rc = 0; | |
| 3798 | }else{ | |
| 3799 | open_db(&data, 0); | |
| 3800 | rc = shell_exec(data.db, zFirstCmd, shell_callback, &data, &zErrMsg); | |
| 3801 | if( zErrMsg!=0 ){ | |
| 3802 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 3803 | return rc!=0 ? rc : 1; | |
| 3804 | }else if( rc!=0 ){ | |
| 3805 | fprintf(stderr,"Error: unable to process SQL \"%s\"\n", zFirstCmd); | |
| 3806 | return rc; | |
| 3807 | } | |
| 3808 | } | |
| 3809 | }else{ | |
| 3810 | /* Run commands received from standard input | |
| 3811 | */ | |
| 3812 | if( stdin_is_interactive ){ | |
| 3813 | char *zHome; | |
| 3814 | char *zHistory = 0; | |
| 3815 | int nHistory; | |
| 3816 | printf( | |
| 3817 | "SQLite version %s %.19s\n" /*extra-version-info*/ | |
| 3818 | "Enter \".help\" for usage hints.\n", | |
| 3819 | sqlite3_libversion(), sqlite3_sourceid() | |
| 3820 | ); | |
| 3821 | if( warnInmemoryDb ){ | |
| 3822 | printf("Connected to a "); | |
| 3823 | printBold("transient in-memory database"); | |
| 3824 | printf(".\nUse \".open FILENAME\" to reopen on a " | |
| 3825 | "persistent database.\n"); | |
| 3826 | } | |
| 3827 | zHome = find_home_dir(); | |
| 3828 | if( zHome ){ | |
| 3829 | nHistory = strlen30(zHome) + 20; | |
| 3830 | if( (zHistory = (char *)malloc(nHistory))!=0 ){ | |
| 3831 | sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome); | |
| 3832 | } | |
| 3833 | } | |
| 3790 | if( zFirstCmd ){ | |
| 3791 | /* Run just the command that follows the database name | |
| 3792 | */ | |
| 3793 | if( zFirstCmd[0]=='.' ){ | |
| 3794 | rc = do_meta_command(zFirstCmd, &data); | |
| 3795 | if( rc==2 ) rc = 0; | |
| 3796 | }else{ | |
| 3797 | open_db(&data, 0); | |
| 3798 | rc = shell_exec(data.db, zFirstCmd, shell_callback, &data, &zErrMsg); | |
| 3799 | if( zErrMsg!=0 ){ | |
| 3800 | fprintf(stderr,"Error: %s\n", zErrMsg); | |
| 3801 | return rc!=0 ? rc : 1; | |
| 3802 | }else if( rc!=0 ){ | |
| 3803 | fprintf(stderr,"Error: unable to process SQL \"%s\"\n", zFirstCmd); | |
| 3804 | return rc; | |
| 3805 | } | |
| 3806 | } | |
| 3807 | }else{ | |
| 3808 | /* Run commands received from standard input | |
| 3809 | */ | |
| 3810 | if( stdin_is_interactive ){ | |
| 3811 | char *zHome; | |
| 3812 | char *zHistory = 0; | |
| 3813 | int nHistory; | |
| 3814 | printf( | |
| 3815 | "SQLite version %s %.19s\n" /*extra-version-info*/ | |
| 3816 | "Enter \".help\" for usage hints.\n", | |
| 3817 | sqlite3_libversion(), sqlite3_sourceid() | |
| 3818 | ); | |
| 3819 | if( warnInmemoryDb ){ | |
| 3820 | printf("Connected to a "); | |
| 3821 | printBold("transient in-memory database"); | |
| 3822 | printf(".\nUse \".open FILENAME\" to reopen on a " | |
| 3823 | "persistent database.\n"); | |
| 3824 | } | |
| 3825 | zHome = find_home_dir(); | |
| 3826 | if( zHome ){ | |
| 3827 | nHistory = strlen30(zHome) + 20; | |
| 3828 | if( (zHistory = (char *)malloc(nHistory))!=0 ){ | |
| 3829 | sqlite3_snprintf(nHistory, zHistory,"%s/.sqlite_history", zHome); | |
| 3830 | } | |
| 3831 | } | |
| 3834 | 3832 | #if defined(HAVE_READLINE) |
| 3835 | ||
| 3833 | if( zHistory ) read_history(zHistory); | |
| 3836 | 3834 | #endif |
| 3837 | rc = process_input(&data, 0); | |
| 3838 | if( zHistory ){ | |
| 3839 | stifle_history(100); | |
| 3840 | write_history(zHistory); | |
| 3841 | free(zHistory); | |
| 3842 | } | |
| 3843 | }else{ | |
| 3844 | rc = process_input(&data, stdin); | |
| 3845 | } | |
| 3846 | } | |
| 3847 | set_table_name(&data, 0); | |
| 3848 | if( data.db ){ | |
| 3849 | sqlite3_close(data.db); | |
| 3850 | } | |
| 3851 | sqlite3_free(data.zFreeOnClose); | |
| 3852 | return rc; | |
| 3853 | } | |
| No newline at end of file | ||
| 3835 | rc = process_input(&data, 0); | |
| 3836 | if( zHistory ){ | |
| 3837 | stifle_history(100); | |
| 3838 | write_history(zHistory); | |
| 3839 | free(zHistory); | |
| 3840 | } | |
| 3841 | }else{ | |
| 3842 | rc = process_input(&data, stdin); | |
| 3843 | } | |
| 3844 | } | |
| 3845 | set_table_name(&data, 0); | |
| 3846 | if( data.db ){ | |
| 3847 | sqlite3_close(data.db); | |
| 3848 | } | |
| 3849 | sqlite3_free(data.zFreeOnClose); | |
| 3850 | return rc; | |
| 3851 | } |
| r31373 | r31374 | |
|---|---|---|
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | 73 | const floppy_format_type FLOPPY_MSX_FORMAT = &floppy_image_format_creator<msx_format>; |
| 74 |
| r31373 | r31374 | |
|---|---|---|
| 520 | 520 | |
| 521 | 521 | ****************************************************************************/ |
| 522 | 522 | |
| 523 | static const UINT8 dos_skewing[] = | |
| 523 | static const UINT8 dos_skewing[] = | |
| 524 | 524 | { |
| 525 | 525 | 0x00, 0x07, 0x0E, 0x06, 0x0D, 0x05, 0x0C, 0x04, |
| 526 | 526 | 0x0B, 0x03, 0x0A, 0x02, 0x09, 0x01, 0x08, 0x0F |
| r31373 | r31374 | |
| 623 | 623 | if (!memcmp("PRODOS", §or_data[0x103], 6)) |
| 624 | 624 | { |
| 625 | 625 | m_prodos_order = true; |
| 626 | } // check for ProDOS order SOS disk | |
| 627 | else if (!memcmp(sos_block1, §or_data[0x100], 4)) | |
| 626 | } // check for ProDOS order SOS disk | |
| 627 | else if (!memcmp(sos_block1, §or_data[0x100], 4)) | |
| 628 | 628 | { |
| 629 | 629 | m_prodos_order = true; |
| 630 | } // check for Apple III A2 emulator disk in ProDOS order | |
| 631 | else if (!memcmp(a3a2emul_block1, §or_data[0x100], 6)) | |
| 630 | } // check for Apple III A2 emulator disk in ProDOS order | |
| 631 | else if (!memcmp(a3a2emul_block1, §or_data[0x100], 6)) | |
| 632 | 632 | { |
| 633 | 633 | m_prodos_order = true; |
| 634 | } // check for PCPI Applicard software in ProDOS order | |
| 635 | else if (!memcmp("COPYRIGHT (C) 1979, DIGITAL RESEARCH", §or_data[0x118], 36)) | |
| 634 | } // check for PCPI Applicard software in ProDOS order | |
| 635 | else if (!memcmp("COPYRIGHT (C) 1979, DIGITAL RESEARCH", §or_data[0x118], 36)) | |
| 636 | 636 | { |
| 637 | 637 | printf("PCPI detected\n"); |
| 638 | 638 | m_prodos_order = true; |
| r31373 | r31374 | |
| 646 | 646 | { |
| 647 | 647 | m_prodos_order = true; |
| 648 | 648 | } |
| 649 | } | |
| 649 | } // check for DOS 3.3 disks in ProDOS order | |
| 650 | 650 | else if (!memcmp(dos33_block1, §or_data[0x100], 4)) |
| 651 | 651 | { |
| 652 | 652 | m_prodos_order = true; |
| r31373 | r31374 | |
| 692 | 692 | nval = sdata[i - 0x56] >> 2; |
| 693 | 693 | else { |
| 694 | 694 | nval = |
| 695 | ((sdata[i+0x00] & 0x01) << 1) | | |
| 696 | ((sdata[i+0x00] & 0x02) >> 1) | | |
| 697 | ((sdata[i+0x56] & 0x01) << 3) | | |
| 695 | ((sdata[i+0x00] & 0x01) << 1) | | |
| 696 | ((sdata[i+0x00] & 0x02) >> 1) | | |
| 697 | ((sdata[i+0x56] & 0x01) << 3) | | |
| 698 | 698 | ((sdata[i+0x56] & 0x02) << 1); |
| 699 | 699 | if(i < 256-0xac) |
| 700 | 700 | nval |= |
| 701 | ((sdata[i+0xac] & 0x01) << 5) | | |
| 701 | ((sdata[i+0xac] & 0x01) << 5) | | |
| 702 | 702 | ((sdata[i+0xac] & 0x02) << 3); |
| 703 | 703 | } |
| 704 | 704 | raw_w(track_data, offset, 8, translate6[nval ^ pval]); |
| r31373 | r31374 | |
| 711 | 711 | assert(offset == 51090); |
| 712 | 712 | |
| 713 | 713 | generate_track_from_levels(track, 0, track_data, 51090, 0, image); |
| 714 | } | |
| 714 | } | |
| 715 | 715 | return true; |
| 716 | 716 | } |
| 717 | 717 | |
| r31373 | r31374 | |
| 789 | 789 | int dosver = 0; // apple dos version; 0 = >=3.3, 1 = <3.3 |
| 790 | 790 | for(;;) { |
| 791 | 791 | UINT8 v = gb(buf, ts, pos, wrap); |
| 792 | if(v == 0xff) | |
| 792 | if(v == 0xff) { | |
| 793 | 793 | hb = 1; |
| 794 | 794 | } |
| 795 | 795 | else if(hb == 1 && v == 0xd5){ |
| r31373 | r31374 | |
| 852 | 852 | |
| 853 | 853 | if (m_prodos_order) |
| 854 | 854 | { |
| 855 | dest = sectdata+(256)*prodos_skewing[se]; | |
| 855 | dest = sectdata+(256)*prodos_skewing[se]; | |
| 856 | 856 | } |
| 857 | 857 | else |
| 858 | 858 | { |
| 859 | dest = sectdata+(256)*dos_skewing[se]; | |
| 859 | dest = sectdata+(256)*dos_skewing[se]; | |
| 860 | 860 | } |
| 861 | 861 | |
| 862 | 862 | // first read in sector and decode to 6bit form |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /********************************************************************** |
| 2 | 2 | |
| 3 | formats/rx50_dsk.c | |
| 4 | Floppies used by Rainbow 100 and 190. | |
| 3 | formats/rx50_dsk.c | |
| 4 | Floppies used by Rainbow 100 and 190. | |
| 5 | 5 | |
| 6 | The RX50 drive: 5.25" format; 300 rpm; MFM 250 kbps; 96 - 100 tpi | |
| 7 | - single sided with two disk slots (1 drive motor served both). | |
| 6 | The RX50 drive: 5.25" format; 300 rpm; MFM 250 kbps; 96 - 100 tpi | |
| 7 | - single sided with two disk slots (1 drive motor served both). | |
| 8 | 8 | |
| 9 | DEC used the RX50 in entirely different architectures (Pro / PDP-11). | |
| 10 | Native Rainbow 100 format: | |
| 11 | - SSQD - 80 tracks with 10 sectors per track (512 byte sectors) | |
| 12 | - first two tracks are reserved for loader code (DOS / CPM / custom) | |
| 13 | - FAT and root directory began immediately on track 2. | |
| 14 | - 2:1 sector interleave pattern - except in tracks 0 and 1. | |
| 15 | NOTE: PUTR tends to interleave loader tracks 0 + 1. Not recommended! | |
| 9 | DEC used the RX50 in entirely different architectures (Pro / PDP-11). | |
| 10 | Native Rainbow 100 format: | |
| 11 | - SSQD - 80 tracks with 10 sectors per track (512 byte sectors) | |
| 12 | - first two tracks are reserved for loader code (DOS / CPM / custom) | |
| 13 | - FAT and root directory began immediately on track 2. | |
| 14 | - 2:1 sector interleave pattern - except in tracks 0 and 1. | |
| 15 | NOTE: PUTR tends to interleave loader tracks 0 + 1. Not recommended! | |
| 16 | 16 | |
| 17 | Jeff's RBIMG is first choice for preservation, TeleDisk is second. | |
| 18 | Always check the track layout. Both have problems with weak disks. | |
| 17 | Jeff's RBIMG is first choice for preservation, TeleDisk is second. | |
| 18 | Always check the track layout. Both have problems with weak disks. | |
| 19 | 19 | |
| 20 | A container to handle copy protected RX 50 disks is needed. Some info | |
| 21 | can be derived from Mark Hittinger's RBACKUP (CP/M source from Nov-94). | |
| 20 | A container to handle copy protected RX 50 disks is needed. Some info | |
| 21 | can be derived from Mark Hittinger's RBACKUP (CP/M source from Nov-94). | |
| 22 | 22 | |
| 23 | TODO: improve code to accept 40 T / single sided / 9 or 8 sector disks: | |
| 24 | a) disks from VT180 (9 sectors; READ ONLY - enforced by BIOS) | |
| 23 | TODO: improve code to accept 40 T / single sided / 9 or 8 sector disks: | |
| 24 | a) disks from VT180 (9 sectors; READ ONLY - enforced by BIOS) | |
| 25 | 25 | |
| 26 | b) 8 sector 160k MS-DOS disks (READ + WRITE support on DEC) | |
| 27 | FORMAT A: /F:160 on DOS; turn MEDIACHK ON | |
| 26 | b) 8 sector 160k MS-DOS disks (READ + WRITE support on DEC) | |
| 27 | FORMAT A: /F:160 on DOS; turn MEDIACHK ON | |
| 28 | 28 | ************************************************************************/ |
| 29 | 29 | |
| 30 | 30 | #include "emu.h" |
| r31373 | r31374 | |
| 40 | 40 | { MFM, 0x4e, 80 }, // (*) GAP (1) |
| 41 | 41 | { MFM, 0x00, 12 }, // Value from (*). (?? = unverified) |
| 42 | 42 | { RAW, 0x5224, 3 }, |
| 43 | { MFM, 0xfc, 1 }, | |
| 44 | { MFM, 0x4e, 50 }, | |
| 43 | { MFM, 0xfc, 1 }, | |
| 44 | { MFM, 0x4e, 50 }, | |
| 45 | 45 | { MFM, 0x00, 12 }, |
| 46 | { SECTOR_LOOP_START, 0, 9 }, // 0 ... f.sector_count-1 | |
| 46 | { SECTOR_LOOP_START, 0, 9 }, // 0 ... f.sector_count-1 | |
| 47 | 47 | { CRC_CCITT_START, 1 }, |
| 48 | { RAW, 0x4489, 3 }, | |
| 49 | { MFM, 0xfe, 1 }, | |
| 48 | { RAW, 0x4489, 3 }, | |
| 49 | { MFM, 0xfe, 1 }, | |
| 50 | 50 | { TRACK_ID }, |
| 51 | 51 | { HEAD_ID }, |
| 52 | 52 | { SECTOR_ID }, |
| 53 | 53 | { SIZE_ID }, |
| 54 | 54 | { CRC_END, 1 }, |
| 55 | 55 | { CRC, 1 }, |
| 56 | { MFM, 0x4e, 22 }, // (*) POST-ID GAP (2) | |
| 57 | { MFM, 0x00, 12 }, // (*) | |
| 56 | { MFM, 0x4e, 22 }, // (*) POST-ID GAP (2) | |
| 57 | { MFM, 0x00, 12 }, // (*) | |
| 58 | 58 | { CRC_CCITT_START, 2 }, |
| 59 | { RAW, 0x4489, 3 }, | |
| 60 | { MFM, 0xfb, 1 }, | |
| 59 | { RAW, 0x4489, 3 }, | |
| 60 | { MFM, 0xfb, 1 }, | |
| 61 | 61 | { SECTOR_DATA, -1 }, |
| 62 | 62 | { CRC_END, 2 }, |
| 63 | 63 | { CRC, 2 }, |
| 64 | { MFM, 0x4e, 48 }, | |
| 64 | { MFM, 0x4e, 48 }, // GAP (3) - taken from RBACKUP source. | |
| 65 | 65 | { MFM, 0x00, 12 }, |
| 66 | { SECTOR_LOOP_END }, | |
| 66 | { SECTOR_LOOP_END }, | |
| 67 | 67 | { MFM, 0x4e, 1 }, // UNVERIFIED - ('esq_16' has 170 x $4e) |
| 68 | 68 | { END } |
| 69 | 69 | }; |
| r31373 | r31374 | |
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | const char *rx50img_format::description() const |
| 81 | { | |
| 81 | { | |
| 82 | 82 | return "DEC Rainbow 100 floppy image"; |
| 83 | 83 | } |
| 84 | 84 | |
| r31373 | r31374 | |
| 106 | 106 | if (size == expected_size) // standard format has 409600 byte |
| 107 | 107 | return; |
| 108 | 108 | /* |
| 109 | track_count = 40; | |
| 110 | sector_count = 9; // [VT 180] | |
| 111 | expected_size = 512 * track_count * head_count * sector_count; | |
| 112 | if (size == expected_size) | |
| 113 | return; | |
| 109 | track_count = 40; | |
| 110 | sector_count = 9; // [VT 180] | |
| 111 | expected_size = 512 * track_count * head_count * sector_count; | |
| 112 | if (size == expected_size) | |
| 113 | return; | |
| 114 | 114 | |
| 115 | track_count = 40; | |
| 116 | sector_count = 8; // [DOS] | |
| 117 | expected_size = 512 * track_count * head_count * sector_count; | |
| 118 | if (size == expected_size) | |
| 119 | return; | |
| 115 | track_count = 40; | |
| 116 | sector_count = 8; // [DOS] | |
| 117 | expected_size = 512 * track_count * head_count * sector_count; | |
| 118 | if (size == expected_size) | |
| 119 | return; | |
| 120 | 120 | */ |
| 121 | 121 | track_count = head_count = sector_count = 0; |
| 122 | 122 | } |
| r31373 | r31374 | |
| 131 | 131 | return 0; |
| 132 | 132 | } |
| 133 | 133 | |
| 134 | ||
| 134 | // /* Sectors are numbered 1 to 10 */ | |
| 135 | 135 | bool rx50img_format::load(io_generic *io, UINT32 form_factor, floppy_image *image) |
| 136 | 136 | { |
| 137 | 137 | UINT8 track_count, head_count, sector_count; |
| r31373 | r31374 | |
| 173 | 173 | head_count = 1; |
| 174 | 174 | |
| 175 | 175 | if(sector_count == 9) // [VT180] 9 sector format : no save! |
| 176 | return false; | |
| 176 | return false; | |
| 177 | 177 | |
| 178 | 178 | if(sector_count != 10) // either 8 or 10 sectors |
| 179 | sector_count = 10; // [STANDARD] | |
| 179 | sector_count = 10; // [STANDARD] | |
| 180 | 180 | |
| 181 | 181 | /* |
| 182 | 182 | if(sector_count != 10) // either 8 or 10 sectors |
| 183 | 183 | { |
| 184 | if(sector_count == 8) | |
| 184 | if(sector_count == 8) | |
| 185 | 185 | { |
| 186 | | |
| 186 | track_count = 40; // [DOS] | |
| 187 | 187 | } else |
| 188 | 188 | { |
| 189 | | |
| 189 | sector_count = 10; // [STANDARD] | |
| 190 | 190 | } |
| 191 | 191 | } |
| 192 | 192 | */ |
| r31373 | r31374 | |
| 213 | 213 | // The BIOS can also * read * VT-180 disks and access MS-DOS 160 k disks (R + W) |
| 214 | 214 | // ( 40 tracks; single sided with 9 or 8 sectors per track ) |
| 215 | 215 | static LEGACY_FLOPPY_OPTIONS_START( dec100_floppy ) |
| 216 | LEGACY_FLOPPY_OPTION( dec100_floppy, "td0", "Teledisk floppy disk image", td0_dsk_identify, td0_dsk_construct, td0_dsk_destruct, NULL ) | |
| 217 | LEGACY_FLOPPY_OPTION( dec100_floppy, "img", "DEC Rainbow 100", basicdsk_identify_default, basicdsk_construct_default, NULL, | |
| 218 | HEADS([1]) | |
| 219 | TRACKS(40/[80]) | |
| 220 | SECTORS(8/9/[10]) | |
| 221 | SECTOR_LENGTH([512]) | |
| 222 | INTERLEAVE([0]) | |
| 223 | FIRST_SECTOR_ID([1]) | |
| 224 | ) | |
| 216 | LEGACY_FLOPPY_OPTION( dec100_floppy, "td0", "Teledisk floppy disk image", td0_dsk_identify, td0_dsk_construct, td0_dsk_destruct, NULL ) | |
| 217 | LEGACY_FLOPPY_OPTION( dec100_floppy, "img", "DEC Rainbow 100", basicdsk_identify_default, basicdsk_construct_default, NULL, | |
| 218 | HEADS([1]) | |
| 219 | TRACKS(40/[80]) | |
| 220 | SECTORS(8/9/[10]) | |
| 221 | SECTOR_LENGTH([512]) | |
| 222 | INTERLEAVE([0]) | |
| 223 | FIRST_SECTOR_ID([1]) | |
| 224 | ) | |
| 225 | 225 | LEGACY_FLOPPY_OPTIONS_END |
| 226 | 226 | |
| 227 | */ | |
| No newline at end of file | ||
| 227 | */ |
| r31373 | r31374 | |
|---|---|---|
| 88 | 88 | copy = 7; |
| 89 | 89 | sector_size = 128 << (t[i+7] & 3); |
| 90 | 90 | logerror("%02x %x - %02x %02x %02x %02x\n", |
| 91 | | |
| 91 | track, side, t[i+4], t[i+5], t[i+6], t[i+7]); | |
| 92 | 92 | } else if(t[i+3] == 0xfb) |
| 93 | 93 | copy = sector_size+3; |
| 94 | 94 | else |
| r31373 | r31374 | |
| 102 | 102 | } |
| 103 | 103 | generate_track_from_levels(track, side, stream, 100000, 0, image); |
| 104 | 104 | } |
| 105 | ||
| 105 | ||
| 106 | 106 | return true; |
| 107 | 107 | } |
| 108 | 108 |
| r31373 | r31374 | |
|---|---|---|
| 181 | 181 | |
| 182 | 182 | //------------------------------------------------- |
| 183 | 183 | // track_memory - enables or disables the memory |
| 184 | // | |
| 184 | // tracking | |
| 185 | 185 | //------------------------------------------------- |
| 186 | 186 | |
| 187 | 187 | void track_memory(bool track) |
| r31373 | r31374 | |
|---|---|---|
| 394 | 394 | const char *s = strrchr(path, '.'); |
| 395 | 395 | return (s != NULL) && !core_stricmp(s, ".7z"); |
| 396 | 396 | } |
| 397 | ||
| 398 | ||
| 397 | ||
| 398 | ||
| 399 | 399 | /*------------------------------------------------- |
| 400 | 400 | is_zip_file - tests to see if this file is a |
| 401 | 401 | ZIP file |
| r31373 | r31374 | |
|---|---|---|
| 121 | 121 | |
| 122 | 122 | #ifdef NS_ENABLE_DEBUG |
| 123 | 123 | #define DBG(x) do { printf("%-20s ", __func__); printf x; putchar('\n'); \ |
| 124 | ||
| 124 | fflush(stdout); } while(0) | |
| 125 | 125 | #else |
| 126 | 126 | #define DBG(x) |
| 127 | 127 | #endif |
| r31373 | r31374 | |
| 143 | 143 | #endif // __cplusplus |
| 144 | 144 | |
| 145 | 145 | union socket_address { |
| 146 | struct sockaddr sa; | |
| 147 | struct sockaddr_in sin; | |
| 146 | struct sockaddr sa; | |
| 147 | struct sockaddr_in sin; | |
| 148 | 148 | #ifdef NS_ENABLE_IPV6 |
| 149 | ||
| 149 | struct sockaddr_in6 sin6; | |
| 150 | 150 | #else |
| 151 | ||
| 151 | struct sockaddr sin6; | |
| 152 | 152 | #endif |
| 153 | 153 | }; |
| 154 | 154 | |
| 155 | 155 | // IO buffers interface |
| 156 | 156 | struct iobuf { |
| 157 | char *buf; | |
| 158 | size_t len; | |
| 159 | size_t size; | |
| 157 | char *buf; | |
| 158 | size_t len; | |
| 159 | size_t size; | |
| 160 | 160 | }; |
| 161 | 161 | |
| 162 | 162 | void iobuf_init(struct iobuf *, size_t initial_size); |
| r31373 | r31374 | |
| 167 | 167 | // Net skeleton interface |
| 168 | 168 | // Events. Meaning of event parameter (evp) is given in the comment. |
| 169 | 169 | enum ns_event { |
| 170 | NS_POLL, // Sent to each connection on each call to ns_server_poll() | |
| 171 | NS_ACCEPT, // New connection accept()-ed. union socket_address *remote_addr | |
| 172 | NS_CONNECT, // connect() succeeded or failed. int *success_status | |
| 173 | NS_RECV, // Data has benn received. int *num_bytes | |
| 174 | NS_SEND, // Data has been written to a socket. int *num_bytes | |
| 175 | NS_CLOSE // Connection is closed. NULL | |
| 170 | NS_POLL, // Sent to each connection on each call to ns_server_poll() | |
| 171 | NS_ACCEPT, // New connection accept()-ed. union socket_address *remote_addr | |
| 172 | NS_CONNECT, // connect() succeeded or failed. int *success_status | |
| 173 | NS_RECV, // Data has benn received. int *num_bytes | |
| 174 | NS_SEND, // Data has been written to a socket. int *num_bytes | |
| 175 | NS_CLOSE // Connection is closed. NULL | |
| 176 | 176 | }; |
| 177 | 177 | |
| 178 | 178 | // Callback function (event handler) prototype, must be defined by user. |
| r31373 | r31374 | |
| 181 | 181 | typedef void (*ns_callback_t)(struct ns_connection *, enum ns_event, void *evp); |
| 182 | 182 | |
| 183 | 183 | struct ns_server { |
| 184 | void *server_data; | |
| 185 | sock_t listening_sock; | |
| 186 | struct ns_connection *active_connections; | |
| 187 | ns_callback_t callback; | |
| 188 | SSL_CTX *ssl_ctx; | |
| 189 | SSL_CTX *client_ssl_ctx; | |
| 190 | sock_t ctl[2]; | |
| 184 | void *server_data; | |
| 185 | sock_t listening_sock; | |
| 186 | struct ns_connection *active_connections; | |
| 187 | ns_callback_t callback; | |
| 188 | SSL_CTX *ssl_ctx; | |
| 189 | SSL_CTX *client_ssl_ctx; | |
| 190 | sock_t ctl[2]; | |
| 191 | 191 | }; |
| 192 | 192 | |
| 193 | 193 | struct ns_connection { |
| 194 | struct ns_connection *prev, *next; | |
| 195 | struct ns_server *server; | |
| 196 | sock_t sock; | |
| 197 | union socket_address sa; | |
| 198 | struct iobuf recv_iobuf; | |
| 199 | struct iobuf send_iobuf; | |
| 200 | SSL *ssl; | |
| 201 | void *connection_data; | |
| 202 | time_t last_io_time; | |
| 203 | unsigned int flags; | |
| 194 | struct ns_connection *prev, *next; | |
| 195 | struct ns_server *server; | |
| 196 | sock_t sock; | |
| 197 | union socket_address sa; | |
| 198 | struct iobuf recv_iobuf; | |
| 199 | struct iobuf send_iobuf; | |
| 200 | SSL *ssl; | |
| 201 | void *connection_data; | |
| 202 | time_t last_io_time; | |
| 203 | unsigned int flags; | |
| 204 | 204 | #define NSF_FINISHED_SENDING_DATA (1 << 0) |
| 205 | 205 | #define NSF_BUFFER_BUT_DONT_SEND (1 << 1) |
| 206 | 206 | #define NSF_SSL_HANDSHAKE_DONE (1 << 2) |
| r31373 | r31374 | |
| 231 | 231 | int ns_set_ssl_cert(struct ns_server *, const char *ssl_cert); |
| 232 | 232 | int ns_set_ssl_ca_cert(struct ns_server *, const char *ssl_ca_cert); |
| 233 | 233 | struct ns_connection *ns_connect(struct ns_server *, const char *host, |
| 234 | ||
| 234 | int port, int ssl, void *connection_param); | |
| 235 | 235 | |
| 236 | 236 | int ns_send(struct ns_connection *, const void *buf, int len); |
| 237 | 237 | int ns_printf(struct ns_connection *, const char *fmt, ...); |
| r31373 | r31374 | |
| 280 | 280 | #endif |
| 281 | 281 | |
| 282 | 282 | struct ctl_msg { |
| 283 | ns_callback_t callback; | |
| 284 | char message[1024 * 8]; | |
| 283 | ns_callback_t callback; | |
| 284 | char message[1024 * 8]; | |
| 285 | 285 | }; |
| 286 | 286 | |
| 287 | 287 | void iobuf_init(struct iobuf *iobuf, size_t size) { |
| 288 | iobuf->len = iobuf->size = 0; | |
| 289 | iobuf->buf = NULL; | |
| 288 | iobuf->len = iobuf->size = 0; | |
| 289 | iobuf->buf = NULL; | |
| 290 | 290 | |
| 291 | if (size > 0 && (iobuf->buf = (char *) NS_MALLOC(size)) != NULL) { | |
| 292 | iobuf->size = size; | |
| 293 | } | |
| 291 | if (size > 0 && (iobuf->buf = (char *) NS_MALLOC(size)) != NULL) { | |
| 292 | iobuf->size = size; | |
| 293 | } | |
| 294 | 294 | } |
| 295 | 295 | |
| 296 | 296 | void iobuf_free(struct iobuf *iobuf) { |
| 297 | if (iobuf != NULL) { | |
| 298 | if (iobuf->buf != NULL) NS_FREE(iobuf->buf); | |
| 299 | iobuf_init(iobuf, 0); | |
| 300 | } | |
| 297 | if (iobuf != NULL) { | |
| 298 | if (iobuf->buf != NULL) NS_FREE(iobuf->buf); | |
| 299 | iobuf_init(iobuf, 0); | |
| 300 | } | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | size_t iobuf_append(struct iobuf *io, const void *buf, size_t len) { |
| 304 | ||
| 304 | char *p = NULL; | |
| 305 | 305 | |
| 306 | assert(io != NULL); | |
| 307 | assert(io->len <= io->size); | |
| 306 | assert(io != NULL); | |
| 307 | assert(io->len <= io->size); | |
| 308 | 308 | |
| 309 | if (len <= 0) { | |
| 310 | } else if (io->len + len <= io->size) { | |
| 311 | memcpy(io->buf + io->len, buf, len); | |
| 312 | io->len += len; | |
| 313 | } else if ((p = (char *) NS_REALLOC(io->buf, io->len + len)) != NULL) { | |
| 314 | io->buf = p; | |
| 315 | memcpy(io->buf + io->len, buf, len); | |
| 316 | io->len += len; | |
| 317 | io->size = io->len; | |
| 318 | } else { | |
| 319 | len = 0; | |
| 320 | } | |
| 309 | if (len <= 0) { | |
| 310 | } else if (io->len + len <= io->size) { | |
| 311 | memcpy(io->buf + io->len, buf, len); | |
| 312 | io->len += len; | |
| 313 | } else if ((p = (char *) NS_REALLOC(io->buf, io->len + len)) != NULL) { | |
| 314 | io->buf = p; | |
| 315 | memcpy(io->buf + io->len, buf, len); | |
| 316 | io->len += len; | |
| 317 | io->size = io->len; | |
| 318 | } else { | |
| 319 | len = 0; | |
| 320 | } | |
| 321 | 321 | |
| 322 | ||
| 322 | return len; | |
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | void iobuf_remove(struct iobuf *io, size_t n) { |
| 326 | if (n > 0 && n <= io->len) { | |
| 327 | memmove(io->buf, io->buf + n, io->len - n); | |
| 328 | io->len -= n; | |
| 329 | } | |
| 326 | if (n > 0 && n <= io->len) { | |
| 327 | memmove(io->buf, io->buf + n, io->len - n); | |
| 328 | io->len -= n; | |
| 329 | } | |
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | #ifndef NS_DISABLE_THREADS |
| 333 | 333 | void *ns_start_thread(void *(*f)(void *), void *p) { |
| 334 | 334 | #ifdef _WIN32 |
| 335 | ||
| 335 | return (void *) _beginthread((void (__cdecl *)(void *)) f, 0, p); | |
| 336 | 336 | #else |
| 337 | pthread_t thread_id = (pthread_t) 0; | |
| 338 | pthread_attr_t attr; | |
| 337 | pthread_t thread_id = (pthread_t) 0; | |
| 338 | pthread_attr_t attr; | |
| 339 | 339 | |
| 340 | (void) pthread_attr_init(&attr); | |
| 341 | (void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); | |
| 340 | (void) pthread_attr_init(&attr); | |
| 341 | (void) pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED); | |
| 342 | 342 | |
| 343 | 343 | #if defined(NS_STACK_SIZE) && NS_STACK_SIZE > 1 |
| 344 | ||
| 344 | (void) pthread_attr_setstacksize(&attr, NS_STACK_SIZE); | |
| 345 | 345 | #endif |
| 346 | 346 | |
| 347 | pthread_create(&thread_id, &attr, f, p); | |
| 348 | pthread_attr_destroy(&attr); | |
| 347 | pthread_create(&thread_id, &attr, f, p); | |
| 348 | pthread_attr_destroy(&attr); | |
| 349 | 349 | |
| 350 | ||
| 350 | return (void *) thread_id; | |
| 351 | 351 | #endif |
| 352 | 352 | } |
| 353 | 353 | #endif // NS_DISABLE_THREADS |
| 354 | 354 | |
| 355 | 355 | static void ns_add_conn(struct ns_server *server, struct ns_connection *c) { |
| 356 | c->next = server->active_connections; | |
| 357 | server->active_connections = c; | |
| 358 | c->prev = NULL; | |
| 359 | if (c->next != NULL) c->next->prev = c; | |
| 356 | c->next = server->active_connections; | |
| 357 | server->active_connections = c; | |
| 358 | c->prev = NULL; | |
| 359 | if (c->next != NULL) c->next->prev = c; | |
| 360 | 360 | } |
| 361 | 361 | |
| 362 | 362 | static void ns_remove_conn(struct ns_connection *conn) { |
| 363 | if (conn->prev == NULL) conn->server->active_connections = conn->next; | |
| 364 | if (conn->prev) conn->prev->next = conn->next; | |
| 365 | if (conn->next) conn->next->prev = conn->prev; | |
| 363 | if (conn->prev == NULL) conn->server->active_connections = conn->next; | |
| 364 | if (conn->prev) conn->prev->next = conn->next; | |
| 365 | if (conn->next) conn->next->prev = conn->prev; | |
| 366 | 366 | } |
| 367 | 367 | |
| 368 | 368 | // Print message to buffer. If buffer is large enough to hold the message, |
| 369 | 369 | // return buffer. If buffer is to small, allocate large enough buffer on heap, |
| 370 | 370 | // and return allocated buffer. |
| 371 | 371 | static int ns_avprintf(char **buf, size_t size, const char *fmt, va_list ap) { |
| 372 | va_list ap_copy; | |
| 373 | int len; | |
| 372 | va_list ap_copy; | |
| 373 | int len; | |
| 374 | 374 | |
| 375 | va_copy(ap_copy, ap); | |
| 376 | len = vsnprintf(*buf, size, fmt, ap_copy); | |
| 377 | va_end(ap_copy); | |
| 375 | va_copy(ap_copy, ap); | |
| 376 | len = vsnprintf(*buf, size, fmt, ap_copy); | |
| 377 | va_end(ap_copy); | |
| 378 | 378 | |
| 379 | if (len < 0) { | |
| 380 | // eCos and Windows are not standard-compliant and return -1 when | |
| 381 | // the buffer is too small. Keep allocating larger buffers until we | |
| 382 | // succeed or out of memory. | |
| 383 | *buf = NULL; | |
| 384 | while (len < 0) { | |
| 385 | if (*buf) free(*buf); | |
| 386 | size *= 2; | |
| 387 | if ((*buf = (char *) NS_MALLOC(size)) == NULL) break; | |
| 388 | va_copy(ap_copy, ap); | |
| 389 | len = vsnprintf(*buf, size, fmt, ap_copy); | |
| 390 | va_end(ap_copy); | |
| 391 | } | |
| 392 | } else if (len > (int) size) { | |
| 393 | // Standard-compliant code path. Allocate a buffer that is large enough. | |
| 394 | if ((*buf = (char *) NS_MALLOC(len + 1)) == NULL) { | |
| 395 | len = -1; | |
| 396 | } else { | |
| 397 | va_copy(ap_copy, ap); | |
| 398 | len = vsnprintf(*buf, len + 1, fmt, ap_copy); | |
| 399 | va_end(ap_copy); | |
| 400 | } | |
| 401 | } | |
| 379 | if (len < 0) { | |
| 380 | // eCos and Windows are not standard-compliant and return -1 when | |
| 381 | // the buffer is too small. Keep allocating larger buffers until we | |
| 382 | // succeed or out of memory. | |
| 383 | *buf = NULL; | |
| 384 | while (len < 0) { | |
| 385 | if (*buf) free(*buf); | |
| 386 | size *= 2; | |
| 387 | if ((*buf = (char *) NS_MALLOC(size)) == NULL) break; | |
| 388 | va_copy(ap_copy, ap); | |
| 389 | len = vsnprintf(*buf, size, fmt, ap_copy); | |
| 390 | va_end(ap_copy); | |
| 391 | } | |
| 392 | } else if (len > (int) size) { | |
| 393 | // Standard-compliant code path. Allocate a buffer that is large enough. | |
| 394 | if ((*buf = (char *) NS_MALLOC(len + 1)) == NULL) { | |
| 395 | len = -1; | |
| 396 | } else { | |
| 397 | va_copy(ap_copy, ap); | |
| 398 | len = vsnprintf(*buf, len + 1, fmt, ap_copy); | |
| 399 | va_end(ap_copy); | |
| 400 | } | |
| 401 | } | |
| 402 | 402 | |
| 403 | ||
| 403 | return len; | |
| 404 | 404 | } |
| 405 | 405 | |
| 406 | 406 | int ns_vprintf(struct ns_connection *conn, const char *fmt, va_list ap) { |
| 407 | char mem[2000], *buf = mem; | |
| 408 | int len; | |
| 407 | char mem[2000], *buf = mem; | |
| 408 | int len; | |
| 409 | 409 | |
| 410 | if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) { | |
| 411 | iobuf_append(&conn->send_iobuf, buf, len); | |
| 412 | } | |
| 413 | if (buf != mem && buf != NULL) { | |
| 414 | free(buf); | |
| 415 | } | |
| 410 | if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) { | |
| 411 | iobuf_append(&conn->send_iobuf, buf, len); | |
| 412 | } | |
| 413 | if (buf != mem && buf != NULL) { | |
| 414 | free(buf); | |
| 415 | } | |
| 416 | 416 | |
| 417 | ||
| 417 | return len; | |
| 418 | 418 | } |
| 419 | 419 | |
| 420 | 420 | int ns_printf(struct ns_connection *conn, const char *fmt, ...) { |
| 421 | int len; | |
| 422 | va_list ap; | |
| 423 | va_start(ap, fmt); | |
| 424 | len = ns_vprintf(conn, fmt, ap); | |
| 425 | va_end(ap); | |
| 426 | return len; | |
| 421 | int len; | |
| 422 | va_list ap; | |
| 423 | va_start(ap, fmt); | |
| 424 | len = ns_vprintf(conn, fmt, ap); | |
| 425 | va_end(ap); | |
| 426 | return len; | |
| 427 | 427 | } |
| 428 | 428 | |
| 429 | 429 | static void ns_call(struct ns_connection *conn, enum ns_event ev, void *p) { |
| 430 | ||
| 430 | if (conn->server->callback) conn->server->callback(conn, ev, p); | |
| 431 | 431 | } |
| 432 | 432 | |
| 433 | 433 | static void ns_close_conn(struct ns_connection *conn) { |
| 434 | DBG(("%p %d", conn, conn->flags)); | |
| 435 | ns_call(conn, NS_CLOSE, NULL); | |
| 436 | ns_remove_conn(conn); | |
| 437 | closesocket(conn->sock); | |
| 438 | iobuf_free(&conn->recv_iobuf); | |
| 439 | iobuf_free(&conn->send_iobuf); | |
| 434 | DBG(("%p %d", conn, conn->flags)); | |
| 435 | ns_call(conn, NS_CLOSE, NULL); | |
| 436 | ns_remove_conn(conn); | |
| 437 | closesocket(conn->sock); | |
| 438 | iobuf_free(&conn->recv_iobuf); | |
| 439 | iobuf_free(&conn->send_iobuf); | |
| 440 | 440 | #ifdef NS_ENABLE_SSL |
| 441 | if (conn->ssl != NULL) { | |
| 442 | SSL_free(conn->ssl); | |
| 443 | } | |
| 441 | if (conn->ssl != NULL) { | |
| 442 | SSL_free(conn->ssl); | |
| 443 | } | |
| 444 | 444 | #endif |
| 445 | ||
| 445 | NS_FREE(conn); | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | void ns_set_close_on_exec(sock_t sock) { |
| 449 | 449 | #ifdef _WIN32 |
| 450 | ||
| 450 | (void) SetHandleInformation((HANDLE) sock, HANDLE_FLAG_INHERIT, 0); | |
| 451 | 451 | #else |
| 452 | ||
| 452 | fcntl(sock, F_SETFD, FD_CLOEXEC); | |
| 453 | 453 | #endif |
| 454 | 454 | } |
| 455 | 455 | |
| 456 | 456 | static void ns_set_non_blocking_mode(sock_t sock) { |
| 457 | 457 | #ifdef _WIN32 |
| 458 | unsigned long on = 1; | |
| 459 | ioctlsocket(sock, FIONBIO, &on); | |
| 458 | unsigned long on = 1; | |
| 459 | ioctlsocket(sock, FIONBIO, &on); | |
| 460 | 460 | #else |
| 461 | int flags = fcntl(sock, F_GETFL, 0); | |
| 462 | fcntl(sock, F_SETFL, flags | O_NONBLOCK); | |
| 461 | int flags = fcntl(sock, F_GETFL, 0); | |
| 462 | fcntl(sock, F_SETFL, flags | O_NONBLOCK); | |
| 463 | 463 | #endif |
| 464 | 464 | } |
| 465 | 465 | |
| 466 | 466 | #ifndef NS_DISABLE_SOCKETPAIR |
| 467 | 467 | int ns_socketpair2(sock_t sp[2], int sock_type) { |
| 468 | union socket_address sa; | |
| 469 | sock_t sock; | |
| 470 | socklen_t len = sizeof(sa.sin); | |
| 471 | int ret = 0; | |
| 468 | union socket_address sa; | |
| 469 | sock_t sock; | |
| 470 | socklen_t len = sizeof(sa.sin); | |
| 471 | int ret = 0; | |
| 472 | 472 | |
| 473 | ||
| 473 | sp[0] = sp[1] = INVALID_SOCKET; | |
| 474 | 474 | |
| 475 | (void) memset(&sa, 0, sizeof(sa)); | |
| 476 | sa.sin.sin_family = AF_INET; | |
| 477 | sa.sin.sin_port = htons(0); | |
| 478 | sa.sin.sin_addr.s_addr = htonl(0x7f000001); | |
| 475 | (void) memset(&sa, 0, sizeof(sa)); | |
| 476 | sa.sin.sin_family = AF_INET; | |
| 477 | sa.sin.sin_port = htons(0); | |
| 478 | sa.sin.sin_addr.s_addr = htonl(0x7f000001); | |
| 479 | 479 | |
| 480 | if ((sock = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET && | |
| 481 | !bind(sock, &sa.sa, len) && | |
| 482 | (sock_type == SOCK_DGRAM || !listen(sock, 1)) && | |
| 483 | !getsockname(sock, &sa.sa, &len) && | |
| 484 | (sp[0] = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET && | |
| 485 | !connect(sp[0], &sa.sa, len) && | |
| 486 | (sock_type == SOCK_STREAM || | |
| 487 | (!getsockname(sp[0], &sa.sa, &len) && !connect(sock, &sa.sa, len))) && | |
| 488 | (sp[1] = (sock_type == SOCK_DGRAM ? sock : | |
| 489 | accept(sock, &sa.sa, &len))) != INVALID_SOCKET) { | |
| 490 | ns_set_close_on_exec(sp[0]); | |
| 491 | ns_set_close_on_exec(sp[1]); | |
| 492 | ret = 1; | |
| 493 | } else { | |
| 494 | if (sp[0] != INVALID_SOCKET) closesocket(sp[0]); | |
| 495 | if (sp[1] != INVALID_SOCKET) closesocket(sp[1]); | |
| 496 | sp[0] = sp[1] = INVALID_SOCKET; | |
| 497 | } | |
| 498 | if (sock_type != SOCK_DGRAM) closesocket(sock); | |
| 480 | if ((sock = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET && | |
| 481 | !bind(sock, &sa.sa, len) && | |
| 482 | (sock_type == SOCK_DGRAM || !listen(sock, 1)) && | |
| 483 | !getsockname(sock, &sa.sa, &len) && | |
| 484 | (sp[0] = socket(AF_INET, sock_type, 0)) != INVALID_SOCKET && | |
| 485 | !connect(sp[0], &sa.sa, len) && | |
| 486 | (sock_type == SOCK_STREAM || | |
| 487 | (!getsockname(sp[0], &sa.sa, &len) && !connect(sock, &sa.sa, len))) && | |
| 488 | (sp[1] = (sock_type == SOCK_DGRAM ? sock : | |
| 489 | accept(sock, &sa.sa, &len))) != INVALID_SOCKET) { | |
| 490 | ns_set_close_on_exec(sp[0]); | |
| 491 | ns_set_close_on_exec(sp[1]); | |
| 492 | ret = 1; | |
| 493 | } else { | |
| 494 | if (sp[0] != INVALID_SOCKET) closesocket(sp[0]); | |
| 495 | if (sp[1] != INVALID_SOCKET) closesocket(sp[1]); | |
| 496 | sp[0] = sp[1] = INVALID_SOCKET; | |
| 497 | } | |
| 498 | if (sock_type != SOCK_DGRAM) closesocket(sock); | |
| 499 | 499 | |
| 500 | ||
| 500 | return ret; | |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | int ns_socketpair(sock_t sp[2]) { |
| 504 | ||
| 504 | return ns_socketpair2(sp, SOCK_STREAM); | |
| 505 | 505 | } |
| 506 | 506 | #endif // NS_DISABLE_SOCKETPAIR |
| 507 | 507 | |
| 508 | 508 | // Valid listening port spec is: [ip_address:]port, e.g. "80", "127.0.0.1:3128" |
| 509 | 509 | static int ns_parse_port_string(const char *str, union socket_address *sa) { |
| 510 | unsigned int a, b, c, d, port; | |
| 511 | int len = 0; | |
| 510 | unsigned int a, b, c, d, port; | |
| 511 | int len = 0; | |
| 512 | 512 | #ifdef NS_ENABLE_IPV6 |
| 513 | ||
| 513 | char buf[100]; | |
| 514 | 514 | #endif |
| 515 | 515 | |
| 516 | // MacOS needs that. If we do not zero it, subsequent bind() will fail. | |
| 517 | // Also, all-zeroes in the socket address means binding to all addresses | |
| 518 | // for both IPv4 and IPv6 (INADDR_ANY and IN6ADDR_ANY_INIT). | |
| 519 | memset(sa, 0, sizeof(*sa)); | |
| 520 | sa->sin.sin_family = AF_INET; | |
| 516 | // MacOS needs that. If we do not zero it, subsequent bind() will fail. | |
| 517 | // Also, all-zeroes in the socket address means binding to all addresses | |
| 518 | // for both IPv4 and IPv6 (INADDR_ANY and IN6ADDR_ANY_INIT). | |
| 519 | memset(sa, 0, sizeof(*sa)); | |
| 520 | sa->sin.sin_family = AF_INET; | |
| 521 | 521 | |
| 522 | if (sscanf(str, "%u.%u.%u.%u:%u%n", &a, &b, &c, &d, &port, &len) == 5) { | |
| 523 | // Bind to a specific IPv4 address, e.g. 192.168.1.5:8080 | |
| 524 | sa->sin.sin_addr.s_addr = htonl((a << 24) | (b << 16) | (c << 8) | d); | |
| 525 | sa->sin.sin_port = htons((uint16_t) port); | |
| 522 | if (sscanf(str, "%u.%u.%u.%u:%u%n", &a, &b, &c, &d, &port, &len) == 5) { | |
| 523 | // Bind to a specific IPv4 address, e.g. 192.168.1.5:8080 | |
| 524 | sa->sin.sin_addr.s_addr = htonl((a << 24) | (b << 16) | (c << 8) | d); | |
| 525 | sa->sin.sin_port = htons((uint16_t) port); | |
| 526 | 526 | #ifdef NS_ENABLE_IPV6 |
| 527 | } else if (sscanf(str, "[%49[^]]]:%u%n", buf, &port, &len) == 2 && | |
| 528 | inet_pton(AF_INET6, buf, &sa->sin6.sin6_addr)) { | |
| 529 | // IPv6 address, e.g. [3ffe:2a00:100:7031::1]:8080 | |
| 530 | sa->sin6.sin6_family = AF_INET6; | |
| 531 | sa->sin6.sin6_port = htons((uint16_t) port); | |
| 527 | } else if (sscanf(str, "[%49[^]]]:%u%n", buf, &port, &len) == 2 && | |
| 528 | inet_pton(AF_INET6, buf, &sa->sin6.sin6_addr)) { | |
| 529 | // IPv6 address, e.g. [3ffe:2a00:100:7031::1]:8080 | |
| 530 | sa->sin6.sin6_family = AF_INET6; | |
| 531 | sa->sin6.sin6_port = htons((uint16_t) port); | |
| 532 | 532 | #endif |
| 533 | } else if (sscanf(str, "%u%n", &port, &len) == 1) { | |
| 534 | // If only port is specified, bind to IPv4, INADDR_ANY | |
| 535 | sa->sin.sin_port = htons((uint16_t) port); | |
| 536 | } else { | |
| 537 | port = 0; // Parsing failure. Make port invalid. | |
| 538 | } | |
| 533 | } else if (sscanf(str, "%u%n", &port, &len) == 1) { | |
| 534 | // If only port is specified, bind to IPv4, INADDR_ANY | |
| 535 | sa->sin.sin_port = htons((uint16_t) port); | |
| 536 | } else { | |
| 537 | port = 0; // Parsing failure. Make port invalid. | |
| 538 | } | |
| 539 | 539 | |
| 540 | ||
| 540 | return port <= 0xffff && str[len] == '\0'; | |
| 541 | 541 | } |
| 542 | 542 | |
| 543 | 543 | // 'sa' must be an initialized address to bind to |
| 544 | 544 | static sock_t ns_open_listening_socket(union socket_address *sa) { |
| 545 | socklen_t len = sizeof(*sa); | |
| 546 | sock_t sock = INVALID_SOCKET; | |
| 545 | socklen_t len = sizeof(*sa); | |
| 546 | sock_t sock = INVALID_SOCKET; | |
| 547 | 547 | #ifndef _WIN32 |
| 548 | ||
| 548 | int on = 1; | |
| 549 | 549 | #endif |
| 550 | 550 | |
| 551 | ||
| 551 | if ((sock = socket(sa->sa.sa_family, SOCK_STREAM, 6)) != INVALID_SOCKET && | |
| 552 | 552 | #ifndef _WIN32 |
| 553 | // SO_RESUSEADDR is not enabled on Windows because the semantics of | |
| 554 | // SO_REUSEADDR on UNIX and Windows is different. On Windows, | |
| 555 | // SO_REUSEADDR allows to bind a socket to a port without error even if | |
| 556 | // the port is already open by another program. This is not the behavior | |
| 557 | // SO_REUSEADDR was designed for, and leads to hard-to-track failure | |
| 558 | // scenarios. Therefore, SO_REUSEADDR was disabled on Windows. | |
| 559 | !setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) && | |
| 553 | // SO_RESUSEADDR is not enabled on Windows because the semantics of | |
| 554 | // SO_REUSEADDR on UNIX and Windows is different. On Windows, | |
| 555 | // SO_REUSEADDR allows to bind a socket to a port without error even if | |
| 556 | // the port is already open by another program. This is not the behavior | |
| 557 | // SO_REUSEADDR was designed for, and leads to hard-to-track failure | |
| 558 | // scenarios. Therefore, SO_REUSEADDR was disabled on Windows. | |
| 559 | !setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (void *) &on, sizeof(on)) && | |
| 560 | 560 | #endif |
| 561 | !bind(sock, &sa->sa, sa->sa.sa_family == AF_INET ? | |
| 562 | sizeof(sa->sin) : sizeof(sa->sin6)) && | |
| 563 | !listen(sock, SOMAXCONN)) { | |
| 564 | ns_set_non_blocking_mode(sock); | |
| 565 | // In case port was set to 0, get the real port number | |
| 566 | (void) getsockname(sock, &sa->sa, &len); | |
| 567 | } else if (sock != INVALID_SOCKET) { | |
| 568 | closesocket(sock); | |
| 569 | sock = INVALID_SOCKET; | |
| 570 | } | |
| 561 | !bind(sock, &sa->sa, sa->sa.sa_family == AF_INET ? | |
| 562 | sizeof(sa->sin) : sizeof(sa->sin6)) && | |
| 563 | !listen(sock, SOMAXCONN)) { | |
| 564 | ns_set_non_blocking_mode(sock); | |
| 565 | // In case port was set to 0, get the real port number | |
| 566 | (void) getsockname(sock, &sa->sa, &len); | |
| 567 | } else if (sock != INVALID_SOCKET) { | |
| 568 | closesocket(sock); | |
| 569 | sock = INVALID_SOCKET; | |
| 570 | } | |
| 571 | 571 | |
| 572 | ||
| 572 | return sock; | |
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | // Certificate generation script is at |
| 576 | 576 | // https://github.com/cesanta/net_skeleton/blob/master/examples/gen_certs.sh |
| 577 | 577 | int ns_set_ssl_ca_cert(struct ns_server *server, const char *cert) { |
| 578 | 578 | #ifdef NS_ENABLE_SSL |
| 579 | STACK_OF(X509_NAME) *list = SSL_load_client_CA_file(cert); | |
| 580 | if (cert != NULL && server->ssl_ctx != NULL && list != NULL) { | |
| 581 | SSL_CTX_set_client_CA_list(server->ssl_ctx, list); | |
| 582 | SSL_CTX_set_verify(server->ssl_ctx, SSL_VERIFY_PEER | | |
| 583 | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); | |
| 584 | return 0; | |
| 585 | } | |
| 579 | STACK_OF(X509_NAME) *list = SSL_load_client_CA_file(cert); | |
| 580 | if (cert != NULL && server->ssl_ctx != NULL && list != NULL) { | |
| 581 | SSL_CTX_set_client_CA_list(server->ssl_ctx, list); | |
| 582 | SSL_CTX_set_verify(server->ssl_ctx, SSL_VERIFY_PEER | | |
| 583 | SSL_VERIFY_FAIL_IF_NO_PEER_CERT, NULL); | |
| 584 | return 0; | |
| 585 | } | |
| 586 | 586 | #endif |
| 587 | ||
| 587 | return server != NULL && cert == NULL ? 0 : -1; | |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | 590 | int ns_set_ssl_cert(struct ns_server *server, const char *cert) { |
| 591 | 591 | #ifdef NS_ENABLE_SSL |
| 592 | if (cert != NULL && | |
| 593 | (server->ssl_ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) { | |
| 594 | return -1; | |
| 595 | } else if (SSL_CTX_use_certificate_file(server->ssl_ctx, cert, 1) == 0 || | |
| 596 | SSL_CTX_use_PrivateKey_file(server->ssl_ctx, cert, 1) == 0) { | |
| 597 | return -2; | |
| 598 | } else { | |
| 599 | SSL_CTX_use_certificate_chain_file(server->ssl_ctx, cert); | |
| 600 | return 0; | |
| 601 | } | |
| 592 | if (cert != NULL && | |
| 593 | (server->ssl_ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) { | |
| 594 | return -1; | |
| 595 | } else if (SSL_CTX_use_certificate_file(server->ssl_ctx, cert, 1) == 0 || | |
| 596 | SSL_CTX_use_PrivateKey_file(server->ssl_ctx, cert, 1) == 0) { | |
| 597 | return -2; | |
| 598 | } else { | |
| 599 | SSL_CTX_use_certificate_chain_file(server->ssl_ctx, cert); | |
| 600 | return 0; | |
| 601 | } | |
| 602 | 602 | #endif |
| 603 | ||
| 603 | return server != NULL && cert == NULL ? 0 : -3; | |
| 604 | 604 | } |
| 605 | 605 | |
| 606 | 606 | int ns_bind(struct ns_server *server, const char *str) { |
| 607 | union socket_address sa; | |
| 608 | ns_parse_port_string(str, &sa); | |
| 609 | if (server->listening_sock != INVALID_SOCKET) { | |
| 610 | closesocket(server->listening_sock); | |
| 611 | } | |
| 612 | server->listening_sock = ns_open_listening_socket(&sa); | |
| 613 | return server->listening_sock == INVALID_SOCKET ? -1 : | |
| 614 | (int) ntohs(sa.sin.sin_port); | |
| 607 | union socket_address sa; | |
| 608 | ns_parse_port_string(str, &sa); | |
| 609 | if (server->listening_sock != INVALID_SOCKET) { | |
| 610 | closesocket(server->listening_sock); | |
| 611 | } | |
| 612 | server->listening_sock = ns_open_listening_socket(&sa); | |
| 613 | return server->listening_sock == INVALID_SOCKET ? -1 : | |
| 614 | (int) ntohs(sa.sin.sin_port); | |
| 615 | 615 | } |
| 616 | 616 | |
| 617 | 617 | |
| 618 | 618 | static struct ns_connection *accept_conn(struct ns_server *server) { |
| 619 | struct ns_connection *c = NULL; | |
| 620 | union socket_address sa; | |
| 621 | socklen_t len = sizeof(sa); | |
| 622 | sock_t sock = INVALID_SOCKET; | |
| 619 | struct ns_connection *c = NULL; | |
| 620 | union socket_address sa; | |
| 621 | socklen_t len = sizeof(sa); | |
| 622 | sock_t sock = INVALID_SOCKET; | |
| 623 | 623 | |
| 624 | // NOTE(lsm): on Windows, sock is always > FD_SETSIZE | |
| 625 | if ((sock = accept(server->listening_sock, &sa.sa, &len)) == INVALID_SOCKET) { | |
| 626 | } else if ((c = (struct ns_connection *) NS_MALLOC(sizeof(*c))) == NULL || | |
| 627 | memset(c, 0, sizeof(*c)) == NULL) { | |
| 628 | closesocket(sock); | |
| 624 | // NOTE(lsm): on Windows, sock is always > FD_SETSIZE | |
| 625 | if ((sock = accept(server->listening_sock, &sa.sa, &len)) == INVALID_SOCKET) { | |
| 626 | } else if ((c = (struct ns_connection *) NS_MALLOC(sizeof(*c))) == NULL || | |
| 627 | memset(c, 0, sizeof(*c)) == NULL) { | |
| 628 | closesocket(sock); | |
| 629 | 629 | #ifdef NS_ENABLE_SSL |
| 630 | } else if (server->ssl_ctx != NULL && | |
| 631 | ((c->ssl = SSL_new(server->ssl_ctx)) == NULL || | |
| 632 | SSL_set_fd(c->ssl, sock) != 1)) { | |
| 633 | DBG(("SSL error")); | |
| 634 | closesocket(sock); | |
| 635 | free(c); | |
| 636 | c = NULL; | |
| 630 | } else if (server->ssl_ctx != NULL && | |
| 631 | ((c->ssl = SSL_new(server->ssl_ctx)) == NULL || | |
| 632 | SSL_set_fd(c->ssl, sock) != 1)) { | |
| 633 | DBG(("SSL error")); | |
| 634 | closesocket(sock); | |
| 635 | free(c); | |
| 636 | c = NULL; | |
| 637 | 637 | #endif |
| 638 | } else { | |
| 639 | ns_set_close_on_exec(sock); | |
| 640 | ns_set_non_blocking_mode(sock); | |
| 641 | c->server = server; | |
| 642 | c->sock = sock; | |
| 643 | c->flags |= NSF_ACCEPTED; | |
| 638 | } else { | |
| 639 | ns_set_close_on_exec(sock); | |
| 640 | ns_set_non_blocking_mode(sock); | |
| 641 | c->server = server; | |
| 642 | c->sock = sock; | |
| 643 | c->flags |= NSF_ACCEPTED; | |
| 644 | 644 | |
| 645 | ns_add_conn(server, c); | |
| 646 | ns_call(c, NS_ACCEPT, &sa); | |
| 647 | DBG(("%p %d %p %p", c, c->sock, c->ssl, server->ssl_ctx)); | |
| 648 | } | |
| 645 | ns_add_conn(server, c); | |
| 646 | ns_call(c, NS_ACCEPT, &sa); | |
| 647 | DBG(("%p %d %p %p", c, c->sock, c->ssl, server->ssl_ctx)); | |
| 648 | } | |
| 649 | 649 | |
| 650 | ||
| 650 | return c; | |
| 651 | 651 | } |
| 652 | 652 | |
| 653 | 653 | static int ns_is_error(int n) { |
| 654 | return n == 0 || | |
| 655 | (n < 0 && errno != EINTR && errno != EINPROGRESS && | |
| 656 | errno != EAGAIN && errno != EWOULDBLOCK | |
| 654 | return n == 0 || | |
| 655 | (n < 0 && errno != EINTR && errno != EINPROGRESS && | |
| 656 | errno != EAGAIN && errno != EWOULDBLOCK | |
| 657 | 657 | #ifdef _WIN32 |
| 658 | ||
| 658 | && WSAGetLastError() != WSAEINTR && WSAGetLastError() != WSAEWOULDBLOCK | |
| 659 | 659 | #endif |
| 660 | ||
| 660 | ); | |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | void ns_sock_to_str(sock_t sock, char *buf, size_t len, int flags) { |
| 664 | union socket_address sa; | |
| 665 | socklen_t slen = sizeof(sa); | |
| 664 | union socket_address sa; | |
| 665 | socklen_t slen = sizeof(sa); | |
| 666 | 666 | |
| 667 | if (buf != NULL && len > 0) { | |
| 668 | buf[0] = '\0'; | |
| 669 | memset(&sa, 0, sizeof(sa)); | |
| 670 | if (flags & 4) { | |
| 671 | getpeername(sock, &sa.sa, &slen); | |
| 672 | } else { | |
| 673 | getsockname(sock, &sa.sa, &slen); | |
| 674 | } | |
| 675 | if (flags & 1) { | |
| 667 | if (buf != NULL && len > 0) { | |
| 668 | buf[0] = '\0'; | |
| 669 | memset(&sa, 0, sizeof(sa)); | |
| 670 | if (flags & 4) { | |
| 671 | getpeername(sock, &sa.sa, &slen); | |
| 672 | } else { | |
| 673 | getsockname(sock, &sa.sa, &slen); | |
| 674 | } | |
| 675 | if (flags & 1) { | |
| 676 | 676 | #if defined(NS_ENABLE_IPV6) |
| 677 | inet_ntop(sa.sa.sa_family, sa.sa.sa_family == AF_INET ? | |
| 678 | (void *) &sa.sin.sin_addr : | |
| 679 | (void *) &sa.sin6.sin6_addr, buf, len); | |
| 677 | inet_ntop(sa.sa.sa_family, sa.sa.sa_family == AF_INET ? | |
| 678 | (void *) &sa.sin.sin_addr : | |
| 679 | (void *) &sa.sin6.sin6_addr, buf, len); | |
| 680 | 680 | #elif defined(_WIN32) |
| 681 | // Only Windoze Vista (and newer) have inet_ntop() | |
| 682 | strncpy(buf, inet_ntoa(sa.sin.sin_addr), len); | |
| 681 | // Only Windoze Vista (and newer) have inet_ntop() | |
| 682 | strncpy(buf, inet_ntoa(sa.sin.sin_addr), len); | |
| 683 | 683 | #else |
| 684 | ||
| 684 | inet_ntop(sa.sa.sa_family, (void *) &sa.sin.sin_addr, buf, len); | |
| 685 | 685 | #endif |
| 686 | } | |
| 687 | if (flags & 2) { | |
| 688 | snprintf(buf + strlen(buf), len - (strlen(buf) + 1), "%s%d", | |
| 689 | flags & 1 ? ":" : "", (int) ntohs(sa.sin.sin_port)); | |
| 690 | } | |
| 691 | } | |
| 686 | } | |
| 687 | if (flags & 2) { | |
| 688 | snprintf(buf + strlen(buf), len - (strlen(buf) + 1), "%s%d", | |
| 689 | flags & 1 ? ":" : "", (int) ntohs(sa.sin.sin_port)); | |
| 690 | } | |
| 691 | } | |
| 692 | 692 | } |
| 693 | 693 | |
| 694 | 694 | int ns_hexdump(const void *buf, int len, char *dst, int dst_len) { |
| 695 | const unsigned char *p = (const unsigned char *) buf; | |
| 696 | char ascii[17] = ""; | |
| 697 | int i, idx, n = 0; | |
| 695 | const unsigned char *p = (const unsigned char *) buf; | |
| 696 | char ascii[17] = ""; | |
| 697 | int i, idx, n = 0; | |
| 698 | 698 | |
| 699 | for (i = 0; i < len; i++) { | |
| 700 | idx = i % 16; | |
| 701 | if (idx == 0) { | |
| 702 | if (i > 0) n += snprintf(dst + n, dst_len - n, " %s\n", ascii); | |
| 703 | n += snprintf(dst + n, dst_len - n, "%04x ", i); | |
| 704 | } | |
| 705 | n += snprintf(dst + n, dst_len - n, " %02x", p[i]); | |
| 706 | ascii[idx] = p[i] < 0x20 || p[i] > 0x7e ? '.' : p[i]; | |
| 707 | ascii[idx + 1] = '\0'; | |
| 708 | } | |
| 699 | for (i = 0; i < len; i++) { | |
| 700 | idx = i % 16; | |
| 701 | if (idx == 0) { | |
| 702 | if (i > 0) n += snprintf(dst + n, dst_len - n, " %s\n", ascii); | |
| 703 | n += snprintf(dst + n, dst_len - n, "%04x ", i); | |
| 704 | } | |
| 705 | n += snprintf(dst + n, dst_len - n, " %02x", p[i]); | |
| 706 | ascii[idx] = p[i] < 0x20 || p[i] > 0x7e ? '.' : p[i]; | |
| 707 | ascii[idx + 1] = '\0'; | |
| 708 | } | |
| 709 | 709 | |
| 710 | while (i++ % 16) n += snprintf(dst + n, dst_len - n, "%s", " "); | |
| 711 | n += snprintf(dst + n, dst_len - n, " %s\n\n", ascii); | |
| 710 | while (i++ % 16) n += snprintf(dst + n, dst_len - n, "%s", " "); | |
| 711 | n += snprintf(dst + n, dst_len - n, " %s\n\n", ascii); | |
| 712 | 712 | |
| 713 | ||
| 713 | return n; | |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | 716 | static void ns_read_from_socket(struct ns_connection *conn) { |
| 717 | char buf[2048]; | |
| 718 | int n = 0; | |
| 717 | char buf[2048]; | |
| 718 | int n = 0; | |
| 719 | 719 | |
| 720 | if (conn->flags & NSF_CONNECTING) { | |
| 721 | int ok = 1, ret; | |
| 722 | socklen_t len = sizeof(ok); | |
| 720 | if (conn->flags & NSF_CONNECTING) { | |
| 721 | int ok = 1, ret; | |
| 722 | socklen_t len = sizeof(ok); | |
| 723 | 723 | |
| 724 | ret = getsockopt(conn->sock, SOL_SOCKET, SO_ERROR, (char *) &ok, &len); | |
| 725 | (void) ret; | |
| 724 | ret = getsockopt(conn->sock, SOL_SOCKET, SO_ERROR, (char *) &ok, &len); | |
| 725 | (void) ret; | |
| 726 | 726 | #ifdef NS_ENABLE_SSL |
| 727 | if (ret == 0 && ok == 0 && conn->ssl != NULL) { | |
| 728 | int res = SSL_connect(conn->ssl); | |
| 729 | int ssl_err = SSL_get_error(conn->ssl, res); | |
| 730 | DBG(("%p %d wres %d %d", conn, conn->flags, res, ssl_err)); | |
| 731 | if (ssl_err == SSL_ERROR_WANT_READ) conn->flags |= NSF_WANT_READ; | |
| 732 | if (ssl_err == SSL_ERROR_WANT_WRITE) conn->flags |= NSF_WANT_WRITE; | |
| 733 | if (res == 1) { | |
| 734 | conn->flags |= NSF_SSL_HANDSHAKE_DONE; | |
| 735 | } else if (ssl_err == SSL_ERROR_WANT_READ || | |
| 736 | ssl_err == SSL_ERROR_WANT_WRITE) { | |
| 737 | return; // Call us again | |
| 738 | } else { | |
| 739 | ok = 1; | |
| 740 | } | |
| 741 | } | |
| 727 | if (ret == 0 && ok == 0 && conn->ssl != NULL) { | |
| 728 | int res = SSL_connect(conn->ssl); | |
| 729 | int ssl_err = SSL_get_error(conn->ssl, res); | |
| 730 | DBG(("%p %d wres %d %d", conn, conn->flags, res, ssl_err)); | |
| 731 | if (ssl_err == SSL_ERROR_WANT_READ) conn->flags |= NSF_WANT_READ; | |
| 732 | if (ssl_err == SSL_ERROR_WANT_WRITE) conn->flags |= NSF_WANT_WRITE; | |
| 733 | if (res == 1) { | |
| 734 | conn->flags |= NSF_SSL_HANDSHAKE_DONE; | |
| 735 | } else if (ssl_err == SSL_ERROR_WANT_READ || | |
| 736 | ssl_err == SSL_ERROR_WANT_WRITE) { | |
| 737 | return; // Call us again | |
| 738 | } else { | |
| 739 | ok = 1; | |
| 740 | } | |
| 741 | } | |
| 742 | 742 | #endif |
| 743 | conn->flags &= ~NSF_CONNECTING; | |
| 744 | DBG(("%p ok=%d", conn, ok)); | |
| 745 | if (ok != 0) { | |
| 746 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 747 | } | |
| 748 | ns_call(conn, NS_CONNECT, &ok); | |
| 749 | return; | |
| 750 | } | |
| 743 | conn->flags &= ~NSF_CONNECTING; | |
| 744 | DBG(("%p ok=%d", conn, ok)); | |
| 745 | if (ok != 0) { | |
| 746 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 747 | } | |
| 748 | ns_call(conn, NS_CONNECT, &ok); | |
| 749 | return; | |
| 750 | } | |
| 751 | 751 | |
| 752 | 752 | #ifdef NS_ENABLE_SSL |
| 753 | if (conn->ssl != NULL) { | |
| 754 | if (conn->flags & NSF_SSL_HANDSHAKE_DONE) { | |
| 755 | n = SSL_read(conn->ssl, buf, sizeof(buf)); | |
| 756 | } else { | |
| 757 | int res = SSL_accept(conn->ssl); | |
| 758 | int ssl_err = SSL_get_error(conn->ssl, res); | |
| 759 | DBG(("%p %d rres %d %d", conn, conn->flags, res, ssl_err)); | |
| 760 | if (ssl_err == SSL_ERROR_WANT_READ) conn->flags |= NSF_WANT_READ; | |
| 761 | if (ssl_err == SSL_ERROR_WANT_WRITE) conn->flags |= NSF_WANT_WRITE; | |
| 762 | if (res == 1) { | |
| 763 | conn->flags |= NSF_SSL_HANDSHAKE_DONE; | |
| 764 | } else if (ssl_err == SSL_ERROR_WANT_READ || | |
| 765 | ssl_err == SSL_ERROR_WANT_WRITE) { | |
| 766 | return; // Call us again | |
| 767 | } else { | |
| 768 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 769 | } | |
| 770 | return; | |
| 771 | } | |
| 772 | } else | |
| 753 | if (conn->ssl != NULL) { | |
| 754 | if (conn->flags & NSF_SSL_HANDSHAKE_DONE) { | |
| 755 | n = SSL_read(conn->ssl, buf, sizeof(buf)); | |
| 756 | } else { | |
| 757 | int res = SSL_accept(conn->ssl); | |
| 758 | int ssl_err = SSL_get_error(conn->ssl, res); | |
| 759 | DBG(("%p %d rres %d %d", conn, conn->flags, res, ssl_err)); | |
| 760 | if (ssl_err == SSL_ERROR_WANT_READ) conn->flags |= NSF_WANT_READ; | |
| 761 | if (ssl_err == SSL_ERROR_WANT_WRITE) conn->flags |= NSF_WANT_WRITE; | |
| 762 | if (res == 1) { | |
| 763 | conn->flags |= NSF_SSL_HANDSHAKE_DONE; | |
| 764 | } else if (ssl_err == SSL_ERROR_WANT_READ || | |
| 765 | ssl_err == SSL_ERROR_WANT_WRITE) { | |
| 766 | return; // Call us again | |
| 767 | } else { | |
| 768 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 769 | } | |
| 770 | return; | |
| 771 | } | |
| 772 | } else | |
| 773 | 773 | #endif |
| 774 | { | |
| 775 | n = recv(conn->sock, buf, sizeof(buf), 0); | |
| 776 | } | |
| 774 | { | |
| 775 | n = recv(conn->sock, buf, sizeof(buf), 0); | |
| 776 | } | |
| 777 | 777 | |
| 778 | ||
| 778 | DBG(("%p %d <- %d bytes", conn, conn->flags, n)); | |
| 779 | 779 | |
| 780 | if (ns_is_error(n)) { | |
| 781 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 782 | } else if (n > 0) { | |
| 783 | iobuf_append(&conn->recv_iobuf, buf, n); | |
| 784 | ns_call(conn, NS_RECV, &n); | |
| 785 | } | |
| 780 | if (ns_is_error(n)) { | |
| 781 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 782 | } else if (n > 0) { | |
| 783 | iobuf_append(&conn->recv_iobuf, buf, n); | |
| 784 | ns_call(conn, NS_RECV, &n); | |
| 785 | } | |
| 786 | 786 | } |
| 787 | 787 | |
| 788 | 788 | static void ns_write_to_socket(struct ns_connection *conn) { |
| 789 | struct iobuf *io = &conn->send_iobuf; | |
| 790 | int n = 0; | |
| 789 | struct iobuf *io = &conn->send_iobuf; | |
| 790 | int n = 0; | |
| 791 | 791 | |
| 792 | 792 | #ifdef NS_ENABLE_SSL |
| 793 | if (conn->ssl != NULL) { | |
| 794 | n = SSL_write(conn->ssl, io->buf, io->len); | |
| 795 | if (n < 0) { | |
| 796 | int ssl_err = SSL_get_error(conn->ssl, n); | |
| 797 | DBG(("%p %d %d", conn, n, ssl_err)); | |
| 798 | if (ssl_err == 2 || ssl_err == 3) { | |
| 799 | return; // Call us again | |
| 800 | } else { | |
| 801 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 802 | } | |
| 803 | } | |
| 804 | } else | |
| 793 | if (conn->ssl != NULL) { | |
| 794 | n = SSL_write(conn->ssl, io->buf, io->len); | |
| 795 | if (n < 0) { | |
| 796 | int ssl_err = SSL_get_error(conn->ssl, n); | |
| 797 | DBG(("%p %d %d", conn, n, ssl_err)); | |
| 798 | if (ssl_err == 2 || ssl_err == 3) { | |
| 799 | return; // Call us again | |
| 800 | } else { | |
| 801 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 802 | } | |
| 803 | } | |
| 804 | } else | |
| 805 | 805 | #endif |
| 806 | ||
| 806 | { n = send(conn->sock, io->buf, io->len, 0); } | |
| 807 | 807 | |
| 808 | ||
| 808 | DBG(("%p %d -> %d bytes", conn, conn->flags, n)); | |
| 809 | 809 | |
| 810 | ns_call(conn, NS_SEND, &n); | |
| 811 | if (ns_is_error(n)) { | |
| 812 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 813 | } else if (n > 0) { | |
| 814 | iobuf_remove(io, n); | |
| 815 | } | |
| 810 | ns_call(conn, NS_SEND, &n); | |
| 811 | if (ns_is_error(n)) { | |
| 812 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 813 | } else if (n > 0) { | |
| 814 | iobuf_remove(io, n); | |
| 815 | } | |
| 816 | 816 | |
| 817 | if (io->len == 0 && (conn->flags & NSF_FINISHED_SENDING_DATA)) { | |
| 818 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 819 | } | |
| 817 | if (io->len == 0 && (conn->flags & NSF_FINISHED_SENDING_DATA)) { | |
| 818 | conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 819 | } | |
| 820 | 820 | } |
| 821 | 821 | |
| 822 | 822 | int ns_send(struct ns_connection *conn, const void *buf, int len) { |
| 823 | ||
| 823 | return iobuf_append(&conn->send_iobuf, buf, len); | |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | 826 | static void ns_add_to_set(sock_t sock, fd_set *set, sock_t *max_fd) { |
| 827 | if (sock != INVALID_SOCKET) { | |
| 828 | FD_SET(sock, set); | |
| 829 | if (*max_fd == INVALID_SOCKET || sock > *max_fd) { | |
| 830 | *max_fd = sock; | |
| 831 | } | |
| 832 | } | |
| 827 | if (sock != INVALID_SOCKET) { | |
| 828 | FD_SET(sock, set); | |
| 829 | if (*max_fd == INVALID_SOCKET || sock > *max_fd) { | |
| 830 | *max_fd = sock; | |
| 831 | } | |
| 832 | } | |
| 833 | 833 | } |
| 834 | 834 | |
| 835 | 835 | int ns_server_poll(struct ns_server *server, int milli) { |
| 836 | struct ns_connection *conn, *tmp_conn; | |
| 837 | struct timeval tv; | |
| 838 | fd_set read_set, write_set; | |
| 839 | int num_active_connections = 0; | |
| 840 | sock_t max_fd = INVALID_SOCKET; | |
| 841 | time_t current_time = time(NULL); | |
| 836 | struct ns_connection *conn, *tmp_conn; | |
| 837 | struct timeval tv; | |
| 838 | fd_set read_set, write_set; | |
| 839 | int num_active_connections = 0; | |
| 840 | sock_t max_fd = INVALID_SOCKET; | |
| 841 | time_t current_time = time(NULL); | |
| 842 | 842 | |
| 843 | if (server->listening_sock == INVALID_SOCKET && | |
| 844 | server->active_connections == NULL) return 0; | |
| 843 | if (server->listening_sock == INVALID_SOCKET && | |
| 844 | server->active_connections == NULL) return 0; | |
| 845 | 845 | |
| 846 | FD_ZERO(&read_set); | |
| 847 | FD_ZERO(&write_set); | |
| 848 | ns_add_to_set(server->listening_sock, &read_set, &max_fd); | |
| 849 | ns_add_to_set(server->ctl[1], &read_set, &max_fd); | |
| 846 | FD_ZERO(&read_set); | |
| 847 | FD_ZERO(&write_set); | |
| 848 | ns_add_to_set(server->listening_sock, &read_set, &max_fd); | |
| 849 | ns_add_to_set(server->ctl[1], &read_set, &max_fd); | |
| 850 | 850 | |
| 851 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 852 | tmp_conn = conn->next; | |
| 853 | ns_call(conn, NS_POLL, ¤t_time); | |
| 854 | if (!(conn->flags & NSF_WANT_WRITE)) { | |
| 855 | //DBG(("%p read_set", conn)); | |
| 856 | ns_add_to_set(conn->sock, &read_set, &max_fd); | |
| 857 | } | |
| 858 | if (((conn->flags & NSF_CONNECTING) && !(conn->flags & NSF_WANT_READ)) || | |
| 859 | (conn->send_iobuf.len > 0 && !(conn->flags & NSF_CONNECTING) && | |
| 860 | !(conn->flags & NSF_BUFFER_BUT_DONT_SEND))) { | |
| 861 | //DBG(("%p write_set", conn)); | |
| 862 | ns_add_to_set(conn->sock, &write_set, &max_fd); | |
| 863 | } | |
| 864 | if (conn->flags & NSF_CLOSE_IMMEDIATELY) { | |
| 865 | ns_close_conn(conn); | |
| 866 | } | |
| 867 | } | |
| 851 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 852 | tmp_conn = conn->next; | |
| 853 | ns_call(conn, NS_POLL, ¤t_time); | |
| 854 | if (!(conn->flags & NSF_WANT_WRITE)) { | |
| 855 | //DBG(("%p read_set", conn)); | |
| 856 | ns_add_to_set(conn->sock, &read_set, &max_fd); | |
| 857 | } | |
| 858 | if (((conn->flags & NSF_CONNECTING) && !(conn->flags & NSF_WANT_READ)) || | |
| 859 | (conn->send_iobuf.len > 0 && !(conn->flags & NSF_CONNECTING) && | |
| 860 | !(conn->flags & NSF_BUFFER_BUT_DONT_SEND))) { | |
| 861 | //DBG(("%p write_set", conn)); | |
| 862 | ns_add_to_set(conn->sock, &write_set, &max_fd); | |
| 863 | } | |
| 864 | if (conn->flags & NSF_CLOSE_IMMEDIATELY) { | |
| 865 | ns_close_conn(conn); | |
| 866 | } | |
| 867 | } | |
| 868 | 868 | |
| 869 | tv.tv_sec = milli / 1000; | |
| 870 | tv.tv_usec = (milli % 1000) * 1000; | |
| 869 | tv.tv_sec = milli / 1000; | |
| 870 | tv.tv_usec = (milli % 1000) * 1000; | |
| 871 | 871 | |
| 872 | if (select((int) max_fd + 1, &read_set, &write_set, NULL, &tv) > 0) { | |
| 873 | // select() might have been waiting for a long time, reset current_time | |
| 874 | // now to prevent last_io_time being set to the past. | |
| 875 | current_time = time(NULL); | |
| 876 | ||
| 877 | // Accept new connections | |
| 878 | if (server->listening_sock != INVALID_SOCKET && | |
| 879 | FD_ISSET(server->listening_sock, &read_set)) { | |
| 880 | // We're not looping here, and accepting just one connection at | |
| 881 | // a time. The reason is that eCos does not respect non-blocking | |
| 882 | // flag on a listening socket and hangs in a loop. | |
| 883 | if ((conn = accept_conn(server)) != NULL) { | |
| 884 | conn->last_io_time = current_time; | |
| 885 | } | |
| 886 | } | |
| 872 | if (select((int) max_fd + 1, &read_set, &write_set, NULL, &tv) > 0) { | |
| 873 | // select() might have been waiting for a long time, reset current_time | |
| 874 | // now to prevent last_io_time being set to the past. | |
| 875 | current_time = time(NULL); | |
| 887 | 876 | |
| 888 | // Read wakeup messages | |
| 889 | if (server->ctl[1] != INVALID_SOCKET && | |
| 890 | FD_ISSET(server->ctl[1], &read_set)) { | |
| 891 | struct ctl_msg ctl_msg; | |
| 892 | int len = recv(server->ctl[1], (char *) &ctl_msg, sizeof(ctl_msg), 0); | |
| 893 | send(server->ctl[1], ctl_msg.message, 1, 0); | |
| 894 | if (len >= (int) sizeof(ctl_msg.callback) && ctl_msg.callback != NULL) { | |
| 895 | ns_iterate(server, ctl_msg.callback, ctl_msg.message); | |
| 896 | } | |
| 897 | } | |
| 877 | // Accept new connections | |
| 878 | if (server->listening_sock != INVALID_SOCKET && | |
| 879 | FD_ISSET(server->listening_sock, &read_set)) { | |
| 880 | // We're not looping here, and accepting just one connection at | |
| 881 | // a time. The reason is that eCos does not respect non-blocking | |
| 882 | // flag on a listening socket and hangs in a loop. | |
| 883 | if ((conn = accept_conn(server)) != NULL) { | |
| 884 | conn->last_io_time = current_time; | |
| 885 | } | |
| 886 | } | |
| 898 | 887 | |
| 899 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 900 | tmp_conn = conn->next; | |
| 901 | if (FD_ISSET(conn->sock, &read_set)) { | |
| 902 | conn->last_io_time = current_time; | |
| 903 | ns_read_from_socket(conn); | |
| 904 | } | |
| 905 | if (FD_ISSET(conn->sock, &write_set)) { | |
| 906 | if (conn->flags & NSF_CONNECTING) { | |
| 907 | ns_read_from_socket(conn); | |
| 908 | } else if (!(conn->flags & NSF_BUFFER_BUT_DONT_SEND)) { | |
| 909 | conn->last_io_time = current_time; | |
| 910 | ns_write_to_socket(conn); | |
| 911 | } | |
| 912 | } | |
| 913 | } | |
| 914 | } | |
| 888 | // Read wakeup messages | |
| 889 | if (server->ctl[1] != INVALID_SOCKET && | |
| 890 | FD_ISSET(server->ctl[1], &read_set)) { | |
| 891 | struct ctl_msg ctl_msg; | |
| 892 | int len = recv(server->ctl[1], (char *) &ctl_msg, sizeof(ctl_msg), 0); | |
| 893 | send(server->ctl[1], ctl_msg.message, 1, 0); | |
| 894 | if (len >= (int) sizeof(ctl_msg.callback) && ctl_msg.callback != NULL) { | |
| 895 | ns_iterate(server, ctl_msg.callback, ctl_msg.message); | |
| 896 | } | |
| 897 | } | |
| 915 | 898 | |
| 916 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 917 | tmp_conn = conn->next; | |
| 918 | num_active_connections++; | |
| 919 | if (conn->flags & NSF_CLOSE_IMMEDIATELY) { | |
| 920 | ns_close_conn(conn); | |
| 921 | } | |
| 922 | } | |
| 923 | //DBG(("%d active connections", num_active_connections)); | |
| 899 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 900 | tmp_conn = conn->next; | |
| 901 | if (FD_ISSET(conn->sock, &read_set)) { | |
| 902 | conn->last_io_time = current_time; | |
| 903 | ns_read_from_socket(conn); | |
| 904 | } | |
| 905 | if (FD_ISSET(conn->sock, &write_set)) { | |
| 906 | if (conn->flags & NSF_CONNECTING) { | |
| 907 | ns_read_from_socket(conn); | |
| 908 | } else if (!(conn->flags & NSF_BUFFER_BUT_DONT_SEND)) { | |
| 909 | conn->last_io_time = current_time; | |
| 910 | ns_write_to_socket(conn); | |
| 911 | } | |
| 912 | } | |
| 913 | } | |
| 914 | } | |
| 924 | 915 | |
| 925 | return num_active_connections; | |
| 916 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 917 | tmp_conn = conn->next; | |
| 918 | num_active_connections++; | |
| 919 | if (conn->flags & NSF_CLOSE_IMMEDIATELY) { | |
| 920 | ns_close_conn(conn); | |
| 921 | } | |
| 922 | } | |
| 923 | //DBG(("%d active connections", num_active_connections)); | |
| 924 | ||
| 925 | return num_active_connections; | |
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | struct ns_connection *ns_connect(struct ns_server *server, const char *host, |
| 929 | int port, int use_ssl, void *param) { | |
| 930 | sock_t sock = INVALID_SOCKET; | |
| 931 | struct sockaddr_in sin; | |
| 932 | struct hostent *he = NULL; | |
| 933 | struct ns_connection *conn = NULL; | |
| 934 | int connect_ret_val; | |
| 929 | int port, int use_ssl, void *param) { | |
| 930 | sock_t sock = INVALID_SOCKET; | |
| 931 | struct sockaddr_in sin; | |
| 932 | struct hostent *he = NULL; | |
| 933 | struct ns_connection *conn = NULL; | |
| 934 | int connect_ret_val; | |
| 935 | 935 | |
| 936 | ||
| 936 | (void) use_ssl; | |
| 937 | 937 | |
| 938 | if (host == NULL || (he = gethostbyname(host)) == NULL || | |
| 939 | (sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { | |
| 940 | DBG(("gethostbyname(%s) failed: %s", host, strerror(errno))); | |
| 941 | return NULL; | |
| 942 | } | |
| 938 | if (host == NULL || (he = gethostbyname(host)) == NULL || | |
| 939 | (sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) { | |
| 940 | DBG(("gethostbyname(%s) failed: %s", host, strerror(errno))); | |
| 941 | return NULL; | |
| 942 | } | |
| 943 | 943 | |
| 944 | sin.sin_family = AF_INET; | |
| 945 | sin.sin_port = htons((uint16_t) port); | |
| 946 | sin.sin_addr = * (struct in_addr *) he->h_addr_list[0]; | |
| 947 | ns_set_non_blocking_mode(sock); | |
| 944 | sin.sin_family = AF_INET; | |
| 945 | sin.sin_port = htons((uint16_t) port); | |
| 946 | sin.sin_addr = * (struct in_addr *) he->h_addr_list[0]; | |
| 947 | ns_set_non_blocking_mode(sock); | |
| 948 | 948 | |
| 949 | connect_ret_val = connect(sock, (struct sockaddr *) &sin, sizeof(sin)); | |
| 950 | if (ns_is_error(connect_ret_val)) { | |
| 951 | closesocket(sock); | |
| 952 | return NULL; | |
| 953 | } else if ((conn = (struct ns_connection *) | |
| 954 | NS_MALLOC(sizeof(*conn))) == NULL) { | |
| 955 | closesocket(sock); | |
| 956 | return NULL; | |
| 957 | } | |
| 949 | connect_ret_val = connect(sock, (struct sockaddr *) &sin, sizeof(sin)); | |
| 950 | if (ns_is_error(connect_ret_val)) { | |
| 951 | closesocket(sock); | |
| 952 | return NULL; | |
| 953 | } else if ((conn = (struct ns_connection *) | |
| 954 | NS_MALLOC(sizeof(*conn))) == NULL) { | |
| 955 | closesocket(sock); | |
| 956 | return NULL; | |
| 957 | } | |
| 958 | 958 | |
| 959 | memset(conn, 0, sizeof(*conn)); | |
| 960 | conn->server = server; | |
| 961 | conn->sock = sock; | |
| 962 | conn->connection_data = param; | |
| 963 | conn->flags = NSF_CONNECTING; | |
| 964 | conn->last_io_time = time(NULL); | |
| 959 | memset(conn, 0, sizeof(*conn)); | |
| 960 | conn->server = server; | |
| 961 | conn->sock = sock; | |
| 962 | conn->connection_data = param; | |
| 963 | conn->flags = NSF_CONNECTING; | |
| 964 | conn->last_io_time = time(NULL); | |
| 965 | 965 | |
| 966 | 966 | #ifdef NS_ENABLE_SSL |
| 967 | if (use_ssl && | |
| 968 | (conn->ssl = SSL_new(server->client_ssl_ctx)) != NULL) { | |
| 969 | SSL_set_fd(conn->ssl, sock); | |
| 970 | } | |
| 967 | if (use_ssl && | |
| 968 | (conn->ssl = SSL_new(server->client_ssl_ctx)) != NULL) { | |
| 969 | SSL_set_fd(conn->ssl, sock); | |
| 970 | } | |
| 971 | 971 | #endif |
| 972 | 972 | |
| 973 | ns_add_conn(server, conn); | |
| 974 | DBG(("%p %s:%d %d %p", conn, host, port, conn->sock, conn->ssl)); | |
| 973 | ns_add_conn(server, conn); | |
| 974 | DBG(("%p %s:%d %d %p", conn, host, port, conn->sock, conn->ssl)); | |
| 975 | 975 | |
| 976 | ||
| 976 | return conn; | |
| 977 | 977 | } |
| 978 | 978 | |
| 979 | 979 | struct ns_connection *ns_add_sock(struct ns_server *s, sock_t sock, void *p) { |
| 980 | struct ns_connection *conn; | |
| 981 | if ((conn = (struct ns_connection *) NS_MALLOC(sizeof(*conn))) != NULL) { | |
| 982 | memset(conn, 0, sizeof(*conn)); | |
| 983 | ns_set_non_blocking_mode(sock); | |
| 984 | conn->sock = sock; | |
| 985 | conn->connection_data = p; | |
| 986 | conn->server = s; | |
| 987 | conn->last_io_time = time(NULL); | |
| 988 | ns_add_conn(s, conn); | |
| 989 | DBG(("%p %d", conn, sock)); | |
| 990 | } | |
| 991 | return conn; | |
| 980 | struct ns_connection *conn; | |
| 981 | if ((conn = (struct ns_connection *) NS_MALLOC(sizeof(*conn))) != NULL) { | |
| 982 | memset(conn, 0, sizeof(*conn)); | |
| 983 | ns_set_non_blocking_mode(sock); | |
| 984 | conn->sock = sock; | |
| 985 | conn->connection_data = p; | |
| 986 | conn->server = s; | |
| 987 | conn->last_io_time = time(NULL); | |
| 988 | ns_add_conn(s, conn); | |
| 989 | DBG(("%p %d", conn, sock)); | |
| 990 | } | |
| 991 | return conn; | |
| 992 | 992 | } |
| 993 | 993 | |
| 994 | 994 | struct ns_connection *ns_next(struct ns_server *s, struct ns_connection *conn) { |
| 995 | ||
| 995 | return conn == NULL ? s->active_connections : conn->next; | |
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | void ns_iterate(struct ns_server *server, ns_callback_t cb, void *param) { |
| 999 | ||
| 999 | struct ns_connection *conn, *tmp_conn; | |
| 1000 | 1000 | |
| 1001 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 1002 | tmp_conn = conn->next; | |
| 1003 | cb(conn, NS_POLL, param); | |
| 1004 | } | |
| 1001 | for (conn = server->active_connections; conn != NULL; conn = tmp_conn) { | |
| 1002 | tmp_conn = conn->next; | |
| 1003 | cb(conn, NS_POLL, param); | |
| 1004 | } | |
| 1005 | 1005 | } |
| 1006 | 1006 | |
| 1007 | 1007 | void ns_server_wakeup_ex(struct ns_server *server, ns_callback_t cb, |
| 1008 | void *data, size_t len) { | |
| 1009 | struct ctl_msg ctl_msg; | |
| 1010 | if (server->ctl[0] != INVALID_SOCKET && data != NULL && | |
| 1011 | len < sizeof(ctl_msg.message)) { | |
| 1012 | ctl_msg.callback = cb; | |
| 1013 | memcpy(ctl_msg.message, data, len); | |
| 1014 | send(server->ctl[0], (char *) &ctl_msg, | |
| 1015 | offsetof(struct ctl_msg, message) + len, 0); | |
| 1016 | recv(server->ctl[0], (char *) &len, 1, 0); | |
| 1017 | } | |
| 1008 | void *data, size_t len) { | |
| 1009 | struct ctl_msg ctl_msg; | |
| 1010 | if (server->ctl[0] != INVALID_SOCKET && data != NULL && | |
| 1011 | len < sizeof(ctl_msg.message)) { | |
| 1012 | ctl_msg.callback = cb; | |
| 1013 | memcpy(ctl_msg.message, data, len); | |
| 1014 | send(server->ctl[0], (char *) &ctl_msg, | |
| 1015 | offsetof(struct ctl_msg, message) + len, 0); | |
| 1016 | recv(server->ctl[0], (char *) &len, 1, 0); | |
| 1017 | } | |
| 1018 | 1018 | } |
| 1019 | 1019 | |
| 1020 | 1020 | void ns_server_wakeup(struct ns_server *server) { |
| 1021 | ||
| 1021 | ns_server_wakeup_ex(server, NULL, (void *) "", 0); | |
| 1022 | 1022 | } |
| 1023 | 1023 | |
| 1024 | 1024 | void ns_server_init(struct ns_server *s, void *server_data, ns_callback_t cb) { |
| 1025 | memset(s, 0, sizeof(*s)); | |
| 1026 | s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET; | |
| 1027 | s->server_data = server_data; | |
| 1028 | s->callback = cb; | |
| 1025 | memset(s, 0, sizeof(*s)); | |
| 1026 | s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET; | |
| 1027 | s->server_data = server_data; | |
| 1028 | s->callback = cb; | |
| 1029 | 1029 | |
| 1030 | 1030 | #ifdef _WIN32 |
| 1031 | ||
| 1031 | { WSADATA data; WSAStartup(MAKEWORD(2, 2), &data); } | |
| 1032 | 1032 | #else |
| 1033 | // Ignore SIGPIPE signal, so if client cancels the request, it | |
| 1034 | // won't kill the whole process. | |
| 1035 | signal(SIGPIPE, SIG_IGN); | |
| 1033 | // Ignore SIGPIPE signal, so if client cancels the request, it | |
| 1034 | // won't kill the whole process. | |
| 1035 | signal(SIGPIPE, SIG_IGN); | |
| 1036 | 1036 | #endif |
| 1037 | 1037 | |
| 1038 | 1038 | #ifndef NS_DISABLE_SOCKETPAIR |
| 1039 | do { | |
| 1040 | ns_socketpair2(s->ctl, SOCK_DGRAM); | |
| 1041 | } while (s->ctl[0] == INVALID_SOCKET); | |
| 1039 | do { | |
| 1040 | ns_socketpair2(s->ctl, SOCK_DGRAM); | |
| 1041 | } while (s->ctl[0] == INVALID_SOCKET); | |
| 1042 | 1042 | #endif |
| 1043 | 1043 | |
| 1044 | 1044 | #ifdef NS_ENABLE_SSL |
| 1045 | SSL_library_init(); | |
| 1046 | s->client_ssl_ctx = SSL_CTX_new(SSLv23_client_method()); | |
| 1045 | SSL_library_init(); | |
| 1046 | s->client_ssl_ctx = SSL_CTX_new(SSLv23_client_method()); | |
| 1047 | 1047 | #endif |
| 1048 | 1048 | } |
| 1049 | 1049 | |
| 1050 | 1050 | void ns_server_free(struct ns_server *s) { |
| 1051 | ||
| 1051 | struct ns_connection *conn, *tmp_conn; | |
| 1052 | 1052 | |
| 1053 | DBG(("%p", s)); | |
| 1054 | if (s == NULL) return; | |
| 1055 | // Do one last poll, see https://github.com/cesanta/mongoose/issues/286 | |
| 1056 | ns_server_poll(s, 0); | |
| 1053 | DBG(("%p", s)); | |
| 1054 | if (s == NULL) return; | |
| 1055 | // Do one last poll, see https://github.com/cesanta/mongoose/issues/286 | |
| 1056 | ns_server_poll(s, 0); | |
| 1057 | 1057 | |
| 1058 | if (s->listening_sock != INVALID_SOCKET) closesocket(s->listening_sock); | |
| 1059 | if (s->ctl[0] != INVALID_SOCKET) closesocket(s->ctl[0]); | |
| 1060 | if (s->ctl[1] != INVALID_SOCKET) closesocket(s->ctl[1]); | |
| 1061 | s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET; | |
| 1058 | if (s->listening_sock != INVALID_SOCKET) closesocket(s->listening_sock); | |
| 1059 | if (s->ctl[0] != INVALID_SOCKET) closesocket(s->ctl[0]); | |
| 1060 | if (s->ctl[1] != INVALID_SOCKET) closesocket(s->ctl[1]); | |
| 1061 | s->listening_sock = s->ctl[0] = s->ctl[1] = INVALID_SOCKET; | |
| 1062 | 1062 | |
| 1063 | for (conn = s->active_connections; conn != NULL; conn = tmp_conn) { | |
| 1064 | tmp_conn = conn->next; | |
| 1065 | ns_close_conn(conn); | |
| 1066 | } | |
| 1063 | for (conn = s->active_connections; conn != NULL; conn = tmp_conn) { | |
| 1064 | tmp_conn = conn->next; | |
| 1065 | ns_close_conn(conn); | |
| 1066 | } | |
| 1067 | 1067 | |
| 1068 | 1068 | #ifdef NS_ENABLE_SSL |
| 1069 | if (s->ssl_ctx != NULL) SSL_CTX_free(s->ssl_ctx); | |
| 1070 | if (s->client_ssl_ctx != NULL) SSL_CTX_free(s->client_ssl_ctx); | |
| 1071 | s->ssl_ctx = s->client_ssl_ctx = NULL; | |
| 1069 | if (s->ssl_ctx != NULL) SSL_CTX_free(s->ssl_ctx); | |
| 1070 | if (s->client_ssl_ctx != NULL) SSL_CTX_free(s->client_ssl_ctx); | |
| 1071 | s->ssl_ctx = s->client_ssl_ctx = NULL; | |
| 1072 | 1072 | #endif |
| 1073 | 1073 | } |
| 1074 | 1074 | // net_skeleton end |
| r31373 | r31374 | |
| 1168 | 1168 | #endif |
| 1169 | 1169 | |
| 1170 | 1170 | struct vec { |
| 1171 | const char *ptr; | |
| 1172 | int len; | |
| 1171 | const char *ptr; | |
| 1172 | int len; | |
| 1173 | 1173 | }; |
| 1174 | 1174 | |
| 1175 | 1175 | // For directory listing and WevDAV support |
| 1176 | 1176 | struct dir_entry { |
| 1177 | struct connection *conn; | |
| 1178 | char *file_name; | |
| 1179 | file_stat_t st; | |
| 1177 | struct connection *conn; | |
| 1178 | char *file_name; | |
| 1179 | file_stat_t st; | |
| 1180 | 1180 | }; |
| 1181 | 1181 | |
| 1182 | 1182 | // NOTE(lsm): this enum shoulds be in sync with the config_options. |
| 1183 | 1183 | enum { |
| 1184 | ||
| 1184 | ACCESS_CONTROL_LIST, | |
| 1185 | 1185 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 1186 | ||
| 1186 | ACCESS_LOG_FILE, | |
| 1187 | 1187 | #ifndef MONGOOSE_NO_AUTH |
| 1188 | ||
| 1188 | AUTH_DOMAIN, | |
| 1189 | 1189 | #endif |
| 1190 | 1190 | #ifndef MONGOOSE_NO_CGI |
| 1191 | CGI_INTERPRETER, | |
| 1192 | CGI_PATTERN, | |
| 1191 | CGI_INTERPRETER, | |
| 1192 | CGI_PATTERN, | |
| 1193 | 1193 | #endif |
| 1194 | DAV_AUTH_FILE, | |
| 1195 | DOCUMENT_ROOT, | |
| 1194 | DAV_AUTH_FILE, | |
| 1195 | DOCUMENT_ROOT, | |
| 1196 | 1196 | #ifndef MONGOOSE_NO_DIRECTORY_LISTING |
| 1197 | ||
| 1197 | ENABLE_DIRECTORY_LISTING, | |
| 1198 | 1198 | #endif |
| 1199 | 1199 | #endif |
| 1200 | ||
| 1200 | EXTRA_MIME_TYPES, | |
| 1201 | 1201 | #if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH) |
| 1202 | ||
| 1202 | GLOBAL_AUTH_FILE, | |
| 1203 | 1203 | #endif |
| 1204 | 1204 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 1205 | HIDE_FILES_PATTERN, | |
| 1206 | HEXDUMP_FILE, | |
| 1207 | INDEX_FILES, | |
| 1205 | HIDE_FILES_PATTERN, | |
| 1206 | HEXDUMP_FILE, | |
| 1207 | INDEX_FILES, | |
| 1208 | 1208 | #endif |
| 1209 | ||
| 1209 | LISTENING_PORT, | |
| 1210 | 1210 | #ifndef _WIN32 |
| 1211 | ||
| 1211 | RUN_AS_USER, | |
| 1212 | 1212 | #endif |
| 1213 | 1213 | #ifndef MONGOOSE_NO_SSI |
| 1214 | ||
| 1214 | SSI_PATTERN, | |
| 1215 | 1215 | #endif |
| 1216 | 1216 | #ifdef NS_ENABLE_SSL |
| 1217 | SSL_CERTIFICATE, | |
| 1218 | SSL_CA_CERTIFICATE, | |
| 1219 | SSL_MITM_CERTS, | |
| 1217 | SSL_CERTIFICATE, | |
| 1218 | SSL_CA_CERTIFICATE, | |
| 1219 | SSL_MITM_CERTS, | |
| 1220 | 1220 | #endif |
| 1221 | URL_REWRITES, | |
| 1222 | NUM_OPTIONS | |
| 1221 | URL_REWRITES, | |
| 1222 | NUM_OPTIONS | |
| 1223 | 1223 | }; |
| 1224 | 1224 | |
| 1225 | 1225 | static const char *static_config_options[] = { |
| 1226 | ||
| 1226 | "access_control_list", NULL, | |
| 1227 | 1227 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 1228 | ||
| 1228 | "access_log_file", NULL, | |
| 1229 | 1229 | #ifndef MONGOOSE_NO_AUTH |
| 1230 | ||
| 1230 | "auth_domain", "mydomain.com", | |
| 1231 | 1231 | #endif |
| 1232 | 1232 | #ifndef MONGOOSE_NO_CGI |
| 1233 | "cgi_interpreter", NULL, | |
| 1234 | "cgi_pattern", DEFAULT_CGI_PATTERN, | |
| 1233 | "cgi_interpreter", NULL, | |
| 1234 | "cgi_pattern", DEFAULT_CGI_PATTERN, | |
| 1235 | 1235 | #endif |
| 1236 | "dav_auth_file", NULL, | |
| 1237 | "document_root", NULL, | |
| 1236 | "dav_auth_file", NULL, | |
| 1237 | "document_root", NULL, | |
| 1238 | 1238 | #ifndef MONGOOSE_NO_DIRECTORY_LISTING |
| 1239 | ||
| 1239 | "enable_directory_listing", "yes", | |
| 1240 | 1240 | #endif |
| 1241 | 1241 | #endif |
| 1242 | ||
| 1242 | "extra_mime_types", NULL, | |
| 1243 | 1243 | #if !defined(MONGOOSE_NO_FILESYSTEM) && !defined(MONGOOSE_NO_AUTH) |
| 1244 | ||
| 1244 | "global_auth_file", NULL, | |
| 1245 | 1245 | #endif |
| 1246 | 1246 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 1247 | "hide_files_patterns", NULL, | |
| 1248 | "hexdump_file", NULL, | |
| 1249 | "index_files","index.html,index.htm,index.shtml,index.cgi,index.php,index.lp", | |
| 1247 | "hide_files_patterns", NULL, | |
| 1248 | "hexdump_file", NULL, | |
| 1249 | "index_files","index.html,index.htm,index.shtml,index.cgi,index.php,index.lp", | |
| 1250 | 1250 | #endif |
| 1251 | ||
| 1251 | "listening_port", NULL, | |
| 1252 | 1252 | #ifndef _WIN32 |
| 1253 | ||
| 1253 | "run_as_user", NULL, | |
| 1254 | 1254 | #endif |
| 1255 | 1255 | #ifndef MONGOOSE_NO_SSI |
| 1256 | ||
| 1256 | "ssi_pattern", "**.shtml$|**.shtm$", | |
| 1257 | 1257 | #endif |
| 1258 | 1258 | #ifdef NS_ENABLE_SSL |
| 1259 | "ssl_certificate", NULL, | |
| 1260 | "ssl_ca_certificate", NULL, | |
| 1261 | "ssl_mitm_certs", NULL, | |
| 1259 | "ssl_certificate", NULL, | |
| 1260 | "ssl_ca_certificate", NULL, | |
| 1261 | "ssl_mitm_certs", NULL, | |
| 1262 | 1262 | #endif |
| 1263 | "url_rewrites", NULL, | |
| 1264 | NULL | |
| 1263 | "url_rewrites", NULL, | |
| 1264 | NULL | |
| 1265 | 1265 | }; |
| 1266 | 1266 | |
| 1267 | 1267 | struct mg_server { |
| 1268 | struct ns_server ns_server; | |
| 1269 | union socket_address lsa; // Listening socket address | |
| 1270 | mg_handler_t event_handler; | |
| 1271 | char *config_options[NUM_OPTIONS]; | |
| 1268 | struct ns_server ns_server; | |
| 1269 | union socket_address lsa; // Listening socket address | |
| 1270 | mg_handler_t event_handler; | |
| 1271 | char *config_options[NUM_OPTIONS]; | |
| 1272 | 1272 | }; |
| 1273 | 1273 | |
| 1274 | 1274 | // Local endpoint representation |
| 1275 | 1275 | union endpoint { |
| 1276 | int fd; // Opened regular local file | |
| 1277 | struct ns_connection *nc; // CGI or proxy->target connection | |
| 1276 | int fd; // Opened regular local file | |
| 1277 | struct ns_connection *nc; // CGI or proxy->target connection | |
| 1278 | 1278 | }; |
| 1279 | 1279 | |
| 1280 | 1280 | enum endpoint_type { |
| 1281 | ||
| 1281 | EP_NONE, EP_FILE, EP_CGI, EP_USER, EP_PUT, EP_CLIENT, EP_PROXY | |
| 1282 | 1282 | }; |
| 1283 | 1283 | |
| 1284 | 1284 | #define MG_HEADERS_SENT NSF_USER_1 |
| r31373 | r31374 | |
| 1287 | 1287 | #define MG_PROXY_CONN NSF_USER_4 |
| 1288 | 1288 | |
| 1289 | 1289 | struct connection { |
| 1290 | struct ns_connection *ns_conn; // NOTE(lsm): main.c depends on this order | |
| 1291 | struct mg_connection mg_conn; | |
| 1292 | struct mg_server *server; | |
| 1293 | union endpoint endpoint; | |
| 1294 | enum endpoint_type endpoint_type; | |
| 1295 | char *path_info; | |
| 1296 | char *request; | |
| 1297 | int64_t num_bytes_sent; // Total number of bytes sent | |
| 1298 | int64_t cl; // Reply content length, for Range support | |
| 1299 | int request_len; // Request length, including last \r\n after last header | |
| 1290 | struct ns_connection *ns_conn; // NOTE(lsm): main.c depends on this order | |
| 1291 | struct mg_connection mg_conn; | |
| 1292 | struct mg_server *server; | |
| 1293 | union endpoint endpoint; | |
| 1294 | enum endpoint_type endpoint_type; | |
| 1295 | char *path_info; | |
| 1296 | char *request; | |
| 1297 | int64_t num_bytes_sent; // Total number of bytes sent | |
| 1298 | int64_t cl; // Reply content length, for Range support | |
| 1299 | int request_len; // Request length, including last \r\n after last header | |
| 1300 | 1300 | }; |
| 1301 | 1301 | |
| 1302 | 1302 | #define MG_CONN_2_CONN(c) ((struct connection *) ((char *) (c) - \ |
| 1303 | ||
| 1303 | offsetof(struct connection, mg_conn))) | |
| 1304 | 1304 | |
| 1305 | 1305 | static void open_local_endpoint(struct connection *conn, int skip_user); |
| 1306 | 1306 | static void close_local_endpoint(struct connection *conn); |
| 1307 | 1307 | |
| 1308 | 1308 | static const struct { |
| 1309 | const char *extension; | |
| 1310 | size_t ext_len; | |
| 1311 | const char *mime_type; | |
| 1309 | const char *extension; | |
| 1310 | size_t ext_len; | |
| 1311 | const char *mime_type; | |
| 1312 | 1312 | } static_builtin_mime_types[] = { |
| 1313 | {".html", 5, "text/html"}, | |
| 1314 | {".htm", 4, "text/html"}, | |
| 1315 | {".shtm", 5, "text/html"}, | |
| 1316 | {".shtml", 6, "text/html"}, | |
| 1317 | {".css", 4, "text/css"}, | |
| 1318 | {".js", 3, "application/x-javascript"}, | |
| 1319 | {".ico", 4, "image/x-icon"}, | |
| 1320 | {".gif", 4, "image/gif"}, | |
| 1321 | {".jpg", 4, "image/jpeg"}, | |
| 1322 | {".jpeg", 5, "image/jpeg"}, | |
| 1323 | {".png", 4, "image/png"}, | |
| 1324 | {".svg", 4, "image/svg+xml"}, | |
| 1325 | {".txt", 4, "text/plain"}, | |
| 1326 | {".torrent", 8, "application/x-bittorrent"}, | |
| 1327 | {".wav", 4, "audio/x-wav"}, | |
| 1328 | {".mp3", 4, "audio/x-mp3"}, | |
| 1329 | {".mid", 4, "audio/mid"}, | |
| 1330 | {".m3u", 4, "audio/x-mpegurl"}, | |
| 1331 | {".ogg", 4, "application/ogg"}, | |
| 1332 | {".ram", 4, "audio/x-pn-realaudio"}, | |
| 1333 | {".xml", 4, "text/xml"}, | |
| 1334 | {".json", 5, "text/json"}, | |
| 1335 | {".xslt", 5, "application/xml"}, | |
| 1336 | {".xsl", 4, "application/xml"}, | |
| 1337 | {".ra", 3, "audio/x-pn-realaudio"}, | |
| 1338 | {".doc", 4, "application/msword"}, | |
| 1339 | {".exe", 4, "application/octet-stream"}, | |
| 1340 | {".zip", 4, "application/x-zip-compressed"}, | |
| 1341 | {".xls", 4, "application/excel"}, | |
| 1342 | {".tgz", 4, "application/x-tar-gz"}, | |
| 1343 | {".tar", 4, "application/x-tar"}, | |
| 1344 | {".gz", 3, "application/x-gunzip"}, | |
| 1345 | {".arj", 4, "application/x-arj-compressed"}, | |
| 1346 | {".rar", 4, "application/x-rar-compressed"}, | |
| 1347 | {".rtf", 4, "application/rtf"}, | |
| 1348 | {".pdf", 4, "application/pdf"}, | |
| 1349 | {".swf", 4, "application/x-shockwave-flash"}, | |
| 1350 | {".mpg", 4, "video/mpeg"}, | |
| 1351 | {".webm", 5, "video/webm"}, | |
| 1352 | {".mpeg", 5, "video/mpeg"}, | |
| 1353 | {".mov", 4, "video/quicktime"}, | |
| 1354 | {".mp4", 4, "video/mp4"}, | |
| 1355 | {".m4v", 4, "video/x-m4v"}, | |
| 1356 | {".asf", 4, "video/x-ms-asf"}, | |
| 1357 | {".avi", 4, "video/x-msvideo"}, | |
| 1358 | {".bmp", 4, "image/bmp"}, | |
| 1359 | {".ttf", 4, "application/x-font-ttf"}, | |
| 1360 | {NULL, 0, NULL} | |
| 1313 | {".html", 5, "text/html"}, | |
| 1314 | {".htm", 4, "text/html"}, | |
| 1315 | {".shtm", 5, "text/html"}, | |
| 1316 | {".shtml", 6, "text/html"}, | |
| 1317 | {".css", 4, "text/css"}, | |
| 1318 | {".js", 3, "application/x-javascript"}, | |
| 1319 | {".ico", 4, "image/x-icon"}, | |
| 1320 | {".gif", 4, "image/gif"}, | |
| 1321 | {".jpg", 4, "image/jpeg"}, | |
| 1322 | {".jpeg", 5, "image/jpeg"}, | |
| 1323 | {".png", 4, "image/png"}, | |
| 1324 | {".svg", 4, "image/svg+xml"}, | |
| 1325 | {".txt", 4, "text/plain"}, | |
| 1326 | {".torrent", 8, "application/x-bittorrent"}, | |
| 1327 | {".wav", 4, "audio/x-wav"}, | |
| 1328 | {".mp3", 4, "audio/x-mp3"}, | |
| 1329 | {".mid", 4, "audio/mid"}, | |
| 1330 | {".m3u", 4, "audio/x-mpegurl"}, | |
| 1331 | {".ogg", 4, "application/ogg"}, | |
| 1332 | {".ram", 4, "audio/x-pn-realaudio"}, | |
| 1333 | {".xml", 4, "text/xml"}, | |
| 1334 | {".json", 5, "text/json"}, | |
| 1335 | {".xslt", 5, "application/xml"}, | |
| 1336 | {".xsl", 4, "application/xml"}, | |
| 1337 | {".ra", 3, "audio/x-pn-realaudio"}, | |
| 1338 | {".doc", 4, "application/msword"}, | |
| 1339 | {".exe", 4, "application/octet-stream"}, | |
| 1340 | {".zip", 4, "application/x-zip-compressed"}, | |
| 1341 | {".xls", 4, "application/excel"}, | |
| 1342 | {".tgz", 4, "application/x-tar-gz"}, | |
| 1343 | {".tar", 4, "application/x-tar"}, | |
| 1344 | {".gz", 3, "application/x-gunzip"}, | |
| 1345 | {".arj", 4, "application/x-arj-compressed"}, | |
| 1346 | {".rar", 4, "application/x-rar-compressed"}, | |
| 1347 | {".rtf", 4, "application/rtf"}, | |
| 1348 | {".pdf", 4, "application/pdf"}, | |
| 1349 | {".swf", 4, "application/x-shockwave-flash"}, | |
| 1350 | {".mpg", 4, "video/mpeg"}, | |
| 1351 | {".webm", 5, "video/webm"}, | |
| 1352 | {".mpeg", 5, "video/mpeg"}, | |
| 1353 | {".mov", 4, "video/quicktime"}, | |
| 1354 | {".mp4", 4, "video/mp4"}, | |
| 1355 | {".m4v", 4, "video/x-m4v"}, | |
| 1356 | {".asf", 4, "video/x-ms-asf"}, | |
| 1357 | {".avi", 4, "video/x-msvideo"}, | |
| 1358 | {".bmp", 4, "image/bmp"}, | |
| 1359 | {".ttf", 4, "application/x-font-ttf"}, | |
| 1360 | {NULL, 0, NULL} | |
| 1361 | 1361 | }; |
| 1362 | 1362 | |
| 1363 | 1363 | #ifndef MONGOOSE_NO_THREADS |
| 1364 | 1364 | void *mg_start_thread(void *(*f)(void *), void *p) { |
| 1365 | ||
| 1365 | return ns_start_thread(f, p); | |
| 1366 | 1366 | } |
| 1367 | 1367 | #endif // MONGOOSE_NO_THREADS |
| 1368 | 1368 | |
| r31373 | r31374 | |
| 1370 | 1370 | // Encode 'path' which is assumed UTF-8 string, into UNICODE string. |
| 1371 | 1371 | // wbuf and wbuf_len is a target buffer and its length. |
| 1372 | 1372 | static void to_wchar(const char *path, wchar_t *wbuf, size_t wbuf_len) { |
| 1373 | ||
| 1373 | char buf[MAX_PATH_SIZE * 2], buf2[MAX_PATH_SIZE * 2], *p; | |
| 1374 | 1374 | |
| 1375 | strncpy(buf, path, sizeof(buf)); | |
| 1376 | buf[sizeof(buf) - 1] = '\0'; | |
| 1375 | strncpy(buf, path, sizeof(buf)); | |
| 1376 | buf[sizeof(buf) - 1] = '\0'; | |
| 1377 | 1377 | |
| 1378 | // Trim trailing slashes. Leave backslash for paths like "X:\" | |
| 1379 | p = buf + strlen(buf) - 1; | |
| 1380 | while (p > buf && p[-1] != ':' && (p[0] == '\\' || p[0] == '/')) *p-- = '\0'; | |
| 1378 | // Trim trailing slashes. Leave backslash for paths like "X:\" | |
| 1379 | p = buf + strlen(buf) - 1; | |
| 1380 | while (p > buf && p[-1] != ':' && (p[0] == '\\' || p[0] == '/')) *p-- = '\0'; | |
| 1381 | 1381 | |
| 1382 | // Convert to Unicode and back. If doubly-converted string does not | |
| 1383 | // match the original, something is fishy, reject. | |
| 1384 | memset(wbuf, 0, wbuf_len * sizeof(wchar_t)); | |
| 1385 | MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, (int) wbuf_len); | |
| 1386 | WideCharToMultiByte(CP_UTF8, 0, wbuf, (int) wbuf_len, buf2, sizeof(buf2), | |
| 1387 | NULL, NULL); | |
| 1388 | if (strcmp(buf, buf2) != 0) { | |
| 1389 | wbuf[0] = L'\0'; | |
| 1390 | } | |
| 1382 | // Convert to Unicode and back. If doubly-converted string does not | |
| 1383 | // match the original, something is fishy, reject. | |
| 1384 | memset(wbuf, 0, wbuf_len * sizeof(wchar_t)); | |
| 1385 | MultiByteToWideChar(CP_UTF8, 0, buf, -1, wbuf, (int) wbuf_len); | |
| 1386 | WideCharToMultiByte(CP_UTF8, 0, wbuf, (int) wbuf_len, buf2, sizeof(buf2), | |
| 1387 | NULL, NULL); | |
| 1388 | if (strcmp(buf, buf2) != 0) { | |
| 1389 | wbuf[0] = L'\0'; | |
| 1390 | } | |
| 1391 | 1391 | } |
| 1392 | 1392 | |
| 1393 | 1393 | static int mg_stat(const char *path, file_stat_t *st) { |
| 1394 | wchar_t wpath[MAX_PATH_SIZE]; | |
| 1395 | to_wchar(path, wpath, ARRAY_SIZE(wpath)); | |
| 1396 | DBG(("[%ls] -> %d", wpath, _wstati64(wpath, st))); | |
| 1397 | return _wstati64(wpath, st); | |
| 1394 | wchar_t wpath[MAX_PATH_SIZE]; | |
| 1395 | to_wchar(path, wpath, ARRAY_SIZE(wpath)); | |
| 1396 | DBG(("[%ls] -> %d", wpath, _wstati64(wpath, st))); | |
| 1397 | return _wstati64(wpath, st); | |
| 1398 | 1398 | } |
| 1399 | 1399 | |
| 1400 | 1400 | static FILE *mg_fopen(const char *path, const char *mode) { |
| 1401 | wchar_t wpath[MAX_PATH_SIZE], wmode[10]; | |
| 1402 | to_wchar(path, wpath, ARRAY_SIZE(wpath)); | |
| 1403 | to_wchar(mode, wmode, ARRAY_SIZE(wmode)); | |
| 1404 | return _wfopen(wpath, wmode); | |
| 1401 | wchar_t wpath[MAX_PATH_SIZE], wmode[10]; | |
| 1402 | to_wchar(path, wpath, ARRAY_SIZE(wpath)); | |
| 1403 | to_wchar(mode, wmode, ARRAY_SIZE(wmode)); | |
| 1404 | return _wfopen(wpath, wmode); | |
| 1405 | 1405 | } |
| 1406 | 1406 | |
| 1407 | 1407 | static int mg_open(const char *path, int flag) { |
| 1408 | wchar_t wpath[MAX_PATH_SIZE]; | |
| 1409 | to_wchar(path, wpath, ARRAY_SIZE(wpath)); | |
| 1410 | return _wopen(wpath, flag); | |
| 1408 | wchar_t wpath[MAX_PATH_SIZE]; | |
| 1409 | to_wchar(path, wpath, ARRAY_SIZE(wpath)); | |
| 1410 | return _wopen(wpath, flag); | |
| 1411 | 1411 | } |
| 1412 | 1412 | #endif // _WIN32 && !MONGOOSE_NO_FILESYSTEM |
| 1413 | 1413 | |
| r31373 | r31374 | |
| 1418 | 1418 | // vector is initialized to point to the "y" part, and val vector length |
| 1419 | 1419 | // is adjusted to point only to "x". |
| 1420 | 1420 | static const char *next_option(const char *list, struct vec *val, |
| 1421 | struct vec *eq_val) { | |
| 1422 | if (list == NULL || *list == '\0') { | |
| 1423 | // End of the list | |
| 1424 | list = NULL; | |
| 1425 | } else { | |
| 1426 | val->ptr = list; | |
| 1427 | if ((list = strchr(val->ptr, ',')) != NULL) { | |
| 1428 | // Comma found. Store length and shift the list ptr | |
| 1429 | val->len = list - val->ptr; | |
| 1430 | list++; | |
| 1431 | } else { | |
| 1432 | // This value is the last one | |
| 1433 | list = val->ptr + strlen(val->ptr); | |
| 1434 | val->len = list - val->ptr; | |
| 1435 | } | |
| 1421 | struct vec *eq_val) { | |
| 1422 | if (list == NULL || *list == '\0') { | |
| 1423 | // End of the list | |
| 1424 | list = NULL; | |
| 1425 | } else { | |
| 1426 | val->ptr = list; | |
| 1427 | if ((list = strchr(val->ptr, ',')) != NULL) { | |
| 1428 | // Comma found. Store length and shift the list ptr | |
| 1429 | val->len = list - val->ptr; | |
| 1430 | list++; | |
| 1431 | } else { | |
| 1432 | // This value is the last one | |
| 1433 | list = val->ptr + strlen(val->ptr); | |
| 1434 | val->len = list - val->ptr; | |
| 1435 | } | |
| 1436 | 1436 | |
| 1437 | if (eq_val != NULL) { | |
| 1438 | // Value has form "x=y", adjust pointers and lengths | |
| 1439 | // so that val points to "x", and eq_val points to "y". | |
| 1440 | eq_val->len = 0; | |
| 1441 | eq_val->ptr = (const char *) memchr(val->ptr, '=', val->len); | |
| 1442 | if (eq_val->ptr != NULL) { | |
| 1443 | eq_val->ptr++; // Skip over '=' character | |
| 1444 | eq_val->len = val->ptr + val->len - eq_val->ptr; | |
| 1445 | val->len = (eq_val->ptr - val->ptr) - 1; | |
| 1446 | } | |
| 1447 | } | |
| 1448 | } | |
| 1437 | if (eq_val != NULL) { | |
| 1438 | // Value has form "x=y", adjust pointers and lengths | |
| 1439 | // so that val points to "x", and eq_val points to "y". | |
| 1440 | eq_val->len = 0; | |
| 1441 | eq_val->ptr = (const char *) memchr(val->ptr, '=', val->len); | |
| 1442 | if (eq_val->ptr != NULL) { | |
| 1443 | eq_val->ptr++; // Skip over '=' character | |
| 1444 | eq_val->len = val->ptr + val->len - eq_val->ptr; | |
| 1445 | val->len = (eq_val->ptr - val->ptr) - 1; | |
| 1446 | } | |
| 1447 | } | |
| 1448 | } | |
| 1449 | 1449 | |
| 1450 | ||
| 1450 | return list; | |
| 1451 | 1451 | } |
| 1452 | 1452 | |
| 1453 | 1453 | // Like snprintf(), but never returns negative value, or a value |
| 1454 | 1454 | // that is larger than a supplied buffer. |
| 1455 | 1455 | static int mg_vsnprintf(char *buf, size_t buflen, const char *fmt, va_list ap) { |
| 1456 | int n; | |
| 1457 | if (buflen < 1) return 0; | |
| 1458 | n = vsnprintf(buf, buflen, fmt, ap); | |
| 1459 | if (n < 0) { | |
| 1460 | n = 0; | |
| 1461 | } else if (n >= (int) buflen) { | |
| 1462 | n = (int) buflen - 1; | |
| 1463 | } | |
| 1464 | buf[n] = '\0'; | |
| 1465 | return n; | |
| 1456 | int n; | |
| 1457 | if (buflen < 1) return 0; | |
| 1458 | n = vsnprintf(buf, buflen, fmt, ap); | |
| 1459 | if (n < 0) { | |
| 1460 | n = 0; | |
| 1461 | } else if (n >= (int) buflen) { | |
| 1462 | n = (int) buflen - 1; | |
| 1463 | } | |
| 1464 | buf[n] = '\0'; | |
| 1465 | return n; | |
| 1466 | 1466 | } |
| 1467 | 1467 | |
| 1468 | 1468 | static int mg_snprintf(char *buf, size_t buflen, const char *fmt, ...) { |
| 1469 | va_list ap; | |
| 1470 | int n; | |
| 1471 | va_start(ap, fmt); | |
| 1472 | n = mg_vsnprintf(buf, buflen, fmt, ap); | |
| 1473 | va_end(ap); | |
| 1474 | return n; | |
| 1469 | va_list ap; | |
| 1470 | int n; | |
| 1471 | va_start(ap, fmt); | |
| 1472 | n = mg_vsnprintf(buf, buflen, fmt, ap); | |
| 1473 | va_end(ap); | |
| 1474 | return n; | |
| 1475 | 1475 | } |
| 1476 | 1476 | |
| 1477 | 1477 | // Check whether full request is buffered. Return: |
| r31373 | r31374 | |
| 1479 | 1479 | // 0 if request is not yet fully buffered |
| 1480 | 1480 | // >0 actual request length, including last \r\n\r\n |
| 1481 | 1481 | static int get_request_len(const char *s, int buf_len) { |
| 1482 | const unsigned char *buf = (unsigned char *) s; | |
| 1483 | int i; | |
| 1482 | const unsigned char *buf = (unsigned char *) s; | |
| 1483 | int i; | |
| 1484 | 1484 | |
| 1485 | for (i = 0; i < buf_len; i++) { | |
| 1486 | // Control characters are not allowed but >=128 are. | |
| 1487 | // Abort scan as soon as one malformed character is found. | |
| 1488 | if (!isprint(buf[i]) && buf[i] != '\r' && buf[i] != '\n' && buf[i] < 128) { | |
| 1489 | return -1; | |
| 1490 | } else if (buf[i] == '\n' && i + 1 < buf_len && buf[i + 1] == '\n') { | |
| 1491 | return i + 2; | |
| 1492 | } else if (buf[i] == '\n' && i + 2 < buf_len && buf[i + 1] == '\r' && | |
| 1493 | buf[i + 2] == '\n') { | |
| 1494 | return i + 3; | |
| 1495 | } | |
| 1496 | } | |
| 1485 | for (i = 0; i < buf_len; i++) { | |
| 1486 | // Control characters are not allowed but >=128 are. | |
| 1487 | // Abort scan as soon as one malformed character is found. | |
| 1488 | if (!isprint(buf[i]) && buf[i] != '\r' && buf[i] != '\n' && buf[i] < 128) { | |
| 1489 | return -1; | |
| 1490 | } else if (buf[i] == '\n' && i + 1 < buf_len && buf[i + 1] == '\n') { | |
| 1491 | return i + 2; | |
| 1492 | } else if (buf[i] == '\n' && i + 2 < buf_len && buf[i + 1] == '\r' && | |
| 1493 | buf[i + 2] == '\n') { | |
| 1494 | return i + 3; | |
| 1495 | } | |
| 1496 | } | |
| 1497 | 1497 | |
| 1498 | ||
| 1498 | return 0; | |
| 1499 | 1499 | } |
| 1500 | 1500 | |
| 1501 | 1501 | // Skip the characters until one of the delimiters characters found. |
| 1502 | 1502 | // 0-terminate resulting word. Skip the rest of the delimiters if any. |
| 1503 | 1503 | // Advance pointer to buffer to the next word. Return found 0-terminated word. |
| 1504 | 1504 | static char *skip(char **buf, const char *delimiters) { |
| 1505 | ||
| 1505 | char *p, *begin_word, *end_word, *end_delimiters; | |
| 1506 | 1506 | |
| 1507 | begin_word = *buf; | |
| 1508 | end_word = begin_word + strcspn(begin_word, delimiters); | |
| 1509 | end_delimiters = end_word + strspn(end_word, delimiters); | |
| 1507 | begin_word = *buf; | |
| 1508 | end_word = begin_word + strcspn(begin_word, delimiters); | |
| 1509 | end_delimiters = end_word + strspn(end_word, delimiters); | |
| 1510 | 1510 | |
| 1511 | for (p = end_word; p < end_delimiters; p++) { | |
| 1512 | *p = '\0'; | |
| 1513 | } | |
| 1511 | for (p = end_word; p < end_delimiters; p++) { | |
| 1512 | *p = '\0'; | |
| 1513 | } | |
| 1514 | 1514 | |
| 1515 | ||
| 1515 | *buf = end_delimiters; | |
| 1516 | 1516 | |
| 1517 | ||
| 1517 | return begin_word; | |
| 1518 | 1518 | } |
| 1519 | 1519 | |
| 1520 | 1520 | // Parse HTTP headers from the given buffer, advance buffer to the point |
| 1521 | 1521 | // where parsing stopped. |
| 1522 | 1522 | static void parse_http_headers(char **buf, struct mg_connection *ri) { |
| 1523 | ||
| 1523 | size_t i; | |
| 1524 | 1524 | |
| 1525 | for (i = 0; i < ARRAY_SIZE(ri->http_headers); i++) { | |
| 1526 | ri->http_headers[i].name = skip(buf, ": "); | |
| 1527 | ri->http_headers[i].value = skip(buf, "\r\n"); | |
| 1528 | if (ri->http_headers[i].name[0] == '\0') | |
| 1529 | break; | |
| 1530 | ri->num_headers = i + 1; | |
| 1531 | } | |
| 1525 | for (i = 0; i < ARRAY_SIZE(ri->http_headers); i++) { | |
| 1526 | ri->http_headers[i].name = skip(buf, ": "); | |
| 1527 | ri->http_headers[i].value = skip(buf, "\r\n"); | |
| 1528 | if (ri->http_headers[i].name[0] == '\0') | |
| 1529 | break; | |
| 1530 | ri->num_headers = i + 1; | |
| 1531 | } | |
| 1532 | 1532 | } |
| 1533 | 1533 | |
| 1534 | 1534 | static const char *status_code_to_str(int status_code) { |
| 1535 | switch (status_code) { | |
| 1536 | case 200: return "OK"; | |
| 1537 | case 201: return "Created"; | |
| 1538 | case 204: return "No Content"; | |
| 1539 | case 301: return "Moved Permanently"; | |
| 1540 | case 302: return "Found"; | |
| 1541 | case 304: return "Not Modified"; | |
| 1542 | case 400: return "Bad Request"; | |
| 1543 | case 403: return "Forbidden"; | |
| 1544 | case 404: return "Not Found"; | |
| 1545 | case 405: return "Method Not Allowed"; | |
| 1546 | case 409: return "Conflict"; | |
| 1547 | case 411: return "Length Required"; | |
| 1548 | case 413: return "Request Entity Too Large"; | |
| 1549 | case 415: return "Unsupported Media Type"; | |
| 1550 | case 423: return "Locked"; | |
| 1551 | case 500: return "Server Error"; | |
| 1552 | case 501: return "Not Implemented"; | |
| 1553 | default: return "Server Error"; | |
| 1554 | } | |
| 1535 | switch (status_code) { | |
| 1536 | case 200: return "OK"; | |
| 1537 | case 201: return "Created"; | |
| 1538 | case 204: return "No Content"; | |
| 1539 | case 301: return "Moved Permanently"; | |
| 1540 | case 302: return "Found"; | |
| 1541 | case 304: return "Not Modified"; | |
| 1542 | case 400: return "Bad Request"; | |
| 1543 | case 403: return "Forbidden"; | |
| 1544 | case 404: return "Not Found"; | |
| 1545 | case 405: return "Method Not Allowed"; | |
| 1546 | case 409: return "Conflict"; | |
| 1547 | case 411: return "Length Required"; | |
| 1548 | case 413: return "Request Entity Too Large"; | |
| 1549 | case 415: return "Unsupported Media Type"; | |
| 1550 | case 423: return "Locked"; | |
| 1551 | case 500: return "Server Error"; | |
| 1552 | case 501: return "Not Implemented"; | |
| 1553 | default: return "Server Error"; | |
| 1554 | } | |
| 1555 | 1555 | } |
| 1556 | 1556 | |
| 1557 | 1557 | static int call_user(struct connection *conn, enum mg_event ev) { |
| 1558 | return conn != NULL && conn->server != NULL && | |
| 1559 | conn->server->event_handler != NULL ? | |
| 1560 | conn->server->event_handler(&conn->mg_conn, ev) : MG_FALSE; | |
| 1558 | return conn != NULL && conn->server != NULL && | |
| 1559 | conn->server->event_handler != NULL ? | |
| 1560 | conn->server->event_handler(&conn->mg_conn, ev) : MG_FALSE; | |
| 1561 | 1561 | } |
| 1562 | 1562 | |
| 1563 | 1563 | static void send_http_error(struct connection *conn, int code, |
| 1564 | const char *fmt, ...) { | |
| 1565 | const char *message = status_code_to_str(code); | |
| 1566 | const char *rewrites = conn->server->config_options[URL_REWRITES]; | |
| 1567 | char headers[200], body[200]; | |
| 1568 | struct vec a, b; | |
| 1569 | va_list ap; | |
| 1570 | int body_len, headers_len, match_code; | |
| 1564 | const char *fmt, ...) { | |
| 1565 | const char *message = status_code_to_str(code); | |
| 1566 | const char *rewrites = conn->server->config_options[URL_REWRITES]; | |
| 1567 | char headers[200], body[200]; | |
| 1568 | struct vec a, b; | |
| 1569 | va_list ap; | |
| 1570 | int body_len, headers_len, match_code; | |
| 1571 | 1571 | |
| 1572 | ||
| 1572 | conn->mg_conn.status_code = code; | |
| 1573 | 1573 | |
| 1574 | // Invoke error handler if it is set | |
| 1575 | if (call_user(conn, MG_HTTP_ERROR) == MG_TRUE) { | |
| 1576 | close_local_endpoint(conn); | |
| 1577 | return; | |
| 1578 | } | |
| 1574 | // Invoke error handler if it is set | |
| 1575 | if (call_user(conn, MG_HTTP_ERROR) == MG_TRUE) { | |
| 1576 | close_local_endpoint(conn); | |
| 1577 | return; | |
| 1578 | } | |
| 1579 | 1579 | |
| 1580 | // Handle error code rewrites | |
| 1581 | while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { | |
| 1582 | if ((match_code = atoi(a.ptr)) > 0 && match_code == code) { | |
| 1583 | struct mg_connection *c = &conn->mg_conn; | |
| 1584 | c->status_code = 302; | |
| 1585 | mg_printf(c, "HTTP/1.1 %d Moved\r\n" | |
| 1586 | "Location: %.*s?code=%d&orig_uri=%s&query_string=%s\r\n\r\n", | |
| 1587 | c->status_code, b.len, b.ptr, code, c->uri, | |
| 1588 | c->query_string == NULL ? "" : c->query_string); | |
| 1589 | close_local_endpoint(conn); | |
| 1590 | return; | |
| 1591 | } | |
| 1592 | } | |
| 1580 | // Handle error code rewrites | |
| 1581 | while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { | |
| 1582 | if ((match_code = atoi(a.ptr)) > 0 && match_code == code) { | |
| 1583 | struct mg_connection *c = &conn->mg_conn; | |
| 1584 | c->status_code = 302; | |
| 1585 | mg_printf(c, "HTTP/1.1 %d Moved\r\n" | |
| 1586 | "Location: %.*s?code=%d&orig_uri=%s&query_string=%s\r\n\r\n", | |
| 1587 | c->status_code, b.len, b.ptr, code, c->uri, | |
| 1588 | c->query_string == NULL ? "" : c->query_string); | |
| 1589 | close_local_endpoint(conn); | |
| 1590 | return; | |
| 1591 | } | |
| 1592 | } | |
| 1593 | 1593 | |
| 1594 | body_len = mg_snprintf(body, sizeof(body), "%d %s\n", code, message); | |
| 1595 | if (fmt != NULL) { | |
| 1596 | va_start(ap, fmt); | |
| 1597 | body_len += mg_vsnprintf(body + body_len, sizeof(body) - body_len, fmt, ap); | |
| 1598 | va_end(ap); | |
| 1599 | } | |
| 1600 | if ((code >= 300 && code <= 399) || code == 204) { | |
| 1601 | // 3xx errors do not have body | |
| 1602 | body_len = 0; | |
| 1603 | } | |
| 1604 | headers_len = mg_snprintf(headers, sizeof(headers), | |
| 1605 | "HTTP/1.1 %d %s\r\nContent-Length: %d\r\n" | |
| 1606 | "Content-Type: text/plain\r\n\r\n", | |
| 1607 | code, message, body_len); | |
| 1608 | ns_send(conn->ns_conn, headers, headers_len); | |
| 1609 | ns_send(conn->ns_conn, body, body_len); | |
| 1610 | close_local_endpoint(conn); // This will write to the log file | |
| 1594 | body_len = mg_snprintf(body, sizeof(body), "%d %s\n", code, message); | |
| 1595 | if (fmt != NULL) { | |
| 1596 | va_start(ap, fmt); | |
| 1597 | body_len += mg_vsnprintf(body + body_len, sizeof(body) - body_len, fmt, ap); | |
| 1598 | va_end(ap); | |
| 1599 | } | |
| 1600 | if ((code >= 300 && code <= 399) || code == 204) { | |
| 1601 | // 3xx errors do not have body | |
| 1602 | body_len = 0; | |
| 1603 | } | |
| 1604 | headers_len = mg_snprintf(headers, sizeof(headers), | |
| 1605 | "HTTP/1.1 %d %s\r\nContent-Length: %d\r\n" | |
| 1606 | "Content-Type: text/plain\r\n\r\n", | |
| 1607 | code, message, body_len); | |
| 1608 | ns_send(conn->ns_conn, headers, headers_len); | |
| 1609 | ns_send(conn->ns_conn, body, body_len); | |
| 1610 | close_local_endpoint(conn); // This will write to the log file | |
| 1611 | 1611 | } |
| 1612 | 1612 | |
| 1613 | 1613 | static void write_chunk(struct connection *conn, const char *buf, int len) { |
| 1614 | char chunk_size[50]; | |
| 1615 | int n = mg_snprintf(chunk_size, sizeof(chunk_size), "%X\r\n", len); | |
| 1616 | ns_send(conn->ns_conn, chunk_size, n); | |
| 1617 | ns_send(conn->ns_conn, buf, len); | |
| 1618 | ns_send(conn->ns_conn, "\r\n", 2); | |
| 1614 | char chunk_size[50]; | |
| 1615 | int n = mg_snprintf(chunk_size, sizeof(chunk_size), "%X\r\n", len); | |
| 1616 | ns_send(conn->ns_conn, chunk_size, n); | |
| 1617 | ns_send(conn->ns_conn, buf, len); | |
| 1618 | ns_send(conn->ns_conn, "\r\n", 2); | |
| 1619 | 1619 | } |
| 1620 | 1620 | |
| 1621 | 1621 | size_t mg_printf(struct mg_connection *conn, const char *fmt, ...) { |
| 1622 | struct connection *c = MG_CONN_2_CONN(conn); | |
| 1623 | va_list ap; | |
| 1622 | struct connection *c = MG_CONN_2_CONN(conn); | |
| 1623 | va_list ap; | |
| 1624 | 1624 | |
| 1625 | va_start(ap, fmt); | |
| 1626 | ns_vprintf(c->ns_conn, fmt, ap); | |
| 1627 | va_end(ap); | |
| 1625 | va_start(ap, fmt); | |
| 1626 | ns_vprintf(c->ns_conn, fmt, ap); | |
| 1627 | va_end(ap); | |
| 1628 | 1628 | |
| 1629 | ||
| 1629 | return c->ns_conn->send_iobuf.len; | |
| 1630 | 1630 | } |
| 1631 | 1631 | |
| 1632 | 1632 | static void ns_forward(struct ns_connection *from, struct ns_connection *to) { |
| 1633 | DBG(("%p -> %p %zu bytes", from, to, from->recv_iobuf.len)); | |
| 1634 | ns_send(to, from->recv_iobuf.buf, from->recv_iobuf.len); | |
| 1635 | iobuf_remove(&from->recv_iobuf, from->recv_iobuf.len); | |
| 1633 | DBG(("%p -> %p %zu bytes", from, to, from->recv_iobuf.len)); | |
| 1634 | ns_send(to, from->recv_iobuf.buf, from->recv_iobuf.len); | |
| 1635 | iobuf_remove(&from->recv_iobuf, from->recv_iobuf.len); | |
| 1636 | 1636 | } |
| 1637 | 1637 | |
| 1638 | 1638 | #ifndef MONGOOSE_NO_CGI |
| 1639 | 1639 | #ifdef _WIN32 |
| 1640 | 1640 | struct threadparam { |
| 1641 | sock_t s; | |
| 1642 | HANDLE hPipe; | |
| 1641 | sock_t s; | |
| 1642 | HANDLE hPipe; | |
| 1643 | 1643 | }; |
| 1644 | 1644 | |
| 1645 | 1645 | static int wait_until_ready(sock_t sock, int for_read) { |
| 1646 | fd_set set; | |
| 1647 | FD_ZERO(&set); | |
| 1648 | FD_SET(sock, &set); | |
| 1649 | select(sock + 1, for_read ? &set : 0, for_read ? 0 : &set, 0, 0); | |
| 1650 | return 1; | |
| 1646 | fd_set set; | |
| 1647 | FD_ZERO(&set); | |
| 1648 | FD_SET(sock, &set); | |
| 1649 | select(sock + 1, for_read ? &set : 0, for_read ? 0 : &set, 0, 0); | |
| 1650 | return 1; | |
| 1651 | 1651 | } |
| 1652 | 1652 | |
| 1653 | 1653 | static void *push_to_stdin(void *arg) { |
| 1654 | struct threadparam *tp = (struct threadparam *)arg; | |
| 1655 | int n, sent, stop = 0; | |
| 1656 | DWORD k; | |
| 1657 | char buf[IOBUF_SIZE]; | |
| 1654 | struct threadparam *tp = (struct threadparam *)arg; | |
| 1655 | int n, sent, stop = 0; | |
| 1656 | DWORD k; | |
| 1657 | char buf[IOBUF_SIZE]; | |
| 1658 | 1658 | |
| 1659 | while (!stop && wait_until_ready(tp->s, 1) && | |
| 1660 | (n = recv(tp->s, buf, sizeof(buf), 0)) > 0) { | |
| 1661 | if (n == -1 && GetLastError() == WSAEWOULDBLOCK) continue; | |
| 1662 | for (sent = 0; !stop && sent < n; sent += k) { | |
| 1663 | if (!WriteFile(tp->hPipe, buf + sent, n - sent, &k, 0)) stop = 1; | |
| 1664 | } | |
| 1665 | } | |
| 1666 | DBG(("%s", "FORWARED EVERYTHING TO CGI")); | |
| 1667 | CloseHandle(tp->hPipe); | |
| 1668 | free(tp); | |
| 1669 | _endthread(); | |
| 1670 | return NULL; | |
| 1659 | while (!stop && wait_until_ready(tp->s, 1) && | |
| 1660 | (n = recv(tp->s, buf, sizeof(buf), 0)) > 0) { | |
| 1661 | if (n == -1 && GetLastError() == WSAEWOULDBLOCK) continue; | |
| 1662 | for (sent = 0; !stop && sent < n; sent += k) { | |
| 1663 | if (!WriteFile(tp->hPipe, buf + sent, n - sent, &k, 0)) stop = 1; | |
| 1664 | } | |
| 1665 | } | |
| 1666 | DBG(("%s", "FORWARED EVERYTHING TO CGI")); | |
| 1667 | CloseHandle(tp->hPipe); | |
| 1668 | free(tp); | |
| 1669 | _endthread(); | |
| 1670 | return NULL; | |
| 1671 | 1671 | } |
| 1672 | 1672 | |
| 1673 | 1673 | static void *pull_from_stdout(void *arg) { |
| 1674 | struct threadparam *tp = (struct threadparam *)arg; | |
| 1675 | int k = 0, stop = 0; | |
| 1676 | DWORD n, sent; | |
| 1677 | char buf[IOBUF_SIZE]; | |
| 1674 | struct threadparam *tp = (struct threadparam *)arg; | |
| 1675 | int k = 0, stop = 0; | |
| 1676 | DWORD n, sent; | |
| 1677 | char buf[IOBUF_SIZE]; | |
| 1678 | 1678 | |
| 1679 | while (!stop && ReadFile(tp->hPipe, buf, sizeof(buf), &n, NULL)) { | |
| 1680 | for (sent = 0; !stop && sent < n; sent += k) { | |
| 1681 | if (wait_until_ready(tp->s, 0) && | |
| 1682 | (k = send(tp->s, buf + sent, n - sent, 0)) <= 0) stop = 1; | |
| 1683 | } | |
| 1684 | } | |
| 1685 | DBG(("%s", "EOF FROM CGI")); | |
| 1686 | CloseHandle(tp->hPipe); | |
| 1687 | shutdown(tp->s, 2); // Without this, IO thread may get truncated data | |
| 1688 | closesocket(tp->s); | |
| 1689 | free(tp); | |
| 1690 | _endthread(); | |
| 1691 | return NULL; | |
| 1679 | while (!stop && ReadFile(tp->hPipe, buf, sizeof(buf), &n, NULL)) { | |
| 1680 | for (sent = 0; !stop && sent < n; sent += k) { | |
| 1681 | if (wait_until_ready(tp->s, 0) && | |
| 1682 | (k = send(tp->s, buf + sent, n - sent, 0)) <= 0) stop = 1; | |
| 1683 | } | |
| 1684 | } | |
| 1685 | DBG(("%s", "EOF FROM CGI")); | |
| 1686 | CloseHandle(tp->hPipe); | |
| 1687 | shutdown(tp->s, 2); // Without this, IO thread may get truncated data | |
| 1688 | closesocket(tp->s); | |
| 1689 | free(tp); | |
| 1690 | _endthread(); | |
| 1691 | return NULL; | |
| 1692 | 1692 | } |
| 1693 | 1693 | |
| 1694 | 1694 | static void spawn_stdio_thread(sock_t sock, HANDLE hPipe, |
| 1695 | void *(*func)(void *)) { | |
| 1696 | struct threadparam *tp = (struct threadparam *)malloc(sizeof(*tp)); | |
| 1697 | if (tp != NULL) { | |
| 1698 | tp->s = sock; | |
| 1699 | tp->hPipe = hPipe; | |
| 1700 | mg_start_thread(func, tp); | |
| 1701 | } | |
| 1695 | void *(*func)(void *)) { | |
| 1696 | struct threadparam *tp = (struct threadparam *)malloc(sizeof(*tp)); | |
| 1697 | if (tp != NULL) { | |
| 1698 | tp->s = sock; | |
| 1699 | tp->hPipe = hPipe; | |
| 1700 | mg_start_thread(func, tp); | |
| 1701 | } | |
| 1702 | 1702 | } |
| 1703 | 1703 | |
| 1704 | 1704 | static void abs_path(const char *utf8_path, char *abs_path, size_t len) { |
| 1705 | wchar_t buf[MAX_PATH_SIZE], buf2[MAX_PATH_SIZE]; | |
| 1706 | to_wchar(utf8_path, buf, ARRAY_SIZE(buf)); | |
| 1707 | GetFullPathNameW(buf, ARRAY_SIZE(buf2), buf2, NULL); | |
| 1708 | WideCharToMultiByte(CP_UTF8, 0, buf2, wcslen(buf2) + 1, abs_path, len, 0, 0); | |
| 1705 | wchar_t buf[MAX_PATH_SIZE], buf2[MAX_PATH_SIZE]; | |
| 1706 | to_wchar(utf8_path, buf, ARRAY_SIZE(buf)); | |
| 1707 | GetFullPathNameW(buf, ARRAY_SIZE(buf2), buf2, NULL); | |
| 1708 | WideCharToMultiByte(CP_UTF8, 0, buf2, wcslen(buf2) + 1, abs_path, len, 0, 0); | |
| 1709 | 1709 | } |
| 1710 | 1710 | |
| 1711 | 1711 | static process_id_t start_process(char *interp, const char *cmd, |
| 1712 | const char *env, const char *envp[], | |
| 1713 | const char *dir, sock_t sock) { | |
| 1714 | STARTUPINFOW si = {0}; | |
| 1715 | PROCESS_INFORMATION pi = {0}; | |
| 1716 | HANDLE a[2], b[2], me = GetCurrentProcess(); | |
| 1717 | wchar_t wcmd[MAX_PATH_SIZE], full_dir[MAX_PATH_SIZE]; | |
| 1718 | char buf[MAX_PATH_SIZE], buf4[MAX_PATH_SIZE], buf5[MAX_PATH_SIZE], | |
| 1719 | cmdline[MAX_PATH_SIZE], *p; | |
| 1720 | DWORD flags = DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS; | |
| 1721 | FILE *fp; | |
| 1712 | const char *env, const char *envp[], | |
| 1713 | const char *dir, sock_t sock) { | |
| 1714 | STARTUPINFOW si = {0}; | |
| 1715 | PROCESS_INFORMATION pi = {0}; | |
| 1716 | HANDLE a[2], b[2], me = GetCurrentProcess(); | |
| 1717 | wchar_t wcmd[MAX_PATH_SIZE], full_dir[MAX_PATH_SIZE]; | |
| 1718 | char buf[MAX_PATH_SIZE], buf4[MAX_PATH_SIZE], buf5[MAX_PATH_SIZE], | |
| 1719 | cmdline[MAX_PATH_SIZE], *p; | |
| 1720 | DWORD flags = DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS; | |
| 1721 | FILE *fp; | |
| 1722 | 1722 | |
| 1723 | si.cb = sizeof(si); | |
| 1724 | si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; | |
| 1725 | si.wShowWindow = SW_HIDE; | |
| 1726 | si.hStdError = GetStdHandle(STD_ERROR_HANDLE); | |
| 1723 | si.cb = sizeof(si); | |
| 1724 | si.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; | |
| 1725 | si.wShowWindow = SW_HIDE; | |
| 1726 | si.hStdError = GetStdHandle(STD_ERROR_HANDLE); | |
| 1727 | 1727 | |
| 1728 | CreatePipe(&a[0], &a[1], NULL, 0); | |
| 1729 | CreatePipe(&b[0], &b[1], NULL, 0); | |
| 1730 | DuplicateHandle(me, a[0], me, &si.hStdInput, 0, TRUE, flags); | |
| 1731 | DuplicateHandle(me, b[1], me, &si.hStdOutput, 0, TRUE, flags); | |
| 1728 | CreatePipe(&a[0], &a[1], NULL, 0); | |
| 1729 | CreatePipe(&b[0], &b[1], NULL, 0); | |
| 1730 | DuplicateHandle(me, a[0], me, &si.hStdInput, 0, TRUE, flags); | |
| 1731 | DuplicateHandle(me, b[1], me, &si.hStdOutput, 0, TRUE, flags); | |
| 1732 | 1732 | |
| 1733 | if (interp == NULL && (fp = fopen(cmd, "r")) != NULL) { | |
| 1734 | buf[0] = buf[1] = '\0'; | |
| 1735 | fgets(buf, sizeof(buf), fp); | |
| 1736 | buf[sizeof(buf) - 1] = '\0'; | |
| 1737 | if (buf[0] == '#' && buf[1] == '!') { | |
| 1738 | interp = buf + 2; | |
| 1739 | for (p = interp + strlen(interp); | |
| 1740 | isspace(* (uint8_t *) p) && p > interp; p--) *p = '\0'; | |
| 1741 | } | |
| 1742 | fclose(fp); | |
| 1743 | } | |
| 1733 | if (interp == NULL && (fp = fopen(cmd, "r")) != NULL) { | |
| 1734 | buf[0] = buf[1] = '\0'; | |
| 1735 | fgets(buf, sizeof(buf), fp); | |
| 1736 | buf[sizeof(buf) - 1] = '\0'; | |
| 1737 | if (buf[0] == '#' && buf[1] == '!') { | |
| 1738 | interp = buf + 2; | |
| 1739 | for (p = interp + strlen(interp); | |
| 1740 | isspace(* (uint8_t *) p) && p > interp; p--) *p = '\0'; | |
| 1741 | } | |
| 1742 | fclose(fp); | |
| 1743 | } | |
| 1744 | 1744 | |
| 1745 | if (interp != NULL) { | |
| 1746 | abs_path(interp, buf4, ARRAY_SIZE(buf4)); | |
| 1747 | interp = buf4; | |
| 1748 | } | |
| 1749 | abs_path(dir, buf5, ARRAY_SIZE(buf5)); | |
| 1750 | to_wchar(dir, full_dir, ARRAY_SIZE(full_dir)); | |
| 1751 | mg_snprintf(cmdline, sizeof(cmdline), "%s%s\"%s\"", | |
| 1752 | interp ? interp : "", interp ? " " : "", cmd); | |
| 1753 | to_wchar(cmdline, wcmd, ARRAY_SIZE(wcmd)); | |
| 1745 | if (interp != NULL) { | |
| 1746 | abs_path(interp, buf4, ARRAY_SIZE(buf4)); | |
| 1747 | interp = buf4; | |
| 1748 | } | |
| 1749 | abs_path(dir, buf5, ARRAY_SIZE(buf5)); | |
| 1750 | to_wchar(dir, full_dir, ARRAY_SIZE(full_dir)); | |
| 1751 | mg_snprintf(cmdline, sizeof(cmdline), "%s%s\"%s\"", | |
| 1752 | interp ? interp : "", interp ? " " : "", cmd); | |
| 1753 | to_wchar(cmdline, wcmd, ARRAY_SIZE(wcmd)); | |
| 1754 | 1754 | |
| 1755 | if (CreateProcessW(NULL, wcmd, NULL, NULL, TRUE, CREATE_NEW_PROCESS_GROUP, | |
| 1756 | (void *) env, full_dir, &si, &pi) != 0) { | |
| 1757 | spawn_stdio_thread(sock, a[1], push_to_stdin); | |
| 1758 | spawn_stdio_thread(sock, b[0], pull_from_stdout); | |
| 1759 | } else { | |
| 1760 | CloseHandle(a[1]); | |
| 1761 | CloseHandle(b[0]); | |
| 1762 | closesocket(sock); | |
| 1763 | } | |
| 1764 | DBG(("CGI command: [%ls] -> %p", wcmd, pi.hProcess)); | |
| 1755 | if (CreateProcessW(NULL, wcmd, NULL, NULL, TRUE, CREATE_NEW_PROCESS_GROUP, | |
| 1756 | (void *) env, full_dir, &si, &pi) != 0) { | |
| 1757 | spawn_stdio_thread(sock, a[1], push_to_stdin); | |
| 1758 | spawn_stdio_thread(sock, b[0], pull_from_stdout); | |
| 1759 | } else { | |
| 1760 | CloseHandle(a[1]); | |
| 1761 | CloseHandle(b[0]); | |
| 1762 | closesocket(sock); | |
| 1763 | } | |
| 1764 | DBG(("CGI command: [%ls] -> %p", wcmd, pi.hProcess)); | |
| 1765 | 1765 | |
| 1766 | CloseHandle(si.hStdOutput); | |
| 1767 | CloseHandle(si.hStdInput); | |
| 1768 | CloseHandle(a[0]); | |
| 1769 | CloseHandle(b[1]); | |
| 1770 | CloseHandle(pi.hThread); | |
| 1771 | CloseHandle(pi.hProcess); | |
| 1766 | CloseHandle(si.hStdOutput); | |
| 1767 | CloseHandle(si.hStdInput); | |
| 1768 | CloseHandle(a[0]); | |
| 1769 | CloseHandle(b[1]); | |
| 1770 | CloseHandle(pi.hThread); | |
| 1771 | CloseHandle(pi.hProcess); | |
| 1772 | 1772 | |
| 1773 | ||
| 1773 | return pi.hProcess; | |
| 1774 | 1774 | } |
| 1775 | 1775 | #else |
| 1776 | 1776 | static process_id_t start_process(const char *interp, const char *cmd, |
| 1777 | const char *env, const char *envp[], | |
| 1778 | const char *dir, sock_t sock) { | |
| 1779 | char buf[500]; | |
| 1780 | process_id_t pid = fork(); | |
| 1781 | (void) env; | |
| 1777 | const char *env, const char *envp[], | |
| 1778 | const char *dir, sock_t sock) { | |
| 1779 | char buf[500]; | |
| 1780 | process_id_t pid = fork(); | |
| 1781 | (void) env; | |
| 1782 | 1782 | |
| 1783 | if (pid == 0) { | |
| 1784 | (void) chdir(dir); | |
| 1785 | (void) dup2(sock, 0); | |
| 1786 | (void) dup2(sock, 1); | |
| 1787 | closesocket(sock); | |
| 1783 | if (pid == 0) { | |
| 1784 | (void) chdir(dir); | |
| 1785 | (void) dup2(sock, 0); | |
| 1786 | (void) dup2(sock, 1); | |
| 1787 | closesocket(sock); | |
| 1788 | 1788 | |
| 1789 | // After exec, all signal handlers are restored to their default values, | |
| 1790 | // with one exception of SIGCHLD. According to POSIX.1-2001 and Linux's | |
| 1791 | // implementation, SIGCHLD's handler will leave unchanged after exec | |
| 1792 | // if it was set to be ignored. Restore it to default action. | |
| 1793 | signal(SIGCHLD, SIG_DFL); | |
| 1789 | // After exec, all signal handlers are restored to their default values, | |
| 1790 | // with one exception of SIGCHLD. According to POSIX.1-2001 and Linux's | |
| 1791 | // implementation, SIGCHLD's handler will leave unchanged after exec | |
| 1792 | // if it was set to be ignored. Restore it to default action. | |
| 1793 | signal(SIGCHLD, SIG_DFL); | |
| 1794 | 1794 | |
| 1795 | if (interp == NULL) { | |
| 1796 | execle(cmd, cmd, NULL, envp); | |
| 1797 | } else { | |
| 1798 | execle(interp, interp, cmd, NULL, envp); | |
| 1799 | } | |
| 1800 | snprintf(buf, sizeof(buf), "Status: 500\r\n\r\n" | |
| 1801 | "500 Server Error: %s%s%s: %s", interp == NULL ? "" : interp, | |
| 1802 | interp == NULL ? "" : " ", cmd, strerror(errno)); | |
| 1803 | send(1, buf, strlen(buf), 0); | |
| 1804 | exit(EXIT_FAILURE); // exec call failed | |
| 1805 | } | |
| 1795 | if (interp == NULL) { | |
| 1796 | execle(cmd, cmd, NULL, envp); | |
| 1797 | } else { | |
| 1798 | execle(interp, interp, cmd, NULL, envp); | |
| 1799 | } | |
| 1800 | snprintf(buf, sizeof(buf), "Status: 500\r\n\r\n" | |
| 1801 | "500 Server Error: %s%s%s: %s", interp == NULL ? "" : interp, | |
| 1802 | interp == NULL ? "" : " ", cmd, strerror(errno)); | |
| 1803 | send(1, buf, strlen(buf), 0); | |
| 1804 | exit(EXIT_FAILURE); // exec call failed | |
| 1805 | } | |
| 1806 | 1806 | |
| 1807 | ||
| 1807 | return pid; | |
| 1808 | 1808 | } |
| 1809 | 1809 | #endif // _WIN32 |
| 1810 | 1810 | |
| r31373 | r31374 | |
| 1817 | 1817 | // We satisfy both worlds: we create an envp array (which is vars), all |
| 1818 | 1818 | // entries are actually pointers inside buf. |
| 1819 | 1819 | struct cgi_env_block { |
| 1820 | struct mg_connection *conn; | |
| 1821 | char buf[CGI_ENVIRONMENT_SIZE]; // Environment buffer | |
| 1822 | const char *vars[MAX_CGI_ENVIR_VARS]; // char *envp[] | |
| 1823 | int len; // Space taken | |
| 1824 | int nvars; // Number of variables in envp[] | |
| 1820 | struct mg_connection *conn; | |
| 1821 | char buf[CGI_ENVIRONMENT_SIZE]; // Environment buffer | |
| 1822 | const char *vars[MAX_CGI_ENVIR_VARS]; // char *envp[] | |
| 1823 | int len; // Space taken | |
| 1824 | int nvars; // Number of variables in envp[] | |
| 1825 | 1825 | }; |
| 1826 | 1826 | |
| 1827 | 1827 | // Append VARIABLE=VALUE\0 string to the buffer, and add a respective |
| 1828 | 1828 | // pointer into the vars array. |
| 1829 | 1829 | static char *addenv(struct cgi_env_block *block, const char *fmt, ...) { |
| 1830 | int n, space; | |
| 1831 | char *added; | |
| 1832 | va_list ap; | |
| 1830 | int n, space; | |
| 1831 | char *added; | |
| 1832 | va_list ap; | |
| 1833 | 1833 | |
| 1834 | // Calculate how much space is left in the buffer | |
| 1835 | space = sizeof(block->buf) - block->len - 2; | |
| 1836 | assert(space >= 0); | |
| 1834 | // Calculate how much space is left in the buffer | |
| 1835 | space = sizeof(block->buf) - block->len - 2; | |
| 1836 | assert(space >= 0); | |
| 1837 | 1837 | |
| 1838 | // Make a pointer to the free space int the buffer | |
| 1839 | added = block->buf + block->len; | |
| 1838 | // Make a pointer to the free space int the buffer | |
| 1839 | added = block->buf + block->len; | |
| 1840 | 1840 | |
| 1841 | // Copy VARIABLE=VALUE\0 string into the free space | |
| 1842 | va_start(ap, fmt); | |
| 1843 | n = mg_vsnprintf(added, (size_t) space, fmt, ap); | |
| 1844 | va_end(ap); | |
| 1841 | // Copy VARIABLE=VALUE\0 string into the free space | |
| 1842 | va_start(ap, fmt); | |
| 1843 | n = mg_vsnprintf(added, (size_t) space, fmt, ap); | |
| 1844 | va_end(ap); | |
| 1845 | 1845 | |
| 1846 | // Make sure we do not overflow buffer and the envp array | |
| 1847 | if (n > 0 && n + 1 < space && | |
| 1848 | block->nvars < (int) ARRAY_SIZE(block->vars) - 2) { | |
| 1849 | // Append a pointer to the added string into the envp array | |
| 1850 | block->vars[block->nvars++] = added; | |
| 1851 | // Bump up used length counter. Include \0 terminator | |
| 1852 | block->len += n + 1; | |
| 1853 | } | |
| 1846 | // Make sure we do not overflow buffer and the envp array | |
| 1847 | if (n > 0 && n + 1 < space && | |
| 1848 | block->nvars < (int) ARRAY_SIZE(block->vars) - 2) { | |
| 1849 | // Append a pointer to the added string into the envp array | |
| 1850 | block->vars[block->nvars++] = added; | |
| 1851 | // Bump up used length counter. Include \0 terminator | |
| 1852 | block->len += n + 1; | |
| 1853 | } | |
| 1854 | 1854 | |
| 1855 | ||
| 1855 | return added; | |
| 1856 | 1856 | } |
| 1857 | 1857 | |
| 1858 | 1858 | static void addenv2(struct cgi_env_block *blk, const char *name) { |
| 1859 | const char *s; | |
| 1860 | if ((s = getenv(name)) != NULL) addenv(blk, "%s=%s", name, s); | |
| 1859 | const char *s; | |
| 1860 | if ((s = getenv(name)) != NULL) addenv(blk, "%s=%s", name, s); | |
| 1861 | 1861 | } |
| 1862 | 1862 | |
| 1863 | 1863 | static void prepare_cgi_environment(struct connection *conn, |
| 1864 | const char *prog, | |
| 1865 | struct cgi_env_block *blk) { | |
| 1866 | struct mg_connection *ri = &conn->mg_conn; | |
| 1867 | const char *s, *slash; | |
| 1868 | char *p, **opts = conn->server->config_options; | |
| 1869 | int i; | |
| 1864 | const char *prog, | |
| 1865 | struct cgi_env_block *blk) { | |
| 1866 | struct mg_connection *ri = &conn->mg_conn; | |
| 1867 | const char *s, *slash; | |
| 1868 | char *p, **opts = conn->server->config_options; | |
| 1869 | int i; | |
| 1870 | 1870 | |
| 1871 | blk->len = blk->nvars = 0; | |
| 1872 | blk->conn = ri; | |
| 1871 | blk->len = blk->nvars = 0; | |
| 1872 | blk->conn = ri; | |
| 1873 | 1873 | |
| 1874 | if ((s = getenv("SERVER_NAME")) != NULL) { | |
| 1875 | addenv(blk, "SERVER_NAME=%s", s); | |
| 1876 | } else { | |
| 1877 | addenv(blk, "SERVER_NAME=%s", ri->local_ip); | |
| 1878 | } | |
| 1879 | addenv(blk, "SERVER_ROOT=%s", opts[DOCUMENT_ROOT]); | |
| 1880 | addenv(blk, "DOCUMENT_ROOT=%s", opts[DOCUMENT_ROOT]); | |
| 1881 | addenv(blk, "SERVER_SOFTWARE=%s/%s", "Mongoose", MONGOOSE_VERSION); | |
| 1874 | if ((s = getenv("SERVER_NAME")) != NULL) { | |
| 1875 | addenv(blk, "SERVER_NAME=%s", s); | |
| 1876 | } else { | |
| 1877 | addenv(blk, "SERVER_NAME=%s", ri->local_ip); | |
| 1878 | } | |
| 1879 | addenv(blk, "SERVER_ROOT=%s", opts[DOCUMENT_ROOT]); | |
| 1880 | addenv(blk, "DOCUMENT_ROOT=%s", opts[DOCUMENT_ROOT]); | |
| 1881 | addenv(blk, "SERVER_SOFTWARE=%s/%s", "Mongoose", MONGOOSE_VERSION); | |
| 1882 | 1882 | |
| 1883 | // Prepare the environment block | |
| 1884 | addenv(blk, "%s", "GATEWAY_INTERFACE=CGI/1.1"); | |
| 1885 | addenv(blk, "%s", "SERVER_PROTOCOL=HTTP/1.1"); | |
| 1886 | addenv(blk, "%s", "REDIRECT_STATUS=200"); // For PHP | |
| 1883 | // Prepare the environment block | |
| 1884 | addenv(blk, "%s", "GATEWAY_INTERFACE=CGI/1.1"); | |
| 1885 | addenv(blk, "%s", "SERVER_PROTOCOL=HTTP/1.1"); | |
| 1886 | addenv(blk, "%s", "REDIRECT_STATUS=200"); // For PHP | |
| 1887 | 1887 | |
| 1888 | // TODO(lsm): fix this for IPv6 case | |
| 1889 | //addenv(blk, "SERVER_PORT=%d", ri->remote_port); | |
| 1888 | // TODO(lsm): fix this for IPv6 case | |
| 1889 | //addenv(blk, "SERVER_PORT=%d", ri->remote_port); | |
| 1890 | 1890 | |
| 1891 | addenv(blk, "REQUEST_METHOD=%s", ri->request_method); | |
| 1892 | addenv(blk, "REMOTE_ADDR=%s", ri->remote_ip); | |
| 1893 | addenv(blk, "REMOTE_PORT=%d", ri->remote_port); | |
| 1894 | addenv(blk, "REQUEST_URI=%s%s%s", ri->uri, | |
| 1895 | ri->query_string == NULL ? "" : "?", | |
| 1896 | ri->query_string == NULL ? "" : ri->query_string); | |
| 1891 | addenv(blk, "REQUEST_METHOD=%s", ri->request_method); | |
| 1892 | addenv(blk, "REMOTE_ADDR=%s", ri->remote_ip); | |
| 1893 | addenv(blk, "REMOTE_PORT=%d", ri->remote_port); | |
| 1894 | addenv(blk, "REQUEST_URI=%s%s%s", ri->uri, | |
| 1895 | ri->query_string == NULL ? "" : "?", | |
| 1896 | ri->query_string == NULL ? "" : ri->query_string); | |
| 1897 | 1897 | |
| 1898 | // SCRIPT_NAME | |
| 1899 | if (conn->path_info != NULL) { | |
| 1900 | addenv(blk, "SCRIPT_NAME=%.*s", | |
| 1901 | (int) (strlen(ri->uri) - strlen(conn->path_info)), ri->uri); | |
| 1902 | addenv(blk, "PATH_INFO=%s", conn->path_info); | |
| 1903 | } else { | |
| 1904 | s = strrchr(prog, '/'); | |
| 1905 | slash = strrchr(ri->uri, '/'); | |
| 1906 | addenv(blk, "SCRIPT_NAME=%.*s%s", | |
| 1907 | slash == NULL ? 0 : (int) (slash - ri->uri), ri->uri, | |
| 1908 | s == NULL ? prog : s); | |
| 1909 | } | |
| 1898 | // SCRIPT_NAME | |
| 1899 | if (conn->path_info != NULL) { | |
| 1900 | addenv(blk, "SCRIPT_NAME=%.*s", | |
| 1901 | (int) (strlen(ri->uri) - strlen(conn->path_info)), ri->uri); | |
| 1902 | addenv(blk, "PATH_INFO=%s", conn->path_info); | |
| 1903 | } else { | |
| 1904 | s = strrchr(prog, '/'); | |
| 1905 | slash = strrchr(ri->uri, '/'); | |
| 1906 | addenv(blk, "SCRIPT_NAME=%.*s%s", | |
| 1907 | slash == NULL ? 0 : (int) (slash - ri->uri), ri->uri, | |
| 1908 | s == NULL ? prog : s); | |
| 1909 | } | |
| 1910 | 1910 | |
| 1911 | addenv(blk, "SCRIPT_FILENAME=%s", prog); | |
| 1912 | addenv(blk, "PATH_TRANSLATED=%s", prog); | |
| 1913 | addenv(blk, "HTTPS=%s", conn->ns_conn->ssl != NULL ? "on" : "off"); | |
| 1911 | addenv(blk, "SCRIPT_FILENAME=%s", prog); | |
| 1912 | addenv(blk, "PATH_TRANSLATED=%s", prog); | |
| 1913 | addenv(blk, "HTTPS=%s", conn->ns_conn->ssl != NULL ? "on" : "off"); | |
| 1914 | 1914 | |
| 1915 | if ((s = mg_get_header(ri, "Content-Type")) != NULL) | |
| 1916 | addenv(blk, "CONTENT_TYPE=%s", s); | |
| 1915 | if ((s = mg_get_header(ri, "Content-Type")) != NULL) | |
| 1916 | addenv(blk, "CONTENT_TYPE=%s", s); | |
| 1917 | 1917 | |
| 1918 | if (ri->query_string != NULL) | |
| 1919 | addenv(blk, "QUERY_STRING=%s", ri->query_string); | |
| 1918 | if (ri->query_string != NULL) | |
| 1919 | addenv(blk, "QUERY_STRING=%s", ri->query_string); | |
| 1920 | 1920 | |
| 1921 | if ((s = mg_get_header(ri, "Content-Length")) != NULL) | |
| 1922 | addenv(blk, "CONTENT_LENGTH=%s", s); | |
| 1921 | if ((s = mg_get_header(ri, "Content-Length")) != NULL) | |
| 1922 | addenv(blk, "CONTENT_LENGTH=%s", s); | |
| 1923 | 1923 | |
| 1924 | addenv2(blk, "PATH"); | |
| 1925 | addenv2(blk, "TMP"); | |
| 1926 | addenv2(blk, "TEMP"); | |
| 1927 | addenv2(blk, "TMPDIR"); | |
| 1928 | addenv2(blk, "PERLLIB"); | |
| 1929 | addenv2(blk, ENV_EXPORT_TO_CGI); | |
| 1924 | addenv2(blk, "PATH"); | |
| 1925 | addenv2(blk, "TMP"); | |
| 1926 | addenv2(blk, "TEMP"); | |
| 1927 | addenv2(blk, "TMPDIR"); | |
| 1928 | addenv2(blk, "PERLLIB"); | |
| 1929 | addenv2(blk, ENV_EXPORT_TO_CGI); | |
| 1930 | 1930 | |
| 1931 | 1931 | #if defined(_WIN32) |
| 1932 | addenv2(blk, "COMSPEC"); | |
| 1933 | addenv2(blk, "SYSTEMROOT"); | |
| 1934 | addenv2(blk, "SystemDrive"); | |
| 1935 | addenv2(blk, "ProgramFiles"); | |
| 1936 | addenv2(blk, "ProgramFiles(x86)"); | |
| 1937 | addenv2(blk, "CommonProgramFiles(x86)"); | |
| 1932 | addenv2(blk, "COMSPEC"); | |
| 1933 | addenv2(blk, "SYSTEMROOT"); | |
| 1934 | addenv2(blk, "SystemDrive"); | |
| 1935 | addenv2(blk, "ProgramFiles"); | |
| 1936 | addenv2(blk, "ProgramFiles(x86)"); | |
| 1937 | addenv2(blk, "CommonProgramFiles(x86)"); | |
| 1938 | 1938 | #else |
| 1939 | ||
| 1939 | addenv2(blk, "LD_LIBRARY_PATH"); | |
| 1940 | 1940 | #endif // _WIN32 |
| 1941 | 1941 | |
| 1942 | // Add all headers as HTTP_* variables | |
| 1943 | for (i = 0; i < ri->num_headers; i++) { | |
| 1944 | p = addenv(blk, "HTTP_%s=%s", | |
| 1945 | ri->http_headers[i].name, ri->http_headers[i].value); | |
| 1942 | // Add all headers as HTTP_* variables | |
| 1943 | for (i = 0; i < ri->num_headers; i++) { | |
| 1944 | p = addenv(blk, "HTTP_%s=%s", | |
| 1945 | ri->http_headers[i].name, ri->http_headers[i].value); | |
| 1946 | 1946 | |
| 1947 | // Convert variable name into uppercase, and change - to _ | |
| 1948 | for (; *p != '=' && *p != '\0'; p++) { | |
| 1949 | if (*p == '-') | |
| 1950 | *p = '_'; | |
| 1951 | *p = (char) toupper(* (unsigned char *) p); | |
| 1952 | } | |
| 1953 | } | |
| 1947 | // Convert variable name into uppercase, and change - to _ | |
| 1948 | for (; *p != '=' && *p != '\0'; p++) { | |
| 1949 | if (*p == '-') | |
| 1950 | *p = '_'; | |
| 1951 | *p = (char) toupper(* (unsigned char *) p); | |
| 1952 | } | |
| 1953 | } | |
| 1954 | 1954 | |
| 1955 | blk->vars[blk->nvars++] = NULL; | |
| 1956 | blk->buf[blk->len++] = '\0'; | |
| 1955 | blk->vars[blk->nvars++] = NULL; | |
| 1956 | blk->buf[blk->len++] = '\0'; | |
| 1957 | 1957 | |
| 1958 | assert(blk->nvars < (int) ARRAY_SIZE(blk->vars)); | |
| 1959 | assert(blk->len > 0); | |
| 1960 | assert(blk->len < (int) sizeof(blk->buf)); | |
| 1958 | assert(blk->nvars < (int) ARRAY_SIZE(blk->vars)); | |
| 1959 | assert(blk->len > 0); | |
| 1960 | assert(blk->len < (int) sizeof(blk->buf)); | |
| 1961 | 1961 | } |
| 1962 | 1962 | |
| 1963 | 1963 | static const char cgi_status[] = "HTTP/1.1 200 OK\r\n"; |
| 1964 | 1964 | |
| 1965 | 1965 | static void open_cgi_endpoint(struct connection *conn, const char *prog) { |
| 1966 | struct cgi_env_block blk; | |
| 1967 | char dir[MAX_PATH_SIZE]; | |
| 1968 | const char *p; | |
| 1969 | sock_t fds[2]; | |
| 1966 | struct cgi_env_block blk; | |
| 1967 | char dir[MAX_PATH_SIZE]; | |
| 1968 | const char *p; | |
| 1969 | sock_t fds[2]; | |
| 1970 | 1970 | |
| 1971 | prepare_cgi_environment(conn, prog, &blk); | |
| 1972 | // CGI must be executed in its own directory. 'dir' must point to the | |
| 1973 | // directory containing executable program, 'p' must point to the | |
| 1974 | // executable program name relative to 'dir'. | |
| 1975 | if ((p = strrchr(prog, '/')) == NULL) { | |
| 1976 | mg_snprintf(dir, sizeof(dir), "%s", "."); | |
| 1977 | } else { | |
| 1978 | mg_snprintf(dir, sizeof(dir), "%.*s", (int) (p - prog), prog); | |
| 1979 | } | |
| 1971 | prepare_cgi_environment(conn, prog, &blk); | |
| 1972 | // CGI must be executed in its own directory. 'dir' must point to the | |
| 1973 | // directory containing executable program, 'p' must point to the | |
| 1974 | // executable program name relative to 'dir'. | |
| 1975 | if ((p = strrchr(prog, '/')) == NULL) { | |
| 1976 | mg_snprintf(dir, sizeof(dir), "%s", "."); | |
| 1977 | } else { | |
| 1978 | mg_snprintf(dir, sizeof(dir), "%.*s", (int) (p - prog), prog); | |
| 1979 | } | |
| 1980 | 1980 | |
| 1981 | // Try to create socketpair in a loop until success. ns_socketpair() | |
| 1982 | // can be interrupted by a signal and fail. | |
| 1983 | // TODO(lsm): use sigaction to restart interrupted syscall | |
| 1984 | do { | |
| 1985 | ns_socketpair(fds); | |
| 1986 | } while (fds[0] == INVALID_SOCKET); | |
| 1981 | // Try to create socketpair in a loop until success. ns_socketpair() | |
| 1982 | // can be interrupted by a signal and fail. | |
| 1983 | // TODO(lsm): use sigaction to restart interrupted syscall | |
| 1984 | do { | |
| 1985 | ns_socketpair(fds); | |
| 1986 | } while (fds[0] == INVALID_SOCKET); | |
| 1987 | 1987 | |
| 1988 | if (start_process(conn->server->config_options[CGI_INTERPRETER], | |
| 1989 | prog, blk.buf, blk.vars, dir, fds[1]) > 0) { | |
| 1990 | conn->endpoint_type = EP_CGI; | |
| 1991 | conn->endpoint.nc = ns_add_sock(&conn->server->ns_server, | |
| 1992 | fds[0], conn); | |
| 1993 | conn->endpoint.nc->flags |= MG_CGI_CONN; | |
| 1994 | ns_send(conn->ns_conn, cgi_status, sizeof(cgi_status) - 1); | |
| 1995 | conn->mg_conn.status_code = 200; | |
| 1996 | conn->ns_conn->flags |= NSF_BUFFER_BUT_DONT_SEND; | |
| 1997 | // Pass POST data to the CGI process | |
| 1998 | conn->endpoint.nc->send_iobuf = conn->ns_conn->recv_iobuf; | |
| 1999 | iobuf_init(&conn->ns_conn->recv_iobuf, 0); | |
| 2000 | } else { | |
| 2001 | closesocket(fds[0]); | |
| 2002 | send_http_error(conn, 500, "start_process(%s) failed", prog); | |
| 2003 | } | |
| 1988 | if (start_process(conn->server->config_options[CGI_INTERPRETER], | |
| 1989 | prog, blk.buf, blk.vars, dir, fds[1]) > 0) { | |
| 1990 | conn->endpoint_type = EP_CGI; | |
| 1991 | conn->endpoint.nc = ns_add_sock(&conn->server->ns_server, | |
| 1992 | fds[0], conn); | |
| 1993 | conn->endpoint.nc->flags |= MG_CGI_CONN; | |
| 1994 | ns_send(conn->ns_conn, cgi_status, sizeof(cgi_status) - 1); | |
| 1995 | conn->mg_conn.status_code = 200; | |
| 1996 | conn->ns_conn->flags |= NSF_BUFFER_BUT_DONT_SEND; | |
| 1997 | // Pass POST data to the CGI process | |
| 1998 | conn->endpoint.nc->send_iobuf = conn->ns_conn->recv_iobuf; | |
| 1999 | iobuf_init(&conn->ns_conn->recv_iobuf, 0); | |
| 2000 | } else { | |
| 2001 | closesocket(fds[0]); | |
| 2002 | send_http_error(conn, 500, "start_process(%s) failed", prog); | |
| 2003 | } | |
| 2004 | 2004 | |
| 2005 | 2005 | #ifndef _WIN32 |
| 2006 | ||
| 2006 | closesocket(fds[1]); // On Windows, CGI stdio thread closes that socket | |
| 2007 | 2007 | #endif |
| 2008 | 2008 | } |
| 2009 | 2009 | |
| 2010 | 2010 | static void on_cgi_data(struct ns_connection *nc) { |
| 2011 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 2012 | const char *status = "500"; | |
| 2013 | struct mg_connection c; | |
| 2011 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 2012 | const char *status = "500"; | |
| 2013 | struct mg_connection c; | |
| 2014 | 2014 | |
| 2015 | ||
| 2015 | if (!conn) return; | |
| 2016 | 2016 | |
| 2017 | // Copy CGI data from CGI socket to the client send buffer | |
| 2018 | ns_forward(nc, conn->ns_conn); | |
| 2017 | // Copy CGI data from CGI socket to the client send buffer | |
| 2018 | ns_forward(nc, conn->ns_conn); | |
| 2019 | 2019 | |
| 2020 | // If reply has not been parsed yet, parse it | |
| 2021 | if (conn->ns_conn->flags & NSF_BUFFER_BUT_DONT_SEND) { | |
| 2022 | struct iobuf *io = &conn->ns_conn->send_iobuf; | |
| 2023 | int s_len = sizeof(cgi_status) - 1; | |
| 2024 | int len = get_request_len(io->buf + s_len, io->len - s_len); | |
| 2025 | char buf[MAX_REQUEST_SIZE], *s = buf; | |
| 2020 | // If reply has not been parsed yet, parse it | |
| 2021 | if (conn->ns_conn->flags & NSF_BUFFER_BUT_DONT_SEND) { | |
| 2022 | struct iobuf *io = &conn->ns_conn->send_iobuf; | |
| 2023 | int s_len = sizeof(cgi_status) - 1; | |
| 2024 | int len = get_request_len(io->buf + s_len, io->len - s_len); | |
| 2025 | char buf[MAX_REQUEST_SIZE], *s = buf; | |
| 2026 | 2026 | |
| 2027 | ||
| 2027 | if (len == 0) return; | |
| 2028 | 2028 | |
| 2029 | if (len < 0 || len > (int) sizeof(buf)) { | |
| 2030 | len = io->len; | |
| 2031 | iobuf_remove(io, io->len); | |
| 2032 | send_http_error(conn, 500, "CGI program sent malformed headers: [%.*s]", | |
| 2033 | len, io->buf); | |
| 2034 | } else { | |
| 2035 | memset(&c, 0, sizeof(c)); | |
| 2036 | memcpy(buf, io->buf + s_len, len); | |
| 2037 | buf[len - 1] = '\0'; | |
| 2038 | parse_http_headers(&s, &c); | |
| 2039 | if (mg_get_header(&c, "Location") != NULL) { | |
| 2040 | status = "302"; | |
| 2041 | } else if ((status = (char *) mg_get_header(&c, "Status")) == NULL) { | |
| 2042 | status = "200"; | |
| 2043 | } | |
| 2044 | memcpy(io->buf + 9, status, 3); | |
| 2045 | conn->mg_conn.status_code = atoi(status); | |
| 2046 | } | |
| 2047 | conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND; | |
| 2048 | } | |
| 2029 | if (len < 0 || len > (int) sizeof(buf)) { | |
| 2030 | len = io->len; | |
| 2031 | iobuf_remove(io, io->len); | |
| 2032 | send_http_error(conn, 500, "CGI program sent malformed headers: [%.*s]", | |
| 2033 | len, io->buf); | |
| 2034 | } else { | |
| 2035 | memset(&c, 0, sizeof(c)); | |
| 2036 | memcpy(buf, io->buf + s_len, len); | |
| 2037 | buf[len - 1] = '\0'; | |
| 2038 | parse_http_headers(&s, &c); | |
| 2039 | if (mg_get_header(&c, "Location") != NULL) { | |
| 2040 | status = "302"; | |
| 2041 | } else if ((status = (char *) mg_get_header(&c, "Status")) == NULL) { | |
| 2042 | status = "200"; | |
| 2043 | } | |
| 2044 | memcpy(io->buf + 9, status, 3); | |
| 2045 | conn->mg_conn.status_code = atoi(status); | |
| 2046 | } | |
| 2047 | conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND; | |
| 2048 | } | |
| 2049 | 2049 | } |
| 2050 | 2050 | #endif // !MONGOOSE_NO_CGI |
| 2051 | 2051 | |
| 2052 | 2052 | static char *mg_strdup(const char *str) { |
| 2053 | char *copy = (char *) malloc(strlen(str) + 1); | |
| 2054 | if (copy != NULL) { | |
| 2055 | strcpy(copy, str); | |
| 2056 | } | |
| 2057 | return copy; | |
| 2053 | char *copy = (char *) malloc(strlen(str) + 1); | |
| 2054 | if (copy != NULL) { | |
| 2055 | strcpy(copy, str); | |
| 2056 | } | |
| 2057 | return copy; | |
| 2058 | 2058 | } |
| 2059 | 2059 | |
| 2060 | 2060 | static int isbyte(int n) { |
| 2061 | ||
| 2061 | return n >= 0 && n <= 255; | |
| 2062 | 2062 | } |
| 2063 | 2063 | |
| 2064 | 2064 | static int parse_net(const char *spec, uint32_t *net, uint32_t *mask) { |
| 2065 | ||
| 2065 | int n, a, b, c, d, slash = 32, len = 0; | |
| 2066 | 2066 | |
| 2067 | if ((sscanf(spec, "%d.%d.%d.%d/%d%n", &a, &b, &c, &d, &slash, &n) == 5 || | |
| 2068 | sscanf(spec, "%d.%d.%d.%d%n", &a, &b, &c, &d, &n) == 4) && | |
| 2069 | isbyte(a) && isbyte(b) && isbyte(c) && isbyte(d) && | |
| 2070 | slash >= 0 && slash < 33) { | |
| 2071 | len = n; | |
| 2072 | *net = ((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint32_t)c << 8) | d; | |
| 2073 | *mask = slash ? 0xffffffffU << (32 - slash) : 0; | |
| 2074 | } | |
| 2067 | if ((sscanf(spec, "%d.%d.%d.%d/%d%n", &a, &b, &c, &d, &slash, &n) == 5 || | |
| 2068 | sscanf(spec, "%d.%d.%d.%d%n", &a, &b, &c, &d, &n) == 4) && | |
| 2069 | isbyte(a) && isbyte(b) && isbyte(c) && isbyte(d) && | |
| 2070 | slash >= 0 && slash < 33) { | |
| 2071 | len = n; | |
| 2072 | *net = ((uint32_t)a << 24) | ((uint32_t)b << 16) | ((uint32_t)c << 8) | d; | |
| 2073 | *mask = slash ? 0xffffffffU << (32 - slash) : 0; | |
| 2074 | } | |
| 2075 | 2075 | |
| 2076 | ||
| 2076 | return len; | |
| 2077 | 2077 | } |
| 2078 | 2078 | |
| 2079 | 2079 | // Verify given socket address against the ACL. |
| 2080 | 2080 | // Return -1 if ACL is malformed, 0 if address is disallowed, 1 if allowed. |
| 2081 | 2081 | static int check_acl(const char *acl, uint32_t remote_ip) { |
| 2082 | int allowed, flag; | |
| 2083 | uint32_t net, mask; | |
| 2084 | struct vec vec; | |
| 2082 | int allowed, flag; | |
| 2083 | uint32_t net, mask; | |
| 2084 | struct vec vec; | |
| 2085 | 2085 | |
| 2086 | // If any ACL is set, deny by default | |
| 2087 | allowed = acl == NULL ? '+' : '-'; | |
| 2086 | // If any ACL is set, deny by default | |
| 2087 | allowed = acl == NULL ? '+' : '-'; | |
| 2088 | 2088 | |
| 2089 | while ((acl = next_option(acl, &vec, NULL)) != NULL) { | |
| 2090 | flag = vec.ptr[0]; | |
| 2091 | if ((flag != '+' && flag != '-') || | |
| 2092 | parse_net(&vec.ptr[1], &net, &mask) == 0) { | |
| 2093 | return -1; | |
| 2094 | } | |
| 2089 | while ((acl = next_option(acl, &vec, NULL)) != NULL) { | |
| 2090 | flag = vec.ptr[0]; | |
| 2091 | if ((flag != '+' && flag != '-') || | |
| 2092 | parse_net(&vec.ptr[1], &net, &mask) == 0) { | |
| 2093 | return -1; | |
| 2094 | } | |
| 2095 | 2095 | |
| 2096 | if (net == (remote_ip & mask)) { | |
| 2097 | allowed = flag; | |
| 2098 | } | |
| 2099 | } | |
| 2096 | if (net == (remote_ip & mask)) { | |
| 2097 | allowed = flag; | |
| 2098 | } | |
| 2099 | } | |
| 2100 | 2100 | |
| 2101 | ||
| 2101 | return allowed == '+'; | |
| 2102 | 2102 | } |
| 2103 | 2103 | |
| 2104 | 2104 | // Protect against directory disclosure attack by removing '..', |
| 2105 | 2105 | // excessive '/' and '\' characters |
| 2106 | 2106 | static void remove_double_dots_and_double_slashes(char *s) { |
| 2107 | ||
| 2107 | char *p = s; | |
| 2108 | 2108 | |
| 2109 | while (*s != '\0') { | |
| 2110 | *p++ = *s++; | |
| 2111 | if (s[-1] == '/' || s[-1] == '\\') { | |
| 2112 | // Skip all following slashes, backslashes and double-dots | |
| 2113 | while (s[0] != '\0') { | |
| 2114 | if (s[0] == '/' || s[0] == '\\') { s++; } | |
| 2115 | else if (s[0] == '.' && s[1] == '.') { s += 2; } | |
| 2116 | else { break; } | |
| 2117 | } | |
| 2118 | } | |
| 2119 | } | |
| 2120 | *p = '\0'; | |
| 2109 | while (*s != '\0') { | |
| 2110 | *p++ = *s++; | |
| 2111 | if (s[-1] == '/' || s[-1] == '\\') { | |
| 2112 | // Skip all following slashes, backslashes and double-dots | |
| 2113 | while (s[0] != '\0') { | |
| 2114 | if (s[0] == '/' || s[0] == '\\') { s++; } | |
| 2115 | else if (s[0] == '.' && s[1] == '.') { s += 2; } | |
| 2116 | else { break; } | |
| 2117 | } | |
| 2118 | } | |
| 2119 | } | |
| 2120 | *p = '\0'; | |
| 2121 | 2121 | } |
| 2122 | 2122 | |
| 2123 | 2123 | int mg_url_decode(const char *src, int src_len, char *dst, |
| 2124 | int dst_len, int is_form_url_encoded) { | |
| 2125 | int i, j, a, b; | |
| 2124 | int dst_len, int is_form_url_encoded) { | |
| 2125 | int i, j, a, b; | |
| 2126 | 2126 | #define HEXTOI(x) (isdigit(x) ? x - '0' : x - 'W') |
| 2127 | 2127 | |
| 2128 | for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) { | |
| 2129 | if (src[i] == '%' && i < src_len - 2 && | |
| 2130 | isxdigit(* (const unsigned char *) (src + i + 1)) && | |
| 2131 | isxdigit(* (const unsigned char *) (src + i + 2))) { | |
| 2132 | a = tolower(* (const unsigned char *) (src + i + 1)); | |
| 2133 | b = tolower(* (const unsigned char *) (src + i + 2)); | |
| 2134 | dst[j] = (char) ((HEXTOI(a) << 4) | HEXTOI(b)); | |
| 2135 | i += 2; | |
| 2136 | } else if (is_form_url_encoded && src[i] == '+') { | |
| 2137 | dst[j] = ' '; | |
| 2138 | } else { | |
| 2139 | dst[j] = src[i]; | |
| 2140 | } | |
| 2141 | } | |
| 2128 | for (i = j = 0; i < src_len && j < dst_len - 1; i++, j++) { | |
| 2129 | if (src[i] == '%' && i < src_len - 2 && | |
| 2130 | isxdigit(* (const unsigned char *) (src + i + 1)) && | |
| 2131 | isxdigit(* (const unsigned char *) (src + i + 2))) { | |
| 2132 | a = tolower(* (const unsigned char *) (src + i + 1)); | |
| 2133 | b = tolower(* (const unsigned char *) (src + i + 2)); | |
| 2134 | dst[j] = (char) ((HEXTOI(a) << 4) | HEXTOI(b)); | |
| 2135 | i += 2; | |
| 2136 | } else if (is_form_url_encoded && src[i] == '+') { | |
| 2137 | dst[j] = ' '; | |
| 2138 | } else { | |
| 2139 | dst[j] = src[i]; | |
| 2140 | } | |
| 2141 | } | |
| 2142 | 2142 | |
| 2143 | ||
| 2143 | dst[j] = '\0'; // Null-terminate the destination | |
| 2144 | 2144 | |
| 2145 | ||
| 2145 | return i >= src_len ? j : -1; | |
| 2146 | 2146 | } |
| 2147 | 2147 | |
| 2148 | 2148 | static int is_valid_http_method(const char *s) { |
| 2149 | return !strcmp(s, "GET") || !strcmp(s, "POST") || !strcmp(s, "HEAD") || | |
| 2150 | !strcmp(s, "CONNECT") || !strcmp(s, "PUT") || !strcmp(s, "DELETE") || | |
| 2151 | !strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL"); | |
| 2149 | return !strcmp(s, "GET") || !strcmp(s, "POST") || !strcmp(s, "HEAD") || | |
| 2150 | !strcmp(s, "CONNECT") || !strcmp(s, "PUT") || !strcmp(s, "DELETE") || | |
| 2151 | !strcmp(s, "OPTIONS") || !strcmp(s, "PROPFIND") || !strcmp(s, "MKCOL"); | |
| 2152 | 2152 | } |
| 2153 | 2153 | |
| 2154 | 2154 | // Parse HTTP request, fill in mg_request structure. |
| r31373 | r31374 | |
| 2156 | 2156 | // HTTP request components, header names and header values. |
| 2157 | 2157 | // Note that len must point to the last \n of HTTP headers. |
| 2158 | 2158 | static int parse_http_message(char *buf, int len, struct mg_connection *ri) { |
| 2159 | ||
| 2159 | int is_request, n; | |
| 2160 | 2160 | |
| 2161 | // Reset the connection. Make sure that we don't touch fields that are | |
| 2162 | // set elsewhere: remote_ip, remote_port, server_param | |
| 2163 | ri->request_method = ri->uri = ri->http_version = ri->query_string = NULL; | |
| 2164 | ri->num_headers = ri->status_code = ri->is_websocket = ri->content_len = 0; | |
| 2161 | // Reset the connection. Make sure that we don't touch fields that are | |
| 2162 | // set elsewhere: remote_ip, remote_port, server_param | |
| 2163 | ri->request_method = ri->uri = ri->http_version = ri->query_string = NULL; | |
| 2164 | ri->num_headers = ri->status_code = ri->is_websocket = ri->content_len = 0; | |
| 2165 | 2165 | |
| 2166 | ||
| 2166 | buf[len - 1] = '\0'; | |
| 2167 | 2167 | |
| 2168 | // RFC says that all initial whitespaces should be ingored | |
| 2169 | while (*buf != '\0' && isspace(* (unsigned char *) buf)) { | |
| 2170 | buf++; | |
| 2171 | } | |
| 2172 | ri->request_method = skip(&buf, " "); | |
| 2173 | ri->uri = skip(&buf, " "); | |
| 2174 | ri->http_version = skip(&buf, "\r\n"); | |
| 2168 | // RFC says that all initial whitespaces should be ingored | |
| 2169 | while (*buf != '\0' && isspace(* (unsigned char *) buf)) { | |
| 2170 | buf++; | |
| 2171 | } | |
| 2172 | ri->request_method = skip(&buf, " "); | |
| 2173 | ri->uri = skip(&buf, " "); | |
| 2174 | ri->http_version = skip(&buf, "\r\n"); | |
| 2175 | 2175 | |
| 2176 | // HTTP message could be either HTTP request or HTTP response, e.g. | |
| 2177 | // "GET / HTTP/1.0 ...." or "HTTP/1.0 200 OK ..." | |
| 2178 | is_request = is_valid_http_method(ri->request_method); | |
| 2179 | if ((is_request && memcmp(ri->http_version, "HTTP/", 5) != 0) || | |
| 2180 | (!is_request && memcmp(ri->request_method, "HTTP/", 5) != 0)) { | |
| 2181 | len = -1; | |
| 2182 | } else { | |
| 2183 | if (is_request) { | |
| 2184 | ri->http_version += 5; | |
| 2185 | } | |
| 2186 | parse_http_headers(&buf, ri); | |
| 2176 | // HTTP message could be either HTTP request or HTTP response, e.g. | |
| 2177 | // "GET / HTTP/1.0 ...." or "HTTP/1.0 200 OK ..." | |
| 2178 | is_request = is_valid_http_method(ri->request_method); | |
| 2179 | if ((is_request && memcmp(ri->http_version, "HTTP/", 5) != 0) || | |
| 2180 | (!is_request && memcmp(ri->request_method, "HTTP/", 5) != 0)) { | |
| 2181 | len = -1; | |
| 2182 | } else { | |
| 2183 | if (is_request) { | |
| 2184 | ri->http_version += 5; | |
| 2185 | } | |
| 2186 | parse_http_headers(&buf, ri); | |
| 2187 | 2187 | |
| 2188 | if ((ri->query_string = strchr(ri->uri, '?')) != NULL) { | |
| 2189 | *(char *) ri->query_string++ = '\0'; | |
| 2190 | } | |
| 2191 | n = (int) strlen(ri->uri); | |
| 2192 | mg_url_decode(ri->uri, n, (char *) ri->uri, n + 1, 0); | |
| 2193 | if (*ri->uri == '/' || *ri->uri == '.') { | |
| 2194 | remove_double_dots_and_double_slashes((char *) ri->uri); | |
| 2195 | } | |
| 2196 | } | |
| 2188 | if ((ri->query_string = strchr(ri->uri, '?')) != NULL) { | |
| 2189 | *(char *) ri->query_string++ = '\0'; | |
| 2190 | } | |
| 2191 | n = (int) strlen(ri->uri); | |
| 2192 | mg_url_decode(ri->uri, n, (char *) ri->uri, n + 1, 0); | |
| 2193 | if (*ri->uri == '/' || *ri->uri == '.') { | |
| 2194 | remove_double_dots_and_double_slashes((char *) ri->uri); | |
| 2195 | } | |
| 2196 | } | |
| 2197 | 2197 | |
| 2198 | ||
| 2198 | return len; | |
| 2199 | 2199 | } |
| 2200 | 2200 | |
| 2201 | 2201 | static int lowercase(const char *s) { |
| 2202 | ||
| 2202 | return tolower(* (const unsigned char *) s); | |
| 2203 | 2203 | } |
| 2204 | 2204 | |
| 2205 | 2205 | static int mg_strcasecmp(const char *s1, const char *s2) { |
| 2206 | ||
| 2206 | int diff; | |
| 2207 | 2207 | |
| 2208 | do { | |
| 2209 | diff = lowercase(s1++) - lowercase(s2++); | |
| 2210 | } while (diff == 0 && s1[-1] != '\0'); | |
| 2208 | do { | |
| 2209 | diff = lowercase(s1++) - lowercase(s2++); | |
| 2210 | } while (diff == 0 && s1[-1] != '\0'); | |
| 2211 | 2211 | |
| 2212 | ||
| 2212 | return diff; | |
| 2213 | 2213 | } |
| 2214 | 2214 | |
| 2215 | 2215 | static int mg_strncasecmp(const char *s1, const char *s2, size_t len) { |
| 2216 | ||
| 2216 | int diff = 0; | |
| 2217 | 2217 | |
| 2218 | if (len > 0) | |
| 2219 | do { | |
| 2220 | diff = lowercase(s1++) - lowercase(s2++); | |
| 2221 | } while (diff == 0 && s1[-1] != '\0' && --len > 0); | |
| 2218 | if (len > 0) | |
| 2219 | do { | |
| 2220 | diff = lowercase(s1++) - lowercase(s2++); | |
| 2221 | } while (diff == 0 && s1[-1] != '\0' && --len > 0); | |
| 2222 | 2222 | |
| 2223 | ||
| 2223 | return diff; | |
| 2224 | 2224 | } |
| 2225 | 2225 | |
| 2226 | 2226 | // Return HTTP header value, or NULL if not found. |
| 2227 | 2227 | const char *mg_get_header(const struct mg_connection *ri, const char *s) { |
| 2228 | ||
| 2228 | int i; | |
| 2229 | 2229 | |
| 2230 | for (i = 0; i < ri->num_headers; i++) | |
| 2231 | if (!mg_strcasecmp(s, ri->http_headers[i].name)) | |
| 2232 | return ri->http_headers[i].value; | |
| 2230 | for (i = 0; i < ri->num_headers; i++) | |
| 2231 | if (!mg_strcasecmp(s, ri->http_headers[i].name)) | |
| 2232 | return ri->http_headers[i].value; | |
| 2233 | 2233 | |
| 2234 | ||
| 2234 | return NULL; | |
| 2235 | 2235 | } |
| 2236 | 2236 | |
| 2237 | 2237 | // Perform case-insensitive match of string against pattern |
| 2238 | 2238 | int mg_match_prefix(const char *pattern, int pattern_len, const char *str) { |
| 2239 | const char *or_str; | |
| 2240 | int len, res, i = 0, j = 0; | |
| 2239 | const char *or_str; | |
| 2240 | int len, res, i = 0, j = 0; | |
| 2241 | 2241 | |
| 2242 | if ((or_str = (const char *) memchr(pattern, '|', pattern_len)) != NULL) { | |
| 2243 | res = mg_match_prefix(pattern, or_str - pattern, str); | |
| 2244 | return res > 0 ? res : mg_match_prefix(or_str + 1, | |
| 2245 | (pattern + pattern_len) - (or_str + 1), str); | |
| 2246 | } | |
| 2242 | if ((or_str = (const char *) memchr(pattern, '|', pattern_len)) != NULL) { | |
| 2243 | res = mg_match_prefix(pattern, or_str - pattern, str); | |
| 2244 | return res > 0 ? res : mg_match_prefix(or_str + 1, | |
| 2245 | (pattern + pattern_len) - (or_str + 1), str); | |
| 2246 | } | |
| 2247 | 2247 | |
| 2248 | for (; i < pattern_len; i++, j++) { | |
| 2249 | if (pattern[i] == '?' && str[j] != '\0') { | |
| 2250 | continue; | |
| 2251 | } else if (pattern[i] == '$') { | |
| 2252 | return str[j] == '\0' ? j : -1; | |
| 2253 | } else if (pattern[i] == '*') { | |
| 2254 | i++; | |
| 2255 | if (pattern[i] == '*') { | |
| 2256 | i++; | |
| 2257 | len = (int) strlen(str + j); | |
| 2258 | } else { | |
| 2259 | len = (int) strcspn(str + j, "/"); | |
| 2260 | } | |
| 2261 | if (i == pattern_len) { | |
| 2262 | return j + len; | |
| 2263 | } | |
| 2264 | do { | |
| 2265 | res = mg_match_prefix(pattern + i, pattern_len - i, str + j + len); | |
| 2266 | } while (res == -1 && len-- > 0); | |
| 2267 | return res == -1 ? -1 : j + res + len; | |
| 2268 | } else if (lowercase(&pattern[i]) != lowercase(&str[j])) { | |
| 2269 | return -1; | |
| 2270 | } | |
| 2271 | } | |
| 2272 | return j; | |
| 2248 | for (; i < pattern_len; i++, j++) { | |
| 2249 | if (pattern[i] == '?' && str[j] != '\0') { | |
| 2250 | continue; | |
| 2251 | } else if (pattern[i] == '$') { | |
| 2252 | return str[j] == '\0' ? j : -1; | |
| 2253 | } else if (pattern[i] == '*') { | |
| 2254 | i++; | |
| 2255 | if (pattern[i] == '*') { | |
| 2256 | i++; | |
| 2257 | len = (int) strlen(str + j); | |
| 2258 | } else { | |
| 2259 | len = (int) strcspn(str + j, "/"); | |
| 2260 | } | |
| 2261 | if (i == pattern_len) { | |
| 2262 | return j + len; | |
| 2263 | } | |
| 2264 | do { | |
| 2265 | res = mg_match_prefix(pattern + i, pattern_len - i, str + j + len); | |
| 2266 | } while (res == -1 && len-- > 0); | |
| 2267 | return res == -1 ? -1 : j + res + len; | |
| 2268 | } else if (lowercase(&pattern[i]) != lowercase(&str[j])) { | |
| 2269 | return -1; | |
| 2270 | } | |
| 2271 | } | |
| 2272 | return j; | |
| 2273 | 2273 | } |
| 2274 | 2274 | |
| 2275 | 2275 | // This function prints HTML pages, and expands "{{something}}" blocks |
| r31373 | r31374 | |
| 2277 | 2277 | // Note that {{@path/to/file}} construct outputs embedded file's contents, |
| 2278 | 2278 | // which provides SSI-like functionality. |
| 2279 | 2279 | void mg_template(struct mg_connection *conn, const char *s, |
| 2280 | struct mg_expansion *expansions) { | |
| 2281 | int i, j, pos = 0, inside_marker = 0; | |
| 2280 | struct mg_expansion *expansions) { | |
| 2281 | int i, j, pos = 0, inside_marker = 0; | |
| 2282 | 2282 | |
| 2283 | for (i = 0; s[i] != '\0'; i++) { | |
| 2284 | if (inside_marker == 0 && !memcmp(&s[i], "{{", 2)) { | |
| 2285 | if (i > pos) { | |
| 2286 | mg_send_data(conn, &s[pos], i - pos); | |
| 2287 | } | |
| 2288 | pos = i; | |
| 2289 | inside_marker = 1; | |
| 2290 | } | |
| 2291 | if (inside_marker == 1 && !memcmp(&s[i], "}}", 2)) { | |
| 2292 | for (j = 0; expansions[j].keyword != NULL; j++) { | |
| 2293 | const char *kw = expansions[j].keyword; | |
| 2294 | if ((int) strlen(kw) == i - (pos + 2) && | |
| 2295 | memcmp(kw, &s[pos + 2], i - (pos + 2)) == 0) { | |
| 2296 | expansions[j].handler(conn); | |
| 2297 | pos = i + 2; | |
| 2298 | break; | |
| 2299 | } | |
| 2300 | } | |
| 2301 | inside_marker = 0; | |
| 2302 | } | |
| 2303 | } | |
| 2304 | if (i > pos) { | |
| 2305 | mg_send_data(conn, &s[pos], i - pos); | |
| 2306 | } | |
| 2283 | for (i = 0; s[i] != '\0'; i++) { | |
| 2284 | if (inside_marker == 0 && !memcmp(&s[i], "{{", 2)) { | |
| 2285 | if (i > pos) { | |
| 2286 | mg_send_data(conn, &s[pos], i - pos); | |
| 2287 | } | |
| 2288 | pos = i; | |
| 2289 | inside_marker = 1; | |
| 2290 | } | |
| 2291 | if (inside_marker == 1 && !memcmp(&s[i], "}}", 2)) { | |
| 2292 | for (j = 0; expansions[j].keyword != NULL; j++) { | |
| 2293 | const char *kw = expansions[j].keyword; | |
| 2294 | if ((int) strlen(kw) == i - (pos + 2) && | |
| 2295 | memcmp(kw, &s[pos + 2], i - (pos + 2)) == 0) { | |
| 2296 | expansions[j].handler(conn); | |
| 2297 | pos = i + 2; | |
| 2298 | break; | |
| 2299 | } | |
| 2300 | } | |
| 2301 | inside_marker = 0; | |
| 2302 | } | |
| 2303 | } | |
| 2304 | if (i > pos) { | |
| 2305 | mg_send_data(conn, &s[pos], i - pos); | |
| 2306 | } | |
| 2307 | 2307 | } |
| 2308 | 2308 | |
| 2309 | 2309 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 2310 | 2310 | static int must_hide_file(struct connection *conn, const char *path) { |
| 2311 | const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$"; | |
| 2312 | const char *pattern = conn->server->config_options[HIDE_FILES_PATTERN]; | |
| 2313 | return mg_match_prefix(pw_pattern, strlen(pw_pattern), path) > 0 || | |
| 2314 | (pattern != NULL && mg_match_prefix(pattern, strlen(pattern), path) > 0); | |
| 2311 | const char *pw_pattern = "**" PASSWORDS_FILE_NAME "$"; | |
| 2312 | const char *pattern = conn->server->config_options[HIDE_FILES_PATTERN]; | |
| 2313 | return mg_match_prefix(pw_pattern, strlen(pw_pattern), path) > 0 || | |
| 2314 | (pattern != NULL && mg_match_prefix(pattern, strlen(pattern), path) > 0); | |
| 2315 | 2315 | } |
| 2316 | 2316 | |
| 2317 | 2317 | // Return 1 if real file has been found, 0 otherwise |
| 2318 | 2318 | static int convert_uri_to_file_name(struct connection *conn, char *buf, |
| 2319 | size_t buf_len, file_stat_t *st) { | |
| 2320 | struct vec a, b; | |
| 2321 | const char *rewrites = conn->server->config_options[URL_REWRITES]; | |
| 2322 | const char *root = conn->server->config_options[DOCUMENT_ROOT]; | |
| 2319 | size_t buf_len, file_stat_t *st) { | |
| 2320 | struct vec a, b; | |
| 2321 | const char *rewrites = conn->server->config_options[URL_REWRITES]; | |
| 2322 | const char *root = conn->server->config_options[DOCUMENT_ROOT]; | |
| 2323 | 2323 | #ifndef MONGOOSE_NO_CGI |
| 2324 | const char *cgi_pat = conn->server->config_options[CGI_PATTERN]; | |
| 2325 | char *p; | |
| 2324 | const char *cgi_pat = conn->server->config_options[CGI_PATTERN]; | |
| 2325 | char *p; | |
| 2326 | 2326 | #endif |
| 2327 | const char *uri = conn->mg_conn.uri; | |
| 2328 | const char *domain = mg_get_header(&conn->mg_conn, "Host"); | |
| 2329 | int match_len, root_len = root == NULL ? 0 : strlen(root); | |
| 2327 | const char *uri = conn->mg_conn.uri; | |
| 2328 | const char *domain = mg_get_header(&conn->mg_conn, "Host"); | |
| 2329 | int match_len, root_len = root == NULL ? 0 : strlen(root); | |
| 2330 | 2330 | |
| 2331 | // Perform virtual hosting rewrites | |
| 2332 | if (rewrites != NULL && domain != NULL) { | |
| 2333 | const char *colon = strchr(domain, ':'); | |
| 2334 | int domain_len = colon == NULL ? (int) strlen(domain) : colon - domain; | |
| 2331 | // Perform virtual hosting rewrites | |
| 2332 | if (rewrites != NULL && domain != NULL) { | |
| 2333 | const char *colon = strchr(domain, ':'); | |
| 2334 | int domain_len = colon == NULL ? (int) strlen(domain) : colon - domain; | |
| 2335 | 2335 | |
| 2336 | while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { | |
| 2337 | if (a.len > 1 && a.ptr[0] == '@' && a.len == domain_len + 1 && | |
| 2338 | mg_strncasecmp(a.ptr + 1, domain, domain_len) == 0) { | |
| 2339 | root = b.ptr; | |
| 2340 | root_len = b.len; | |
| 2341 | break; | |
| 2342 | } | |
| 2343 | } | |
| 2344 | } | |
| 2336 | while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { | |
| 2337 | if (a.len > 1 && a.ptr[0] == '@' && a.len == domain_len + 1 && | |
| 2338 | mg_strncasecmp(a.ptr + 1, domain, domain_len) == 0) { | |
| 2339 | root = b.ptr; | |
| 2340 | root_len = b.len; | |
| 2341 | break; | |
| 2342 | } | |
| 2343 | } | |
| 2344 | } | |
| 2345 | 2345 | |
| 2346 | // No filesystem access | |
| 2347 | if (root == NULL || root_len == 0) return 0; | |
| 2346 | // No filesystem access | |
| 2347 | if (root == NULL || root_len == 0) return 0; | |
| 2348 | 2348 | |
| 2349 | // Handle URL rewrites | |
| 2350 | mg_snprintf(buf, buf_len, "%.*s%s", root_len, root, uri); | |
| 2351 | rewrites = conn->server->config_options[URL_REWRITES]; // Re-initialize! | |
| 2352 | while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { | |
| 2353 | if ((match_len = mg_match_prefix(a.ptr, a.len, uri)) > 0) { | |
| 2354 | mg_snprintf(buf, buf_len, "%.*s%s", (int) b.len, b.ptr, uri + match_len); | |
| 2355 | break; | |
| 2356 | } | |
| 2357 | } | |
| 2349 | // Handle URL rewrites | |
| 2350 | mg_snprintf(buf, buf_len, "%.*s%s", root_len, root, uri); | |
| 2351 | rewrites = conn->server->config_options[URL_REWRITES]; // Re-initialize! | |
| 2352 | while ((rewrites = next_option(rewrites, &a, &b)) != NULL) { | |
| 2353 | if ((match_len = mg_match_prefix(a.ptr, a.len, uri)) > 0) { | |
| 2354 | mg_snprintf(buf, buf_len, "%.*s%s", (int) b.len, b.ptr, uri + match_len); | |
| 2355 | break; | |
| 2356 | } | |
| 2357 | } | |
| 2358 | 2358 | |
| 2359 | ||
| 2359 | if (stat(buf, st) == 0) return 1; | |
| 2360 | 2360 | |
| 2361 | 2361 | #ifndef MONGOOSE_NO_CGI |
| 2362 | // Support PATH_INFO for CGI scripts. | |
| 2363 | for (p = buf + strlen(root) + 2; *p != '\0'; p++) { | |
| 2364 | if (*p == '/') { | |
| 2365 | *p = '\0'; | |
| 2366 | if (mg_match_prefix(cgi_pat, strlen(cgi_pat), buf) > 0 && | |
| 2367 | !stat(buf, st)) { | |
| 2368 | DBG(("!!!! [%s]", buf)); | |
| 2369 | *p = '/'; | |
| 2370 | conn->path_info = mg_strdup(p); | |
| 2371 | *p = '\0'; | |
| 2372 | return 1; | |
| 2373 | } | |
| 2374 | *p = '/'; | |
| 2375 | } | |
| 2376 | } | |
| 2362 | // Support PATH_INFO for CGI scripts. | |
| 2363 | for (p = buf + strlen(root) + 2; *p != '\0'; p++) { | |
| 2364 | if (*p == '/') { | |
| 2365 | *p = '\0'; | |
| 2366 | if (mg_match_prefix(cgi_pat, strlen(cgi_pat), buf) > 0 && | |
| 2367 | !stat(buf, st)) { | |
| 2368 | DBG(("!!!! [%s]", buf)); | |
| 2369 | *p = '/'; | |
| 2370 | conn->path_info = mg_strdup(p); | |
| 2371 | *p = '\0'; | |
| 2372 | return 1; | |
| 2373 | } | |
| 2374 | *p = '/'; | |
| 2375 | } | |
| 2376 | } | |
| 2377 | 2377 | #endif |
| 2378 | 2378 | |
| 2379 | ||
| 2379 | return 0; | |
| 2380 | 2380 | } |
| 2381 | 2381 | #endif // MONGOOSE_NO_FILESYSTEM |
| 2382 | 2382 | |
| 2383 | 2383 | static int should_keep_alive(const struct mg_connection *conn) { |
| 2384 | struct connection *c = MG_CONN_2_CONN(conn); | |
| 2385 | const char *method = conn->request_method; | |
| 2386 | const char *http_version = conn->http_version; | |
| 2387 | const char *header = mg_get_header(conn, "Connection"); | |
| 2388 | return method != NULL && | |
| 2389 | (!strcmp(method, "GET") || c->endpoint_type == EP_USER) && | |
| 2390 | ((header != NULL && !mg_strcasecmp(header, "keep-alive")) || | |
| 2391 | (header == NULL && http_version && !strcmp(http_version, "1.1"))); | |
| 2384 | struct connection *c = MG_CONN_2_CONN(conn); | |
| 2385 | const char *method = conn->request_method; | |
| 2386 | const char *http_version = conn->http_version; | |
| 2387 | const char *header = mg_get_header(conn, "Connection"); | |
| 2388 | return method != NULL && | |
| 2389 | (!strcmp(method, "GET") || c->endpoint_type == EP_USER) && | |
| 2390 | ((header != NULL && !mg_strcasecmp(header, "keep-alive")) || | |
| 2391 | (header == NULL && http_version && !strcmp(http_version, "1.1"))); | |
| 2392 | 2392 | } |
| 2393 | 2393 | |
| 2394 | 2394 | size_t mg_write(struct mg_connection *c, const void *buf, int len) { |
| 2395 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2396 | ns_send(conn->ns_conn, buf, len); | |
| 2397 | return conn->ns_conn->send_iobuf.len; | |
| 2395 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2396 | ns_send(conn->ns_conn, buf, len); | |
| 2397 | return conn->ns_conn->send_iobuf.len; | |
| 2398 | 2398 | } |
| 2399 | 2399 | |
| 2400 | 2400 | void mg_send_status(struct mg_connection *c, int status) { |
| 2401 | if (c->status_code == 0) { | |
| 2402 | c->status_code = status; | |
| 2403 | mg_printf(c, "HTTP/1.1 %d %s\r\n", status, status_code_to_str(status)); | |
| 2404 | } | |
| 2401 | if (c->status_code == 0) { | |
| 2402 | c->status_code = status; | |
| 2403 | mg_printf(c, "HTTP/1.1 %d %s\r\n", status, status_code_to_str(status)); | |
| 2404 | } | |
| 2405 | 2405 | } |
| 2406 | 2406 | |
| 2407 | 2407 | void mg_send_header(struct mg_connection *c, const char *name, const char *v) { |
| 2408 | if (c->status_code == 0) { | |
| 2409 | c->status_code = 200; | |
| 2410 | mg_printf(c, "HTTP/1.1 %d %s\r\n", 200, status_code_to_str(200)); | |
| 2411 | } | |
| 2412 | mg_printf(c, "%s: %s\r\n", name, v); | |
| 2408 | if (c->status_code == 0) { | |
| 2409 | c->status_code = 200; | |
| 2410 | mg_printf(c, "HTTP/1.1 %d %s\r\n", 200, status_code_to_str(200)); | |
| 2411 | } | |
| 2412 | mg_printf(c, "%s: %s\r\n", name, v); | |
| 2413 | 2413 | } |
| 2414 | 2414 | |
| 2415 | 2415 | static void terminate_headers(struct mg_connection *c) { |
| 2416 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2417 | if (!(conn->ns_conn->flags & MG_HEADERS_SENT)) { | |
| 2418 | mg_send_header(c, "Transfer-Encoding", "chunked"); | |
| 2419 | mg_write(c, "\r\n", 2); | |
| 2420 | conn->ns_conn->flags |= MG_HEADERS_SENT; | |
| 2421 | } | |
| 2416 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2417 | if (!(conn->ns_conn->flags & MG_HEADERS_SENT)) { | |
| 2418 | mg_send_header(c, "Transfer-Encoding", "chunked"); | |
| 2419 | mg_write(c, "\r\n", 2); | |
| 2420 | conn->ns_conn->flags |= MG_HEADERS_SENT; | |
| 2421 | } | |
| 2422 | 2422 | } |
| 2423 | 2423 | |
| 2424 | 2424 | size_t mg_send_data(struct mg_connection *c, const void *data, int data_len) { |
| 2425 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2426 | terminate_headers(c); | |
| 2427 | write_chunk(MG_CONN_2_CONN(c), (const char *) data, data_len); | |
| 2428 | return conn->ns_conn->send_iobuf.len; | |
| 2425 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2426 | terminate_headers(c); | |
| 2427 | write_chunk(MG_CONN_2_CONN(c), (const char *) data, data_len); | |
| 2428 | return conn->ns_conn->send_iobuf.len; | |
| 2429 | 2429 | } |
| 2430 | 2430 | |
| 2431 | 2431 | size_t mg_printf_data(struct mg_connection *c, const char *fmt, ...) { |
| 2432 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2433 | va_list ap; | |
| 2434 | int len; | |
| 2435 | char mem[IOBUF_SIZE], *buf = mem; | |
| 2432 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 2433 | va_list ap; | |
| 2434 | int len; | |
| 2435 | char mem[IOBUF_SIZE], *buf = mem; | |
| 2436 | 2436 | |
| 2437 | ||
| 2437 | terminate_headers(c); | |
| 2438 | 2438 | |
| 2439 | va_start(ap, fmt); | |
| 2440 | len = ns_avprintf(&buf, sizeof(mem), fmt, ap); | |
| 2441 | va_end(ap); | |
| 2439 | va_start(ap, fmt); | |
| 2440 | len = ns_avprintf(&buf, sizeof(mem), fmt, ap); | |
| 2441 | va_end(ap); | |
| 2442 | 2442 | |
| 2443 | if (len >= 0) { | |
| 2444 | write_chunk((struct connection *) conn, buf, len); | |
| 2445 | } | |
| 2446 | if (buf != mem && buf != NULL) { | |
| 2447 | free(buf); | |
| 2448 | } | |
| 2449 | return conn->ns_conn->send_iobuf.len; | |
| 2443 | if (len >= 0) { | |
| 2444 | write_chunk((struct connection *) conn, buf, len); | |
| 2445 | } | |
| 2446 | if (buf != mem && buf != NULL) { | |
| 2447 | free(buf); | |
| 2448 | } | |
| 2449 | return conn->ns_conn->send_iobuf.len; | |
| 2450 | 2450 | } |
| 2451 | 2451 | |
| 2452 | 2452 | #if !defined(MONGOOSE_NO_WEBSOCKET) || !defined(MONGOOSE_NO_AUTH) |
| 2453 | 2453 | static int is_big_endian(void) { |
| 2454 | static const int n = 1; | |
| 2455 | return ((char *) &n)[0] == 0; | |
| 2454 | static const int n = 1; | |
| 2455 | return ((char *) &n)[0] == 0; | |
| 2456 | 2456 | } |
| 2457 | 2457 | #endif |
| 2458 | 2458 | |
| r31373 | r31374 | |
| 2469 | 2469 | #define rol(value, bits) (((value) << (bits)) | ((value) >> (32 - (bits)))) |
| 2470 | 2470 | |
| 2471 | 2471 | static uint32_t blk0(union char64long16 *block, int i) { |
| 2472 | // Forrest: SHA expect BIG_ENDIAN, swap if LITTLE_ENDIAN | |
| 2473 | if (!is_big_endian()) { | |
| 2474 | block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) | | |
| 2475 | (rol(block->l[i], 8) & 0x00FF00FF); | |
| 2476 | } | |
| 2477 | return block->l[i]; | |
| 2472 | // Forrest: SHA expect BIG_ENDIAN, swap if LITTLE_ENDIAN | |
| 2473 | if (!is_big_endian()) { | |
| 2474 | block->l[i] = (rol(block->l[i], 24) & 0xFF00FF00) | | |
| 2475 | (rol(block->l[i], 8) & 0x00FF00FF); | |
| 2476 | } | |
| 2477 | return block->l[i]; | |
| 2478 | 2478 | } |
| 2479 | 2479 | |
| 2480 | 2480 | #define blk(i) (block->l[i&15] = rol(block->l[(i+13)&15]^block->l[(i+8)&15] \ |
| 2481 | ||
| 2481 | ^block->l[(i+2)&15]^block->l[i&15],1)) | |
| 2482 | 2482 | #define R0(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk0(block, i)+0x5A827999+rol(v,5);w=rol(w,30); |
| 2483 | 2483 | #define R1(v,w,x,y,z,i) z+=((w&(x^y))^y)+blk(i)+0x5A827999+rol(v,5);w=rol(w,30); |
| 2484 | 2484 | #define R2(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0x6ED9EBA1+rol(v,5);w=rol(w,30); |
| r31373 | r31374 | |
| 2486 | 2486 | #define R4(v,w,x,y,z,i) z+=(w^x^y)+blk(i)+0xCA62C1D6+rol(v,5);w=rol(w,30); |
| 2487 | 2487 | |
| 2488 | 2488 | typedef struct { |
| 2489 | uint32_t state[5]; | |
| 2490 | uint32_t count[2]; | |
| 2491 | unsigned char buffer[64]; | |
| 2489 | uint32_t state[5]; | |
| 2490 | uint32_t count[2]; | |
| 2491 | unsigned char buffer[64]; | |
| 2492 | 2492 | } SHA1_CTX; |
| 2493 | 2493 | |
| 2494 | 2494 | static void SHA1Transform(uint32_t state[5], const unsigned char buffer[64]) { |
| 2495 | uint32_t a, b, c, d, e; | |
| 2496 | union char64long16 block[1]; | |
| 2495 | uint32_t a, b, c, d, e; | |
| 2496 | union char64long16 block[1]; | |
| 2497 | 2497 | |
| 2498 | memcpy(block, buffer, 64); | |
| 2499 | a = state[0]; | |
| 2500 | b = state[1]; | |
| 2501 | c = state[2]; | |
| 2502 | d = state[3]; | |
| 2503 | e = state[4]; | |
| 2504 | R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); | |
| 2505 | R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); | |
| 2506 | R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); | |
| 2507 | R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); | |
| 2508 | R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); | |
| 2509 | R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); | |
| 2510 | R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); | |
| 2511 | R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); | |
| 2512 | R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); | |
| 2513 | R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); | |
| 2514 | R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); | |
| 2515 | R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); | |
| 2516 | R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); | |
| 2517 | R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); | |
| 2518 | R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); | |
| 2519 | R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); | |
| 2520 | R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); | |
| 2521 | R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); | |
| 2522 | R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); | |
| 2523 | R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); | |
| 2524 | state[0] += a; | |
| 2525 | state[1] += b; | |
| 2526 | state[2] += c; | |
| 2527 | state[3] += d; | |
| 2528 | state[4] += e; | |
| 2529 | // Erase working structures. The order of operations is important, | |
| 2530 | // used to ensure that compiler doesn't optimize those out. | |
| 2531 | memset(block, 0, sizeof(block)); | |
| 2532 | a = b = c = d = e = 0; | |
| 2533 | (void) a; (void) b; (void) c; (void) d; (void) e; | |
| 2498 | memcpy(block, buffer, 64); | |
| 2499 | a = state[0]; | |
| 2500 | b = state[1]; | |
| 2501 | c = state[2]; | |
| 2502 | d = state[3]; | |
| 2503 | e = state[4]; | |
| 2504 | R0(a,b,c,d,e, 0); R0(e,a,b,c,d, 1); R0(d,e,a,b,c, 2); R0(c,d,e,a,b, 3); | |
| 2505 | R0(b,c,d,e,a, 4); R0(a,b,c,d,e, 5); R0(e,a,b,c,d, 6); R0(d,e,a,b,c, 7); | |
| 2506 | R0(c,d,e,a,b, 8); R0(b,c,d,e,a, 9); R0(a,b,c,d,e,10); R0(e,a,b,c,d,11); | |
| 2507 | R0(d,e,a,b,c,12); R0(c,d,e,a,b,13); R0(b,c,d,e,a,14); R0(a,b,c,d,e,15); | |
| 2508 | R1(e,a,b,c,d,16); R1(d,e,a,b,c,17); R1(c,d,e,a,b,18); R1(b,c,d,e,a,19); | |
| 2509 | R2(a,b,c,d,e,20); R2(e,a,b,c,d,21); R2(d,e,a,b,c,22); R2(c,d,e,a,b,23); | |
| 2510 | R2(b,c,d,e,a,24); R2(a,b,c,d,e,25); R2(e,a,b,c,d,26); R2(d,e,a,b,c,27); | |
| 2511 | R2(c,d,e,a,b,28); R2(b,c,d,e,a,29); R2(a,b,c,d,e,30); R2(e,a,b,c,d,31); | |
| 2512 | R2(d,e,a,b,c,32); R2(c,d,e,a,b,33); R2(b,c,d,e,a,34); R2(a,b,c,d,e,35); | |
| 2513 | R2(e,a,b,c,d,36); R2(d,e,a,b,c,37); R2(c,d,e,a,b,38); R2(b,c,d,e,a,39); | |
| 2514 | R3(a,b,c,d,e,40); R3(e,a,b,c,d,41); R3(d,e,a,b,c,42); R3(c,d,e,a,b,43); | |
| 2515 | R3(b,c,d,e,a,44); R3(a,b,c,d,e,45); R3(e,a,b,c,d,46); R3(d,e,a,b,c,47); | |
| 2516 | R3(c,d,e,a,b,48); R3(b,c,d,e,a,49); R3(a,b,c,d,e,50); R3(e,a,b,c,d,51); | |
| 2517 | R3(d,e,a,b,c,52); R3(c,d,e,a,b,53); R3(b,c,d,e,a,54); R3(a,b,c,d,e,55); | |
| 2518 | R3(e,a,b,c,d,56); R3(d,e,a,b,c,57); R3(c,d,e,a,b,58); R3(b,c,d,e,a,59); | |
| 2519 | R4(a,b,c,d,e,60); R4(e,a,b,c,d,61); R4(d,e,a,b,c,62); R4(c,d,e,a,b,63); | |
| 2520 | R4(b,c,d,e,a,64); R4(a,b,c,d,e,65); R4(e,a,b,c,d,66); R4(d,e,a,b,c,67); | |
| 2521 | R4(c,d,e,a,b,68); R4(b,c,d,e,a,69); R4(a,b,c,d,e,70); R4(e,a,b,c,d,71); | |
| 2522 | R4(d,e,a,b,c,72); R4(c,d,e,a,b,73); R4(b,c,d,e,a,74); R4(a,b,c,d,e,75); | |
| 2523 | R4(e,a,b,c,d,76); R4(d,e,a,b,c,77); R4(c,d,e,a,b,78); R4(b,c,d,e,a,79); | |
| 2524 | state[0] += a; | |
| 2525 | state[1] += b; | |
| 2526 | state[2] += c; | |
| 2527 | state[3] += d; | |
| 2528 | state[4] += e; | |
| 2529 | // Erase working structures. The order of operations is important, | |
| 2530 | // used to ensure that compiler doesn't optimize those out. | |
| 2531 | memset(block, 0, sizeof(block)); | |
| 2532 | a = b = c = d = e = 0; | |
| 2533 | (void) a; (void) b; (void) c; (void) d; (void) e; | |
| 2534 | 2534 | } |
| 2535 | 2535 | |
| 2536 | 2536 | static void SHA1Init(SHA1_CTX* context) { |
| 2537 | context->state[0] = 0x67452301; | |
| 2538 | context->state[1] = 0xEFCDAB89; | |
| 2539 | context->state[2] = 0x98BADCFE; | |
| 2540 | context->state[3] = 0x10325476; | |
| 2541 | context->state[4] = 0xC3D2E1F0; | |
| 2542 | context->count[0] = context->count[1] = 0; | |
| 2537 | context->state[0] = 0x67452301; | |
| 2538 | context->state[1] = 0xEFCDAB89; | |
| 2539 | context->state[2] = 0x98BADCFE; | |
| 2540 | context->state[3] = 0x10325476; | |
| 2541 | context->state[4] = 0xC3D2E1F0; | |
| 2542 | context->count[0] = context->count[1] = 0; | |
| 2543 | 2543 | } |
| 2544 | 2544 | |
| 2545 | 2545 | static void SHA1Update(SHA1_CTX* context, const unsigned char* data, |
| 2546 | uint32_t len) { | |
| 2547 | uint32_t i, j; | |
| 2546 | uint32_t len) { | |
| 2547 | uint32_t i, j; | |
| 2548 | 2548 | |
| 2549 | j = context->count[0]; | |
| 2550 | if ((context->count[0] += len << 3) < j) | |
| 2551 | context->count[1]++; | |
| 2552 | context->count[1] += (len>>29); | |
| 2553 | j = (j >> 3) & 63; | |
| 2554 | if ((j + len) > 63) { | |
| 2555 | memcpy(&context->buffer[j], data, (i = 64-j)); | |
| 2556 | SHA1Transform(context->state, context->buffer); | |
| 2557 | for ( ; i + 63 < len; i += 64) { | |
| 2558 | SHA1Transform(context->state, &data[i]); | |
| 2559 | } | |
| 2560 | j = 0; | |
| 2561 | } | |
| 2562 | else i = 0; | |
| 2563 | memcpy(&context->buffer[j], &data[i], len - i); | |
| 2549 | j = context->count[0]; | |
| 2550 | if ((context->count[0] += len << 3) < j) | |
| 2551 | context->count[1]++; | |
| 2552 | context->count[1] += (len>>29); | |
| 2553 | j = (j >> 3) & 63; | |
| 2554 | if ((j + len) > 63) { | |
| 2555 | memcpy(&context->buffer[j], data, (i = 64-j)); | |
| 2556 | SHA1Transform(context->state, context->buffer); | |
| 2557 | for ( ; i + 63 < len; i += 64) { | |
| 2558 | SHA1Transform(context->state, &data[i]); | |
| 2559 | } | |
| 2560 | j = 0; | |
| 2561 | } | |
| 2562 | else i = 0; | |
| 2563 | memcpy(&context->buffer[j], &data[i], len - i); | |
| 2564 | 2564 | } |
| 2565 | 2565 | |
| 2566 | 2566 | static void SHA1Final(unsigned char digest[20], SHA1_CTX* context) { |
| 2567 | unsigned i; | |
| 2568 | unsigned char finalcount[8], c; | |
| 2567 | unsigned i; | |
| 2568 | unsigned char finalcount[8], c; | |
| 2569 | 2569 | |
| 2570 | for (i = 0; i < 8; i++) { | |
| 2571 | finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] | |
| 2572 | >> ((3-(i & 3)) * 8) ) & 255); | |
| 2573 | } | |
| 2574 | c = 0200; | |
| 2575 | SHA1Update(context, &c, 1); | |
| 2576 | while ((context->count[0] & 504) != 448) { | |
| 2577 | c = 0000; | |
| 2578 | SHA1Update(context, &c, 1); | |
| 2579 | } | |
| 2580 | SHA1Update(context, finalcount, 8); | |
| 2581 | for (i = 0; i < 20; i++) { | |
| 2582 | digest[i] = (unsigned char) | |
| 2583 | ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); | |
| 2584 | } | |
| 2585 | memset(context, '\0', sizeof(*context)); | |
| 2586 | memset(&finalcount, '\0', sizeof(finalcount)); | |
| 2570 | for (i = 0; i < 8; i++) { | |
| 2571 | finalcount[i] = (unsigned char)((context->count[(i >= 4 ? 0 : 1)] | |
| 2572 | >> ((3-(i & 3)) * 8) ) & 255); | |
| 2573 | } | |
| 2574 | c = 0200; | |
| 2575 | SHA1Update(context, &c, 1); | |
| 2576 | while ((context->count[0] & 504) != 448) { | |
| 2577 | c = 0000; | |
| 2578 | SHA1Update(context, &c, 1); | |
| 2579 | } | |
| 2580 | SHA1Update(context, finalcount, 8); | |
| 2581 | for (i = 0; i < 20; i++) { | |
| 2582 | digest[i] = (unsigned char) | |
| 2583 | ((context->state[i>>2] >> ((3-(i & 3)) * 8) ) & 255); | |
| 2584 | } | |
| 2585 | memset(context, '\0', sizeof(*context)); | |
| 2586 | memset(&finalcount, '\0', sizeof(finalcount)); | |
| 2587 | 2587 | } |
| 2588 | 2588 | // END OF SHA1 CODE |
| 2589 | 2589 | |
| 2590 | 2590 | static void base64_encode(const unsigned char *src, int src_len, char *dst) { |
| 2591 | static const char *b64 = | |
| 2592 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
| 2593 | int i, j, a, b, c; | |
| 2591 | static const char *b64 = | |
| 2592 | "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; | |
| 2593 | int i, j, a, b, c; | |
| 2594 | 2594 | |
| 2595 | for (i = j = 0; i < src_len; i += 3) { | |
| 2596 | a = src[i]; | |
| 2597 | b = i + 1 >= src_len ? 0 : src[i + 1]; | |
| 2598 | c = i + 2 >= src_len ? 0 : src[i + 2]; | |
| 2595 | for (i = j = 0; i < src_len; i += 3) { | |
| 2596 | a = src[i]; | |
| 2597 | b = i + 1 >= src_len ? 0 : src[i + 1]; | |
| 2598 | c = i + 2 >= src_len ? 0 : src[i + 2]; | |
| 2599 | 2599 | |
| 2600 | dst[j++] = b64[a >> 2]; | |
| 2601 | dst[j++] = b64[((a & 3) << 4) | (b >> 4)]; | |
| 2602 | if (i + 1 < src_len) { | |
| 2603 | dst[j++] = b64[(b & 15) << 2 | (c >> 6)]; | |
| 2604 | } | |
| 2605 | if (i + 2 < src_len) { | |
| 2606 | dst[j++] = b64[c & 63]; | |
| 2607 | } | |
| 2608 | } | |
| 2609 | while (j % 4 != 0) { | |
| 2610 | dst[j++] = '='; | |
| 2611 | } | |
| 2612 | dst[j++] = '\0'; | |
| 2600 | dst[j++] = b64[a >> 2]; | |
| 2601 | dst[j++] = b64[((a & 3) << 4) | (b >> 4)]; | |
| 2602 | if (i + 1 < src_len) { | |
| 2603 | dst[j++] = b64[(b & 15) << 2 | (c >> 6)]; | |
| 2604 | } | |
| 2605 | if (i + 2 < src_len) { | |
| 2606 | dst[j++] = b64[c & 63]; | |
| 2607 | } | |
| 2608 | } | |
| 2609 | while (j % 4 != 0) { | |
| 2610 | dst[j++] = '='; | |
| 2611 | } | |
| 2612 | dst[j++] = '\0'; | |
| 2613 | 2613 | } |
| 2614 | 2614 | |
| 2615 | 2615 | static void send_websocket_handshake(struct mg_connection *conn, |
| 2616 | const char *key) { | |
| 2617 | static const char *magic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; | |
| 2618 | char buf[500], sha[20], b64_sha[sizeof(sha) * 2]; | |
| 2619 | SHA1_CTX sha_ctx; | |
| 2616 | const char *key) { | |
| 2617 | static const char *magic = "258EAFA5-E914-47DA-95CA-C5AB0DC85B11"; | |
| 2618 | char buf[500], sha[20], b64_sha[sizeof(sha) * 2]; | |
| 2619 | SHA1_CTX sha_ctx; | |
| 2620 | 2620 | |
| 2621 | mg_snprintf(buf, sizeof(buf), "%s%s", key, magic); | |
| 2622 | SHA1Init(&sha_ctx); | |
| 2623 | SHA1Update(&sha_ctx, (unsigned char *) buf, strlen(buf)); | |
| 2624 | SHA1Final((unsigned char *) sha, &sha_ctx); | |
| 2625 | base64_encode((unsigned char *) sha, sizeof(sha), b64_sha); | |
| 2626 | mg_snprintf(buf, sizeof(buf), "%s%s%s", | |
| 2627 | "HTTP/1.1 101 Switching Protocols\r\n" | |
| 2628 | "Upgrade: websocket\r\n" | |
| 2629 | "Connection: Upgrade\r\n" | |
| 2630 | "Sec-WebSocket-Accept: ", b64_sha, "\r\n\r\n"); | |
| 2621 | mg_snprintf(buf, sizeof(buf), "%s%s", key, magic); | |
| 2622 | SHA1Init(&sha_ctx); | |
| 2623 | SHA1Update(&sha_ctx, (unsigned char *) buf, strlen(buf)); | |
| 2624 | SHA1Final((unsigned char *) sha, &sha_ctx); | |
| 2625 | base64_encode((unsigned char *) sha, sizeof(sha), b64_sha); | |
| 2626 | mg_snprintf(buf, sizeof(buf), "%s%s%s", | |
| 2627 | "HTTP/1.1 101 Switching Protocols\r\n" | |
| 2628 | "Upgrade: websocket\r\n" | |
| 2629 | "Connection: Upgrade\r\n" | |
| 2630 | "Sec-WebSocket-Accept: ", b64_sha, "\r\n\r\n"); | |
| 2631 | 2631 | |
| 2632 | ||
| 2632 | mg_write(conn, buf, strlen(buf)); | |
| 2633 | 2633 | } |
| 2634 | 2634 | |
| 2635 | 2635 | static int deliver_websocket_frame(struct connection *conn) { |
| 2636 | // Having buf unsigned char * is important, as it is used below in arithmetic | |
| 2637 | unsigned char *buf = (unsigned char *) conn->ns_conn->recv_iobuf.buf; | |
| 2638 | int i, len, buf_len = conn->ns_conn->recv_iobuf.len, frame_len = 0, | |
| 2639 | mask_len = 0, header_len = 0, data_len = 0, buffered = 0; | |
| 2636 | // Having buf unsigned char * is important, as it is used below in arithmetic | |
| 2637 | unsigned char *buf = (unsigned char *) conn->ns_conn->recv_iobuf.buf; | |
| 2638 | int i, len, buf_len = conn->ns_conn->recv_iobuf.len, frame_len = 0, | |
| 2639 | mask_len = 0, header_len = 0, data_len = 0, buffered = 0; | |
| 2640 | 2640 | |
| 2641 | if (buf_len >= 2) { | |
| 2642 | len = buf[1] & 127; | |
| 2643 | mask_len = buf[1] & 128 ? 4 : 0; | |
| 2644 | if (len < 126 && buf_len >= mask_len) { | |
| 2645 | data_len = len; | |
| 2646 | header_len = 2 + mask_len; | |
| 2647 | } else if (len == 126 && buf_len >= 4 + mask_len) { | |
| 2648 | header_len = 4 + mask_len; | |
| 2649 | data_len = ((((int) buf[2]) << 8) + buf[3]); | |
| 2650 | } else if (buf_len >= 10 + mask_len) { | |
| 2651 | header_len = 10 + mask_len; | |
| 2652 | data_len = (int) (((uint64_t) htonl(* (uint32_t *) &buf[2])) << 32) + | |
| 2653 | htonl(* (uint32_t *) &buf[6]); | |
| 2654 | } | |
| 2655 | } | |
| 2641 | if (buf_len >= 2) { | |
| 2642 | len = buf[1] & 127; | |
| 2643 | mask_len = buf[1] & 128 ? 4 : 0; | |
| 2644 | if (len < 126 && buf_len >= mask_len) { | |
| 2645 | data_len = len; | |
| 2646 | header_len = 2 + mask_len; | |
| 2647 | } else if (len == 126 && buf_len >= 4 + mask_len) { | |
| 2648 | header_len = 4 + mask_len; | |
| 2649 | data_len = ((((int) buf[2]) << 8) + buf[3]); | |
| 2650 | } else if (buf_len >= 10 + mask_len) { | |
| 2651 | header_len = 10 + mask_len; | |
| 2652 | data_len = (int) (((uint64_t) htonl(* (uint32_t *) &buf[2])) << 32) + | |
| 2653 | htonl(* (uint32_t *) &buf[6]); | |
| 2654 | } | |
| 2655 | } | |
| 2656 | 2656 | |
| 2657 | frame_len = header_len + data_len; | |
| 2658 | buffered = frame_len > 0 && frame_len <= buf_len; | |
| 2657 | frame_len = header_len + data_len; | |
| 2658 | buffered = frame_len > 0 && frame_len <= buf_len; | |
| 2659 | 2659 | |
| 2660 | if (buffered) { | |
| 2661 | conn->mg_conn.content_len = data_len; | |
| 2662 | conn->mg_conn.content = (char *) buf + header_len; | |
| 2663 | conn->mg_conn.wsbits = buf[0]; | |
| 2660 | if (buffered) { | |
| 2661 | conn->mg_conn.content_len = data_len; | |
| 2662 | conn->mg_conn.content = (char *) buf + header_len; | |
| 2663 | conn->mg_conn.wsbits = buf[0]; | |
| 2664 | 2664 | |
| 2665 | // Apply mask if necessary | |
| 2666 | if (mask_len > 0) { | |
| 2667 | for (i = 0; i < data_len; i++) { | |
| 2668 | buf[i + header_len] ^= (buf + header_len - mask_len)[i % 4]; | |
| 2669 | } | |
| 2670 | } | |
| 2665 | // Apply mask if necessary | |
| 2666 | if (mask_len > 0) { | |
| 2667 | for (i = 0; i < data_len; i++) { | |
| 2668 | buf[i + header_len] ^= (buf + header_len - mask_len)[i % 4]; | |
| 2669 | } | |
| 2670 | } | |
| 2671 | 2671 | |
| 2672 | // Call the handler and remove frame from the iobuf | |
| 2673 | if (call_user(conn, MG_REQUEST) == MG_FALSE) { | |
| 2674 | conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA; | |
| 2675 | } | |
| 2676 | iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len); | |
| 2677 | } | |
| 2672 | // Call the handler and remove frame from the iobuf | |
| 2673 | if (call_user(conn, MG_REQUEST) == MG_FALSE) { | |
| 2674 | conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA; | |
| 2675 | } | |
| 2676 | iobuf_remove(&conn->ns_conn->recv_iobuf, frame_len); | |
| 2677 | } | |
| 2678 | 2678 | |
| 2679 | ||
| 2679 | return buffered; | |
| 2680 | 2680 | } |
| 2681 | 2681 | |
| 2682 | 2682 | size_t mg_websocket_write(struct mg_connection* conn, int opcode, |
| 2683 | const char *data, size_t data_len) { | |
| 2684 | unsigned char mem[4192], *copy = mem; | |
| 2685 | size_t copy_len = 0; | |
| 2683 | const char *data, size_t data_len) { | |
| 2684 | unsigned char mem[4192], *copy = mem; | |
| 2685 | size_t copy_len = 0; | |
| 2686 | 2686 | |
| 2687 | if (data_len + 10 > sizeof(mem) && | |
| 2688 | (copy = (unsigned char *) malloc(data_len + 10)) == NULL) { | |
| 2689 | return 0; | |
| 2690 | } | |
| 2687 | if (data_len + 10 > sizeof(mem) && | |
| 2688 | (copy = (unsigned char *) malloc(data_len + 10)) == NULL) { | |
| 2689 | return 0; | |
| 2690 | } | |
| 2691 | 2691 | |
| 2692 | ||
| 2692 | copy[0] = 0x80 + (opcode & 0x0f); | |
| 2693 | 2693 | |
| 2694 | // Frame format: http://tools.ietf.org/html/rfc6455#section-5.2 | |
| 2695 | if (data_len < 126) { | |
| 2696 | // Inline 7-bit length field | |
| 2697 | copy[1] = data_len; | |
| 2698 | memcpy(copy + 2, data, data_len); | |
| 2699 | copy_len = 2 + data_len; | |
| 2700 | } else if (data_len <= 0xFFFF) { | |
| 2701 | // 16-bit length field | |
| 2702 | copy[1] = 126; | |
| 2703 | * (uint16_t *) (copy + 2) = (uint16_t) htons((uint16_t) data_len); | |
| 2704 | memcpy(copy + 4, data, data_len); | |
| 2705 | copy_len = 4 + data_len; | |
| 2706 | } else { | |
| 2707 | // 64-bit length field | |
| 2708 | copy[1] = 127; | |
| 2709 | * (uint32_t *) (copy + 2) = (uint32_t) | |
| 2710 | htonl((uint32_t) ((uint64_t) data_len >> 32)); | |
| 2711 | * (uint32_t *) (copy + 6) = (uint32_t) htonl(data_len & 0xffffffff); | |
| 2712 | memcpy(copy + 10, data, data_len); | |
| 2713 | copy_len = 10 + data_len; | |
| 2714 | } | |
| 2694 | // Frame format: http://tools.ietf.org/html/rfc6455#section-5.2 | |
| 2695 | if (data_len < 126) { | |
| 2696 | // Inline 7-bit length field | |
| 2697 | copy[1] = data_len; | |
| 2698 | memcpy(copy + 2, data, data_len); | |
| 2699 | copy_len = 2 + data_len; | |
| 2700 | } else if (data_len <= 0xFFFF) { | |
| 2701 | // 16-bit length field | |
| 2702 | copy[1] = 126; | |
| 2703 | * (uint16_t *) (copy + 2) = (uint16_t) htons((uint16_t) data_len); | |
| 2704 | memcpy(copy + 4, data, data_len); | |
| 2705 | copy_len = 4 + data_len; | |
| 2706 | } else { | |
| 2707 | // 64-bit length field | |
| 2708 | copy[1] = 127; | |
| 2709 | * (uint32_t *) (copy + 2) = (uint32_t) | |
| 2710 | htonl((uint32_t) ((uint64_t) data_len >> 32)); | |
| 2711 | * (uint32_t *) (copy + 6) = (uint32_t) htonl(data_len & 0xffffffff); | |
| 2712 | memcpy(copy + 10, data, data_len); | |
| 2713 | copy_len = 10 + data_len; | |
| 2714 | } | |
| 2715 | 2715 | |
| 2716 | if (copy_len > 0) { | |
| 2717 | mg_write(conn, copy, copy_len); | |
| 2718 | } | |
| 2719 | if (copy != mem) { | |
| 2720 | free(copy); | |
| 2721 | } | |
| 2716 | if (copy_len > 0) { | |
| 2717 | mg_write(conn, copy, copy_len); | |
| 2718 | } | |
| 2719 | if (copy != mem) { | |
| 2720 | free(copy); | |
| 2721 | } | |
| 2722 | 2722 | |
| 2723 | // If we send closing frame, schedule a connection to be closed after | |
| 2724 | // data is drained to the client. | |
| 2725 | if (opcode == WEBSOCKET_OPCODE_CONNECTION_CLOSE) { | |
| 2726 | MG_CONN_2_CONN(conn)->ns_conn->flags |= NSF_FINISHED_SENDING_DATA; | |
| 2727 | } | |
| 2723 | // If we send closing frame, schedule a connection to be closed after | |
| 2724 | // data is drained to the client. | |
| 2725 | if (opcode == WEBSOCKET_OPCODE_CONNECTION_CLOSE) { | |
| 2726 | MG_CONN_2_CONN(conn)->ns_conn->flags |= NSF_FINISHED_SENDING_DATA; | |
| 2727 | } | |
| 2728 | 2728 | |
| 2729 | ||
| 2729 | return MG_CONN_2_CONN(conn)->ns_conn->send_iobuf.len; | |
| 2730 | 2730 | } |
| 2731 | 2731 | |
| 2732 | 2732 | size_t mg_websocket_printf(struct mg_connection* conn, int opcode, |
| 2733 | const char *fmt, ...) { | |
| 2734 | char mem[4192], *buf = mem; | |
| 2735 | va_list ap; | |
| 2736 | int len; | |
| 2733 | const char *fmt, ...) { | |
| 2734 | char mem[4192], *buf = mem; | |
| 2735 | va_list ap; | |
| 2736 | int len; | |
| 2737 | 2737 | |
| 2738 | va_start(ap, fmt); | |
| 2739 | if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) { | |
| 2740 | mg_websocket_write(conn, opcode, buf, len); | |
| 2741 | } | |
| 2742 | va_end(ap); | |
| 2738 | va_start(ap, fmt); | |
| 2739 | if ((len = ns_avprintf(&buf, sizeof(mem), fmt, ap)) > 0) { | |
| 2740 | mg_websocket_write(conn, opcode, buf, len); | |
| 2741 | } | |
| 2742 | va_end(ap); | |
| 2743 | 2743 | |
| 2744 | if (buf != mem && buf != NULL) { | |
| 2745 | free(buf); | |
| 2746 | } | |
| 2744 | if (buf != mem && buf != NULL) { | |
| 2745 | free(buf); | |
| 2746 | } | |
| 2747 | 2747 | |
| 2748 | ||
| 2748 | return MG_CONN_2_CONN(conn)->ns_conn->send_iobuf.len; | |
| 2749 | 2749 | } |
| 2750 | 2750 | |
| 2751 | 2751 | static void send_websocket_handshake_if_requested(struct mg_connection *conn) { |
| 2752 | const char *ver = mg_get_header(conn, "Sec-WebSocket-Version"), | |
| 2753 | *key = mg_get_header(conn, "Sec-WebSocket-Key"); | |
| 2754 | if (ver != NULL && key != NULL) { | |
| 2755 | conn->is_websocket = 1; | |
| 2756 | if (call_user(MG_CONN_2_CONN(conn), MG_WS_HANDSHAKE) == MG_FALSE) { | |
| 2757 | send_websocket_handshake(conn, key); | |
| 2758 | } | |
| 2759 | call_user(MG_CONN_2_CONN(conn), MG_WS_CONNECT); | |
| 2760 | } | |
| 2752 | const char *ver = mg_get_header(conn, "Sec-WebSocket-Version"), | |
| 2753 | *key = mg_get_header(conn, "Sec-WebSocket-Key"); | |
| 2754 | if (ver != NULL && key != NULL) { | |
| 2755 | conn->is_websocket = 1; | |
| 2756 | if (call_user(MG_CONN_2_CONN(conn), MG_WS_HANDSHAKE) == MG_FALSE) { | |
| 2757 | send_websocket_handshake(conn, key); | |
| 2758 | } | |
| 2759 | call_user(MG_CONN_2_CONN(conn), MG_WS_CONNECT); | |
| 2760 | } | |
| 2761 | 2761 | } |
| 2762 | 2762 | |
| 2763 | 2763 | static void ping_idle_websocket_connection(struct connection *conn, time_t t) { |
| 2764 | if (t - conn->ns_conn->last_io_time > MONGOOSE_USE_WEBSOCKET_PING_INTERVAL) { | |
| 2765 | mg_websocket_write(&conn->mg_conn, WEBSOCKET_OPCODE_PING, "", 0); | |
| 2766 | } | |
| 2764 | if (t - conn->ns_conn->last_io_time > MONGOOSE_USE_WEBSOCKET_PING_INTERVAL) { | |
| 2765 | mg_websocket_write(&conn->mg_conn, WEBSOCKET_OPCODE_PING, "", 0); | |
| 2766 | } | |
| 2767 | 2767 | } |
| 2768 | 2768 | #else |
| 2769 | 2769 | #define ping_idle_websocket_connection(conn, t) |
| 2770 | 2770 | #endif // !MONGOOSE_NO_WEBSOCKET |
| 2771 | 2771 | |
| 2772 | 2772 | static void write_terminating_chunk(struct connection *conn) { |
| 2773 | ||
| 2773 | mg_write(&conn->mg_conn, "0\r\n\r\n", 5); | |
| 2774 | 2774 | } |
| 2775 | 2775 | |
| 2776 | 2776 | static int call_request_handler(struct connection *conn) { |
| 2777 | int result; | |
| 2778 | conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf; | |
| 2779 | if ((result = call_user(conn, MG_REQUEST)) == MG_TRUE) { | |
| 2780 | if (conn->ns_conn->flags & MG_HEADERS_SENT) { | |
| 2781 | write_terminating_chunk(conn); | |
| 2782 | } | |
| 2783 | close_local_endpoint(conn); | |
| 2784 | } | |
| 2785 | return result; | |
| 2777 | int result; | |
| 2778 | conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf; | |
| 2779 | if ((result = call_user(conn, MG_REQUEST)) == MG_TRUE) { | |
| 2780 | if (conn->ns_conn->flags & MG_HEADERS_SENT) { | |
| 2781 | write_terminating_chunk(conn); | |
| 2782 | } | |
| 2783 | close_local_endpoint(conn); | |
| 2784 | } | |
| 2785 | return result; | |
| 2786 | 2786 | } |
| 2787 | 2787 | |
| 2788 | 2788 | const char *mg_get_mime_type(const char *path, const char *default_mime_type) { |
| 2789 | const char *ext; | |
| 2790 | size_t i, path_len; | |
| 2789 | const char *ext; | |
| 2790 | size_t i, path_len; | |
| 2791 | 2791 | |
| 2792 | ||
| 2792 | path_len = strlen(path); | |
| 2793 | 2793 | |
| 2794 | for (i = 0; static_builtin_mime_types[i].extension != NULL; i++) { | |
| 2795 | ext = path + (path_len - static_builtin_mime_types[i].ext_len); | |
| 2796 | if (path_len > static_builtin_mime_types[i].ext_len && | |
| 2797 | mg_strcasecmp(ext, static_builtin_mime_types[i].extension) == 0) { | |
| 2798 | return static_builtin_mime_types[i].mime_type; | |
| 2799 | } | |
| 2800 | } | |
| 2794 | for (i = 0; static_builtin_mime_types[i].extension != NULL; i++) { | |
| 2795 | ext = path + (path_len - static_builtin_mime_types[i].ext_len); | |
| 2796 | if (path_len > static_builtin_mime_types[i].ext_len && | |
| 2797 | mg_strcasecmp(ext, static_builtin_mime_types[i].extension) == 0) { | |
| 2798 | return static_builtin_mime_types[i].mime_type; | |
| 2799 | } | |
| 2800 | } | |
| 2801 | 2801 | |
| 2802 | ||
| 2802 | return default_mime_type; | |
| 2803 | 2803 | } |
| 2804 | 2804 | |
| 2805 | 2805 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 2806 | 2806 | // Convert month to the month number. Return -1 on error, or month number |
| 2807 | 2807 | static int get_month_index(const char *s) { |
| 2808 | static const char *month_names[] = { | |
| 2809 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", | |
| 2810 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" | |
| 2811 | }; | |
| 2812 | int i; | |
| 2808 | static const char *month_names[] = { | |
| 2809 | "Jan", "Feb", "Mar", "Apr", "May", "Jun", | |
| 2810 | "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" | |
| 2811 | }; | |
| 2812 | int i; | |
| 2813 | 2813 | |
| 2814 | for (i = 0; i < (int) ARRAY_SIZE(month_names); i++) | |
| 2815 | if (!strcmp(s, month_names[i])) | |
| 2816 | return i; | |
| 2814 | for (i = 0; i < (int) ARRAY_SIZE(month_names); i++) | |
| 2815 | if (!strcmp(s, month_names[i])) | |
| 2816 | return i; | |
| 2817 | 2817 | |
| 2818 | ||
| 2818 | return -1; | |
| 2819 | 2819 | } |
| 2820 | 2820 | |
| 2821 | 2821 | static int num_leap_years(int year) { |
| 2822 | ||
| 2822 | return year / 4 - year / 100 + year / 400; | |
| 2823 | 2823 | } |
| 2824 | 2824 | |
| 2825 | 2825 | // Parse UTC date-time string, and return the corresponding time_t value. |
| 2826 | 2826 | static time_t parse_date_string(const char *datetime) { |
| 2827 | static const unsigned short days_before_month[] = { | |
| 2828 | 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 | |
| 2829 | }; | |
| 2830 | char month_str[32]; | |
| 2831 | int second, minute, hour, day, month, year, leap_days, days; | |
| 2832 | time_t result = (time_t) 0; | |
| 2827 | static const unsigned short days_before_month[] = { | |
| 2828 | 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 | |
| 2829 | }; | |
| 2830 | char month_str[32]; | |
| 2831 | int second, minute, hour, day, month, year, leap_days, days; | |
| 2832 | time_t result = (time_t) 0; | |
| 2833 | 2833 | |
| 2834 | if (((sscanf(datetime, "%d/%3s/%d %d:%d:%d", | |
| 2835 | &day, month_str, &year, &hour, &minute, &second) == 6) || | |
| 2836 | (sscanf(datetime, "%d %3s %d %d:%d:%d", | |
| 2837 | &day, month_str, &year, &hour, &minute, &second) == 6) || | |
| 2838 | (sscanf(datetime, "%*3s, %d %3s %d %d:%d:%d", | |
| 2839 | &day, month_str, &year, &hour, &minute, &second) == 6) || | |
| 2840 | (sscanf(datetime, "%d-%3s-%d %d:%d:%d", | |
| 2841 | &day, month_str, &year, &hour, &minute, &second) == 6)) && | |
| 2842 | year > 1970 && | |
| 2843 | (month = get_month_index(month_str)) != -1) { | |
| 2844 | leap_days = num_leap_years(year) - num_leap_years(1970); | |
| 2845 | year -= 1970; | |
| 2846 | days = year * 365 + days_before_month[month] + (day - 1) + leap_days; | |
| 2847 | result = days * 24 * 3600 + hour * 3600 + minute * 60 + second; | |
| 2848 | } | |
| 2834 | if (((sscanf(datetime, "%d/%3s/%d %d:%d:%d", | |
| 2835 | &day, month_str, &year, &hour, &minute, &second) == 6) || | |
| 2836 | (sscanf(datetime, "%d %3s %d %d:%d:%d", | |
| 2837 | &day, month_str, &year, &hour, &minute, &second) == 6) || | |
| 2838 | (sscanf(datetime, "%*3s, %d %3s %d %d:%d:%d", | |
| 2839 | &day, month_str, &year, &hour, &minute, &second) == 6) || | |
| 2840 | (sscanf(datetime, "%d-%3s-%d %d:%d:%d", | |
| 2841 | &day, month_str, &year, &hour, &minute, &second) == 6)) && | |
| 2842 | year > 1970 && | |
| 2843 | (month = get_month_index(month_str)) != -1) { | |
| 2844 | leap_days = num_leap_years(year) - num_leap_years(1970); | |
| 2845 | year -= 1970; | |
| 2846 | days = year * 365 + days_before_month[month] + (day - 1) + leap_days; | |
| 2847 | result = days * 24 * 3600 + hour * 3600 + minute * 60 + second; | |
| 2848 | } | |
| 2849 | 2849 | |
| 2850 | ||
| 2850 | return result; | |
| 2851 | 2851 | } |
| 2852 | 2852 | |
| 2853 | 2853 | // Look at the "path" extension and figure what mime type it has. |
| 2854 | 2854 | // Store mime type in the vector. |
| 2855 | 2855 | static void get_mime_type(const struct mg_server *server, const char *path, |
| 2856 | struct vec *vec) { | |
| 2857 | struct vec ext_vec, mime_vec; | |
| 2858 | const char *list, *ext; | |
| 2859 | size_t path_len; | |
| 2856 | struct vec *vec) { | |
| 2857 | struct vec ext_vec, mime_vec; | |
| 2858 | const char *list, *ext; | |
| 2859 | size_t path_len; | |
| 2860 | 2860 | |
| 2861 | ||
| 2861 | path_len = strlen(path); | |
| 2862 | 2862 | |
| 2863 | // Scan user-defined mime types first, in case user wants to | |
| 2864 | // override default mime types. | |
| 2865 | list = server->config_options[EXTRA_MIME_TYPES]; | |
| 2866 | while ((list = next_option(list, &ext_vec, &mime_vec)) != NULL) { | |
| 2867 | // ext now points to the path suffix | |
| 2868 | ext = path + path_len - ext_vec.len; | |
| 2869 | if (mg_strncasecmp(ext, ext_vec.ptr, ext_vec.len) == 0) { | |
| 2870 | *vec = mime_vec; | |
| 2871 | return; | |
| 2872 | } | |
| 2873 | } | |
| 2863 | // Scan user-defined mime types first, in case user wants to | |
| 2864 | // override default mime types. | |
| 2865 | list = server->config_options[EXTRA_MIME_TYPES]; | |
| 2866 | while ((list = next_option(list, &ext_vec, &mime_vec)) != NULL) { | |
| 2867 | // ext now points to the path suffix | |
| 2868 | ext = path + path_len - ext_vec.len; | |
| 2869 | if (mg_strncasecmp(ext, ext_vec.ptr, ext_vec.len) == 0) { | |
| 2870 | *vec = mime_vec; | |
| 2871 | return; | |
| 2872 | } | |
| 2873 | } | |
| 2874 | 2874 | |
| 2875 | vec->ptr = mg_get_mime_type(path, "text/plain"); | |
| 2876 | vec->len = strlen(vec->ptr); | |
| 2875 | vec->ptr = mg_get_mime_type(path, "text/plain"); | |
| 2876 | vec->len = strlen(vec->ptr); | |
| 2877 | 2877 | } |
| 2878 | 2878 | |
| 2879 | 2879 | static const char *suggest_connection_header(const struct mg_connection *conn) { |
| 2880 | ||
| 2880 | return should_keep_alive(conn) ? "keep-alive" : "close"; | |
| 2881 | 2881 | } |
| 2882 | 2882 | |
| 2883 | 2883 | static void construct_etag(char *buf, size_t buf_len, const file_stat_t *st) { |
| 2884 | mg_snprintf(buf, buf_len, "\"%lx.%" INT64_FMT "\"", | |
| 2885 | (unsigned long) st->st_mtime, (int64_t) st->st_size); | |
| 2884 | mg_snprintf(buf, buf_len, "\"%lx.%" INT64_FMT "\"", | |
| 2885 | (unsigned long) st->st_mtime, (int64_t) st->st_size); | |
| 2886 | 2886 | } |
| 2887 | 2887 | |
| 2888 | 2888 | // Return True if we should reply 304 Not Modified. |
| 2889 | 2889 | static int is_not_modified(const struct connection *conn, |
| 2890 | const file_stat_t *stp) { | |
| 2891 | char etag[64]; | |
| 2892 | const char *ims = mg_get_header(&conn->mg_conn, "If-Modified-Since"); | |
| 2893 | const char *inm = mg_get_header(&conn->mg_conn, "If-None-Match"); | |
| 2894 | construct_etag(etag, sizeof(etag), stp); | |
| 2895 | return (inm != NULL && !mg_strcasecmp(etag, inm)) || | |
| 2896 | (ims != NULL && stp->st_mtime <= parse_date_string(ims)); | |
| 2890 | const file_stat_t *stp) { | |
| 2891 | char etag[64]; | |
| 2892 | const char *ims = mg_get_header(&conn->mg_conn, "If-Modified-Since"); | |
| 2893 | const char *inm = mg_get_header(&conn->mg_conn, "If-None-Match"); | |
| 2894 | construct_etag(etag, sizeof(etag), stp); | |
| 2895 | return (inm != NULL && !mg_strcasecmp(etag, inm)) || | |
| 2896 | (ims != NULL && stp->st_mtime <= parse_date_string(ims)); | |
| 2897 | 2897 | } |
| 2898 | 2898 | |
| 2899 | 2899 | // For given directory path, substitute it to valid index file. |
| 2900 | 2900 | // Return 0 if index file has been found, -1 if not found. |
| 2901 | 2901 | // If the file is found, it's stats is returned in stp. |
| 2902 | 2902 | static int find_index_file(struct connection *conn, char *path, |
| 2903 | size_t path_len, file_stat_t *stp) { | |
| 2904 | const char *list = conn->server->config_options[INDEX_FILES]; | |
| 2905 | file_stat_t st; | |
| 2906 | struct vec filename_vec; | |
| 2907 | size_t n = strlen(path), found = 0; | |
| 2903 | size_t path_len, file_stat_t *stp) { | |
| 2904 | const char *list = conn->server->config_options[INDEX_FILES]; | |
| 2905 | file_stat_t st; | |
| 2906 | struct vec filename_vec; | |
| 2907 | size_t n = strlen(path), found = 0; | |
| 2908 | 2908 | |
| 2909 | // The 'path' given to us points to the directory. Remove all trailing | |
| 2910 | // directory separator characters from the end of the path, and | |
| 2911 | // then append single directory separator character. | |
| 2912 | while (n > 0 && path[n - 1] == '/') { | |
| 2913 | n--; | |
| 2914 | } | |
| 2915 | path[n] = '/'; | |
| 2909 | // The 'path' given to us points to the directory. Remove all trailing | |
| 2910 | // directory separator characters from the end of the path, and | |
| 2911 | // then append single directory separator character. | |
| 2912 | while (n > 0 && path[n - 1] == '/') { | |
| 2913 | n--; | |
| 2914 | } | |
| 2915 | path[n] = '/'; | |
| 2916 | 2916 | |
| 2917 | // Traverse index files list. For each entry, append it to the given | |
| 2918 | // path and see if the file exists. If it exists, break the loop | |
| 2919 | while ((list = next_option(list, &filename_vec, NULL)) != NULL) { | |
| 2917 | // Traverse index files list. For each entry, append it to the given | |
| 2918 | // path and see if the file exists. If it exists, break the loop | |
| 2919 | while ((list = next_option(list, &filename_vec, NULL)) != NULL) { | |
| 2920 | // Ignore too long entries that may overflow path buffer | |
| 2921 | if (filename_vec.len > (int) (path_len - (n + 2))) | |
| 2922 | continue; | |
| 2920 | 2923 | |
| 2921 | // Ignore too long entries that may overflow path buffer | |
| 2922 | if (filename_vec.len > (int) (path_len - (n + 2))) | |
| 2923 | continue; | |
| 2924 | // Prepare full path to the index file | |
| 2925 | strncpy(path + n + 1, filename_vec.ptr, filename_vec.len); | |
| 2926 | path[n + 1 + filename_vec.len] = '\0'; | |
| 2924 | 2927 | |
| 2925 | // Prepare full path to the index file | |
| 2926 | strncpy(path + n + 1, filename_vec.ptr, filename_vec.len); | |
| 2927 | path[n + 1 + filename_vec.len] = '\0'; | |
| 2928 | //DBG(("[%s]", path)); | |
| 2928 | 2929 | |
| 2929 | //DBG(("[%s]", path)); | |
| 2930 | // Does it exist? | |
| 2931 | if (!stat(path, &st)) { | |
| 2932 | // Yes it does, break the loop | |
| 2933 | *stp = st; | |
| 2934 | found = 1; | |
| 2935 | break; | |
| 2936 | } | |
| 2937 | } | |
| 2930 | 2938 | |
| 2931 | // Does it exist? | |
| 2932 | if (!stat(path, &st)) { | |
| 2933 | // Yes it does, break the loop | |
| 2934 | *stp = st; | |
| 2935 | found = 1; | |
| 2936 | break; | |
| 2937 | } | |
| 2938 | } | |
| 2939 | // If no index file exists, restore directory path | |
| 2940 | if (!found) { | |
| 2941 | path[n] = '\0'; | |
| 2942 | } | |
| 2939 | 2943 | |
| 2940 | // If no index file exists, restore directory path | |
| 2941 | if (!found) { | |
| 2942 | path[n] = '\0'; | |
| 2943 | } | |
| 2944 | ||
| 2945 | return found; | |
| 2944 | return found; | |
| 2946 | 2945 | } |
| 2947 | 2946 | |
| 2948 | 2947 | static int parse_range_header(const char *header, int64_t *a, int64_t *b) { |
| 2949 | ||
| 2948 | return sscanf(header, "bytes=%" INT64_FMT "-%" INT64_FMT, a, b); | |
| 2950 | 2949 | } |
| 2951 | 2950 | |
| 2952 | 2951 | static void gmt_time_string(char *buf, size_t buf_len, time_t *t) { |
| 2953 | ||
| 2952 | strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S GMT", gmtime(t)); | |
| 2954 | 2953 | } |
| 2955 | 2954 | |
| 2956 | 2955 | static void open_file_endpoint(struct connection *conn, const char *path, |
| 2957 | file_stat_t *st) { | |
| 2958 | char date[64], lm[64], etag[64], range[64], headers[500]; | |
| 2959 | const char *msg = "OK", *hdr; | |
| 2960 | time_t curtime = time(NULL); | |
| 2961 | int64_t r1, r2; | |
| 2962 | struct vec mime_vec; | |
| 2963 | int n; | |
| 2956 | file_stat_t *st) { | |
| 2957 | char date[64], lm[64], etag[64], range[64], headers[500]; | |
| 2958 | const char *msg = "OK", *hdr; | |
| 2959 | time_t curtime = time(NULL); | |
| 2960 | int64_t r1, r2; | |
| 2961 | struct vec mime_vec; | |
| 2962 | int n; | |
| 2964 | 2963 | |
| 2965 | conn->endpoint_type = EP_FILE; | |
| 2966 | ns_set_close_on_exec(conn->endpoint.fd); | |
| 2967 | conn->mg_conn.status_code = 200; | |
| 2964 | conn->endpoint_type = EP_FILE; | |
| 2965 | ns_set_close_on_exec(conn->endpoint.fd); | |
| 2966 | conn->mg_conn.status_code = 200; | |
| 2968 | 2967 | |
| 2969 | get_mime_type(conn->server, path, &mime_vec); | |
| 2970 | conn->cl = st->st_size; | |
| 2971 | range[0] = '\0'; | |
| 2968 | get_mime_type(conn->server, path, &mime_vec); | |
| 2969 | conn->cl = st->st_size; | |
| 2970 | range[0] = '\0'; | |
| 2972 | 2971 | |
| 2973 | // If Range: header specified, act accordingly | |
| 2974 | r1 = r2 = 0; | |
| 2975 | hdr = mg_get_header(&conn->mg_conn, "Range"); | |
| 2976 | if (hdr != NULL && (n = parse_range_header(hdr, &r1, &r2)) > 0 && | |
| 2977 | r1 >= 0 && r2 >= 0) { | |
| 2978 | conn->mg_conn.status_code = 206; | |
| 2979 | conn->cl = n == 2 ? (r2 > conn->cl ? conn->cl : r2) - r1 + 1: conn->cl - r1; | |
| 2980 | mg_snprintf(range, sizeof(range), "Content-Range: bytes " | |
| 2981 | "%" INT64_FMT "-%" INT64_FMT "/%" INT64_FMT "\r\n", | |
| 2982 | r1, r1 + conn->cl - 1, (int64_t) st->st_size); | |
| 2983 | msg = "Partial Content"; | |
| 2984 | lseek(conn->endpoint.fd, r1, SEEK_SET); | |
| 2985 | } | |
| 2972 | // If Range: header specified, act accordingly | |
| 2973 | r1 = r2 = 0; | |
| 2974 | hdr = mg_get_header(&conn->mg_conn, "Range"); | |
| 2975 | if (hdr != NULL && (n = parse_range_header(hdr, &r1, &r2)) > 0 && | |
| 2976 | r1 >= 0 && r2 >= 0) { | |
| 2977 | conn->mg_conn.status_code = 206; | |
| 2978 | conn->cl = n == 2 ? (r2 > conn->cl ? conn->cl : r2) - r1 + 1: conn->cl - r1; | |
| 2979 | mg_snprintf(range, sizeof(range), "Content-Range: bytes " | |
| 2980 | "%" INT64_FMT "-%" INT64_FMT "/%" INT64_FMT "\r\n", | |
| 2981 | r1, r1 + conn->cl - 1, (int64_t) st->st_size); | |
| 2982 | msg = "Partial Content"; | |
| 2983 | lseek(conn->endpoint.fd, r1, SEEK_SET); | |
| 2984 | } | |
| 2986 | 2985 | |
| 2987 | // Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to | |
| 2988 | // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 | |
| 2989 | gmt_time_string(date, sizeof(date), &curtime); | |
| 2990 | gmt_time_string(lm, sizeof(lm), &st->st_mtime); | |
| 2991 | construct_etag(etag, sizeof(etag), st); | |
| 2986 | // Prepare Etag, Date, Last-Modified headers. Must be in UTC, according to | |
| 2987 | // http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3 | |
| 2988 | gmt_time_string(date, sizeof(date), &curtime); | |
| 2989 | gmt_time_string(lm, sizeof(lm), &st->st_mtime); | |
| 2990 | construct_etag(etag, sizeof(etag), st); | |
| 2992 | 2991 | |
| 2993 | n = mg_snprintf(headers, sizeof(headers), | |
| 2994 | "HTTP/1.1 %d %s\r\n" | |
| 2995 | "Date: %s\r\n" | |
| 2996 | "Last-Modified: %s\r\n" | |
| 2997 | "Etag: %s\r\n" | |
| 2998 | "Content-Type: %.*s\r\n" | |
| 2999 | "Content-Length: %" INT64_FMT "\r\n" | |
| 3000 | "Connection: %s\r\n" | |
| 3001 | "Accept-Ranges: bytes\r\n" | |
| 3002 | "%s%s\r\n", | |
| 3003 | conn->mg_conn.status_code, msg, date, lm, etag, | |
| 3004 | (int) mime_vec.len, mime_vec.ptr, conn->cl, | |
| 3005 | suggest_connection_header(&conn->mg_conn), | |
| 3006 | range, MONGOOSE_USE_EXTRA_HTTP_HEADERS); | |
| 3007 | ns_send(conn->ns_conn, headers, n); | |
| 2992 | n = mg_snprintf(headers, sizeof(headers), | |
| 2993 | "HTTP/1.1 %d %s\r\n" | |
| 2994 | "Date: %s\r\n" | |
| 2995 | "Last-Modified: %s\r\n" | |
| 2996 | "Etag: %s\r\n" | |
| 2997 | "Content-Type: %.*s\r\n" | |
| 2998 | "Content-Length: %" INT64_FMT "\r\n" | |
| 2999 | "Connection: %s\r\n" | |
| 3000 | "Accept-Ranges: bytes\r\n" | |
| 3001 | "%s%s\r\n", | |
| 3002 | conn->mg_conn.status_code, msg, date, lm, etag, | |
| 3003 | (int) mime_vec.len, mime_vec.ptr, conn->cl, | |
| 3004 | suggest_connection_header(&conn->mg_conn), | |
| 3005 | range, MONGOOSE_USE_EXTRA_HTTP_HEADERS); | |
| 3006 | ns_send(conn->ns_conn, headers, n); | |
| 3008 | 3007 | |
| 3009 | if (!strcmp(conn->mg_conn.request_method, "HEAD")) { | |
| 3010 | conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA; | |
| 3011 | close(conn->endpoint.fd); | |
| 3012 | conn->endpoint_type = EP_NONE; | |
| 3013 | } | |
| 3008 | if (!strcmp(conn->mg_conn.request_method, "HEAD")) { | |
| 3009 | conn->ns_conn->flags |= NSF_FINISHED_SENDING_DATA; | |
| 3010 | close(conn->endpoint.fd); | |
| 3011 | conn->endpoint_type = EP_NONE; | |
| 3012 | } | |
| 3014 | 3013 | } |
| 3015 | 3014 | #endif // MONGOOSE_NO_FILESYSTEM |
| 3016 | 3015 | |
| 3017 | 3016 | static void call_request_handler_if_data_is_buffered(struct connection *conn) { |
| 3018 | struct iobuf *loc = &conn->ns_conn->recv_iobuf; | |
| 3019 | struct mg_connection *c = &conn->mg_conn; | |
| 3017 | struct iobuf *loc = &conn->ns_conn->recv_iobuf; | |
| 3018 | struct mg_connection *c = &conn->mg_conn; | |
| 3020 | 3019 | |
| 3021 | 3020 | #ifndef MONGOOSE_NO_WEBSOCKET |
| 3022 | if (conn->mg_conn.is_websocket) { | |
| 3023 | do { } while (deliver_websocket_frame(conn)); | |
| 3024 | } else | |
| 3021 | if (conn->mg_conn.is_websocket) { | |
| 3022 | do { } while (deliver_websocket_frame(conn)); | |
| 3023 | } else | |
| 3025 | 3024 | #endif |
| 3026 | if ((size_t) loc->len >= c->content_len && | |
| 3027 | call_request_handler(conn) == MG_FALSE) { | |
| 3028 | open_local_endpoint(conn, 1); | |
| 3029 | } | |
| 3025 | if ((size_t) loc->len >= c->content_len && | |
| 3026 | call_request_handler(conn) == MG_FALSE) { | |
| 3027 | open_local_endpoint(conn, 1); | |
| 3028 | } | |
| 3030 | 3029 | } |
| 3031 | 3030 | |
| 3032 | 3031 | #if !defined(MONGOOSE_NO_DIRECTORY_LISTING) || !defined(MONGOOSE_NO_DAV) |
| 3033 | 3032 | |
| 3034 | 3033 | #ifdef _WIN32 |
| 3035 | 3034 | struct dirent { |
| 3036 | ||
| 3035 | char d_name[MAX_PATH_SIZE]; | |
| 3037 | 3036 | }; |
| 3038 | 3037 | |
| 3039 | 3038 | typedef struct DIR { |
| 3040 | HANDLE handle; | |
| 3041 | WIN32_FIND_DATAW info; | |
| 3042 | struct dirent result; | |
| 3039 | HANDLE handle; | |
| 3040 | WIN32_FIND_DATAW info; | |
| 3041 | struct dirent result; | |
| 3043 | 3042 | } DIR; |
| 3044 | 3043 | |
| 3045 | 3044 | // Implementation of POSIX opendir/closedir/readdir for Windows. |
| 3046 | 3045 | static DIR *opendir(const char *name) { |
| 3047 | DIR *dir = NULL; | |
| 3048 | wchar_t wpath[MAX_PATH_SIZE]; | |
| 3049 | DWORD attrs; | |
| 3046 | DIR *dir = NULL; | |
| 3047 | wchar_t wpath[MAX_PATH_SIZE]; | |
| 3048 | DWORD attrs; | |
| 3050 | 3049 | |
| 3051 | if (name == NULL) { | |
| 3052 | SetLastError(ERROR_BAD_ARGUMENTS); | |
| 3053 | } else if ((dir = (DIR *) malloc(sizeof(*dir))) == NULL) { | |
| 3054 | SetLastError(ERROR_NOT_ENOUGH_MEMORY); | |
| 3055 | } else { | |
| 3056 | to_wchar(name, wpath, ARRAY_SIZE(wpath)); | |
| 3057 | attrs = GetFileAttributesW(wpath); | |
| 3058 | if (attrs != 0xFFFFFFFF && | |
| 3059 | ((attrs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)) { | |
| 3060 | (void) wcscat(wpath, L"\\*"); | |
| 3061 | dir->handle = FindFirstFileW(wpath, &dir->info); | |
| 3062 | dir->result.d_name[0] = '\0'; | |
| 3063 | } else { | |
| 3064 | free(dir); | |
| 3065 | dir = NULL; | |
| 3066 | } | |
| 3067 | } | |
| 3050 | if (name == NULL) { | |
| 3051 | SetLastError(ERROR_BAD_ARGUMENTS); | |
| 3052 | } else if ((dir = (DIR *) malloc(sizeof(*dir))) == NULL) { | |
| 3053 | SetLastError(ERROR_NOT_ENOUGH_MEMORY); | |
| 3054 | } else { | |
| 3055 | to_wchar(name, wpath, ARRAY_SIZE(wpath)); | |
| 3056 | attrs = GetFileAttributesW(wpath); | |
| 3057 | if (attrs != 0xFFFFFFFF && | |
| 3058 | ((attrs & FILE_ATTRIBUTE_DIRECTORY) == FILE_ATTRIBUTE_DIRECTORY)) { | |
| 3059 | (void) wcscat(wpath, L"\\*"); | |
| 3060 | dir->handle = FindFirstFileW(wpath, &dir->info); | |
| 3061 | dir->result.d_name[0] = '\0'; | |
| 3062 | } else { | |
| 3063 | free(dir); | |
| 3064 | dir = NULL; | |
| 3065 | } | |
| 3066 | } | |
| 3068 | 3067 | |
| 3069 | ||
| 3068 | return dir; | |
| 3070 | 3069 | } |
| 3071 | 3070 | |
| 3072 | 3071 | static int closedir(DIR *dir) { |
| 3073 | ||
| 3072 | int result = 0; | |
| 3074 | 3073 | |
| 3075 | if (dir != NULL) { | |
| 3076 | if (dir->handle != INVALID_HANDLE_VALUE) | |
| 3077 | result = FindClose(dir->handle) ? 0 : -1; | |
| 3074 | if (dir != NULL) { | |
| 3075 | if (dir->handle != INVALID_HANDLE_VALUE) | |
| 3076 | result = FindClose(dir->handle) ? 0 : -1; | |
| 3078 | 3077 | |
| 3079 | free(dir); | |
| 3080 | } else { | |
| 3081 | result = -1; | |
| 3082 | SetLastError(ERROR_BAD_ARGUMENTS); | |
| 3083 | } | |
| 3078 | free(dir); | |
| 3079 | } else { | |
| 3080 | result = -1; | |
| 3081 | SetLastError(ERROR_BAD_ARGUMENTS); | |
| 3082 | } | |
| 3084 | 3083 | |
| 3085 | ||
| 3084 | return result; | |
| 3086 | 3085 | } |
| 3087 | 3086 | |
| 3088 | 3087 | static struct dirent *readdir(DIR *dir) { |
| 3089 | ||
| 3088 | struct dirent *result = 0; | |
| 3090 | 3089 | |
| 3091 | if (dir) { | |
| 3092 | if (dir->handle != INVALID_HANDLE_VALUE) { | |
| 3093 | result = &dir->result; | |
| 3094 | (void) WideCharToMultiByte(CP_UTF8, 0, | |
| 3095 | dir->info.cFileName, -1, result->d_name, | |
| 3096 | sizeof(result->d_name), NULL, NULL); | |
| 3090 | if (dir) { | |
| 3091 | if (dir->handle != INVALID_HANDLE_VALUE) { | |
| 3092 | result = &dir->result; | |
| 3093 | (void) WideCharToMultiByte(CP_UTF8, 0, | |
| 3094 | dir->info.cFileName, -1, result->d_name, | |
| 3095 | sizeof(result->d_name), NULL, NULL); | |
| 3097 | 3096 | |
| 3098 | if (!FindNextFileW(dir->handle, &dir->info)) { | |
| 3099 | (void) FindClose(dir->handle); | |
| 3100 | dir->handle = INVALID_HANDLE_VALUE; | |
| 3101 | } | |
| 3097 | if (!FindNextFileW(dir->handle, &dir->info)) { | |
| 3098 | (void) FindClose(dir->handle); | |
| 3099 | dir->handle = INVALID_HANDLE_VALUE; | |
| 3100 | } | |
| 3102 | 3101 | |
| 3103 | } else { | |
| 3104 | SetLastError(ERROR_FILE_NOT_FOUND); | |
| 3105 | } | |
| 3106 | } else { | |
| 3107 | SetLastError(ERROR_BAD_ARGUMENTS); | |
| 3108 | } | |
| 3102 | } else { | |
| 3103 | SetLastError(ERROR_FILE_NOT_FOUND); | |
| 3104 | } | |
| 3105 | } else { | |
| 3106 | SetLastError(ERROR_BAD_ARGUMENTS); | |
| 3107 | } | |
| 3109 | 3108 | |
| 3110 | ||
| 3109 | return result; | |
| 3111 | 3110 | } |
| 3112 | 3111 | #endif // _WIN32 POSIX opendir/closedir/readdir implementation |
| 3113 | 3112 | |
| 3114 | 3113 | static int scan_directory(struct connection *conn, const char *dir, |
| 3115 | struct dir_entry **arr) { | |
| 3116 | char path[MAX_PATH_SIZE]; | |
| 3117 | struct dir_entry *p; | |
| 3118 | struct dirent *dp; | |
| 3119 | int arr_size = 0, arr_ind = 0, inc = 100; | |
| 3120 | DIR *dirp; | |
| 3114 | struct dir_entry **arr) { | |
| 3115 | char path[MAX_PATH_SIZE]; | |
| 3116 | struct dir_entry *p; | |
| 3117 | struct dirent *dp; | |
| 3118 | int arr_size = 0, arr_ind = 0, inc = 100; | |
| 3119 | DIR *dirp; | |
| 3121 | 3120 | |
| 3122 | *arr = NULL; | |
| 3123 | if ((dirp = (opendir(dir))) == NULL) return 0; | |
| 3121 | *arr = NULL; | |
| 3122 | if ((dirp = (opendir(dir))) == NULL) return 0; | |
| 3124 | 3123 | |
| 3125 | while ((dp = readdir(dirp)) != NULL) { | |
| 3126 | // Do not show current dir and hidden files | |
| 3127 | if (!strcmp(dp->d_name, ".") || | |
| 3128 | !strcmp(dp->d_name, "..") || | |
| 3129 | must_hide_file(conn, dp->d_name)) { | |
| 3130 | continue; | |
| 3131 | } | |
| 3132 | mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name); | |
| 3124 | while ((dp = readdir(dirp)) != NULL) { | |
| 3125 | // Do not show current dir and hidden files | |
| 3126 | if (!strcmp(dp->d_name, ".") || | |
| 3127 | !strcmp(dp->d_name, "..") || | |
| 3128 | must_hide_file(conn, dp->d_name)) { | |
| 3129 | continue; | |
| 3130 | } | |
| 3131 | mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name); | |
| 3133 | 3132 | |
| 3134 | // Resize the array if nesessary | |
| 3135 | if (arr_ind >= arr_size) { | |
| 3136 | if ((p = (struct dir_entry *) | |
| 3137 | realloc(*arr, (inc + arr_size) * sizeof(**arr))) != NULL) { | |
| 3138 | // Memset new chunk to zero, otherwize st_mtime will have garbage which | |
| 3139 | // can make strftime() segfault, see | |
| 3140 | // http://code.google.com/p/mongoose/issues/detail?id=79 | |
| 3141 | memset(p + arr_size, 0, sizeof(**arr) * inc); | |
| 3133 | // Resize the array if nesessary | |
| 3134 | if (arr_ind >= arr_size) { | |
| 3135 | if ((p = (struct dir_entry *) | |
| 3136 | realloc(*arr, (inc + arr_size) * sizeof(**arr))) != NULL) { | |
| 3137 | // Memset new chunk to zero, otherwize st_mtime will have garbage which | |
| 3138 | // can make strftime() segfault, see | |
| 3139 | // http://code.google.com/p/mongoose/issues/detail?id=79 | |
| 3140 | memset(p + arr_size, 0, sizeof(**arr) * inc); | |
| 3142 | 3141 | |
| 3143 | *arr = p; | |
| 3144 | arr_size += inc; | |
| 3145 | } | |
| 3146 | } | |
| 3142 | *arr = p; | |
| 3143 | arr_size += inc; | |
| 3144 | } | |
| 3145 | } | |
| 3147 | 3146 | |
| 3148 | if (arr_ind < arr_size) { | |
| 3149 | (*arr)[arr_ind].conn = conn; | |
| 3150 | (*arr)[arr_ind].file_name = strdup(dp->d_name); | |
| 3151 | stat(path, &(*arr)[arr_ind].st); | |
| 3152 | arr_ind++; | |
| 3153 | } | |
| 3154 | } | |
| 3155 | closedir(dirp); | |
| 3147 | if (arr_ind < arr_size) { | |
| 3148 | (*arr)[arr_ind].conn = conn; | |
| 3149 | (*arr)[arr_ind].file_name = strdup(dp->d_name); | |
| 3150 | stat(path, &(*arr)[arr_ind].st); | |
| 3151 | arr_ind++; | |
| 3152 | } | |
| 3153 | } | |
| 3154 | closedir(dirp); | |
| 3156 | 3155 | |
| 3157 | ||
| 3156 | return arr_ind; | |
| 3158 | 3157 | } |
| 3159 | 3158 | |
| 3160 | 3159 | int mg_url_encode(const char *src, size_t s_len, char *dst, size_t dst_len) { |
| 3161 | static const char *dont_escape = "._-$,;~()"; | |
| 3162 | static const char *hex = "0123456789abcdef"; | |
| 3163 | size_t i = 0, j = 0; | |
| 3160 | static const char *dont_escape = "._-$,;~()"; | |
| 3161 | static const char *hex = "0123456789abcdef"; | |
| 3162 | size_t i = 0, j = 0; | |
| 3164 | 3163 | |
| 3165 | for (i = j = 0; dst_len > 0 && i < s_len && j < dst_len - 1; i++, j++) { | |
| 3166 | if (isalnum(* (const unsigned char *) (src + i)) || | |
| 3167 | strchr(dont_escape, * (const unsigned char *) (src + i)) != NULL) { | |
| 3168 | dst[j] = src[i]; | |
| 3169 | } else if (j + 3 < dst_len) { | |
| 3170 | dst[j] = '%'; | |
| 3171 | dst[j + 1] = hex[(* (const unsigned char *) (src + i)) >> 4]; | |
| 3172 | dst[j + 2] = hex[(* (const unsigned char *) (src + i)) & 0xf]; | |
| 3173 | j += 2; | |
| 3174 | } | |
| 3175 | } | |
| 3164 | for (i = j = 0; dst_len > 0 && i < s_len && j < dst_len - 1; i++, j++) { | |
| 3165 | if (isalnum(* (const unsigned char *) (src + i)) || | |
| 3166 | strchr(dont_escape, * (const unsigned char *) (src + i)) != NULL) { | |
| 3167 | dst[j] = src[i]; | |
| 3168 | } else if (j + 3 < dst_len) { | |
| 3169 | dst[j] = '%'; | |
| 3170 | dst[j + 1] = hex[(* (const unsigned char *) (src + i)) >> 4]; | |
| 3171 | dst[j + 2] = hex[(* (const unsigned char *) (src + i)) & 0xf]; | |
| 3172 | j += 2; | |
| 3173 | } | |
| 3174 | } | |
| 3176 | 3175 | |
| 3177 | dst[j] = '\0'; | |
| 3178 | return j; | |
| 3176 | dst[j] = '\0'; | |
| 3177 | return j; | |
| 3179 | 3178 | } |
| 3180 | 3179 | #endif // !NO_DIRECTORY_LISTING || !MONGOOSE_NO_DAV |
| 3181 | 3180 | |
| 3182 | 3181 | #ifndef MONGOOSE_NO_DIRECTORY_LISTING |
| 3183 | 3182 | |
| 3184 | 3183 | static void print_dir_entry(const struct dir_entry *de) { |
| 3185 | char size[64], mod[64], href[MAX_PATH_SIZE * 3]; | |
| 3186 | int64_t fsize = de->st.st_size; | |
| 3187 | int is_dir = S_ISDIR(de->st.st_mode); | |
| 3188 | const char *slash = is_dir ? "/" : ""; | |
| 3184 | char size[64], mod[64], href[MAX_PATH_SIZE * 3]; | |
| 3185 | int64_t fsize = de->st.st_size; | |
| 3186 | int is_dir = S_ISDIR(de->st.st_mode); | |
| 3187 | const char *slash = is_dir ? "/" : ""; | |
| 3189 | 3188 | |
| 3190 | if (is_dir) { | |
| 3191 | mg_snprintf(size, sizeof(size), "%s", "[DIRECTORY]"); | |
| 3192 | } else { | |
| 3193 | // We use (signed) cast below because MSVC 6 compiler cannot | |
| 3194 | // convert unsigned __int64 to double. | |
| 3195 | if (fsize < 1024) { | |
| 3196 | mg_snprintf(size, sizeof(size), "%d", (int) fsize); | |
| 3197 | } else if (fsize < 0x100000) { | |
| 3198 | mg_snprintf(size, sizeof(size), "%.1fk", (double) fsize / 1024.0); | |
| 3199 | } else if (fsize < 0x40000000) { | |
| 3200 | mg_snprintf(size, sizeof(size), "%.1fM", (double) fsize / 1048576); | |
| 3201 | } else { | |
| 3202 | mg_snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824); | |
| 3203 | } | |
| 3204 | } | |
| 3205 | strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&de->st.st_mtime)); | |
| 3206 | mg_url_encode(de->file_name, strlen(de->file_name), href, sizeof(href)); | |
| 3207 | mg_printf_data(&de->conn->mg_conn, | |
| 3208 | "<tr><td><a href=\"%s%s\">%s%s</a></td>" | |
| 3209 | "<td> %s</td><td> %s</td></tr>\n", | |
| 3210 | href, slash, de->file_name, slash, mod, size); | |
| 3189 | if (is_dir) { | |
| 3190 | mg_snprintf(size, sizeof(size), "%s", "[DIRECTORY]"); | |
| 3191 | } else { | |
| 3192 | // We use (signed) cast below because MSVC 6 compiler cannot | |
| 3193 | // convert unsigned __int64 to double. | |
| 3194 | if (fsize < 1024) { | |
| 3195 | mg_snprintf(size, sizeof(size), "%d", (int) fsize); | |
| 3196 | } else if (fsize < 0x100000) { | |
| 3197 | mg_snprintf(size, sizeof(size), "%.1fk", (double) fsize / 1024.0); | |
| 3198 | } else if (fsize < 0x40000000) { | |
| 3199 | mg_snprintf(size, sizeof(size), "%.1fM", (double) fsize / 1048576); | |
| 3200 | } else { | |
| 3201 | mg_snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824); | |
| 3202 | } | |
| 3203 | } | |
| 3204 | strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&de->st.st_mtime)); | |
| 3205 | mg_url_encode(de->file_name, strlen(de->file_name), href, sizeof(href)); | |
| 3206 | mg_printf_data(&de->conn->mg_conn, | |
| 3207 | "<tr><td><a href=\"%s%s\">%s%s</a></td>" | |
| 3208 | "<td> %s</td><td> %s</td></tr>\n", | |
| 3209 | href, slash, de->file_name, slash, mod, size); | |
| 3211 | 3210 | } |
| 3212 | 3211 | |
| 3213 | 3212 | // Sort directory entries by size, or name, or modification time. |
| 3214 | 3213 | // On windows, __cdecl specification is needed in case if project is built |
| 3215 | 3214 | // with __stdcall convention. qsort always requires __cdels callback. |
| 3216 | 3215 | static int __cdecl compare_dir_entries(const void *p1, const void *p2) { |
| 3217 | const struct dir_entry *a = (const struct dir_entry *) p1, | |
| 3218 | *b = (const struct dir_entry *) p2; | |
| 3219 | const char *qs = a->conn->mg_conn.query_string ? | |
| 3220 | a->conn->mg_conn.query_string : "na"; | |
| 3221 | int cmp_result = 0; | |
| 3216 | const struct dir_entry *a = (const struct dir_entry *) p1, | |
| 3217 | *b = (const struct dir_entry *) p2; | |
| 3218 | const char *qs = a->conn->mg_conn.query_string ? | |
| 3219 | a->conn->mg_conn.query_string : "na"; | |
| 3220 | int cmp_result = 0; | |
| 3222 | 3221 | |
| 3223 | if (S_ISDIR(a->st.st_mode) && !S_ISDIR(b->st.st_mode)) { | |
| 3224 | return -1; // Always put directories on top | |
| 3225 | } else if (!S_ISDIR(a->st.st_mode) && S_ISDIR(b->st.st_mode)) { | |
| 3226 | return 1; // Always put directories on top | |
| 3227 | } else if (*qs == 'n') { | |
| 3228 | cmp_result = strcmp(a->file_name, b->file_name); | |
| 3229 | } else if (*qs == 's') { | |
| 3230 | cmp_result = a->st.st_size == b->st.st_size ? 0 : | |
| 3231 | a->st.st_size > b->st.st_size ? 1 : -1; | |
| 3232 | } else if (*qs == 'd') { | |
| 3233 | cmp_result = a->st.st_mtime == b->st.st_mtime ? 0 : | |
| 3234 | a->st.st_mtime > b->st.st_mtime ? 1 : -1; | |
| 3235 | } | |
| 3222 | if (S_ISDIR(a->st.st_mode) && !S_ISDIR(b->st.st_mode)) { | |
| 3223 | return -1; // Always put directories on top | |
| 3224 | } else if (!S_ISDIR(a->st.st_mode) && S_ISDIR(b->st.st_mode)) { | |
| 3225 | return 1; // Always put directories on top | |
| 3226 | } else if (*qs == 'n') { | |
| 3227 | cmp_result = strcmp(a->file_name, b->file_name); | |
| 3228 | } else if (*qs == 's') { | |
| 3229 | cmp_result = a->st.st_size == b->st.st_size ? 0 : | |
| 3230 | a->st.st_size > b->st.st_size ? 1 : -1; | |
| 3231 | } else if (*qs == 'd') { | |
| 3232 | cmp_result = a->st.st_mtime == b->st.st_mtime ? 0 : | |
| 3233 | a->st.st_mtime > b->st.st_mtime ? 1 : -1; | |
| 3234 | } | |
| 3236 | 3235 | |
| 3237 | ||
| 3236 | return qs[1] == 'd' ? -cmp_result : cmp_result; | |
| 3238 | 3237 | } |
| 3239 | 3238 | |
| 3240 | 3239 | static void send_directory_listing(struct connection *conn, const char *dir) { |
| 3241 | struct dir_entry *arr = NULL; | |
| 3242 | int i, num_entries, sort_direction = conn->mg_conn.query_string != NULL && | |
| 3243 | conn->mg_conn.query_string[1] == 'd' ? 'a' : 'd'; | |
| 3240 | struct dir_entry *arr = NULL; | |
| 3241 | int i, num_entries, sort_direction = conn->mg_conn.query_string != NULL && | |
| 3242 | conn->mg_conn.query_string[1] == 'd' ? 'a' : 'd'; | |
| 3244 | 3243 | |
| 3245 | mg_send_header(&conn->mg_conn, "Transfer-Encoding", "chunked"); | |
| 3246 | mg_send_header(&conn->mg_conn, "Content-Type", "text/html; charset=utf-8"); | |
| 3244 | mg_send_header(&conn->mg_conn, "Transfer-Encoding", "chunked"); | |
| 3245 | mg_send_header(&conn->mg_conn, "Content-Type", "text/html; charset=utf-8"); | |
| 3247 | 3246 | |
| 3248 | mg_printf_data(&conn->mg_conn, | |
| 3249 | "<html><head><title>Index of %s</title>" | |
| 3250 | "<style>th {text-align: left;}</style></head>" | |
| 3251 | "<body><h1>Index of %s</h1><pre><table cellpadding=\"0\">" | |
| 3252 | "<tr><th><a href=\"?n%c\">Name</a></th>" | |
| 3253 | "<th><a href=\"?d%c\">Modified</a></th>" | |
| 3254 | "<th><a href=\"?s%c\">Size</a></th></tr>" | |
| 3255 | "<tr><td colspan=\"3\"><hr></td></tr>", | |
| 3256 | conn->mg_conn.uri, conn->mg_conn.uri, | |
| 3257 | sort_direction, sort_direction, sort_direction); | |
| 3247 | mg_printf_data(&conn->mg_conn, | |
| 3248 | "<html><head><title>Index of %s</title>" | |
| 3249 | "<style>th {text-align: left;}</style></head>" | |
| 3250 | "<body><h1>Index of %s</h1><pre><table cellpadding=\"0\">" | |
| 3251 | "<tr><th><a href=\"?n%c\">Name</a></th>" | |
| 3252 | "<th><a href=\"?d%c\">Modified</a></th>" | |
| 3253 | "<th><a href=\"?s%c\">Size</a></th></tr>" | |
| 3254 | "<tr><td colspan=\"3\"><hr></td></tr>", | |
| 3255 | conn->mg_conn.uri, conn->mg_conn.uri, | |
| 3256 | sort_direction, sort_direction, sort_direction); | |
| 3258 | 3257 | |
| 3259 | num_entries = scan_directory(conn, dir, &arr); | |
| 3260 | qsort(arr, num_entries, sizeof(arr[0]), compare_dir_entries); | |
| 3261 | for (i = 0; i < num_entries; i++) { | |
| 3262 | print_dir_entry(&arr[i]); | |
| 3263 | free(arr[i].file_name); | |
| 3264 | } | |
| 3265 | free(arr); | |
| 3258 | num_entries = scan_directory(conn, dir, &arr); | |
| 3259 | qsort(arr, num_entries, sizeof(arr[0]), compare_dir_entries); | |
| 3260 | for (i = 0; i < num_entries; i++) { | |
| 3261 | print_dir_entry(&arr[i]); | |
| 3262 | free(arr[i].file_name); | |
| 3263 | } | |
| 3264 | free(arr); | |
| 3266 | 3265 | |
| 3267 | write_terminating_chunk(conn); | |
| 3268 | close_local_endpoint(conn); | |
| 3266 | write_terminating_chunk(conn); | |
| 3267 | close_local_endpoint(conn); | |
| 3269 | 3268 | } |
| 3270 | 3269 | #endif // MONGOOSE_NO_DIRECTORY_LISTING |
| 3271 | 3270 | |
| 3272 | 3271 | #ifndef MONGOOSE_NO_DAV |
| 3273 | 3272 | static void print_props(struct connection *conn, const char *uri, |
| 3274 | file_stat_t *stp) { | |
| 3275 | char mtime[64]; | |
| 3273 | file_stat_t *stp) { | |
| 3274 | char mtime[64]; | |
| 3276 | 3275 | |
| 3277 | gmt_time_string(mtime, sizeof(mtime), &stp->st_mtime); | |
| 3278 | mg_printf(&conn->mg_conn, | |
| 3279 | "<d:response>" | |
| 3280 | "<d:href>%s</d:href>" | |
| 3281 | "<d:propstat>" | |
| 3282 | "<d:prop>" | |
| 3283 | "<d:resourcetype>%s</d:resourcetype>" | |
| 3284 | "<d:getcontentlength>%" INT64_FMT "</d:getcontentlength>" | |
| 3285 | "<d:getlastmodified>%s</d:getlastmodified>" | |
| 3286 | "</d:prop>" | |
| 3287 | "<d:status>HTTP/1.1 200 OK</d:status>" | |
| 3288 | "</d:propstat>" | |
| 3289 | "</d:response>\n", | |
| 3290 | uri, S_ISDIR(stp->st_mode) ? "<d:collection/>" : "", | |
| 3291 | (int64_t) stp->st_size, mtime); | |
| 3276 | gmt_time_string(mtime, sizeof(mtime), &stp->st_mtime); | |
| 3277 | mg_printf(&conn->mg_conn, | |
| 3278 | "<d:response>" | |
| 3279 | "<d:href>%s</d:href>" | |
| 3280 | "<d:propstat>" | |
| 3281 | "<d:prop>" | |
| 3282 | "<d:resourcetype>%s</d:resourcetype>" | |
| 3283 | "<d:getcontentlength>%" INT64_FMT "</d:getcontentlength>" | |
| 3284 | "<d:getlastmodified>%s</d:getlastmodified>" | |
| 3285 | "</d:prop>" | |
| 3286 | "<d:status>HTTP/1.1 200 OK</d:status>" | |
| 3287 | "</d:propstat>" | |
| 3288 | "</d:response>\n", | |
| 3289 | uri, S_ISDIR(stp->st_mode) ? "<d:collection/>" : "", | |
| 3290 | (int64_t) stp->st_size, mtime); | |
| 3292 | 3291 | } |
| 3293 | 3292 | |
| 3294 | 3293 | static void handle_propfind(struct connection *conn, const char *path, |
| 3295 | file_stat_t *stp, int exists) { | |
| 3296 | static const char header[] = "HTTP/1.1 207 Multi-Status\r\n" | |
| 3297 | "Connection: close\r\n" | |
| 3298 | "Content-Type: text/xml; charset=utf-8\r\n\r\n" | |
| 3299 | "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | |
| 3300 | "<d:multistatus xmlns:d='DAV:'>\n"; | |
| 3301 | static const char footer[] = "</d:multistatus>"; | |
| 3302 | const char *depth = mg_get_header(&conn->mg_conn, "Depth"), | |
| 3303 | *list_dir = conn->server->config_options[ENABLE_DIRECTORY_LISTING]; | |
| 3294 | file_stat_t *stp, int exists) { | |
| 3295 | static const char header[] = "HTTP/1.1 207 Multi-Status\r\n" | |
| 3296 | "Connection: close\r\n" | |
| 3297 | "Content-Type: text/xml; charset=utf-8\r\n\r\n" | |
| 3298 | "<?xml version=\"1.0\" encoding=\"utf-8\"?>" | |
| 3299 | "<d:multistatus xmlns:d='DAV:'>\n"; | |
| 3300 | static const char footer[] = "</d:multistatus>"; | |
| 3301 | const char *depth = mg_get_header(&conn->mg_conn, "Depth"), | |
| 3302 | *list_dir = conn->server->config_options[ENABLE_DIRECTORY_LISTING]; | |
| 3304 | 3303 | |
| 3305 | ||
| 3304 | conn->mg_conn.status_code = 207; | |
| 3306 | 3305 | |
| 3307 | // Print properties for the requested resource itself | |
| 3308 | if (!exists) { | |
| 3309 | conn->mg_conn.status_code = 404; | |
| 3310 | mg_printf(&conn->mg_conn, "%s", "HTTP/1.1 404 Not Found\r\n\r\n"); | |
| 3311 | } else if (S_ISDIR(stp->st_mode) && mg_strcasecmp(list_dir, "yes") != 0) { | |
| 3312 | conn->mg_conn.status_code = 403; | |
| 3313 | mg_printf(&conn->mg_conn, "%s", | |
| 3314 | "HTTP/1.1 403 Directory Listing Denied\r\n\r\n"); | |
| 3315 | } else { | |
| 3316 | ns_send(conn->ns_conn, header, sizeof(header) - 1); | |
| 3317 | print_props(conn, conn->mg_conn.uri, stp); | |
| 3306 | // Print properties for the requested resource itself | |
| 3307 | if (!exists) { | |
| 3308 | conn->mg_conn.status_code = 404; | |
| 3309 | mg_printf(&conn->mg_conn, "%s", "HTTP/1.1 404 Not Found\r\n\r\n"); | |
| 3310 | } else if (S_ISDIR(stp->st_mode) && mg_strcasecmp(list_dir, "yes") != 0) { | |
| 3311 | conn->mg_conn.status_code = 403; | |
| 3312 | mg_printf(&conn->mg_conn, "%s", | |
| 3313 | "HTTP/1.1 403 Directory Listing Denied\r\n\r\n"); | |
| 3314 | } else { | |
| 3315 | ns_send(conn->ns_conn, header, sizeof(header) - 1); | |
| 3316 | print_props(conn, conn->mg_conn.uri, stp); | |
| 3318 | 3317 | |
| 3319 | if (S_ISDIR(stp->st_mode) && | |
| 3320 | (depth == NULL || strcmp(depth, "0") != 0)) { | |
| 3321 | struct dir_entry *arr = NULL; | |
| 3322 | int i, num_entries = scan_directory(conn, path, &arr); | |
| 3318 | if (S_ISDIR(stp->st_mode) && | |
| 3319 | (depth == NULL || strcmp(depth, "0") != 0)) { | |
| 3320 | struct dir_entry *arr = NULL; | |
| 3321 | int i, num_entries = scan_directory(conn, path, &arr); | |
| 3323 | 3322 | |
| 3324 | for (i = 0; i < num_entries; i++) { | |
| 3325 | char buf[MAX_PATH_SIZE * 3]; | |
| 3326 | struct dir_entry *de = &arr[i]; | |
| 3327 | mg_url_encode(de->file_name, strlen(de->file_name), buf, sizeof(buf)); | |
| 3328 | print_props(conn, buf, &de->st); | |
| 3329 | } | |
| 3330 | } | |
| 3331 | ns_send(conn->ns_conn, footer, sizeof(footer) - 1); | |
| 3332 | } | |
| 3323 | for (i = 0; i < num_entries; i++) { | |
| 3324 | char buf[MAX_PATH_SIZE * 3]; | |
| 3325 | struct dir_entry *de = &arr[i]; | |
| 3326 | mg_url_encode(de->file_name, strlen(de->file_name), buf, sizeof(buf)); | |
| 3327 | print_props(conn, buf, &de->st); | |
| 3328 | } | |
| 3329 | } | |
| 3330 | ns_send(conn->ns_conn, footer, sizeof(footer) - 1); | |
| 3331 | } | |
| 3333 | 3332 | |
| 3334 | ||
| 3333 | close_local_endpoint(conn); | |
| 3335 | 3334 | } |
| 3336 | 3335 | |
| 3337 | 3336 | static void handle_mkcol(struct connection *conn, const char *path) { |
| 3338 | ||
| 3337 | int status_code = 500; | |
| 3339 | 3338 | |
| 3340 | if (conn->mg_conn.content_len > 0) { | |
| 3341 | status_code = 415; | |
| 3342 | } else if (!mkdir(path, 0755)) { | |
| 3343 | status_code = 201; | |
| 3344 | } else if (errno == EEXIST) { | |
| 3345 | status_code = 405; | |
| 3346 | } else if (errno == EACCES) { | |
| 3347 | status_code = 403; | |
| 3348 | } else if (errno == ENOENT) { | |
| 3349 | status_code = 409; | |
| 3350 | } | |
| 3351 | send_http_error(conn, status_code, NULL); | |
| 3339 | if (conn->mg_conn.content_len > 0) { | |
| 3340 | status_code = 415; | |
| 3341 | } else if (!mkdir(path, 0755)) { | |
| 3342 | status_code = 201; | |
| 3343 | } else if (errno == EEXIST) { | |
| 3344 | status_code = 405; | |
| 3345 | } else if (errno == EACCES) { | |
| 3346 | status_code = 403; | |
| 3347 | } else if (errno == ENOENT) { | |
| 3348 | status_code = 409; | |
| 3349 | } | |
| 3350 | send_http_error(conn, status_code, NULL); | |
| 3352 | 3351 | } |
| 3353 | 3352 | |
| 3354 | 3353 | static int remove_directory(const char *dir) { |
| 3355 | char path[MAX_PATH_SIZE]; | |
| 3356 | struct dirent *dp; | |
| 3357 | file_stat_t st; | |
| 3358 | DIR *dirp; | |
| 3354 | char path[MAX_PATH_SIZE]; | |
| 3355 | struct dirent *dp; | |
| 3356 | file_stat_t st; | |
| 3357 | DIR *dirp; | |
| 3359 | 3358 | |
| 3360 | ||
| 3359 | if ((dirp = opendir(dir)) == NULL) return 0; | |
| 3361 | 3360 | |
| 3362 | while ((dp = readdir(dirp)) != NULL) { | |
| 3363 | if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue; | |
| 3364 | mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name); | |
| 3365 | stat(path, &st); | |
| 3366 | if (S_ISDIR(st.st_mode)) { | |
| 3367 | remove_directory(path); | |
| 3368 | } else { | |
| 3369 | remove(path); | |
| 3370 | } | |
| 3371 | } | |
| 3372 | closedir(dirp); | |
| 3373 | rmdir(dir); | |
| 3361 | while ((dp = readdir(dirp)) != NULL) { | |
| 3362 | if (!strcmp(dp->d_name, ".") || !strcmp(dp->d_name, "..")) continue; | |
| 3363 | mg_snprintf(path, sizeof(path), "%s%c%s", dir, '/', dp->d_name); | |
| 3364 | stat(path, &st); | |
| 3365 | if (S_ISDIR(st.st_mode)) { | |
| 3366 | remove_directory(path); | |
| 3367 | } else { | |
| 3368 | remove(path); | |
| 3369 | } | |
| 3370 | } | |
| 3371 | closedir(dirp); | |
| 3372 | rmdir(dir); | |
| 3374 | 3373 | |
| 3375 | ||
| 3374 | return 1; | |
| 3376 | 3375 | } |
| 3377 | 3376 | |
| 3378 | 3377 | static void handle_delete(struct connection *conn, const char *path) { |
| 3379 | ||
| 3378 | file_stat_t st; | |
| 3380 | 3379 | |
| 3381 | if (stat(path, &st) != 0) { | |
| 3382 | send_http_error(conn, 404, NULL); | |
| 3383 | } else if (S_ISDIR(st.st_mode)) { | |
| 3384 | remove_directory(path); | |
| 3385 | send_http_error(conn, 204, NULL); | |
| 3386 | } else if (remove(path) == 0) { | |
| 3387 | send_http_error(conn, 204, NULL); | |
| 3388 | } else { | |
| 3389 | send_http_error(conn, 423, NULL); | |
| 3390 | } | |
| 3380 | if (stat(path, &st) != 0) { | |
| 3381 | send_http_error(conn, 404, NULL); | |
| 3382 | } else if (S_ISDIR(st.st_mode)) { | |
| 3383 | remove_directory(path); | |
| 3384 | send_http_error(conn, 204, NULL); | |
| 3385 | } else if (remove(path) == 0) { | |
| 3386 | send_http_error(conn, 204, NULL); | |
| 3387 | } else { | |
| 3388 | send_http_error(conn, 423, NULL); | |
| 3389 | } | |
| 3391 | 3390 | } |
| 3392 | 3391 | |
| 3393 | 3392 | // For a given PUT path, create all intermediate subdirectories |
| 3394 | 3393 | // for given path. Return 0 if the path itself is a directory, |
| 3395 | 3394 | // or -1 on error, 1 if OK. |
| 3396 | 3395 | static int put_dir(const char *path) { |
| 3397 | char buf[MAX_PATH_SIZE]; | |
| 3398 | const char *s, *p; | |
| 3399 | file_stat_t st; | |
| 3396 | char buf[MAX_PATH_SIZE]; | |
| 3397 | const char *s, *p; | |
| 3398 | file_stat_t st; | |
| 3400 | 3399 | |
| 3401 | // Create intermediate directories if they do not exist | |
| 3402 | for (s = p = path + 1; (p = strchr(s, '/')) != NULL; s = ++p) { | |
| 3403 | if (p - path >= (int) sizeof(buf)) return -1; // Buffer overflow | |
| 3404 | memcpy(buf, path, p - path); | |
| 3405 | buf[p - path] = '\0'; | |
| 3406 | if (stat(buf, &st) != 0 && mkdir(buf, 0755) != 0) return -1; | |
| 3407 | if (p[1] == '\0') return 0; // Path is a directory itself | |
| 3408 | } | |
| 3400 | // Create intermediate directories if they do not exist | |
| 3401 | for (s = p = path + 1; (p = strchr(s, '/')) != NULL; s = ++p) { | |
| 3402 | if (p - path >= (int) sizeof(buf)) return -1; // Buffer overflow | |
| 3403 | memcpy(buf, path, p - path); | |
| 3404 | buf[p - path] = '\0'; | |
| 3405 | if (stat(buf, &st) != 0 && mkdir(buf, 0755) != 0) return -1; | |
| 3406 | if (p[1] == '\0') return 0; // Path is a directory itself | |
| 3407 | } | |
| 3409 | 3408 | |
| 3410 | ||
| 3409 | return 1; | |
| 3411 | 3410 | } |
| 3412 | 3411 | |
| 3413 | 3412 | static void handle_put(struct connection *conn, const char *path) { |
| 3414 | file_stat_t st; | |
| 3415 | const char *range, *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length"); | |
| 3416 | int64_t r1, r2; | |
| 3417 | int rc; | |
| 3413 | file_stat_t st; | |
| 3414 | const char *range, *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length"); | |
| 3415 | int64_t r1, r2; | |
| 3416 | int rc; | |
| 3418 | 3417 | |
| 3419 | conn->mg_conn.status_code = !stat(path, &st) ? 200 : 201; | |
| 3420 | if ((rc = put_dir(path)) == 0) { | |
| 3421 | mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\n\r\n", | |
| 3422 | conn->mg_conn.status_code); | |
| 3423 | close_local_endpoint(conn); | |
| 3424 | } else if (rc == -1) { | |
| 3425 | send_http_error(conn, 500, "put_dir: %s", strerror(errno)); | |
| 3426 | } else if (cl_hdr == NULL) { | |
| 3427 | send_http_error(conn, 411, NULL); | |
| 3418 | conn->mg_conn.status_code = !stat(path, &st) ? 200 : 201; | |
| 3419 | if ((rc = put_dir(path)) == 0) { | |
| 3420 | mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\n\r\n", | |
| 3421 | conn->mg_conn.status_code); | |
| 3422 | close_local_endpoint(conn); | |
| 3423 | } else if (rc == -1) { | |
| 3424 | send_http_error(conn, 500, "put_dir: %s", strerror(errno)); | |
| 3425 | } else if (cl_hdr == NULL) { | |
| 3426 | send_http_error(conn, 411, NULL); | |
| 3428 | 3427 | #ifdef _WIN32 |
| 3429 | //On Windows, open() is a macro with 2 params | |
| 3430 | } else if ((conn->endpoint.fd = | |
| 3431 | open(path, O_RDWR | O_CREAT | O_TRUNC)) < 0) { | |
| 3428 | //On Windows, open() is a macro with 2 params | |
| 3429 | } else if ((conn->endpoint.fd = | |
| 3430 | open(path, O_RDWR | O_CREAT | O_TRUNC)) < 0) { | |
| 3432 | 3431 | #else |
| 3433 | } else if ((conn->endpoint.fd = | |
| 3434 | open(path, O_RDWR | O_CREAT | O_TRUNC, 0644)) < 0) { | |
| 3432 | } else if ((conn->endpoint.fd = | |
| 3433 | open(path, O_RDWR | O_CREAT | O_TRUNC, 0644)) < 0) { | |
| 3435 | 3434 | #endif |
| 3436 | send_http_error(conn, 500, "open(%s): %s", path, strerror(errno)); | |
| 3437 | } else { | |
| 3438 | DBG(("PUT [%s] %zu", path, conn->ns_conn->recv_iobuf.len)); | |
| 3439 | conn->endpoint_type = EP_PUT; | |
| 3440 | ns_set_close_on_exec(conn->endpoint.fd); | |
| 3441 | range = mg_get_header(&conn->mg_conn, "Content-Range"); | |
| 3442 | conn->cl = to64(cl_hdr); | |
| 3443 | r1 = r2 = 0; | |
| 3444 | if (range != NULL && parse_range_header(range, &r1, &r2) > 0) { | |
| 3445 | conn->mg_conn.status_code = 206; | |
| 3446 | lseek(conn->endpoint.fd, r1, SEEK_SET); | |
| 3447 | conn->cl = r2 > r1 ? r2 - r1 + 1: conn->cl - r1; | |
| 3448 | } | |
| 3449 | mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\nContent-Length: 0\r\n\r\n", | |
| 3450 | conn->mg_conn.status_code); | |
| 3451 | } | |
| 3435 | send_http_error(conn, 500, "open(%s): %s", path, strerror(errno)); | |
| 3436 | } else { | |
| 3437 | DBG(("PUT [%s] %zu", path, conn->ns_conn->recv_iobuf.len)); | |
| 3438 | conn->endpoint_type = EP_PUT; | |
| 3439 | ns_set_close_on_exec(conn->endpoint.fd); | |
| 3440 | range = mg_get_header(&conn->mg_conn, "Content-Range"); | |
| 3441 | conn->cl = to64(cl_hdr); | |
| 3442 | r1 = r2 = 0; | |
| 3443 | if (range != NULL && parse_range_header(range, &r1, &r2) > 0) { | |
| 3444 | conn->mg_conn.status_code = 206; | |
| 3445 | lseek(conn->endpoint.fd, r1, SEEK_SET); | |
| 3446 | conn->cl = r2 > r1 ? r2 - r1 + 1: conn->cl - r1; | |
| 3447 | } | |
| 3448 | mg_printf(&conn->mg_conn, "HTTP/1.1 %d OK\r\nContent-Length: 0\r\n\r\n", | |
| 3449 | conn->mg_conn.status_code); | |
| 3450 | } | |
| 3452 | 3451 | } |
| 3453 | 3452 | |
| 3454 | 3453 | static void forward_put_data(struct connection *conn) { |
| 3455 | struct iobuf *io = &conn->ns_conn->recv_iobuf; | |
| 3456 | size_t k = conn->cl < (int64_t) io->len ? conn->cl : io->len; // To write | |
| 3457 | int n = write(conn->endpoint.fd, io->buf, k); // Write them! | |
| 3458 | if (n > 0) { | |
| 3459 | iobuf_remove(io, n); | |
| 3460 | conn->cl -= n; | |
| 3461 | } | |
| 3462 | if (conn->cl <= 0) { | |
| 3463 | close_local_endpoint(conn); | |
| 3464 | } | |
| 3454 | struct iobuf *io = &conn->ns_conn->recv_iobuf; | |
| 3455 | size_t k = conn->cl < (int64_t) io->len ? conn->cl : io->len; // To write | |
| 3456 | int n = write(conn->endpoint.fd, io->buf, k); // Write them! | |
| 3457 | if (n > 0) { | |
| 3458 | iobuf_remove(io, n); | |
| 3459 | conn->cl -= n; | |
| 3460 | } | |
| 3461 | if (conn->cl <= 0) { | |
| 3462 | close_local_endpoint(conn); | |
| 3463 | } | |
| 3465 | 3464 | } |
| 3466 | 3465 | #endif // MONGOOSE_NO_DAV |
| 3467 | 3466 | |
| 3468 | 3467 | static void send_options(struct connection *conn) { |
| 3469 | conn->mg_conn.status_code = 200; | |
| 3470 | mg_printf(&conn->mg_conn, "%s", | |
| 3471 | "HTTP/1.1 200 OK\r\nAllow: GET, POST, HEAD, CONNECT, PUT, " | |
| 3472 | "DELETE, OPTIONS, PROPFIND, MKCOL\r\nDAV: 1\r\n\r\n"); | |
| 3473 | close_local_endpoint(conn); | |
| 3468 | conn->mg_conn.status_code = 200; | |
| 3469 | mg_printf(&conn->mg_conn, "%s", | |
| 3470 | "HTTP/1.1 200 OK\r\nAllow: GET, POST, HEAD, CONNECT, PUT, " | |
| 3471 | "DELETE, OPTIONS, PROPFIND, MKCOL\r\nDAV: 1\r\n\r\n"); | |
| 3472 | close_local_endpoint(conn); | |
| 3474 | 3473 | } |
| 3475 | 3474 | |
| 3476 | 3475 | #ifndef MONGOOSE_NO_AUTH |
| 3477 | 3476 | void mg_send_digest_auth_request(struct mg_connection *c) { |
| 3478 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 3479 | c->status_code = 401; | |
| 3480 | mg_printf(c, | |
| 3481 | "HTTP/1.1 401 Unauthorized\r\n" | |
| 3482 | "WWW-Authenticate: Digest qop=\"auth\", " | |
| 3483 | "realm=\"%s\", nonce=\"%lu\"\r\n\r\n", | |
| 3484 | conn->server->config_options[AUTH_DOMAIN], | |
| 3485 | (unsigned long) time(NULL)); | |
| 3486 | close_local_endpoint(conn); | |
| 3477 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 3478 | c->status_code = 401; | |
| 3479 | mg_printf(c, | |
| 3480 | "HTTP/1.1 401 Unauthorized\r\n" | |
| 3481 | "WWW-Authenticate: Digest qop=\"auth\", " | |
| 3482 | "realm=\"%s\", nonce=\"%lu\"\r\n\r\n", | |
| 3483 | conn->server->config_options[AUTH_DOMAIN], | |
| 3484 | (unsigned long) time(NULL)); | |
| 3485 | close_local_endpoint(conn); | |
| 3487 | 3486 | } |
| 3488 | 3487 | |
| 3489 | 3488 | // Use the global passwords file, if specified by auth_gpass option, |
| 3490 | 3489 | // or search for .htpasswd in the requested directory. |
| 3491 | 3490 | static FILE *open_auth_file(struct connection *conn, const char *path) { |
| 3492 | char name[MAX_PATH_SIZE]; | |
| 3493 | const char *p, *gpass = conn->server->config_options[GLOBAL_AUTH_FILE]; | |
| 3494 | file_stat_t st; | |
| 3495 | FILE *fp = NULL; | |
| 3491 | char name[MAX_PATH_SIZE]; | |
| 3492 | const char *p, *gpass = conn->server->config_options[GLOBAL_AUTH_FILE]; | |
| 3493 | file_stat_t st; | |
| 3494 | FILE *fp = NULL; | |
| 3496 | 3495 | |
| 3497 | if (gpass != NULL) { | |
| 3498 | // Use global passwords file | |
| 3499 | fp = fopen(gpass, "r"); | |
| 3500 | } else if (!stat(path, &st) && S_ISDIR(st.st_mode)) { | |
| 3501 | mg_snprintf(name, sizeof(name), "%s%c%s", path, '/', PASSWORDS_FILE_NAME); | |
| 3502 | fp = fopen(name, "r"); | |
| 3503 | } else { | |
| 3504 | // Try to find .htpasswd in requested directory. | |
| 3505 | if ((p = strrchr(path, '/')) == NULL) p = path; | |
| 3506 | mg_snprintf(name, sizeof(name), "%.*s%c%s", | |
| 3507 | (int) (p - path), path, '/', PASSWORDS_FILE_NAME); | |
| 3508 | fp = fopen(name, "r"); | |
| 3509 | } | |
| 3496 | if (gpass != NULL) { | |
| 3497 | // Use global passwords file | |
| 3498 | fp = fopen(gpass, "r"); | |
| 3499 | } else if (!stat(path, &st) && S_ISDIR(st.st_mode)) { | |
| 3500 | mg_snprintf(name, sizeof(name), "%s%c%s", path, '/', PASSWORDS_FILE_NAME); | |
| 3501 | fp = fopen(name, "r"); | |
| 3502 | } else { | |
| 3503 | // Try to find .htpasswd in requested directory. | |
| 3504 | if ((p = strrchr(path, '/')) == NULL) p = path; | |
| 3505 | mg_snprintf(name, sizeof(name), "%.*s%c%s", | |
| 3506 | (int) (p - path), path, '/', PASSWORDS_FILE_NAME); | |
| 3507 | fp = fopen(name, "r"); | |
| 3508 | } | |
| 3510 | 3509 | |
| 3511 | ||
| 3510 | return fp; | |
| 3512 | 3511 | } |
| 3513 | 3512 | |
| 3514 | 3513 | #if !defined(HAVE_MD5) && !defined(MONGOOSE_NO_AUTH) |
| 3515 | 3514 | typedef struct MD5Context { |
| 3516 | uint32_t buf[4]; | |
| 3517 | uint32_t bits[2]; | |
| 3518 | unsigned char in[64]; | |
| 3515 | uint32_t buf[4]; | |
| 3516 | uint32_t bits[2]; | |
| 3517 | unsigned char in[64]; | |
| 3519 | 3518 | } MD5_CTX; |
| 3520 | 3519 | |
| 3521 | 3520 | static void byteReverse(unsigned char *buf, unsigned longs) { |
| 3522 | ||
| 3521 | uint32_t t; | |
| 3523 | 3522 | |
| 3524 | // Forrest: MD5 expect LITTLE_ENDIAN, swap if BIG_ENDIAN | |
| 3525 | if (is_big_endian()) { | |
| 3526 | do { | |
| 3527 | t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | | |
| 3528 | ((unsigned) buf[1] << 8 | buf[0]); | |
| 3529 | * (uint32_t *) buf = t; | |
| 3530 | buf += 4; | |
| 3531 | } while (--longs); | |
| 3532 | } | |
| 3523 | // Forrest: MD5 expect LITTLE_ENDIAN, swap if BIG_ENDIAN | |
| 3524 | if (is_big_endian()) { | |
| 3525 | do { | |
| 3526 | t = (uint32_t) ((unsigned) buf[3] << 8 | buf[2]) << 16 | | |
| 3527 | ((unsigned) buf[1] << 8 | buf[0]); | |
| 3528 | * (uint32_t *) buf = t; | |
| 3529 | buf += 4; | |
| 3530 | } while (--longs); | |
| 3531 | } | |
| 3533 | 3532 | } |
| 3534 | 3533 | |
| 3535 | 3534 | #define F1(x, y, z) (z ^ (x & (y ^ z))) |
| r31373 | r31374 | |
| 3538 | 3537 | #define F4(x, y, z) (y ^ (x | ~z)) |
| 3539 | 3538 | |
| 3540 | 3539 | #define MD5STEP(f, w, x, y, z, data, s) \ |
| 3541 | ||
| 3540 | ( w += f(x, y, z) + data, w = w<<s | w>>(32-s), w += x ) | |
| 3542 | 3541 | |
| 3543 | 3542 | // Start MD5 accumulation. Set bit count to 0 and buffer to mysterious |
| 3544 | 3543 | // initialization constants. |
| 3545 | 3544 | static void MD5Init(MD5_CTX *ctx) { |
| 3546 | ctx->buf[0] = 0x67452301; | |
| 3547 | ctx->buf[1] = 0xefcdab89; | |
| 3548 | ctx->buf[2] = 0x98badcfe; | |
| 3549 | ctx->buf[3] = 0x10325476; | |
| 3545 | ctx->buf[0] = 0x67452301; | |
| 3546 | ctx->buf[1] = 0xefcdab89; | |
| 3547 | ctx->buf[2] = 0x98badcfe; | |
| 3548 | ctx->buf[3] = 0x10325476; | |
| 3550 | 3549 | |
| 3551 | ctx->bits[0] = 0; | |
| 3552 | ctx->bits[1] = 0; | |
| 3550 | ctx->bits[0] = 0; | |
| 3551 | ctx->bits[1] = 0; | |
| 3553 | 3552 | } |
| 3554 | 3553 | |
| 3555 | 3554 | static void MD5Transform(uint32_t buf[4], uint32_t const in[16]) { |
| 3556 | ||
| 3555 | register uint32_t a, b, c, d; | |
| 3557 | 3556 | |
| 3558 | a = buf[0]; | |
| 3559 | b = buf[1]; | |
| 3560 | c = buf[2]; | |
| 3561 | d = buf[3]; | |
| 3557 | a = buf[0]; | |
| 3558 | b = buf[1]; | |
| 3559 | c = buf[2]; | |
| 3560 | d = buf[3]; | |
| 3562 | 3561 | |
| 3563 | MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); | |
| 3564 | MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); | |
| 3565 | MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); | |
| 3566 | MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); | |
| 3567 | MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); | |
| 3568 | MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); | |
| 3569 | MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); | |
| 3570 | MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); | |
| 3571 | MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); | |
| 3572 | MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); | |
| 3573 | MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); | |
| 3574 | MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); | |
| 3575 | MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); | |
| 3576 | MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); | |
| 3577 | MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); | |
| 3578 | MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); | |
| 3562 | MD5STEP(F1, a, b, c, d, in[0] + 0xd76aa478, 7); | |
| 3563 | MD5STEP(F1, d, a, b, c, in[1] + 0xe8c7b756, 12); | |
| 3564 | MD5STEP(F1, c, d, a, b, in[2] + 0x242070db, 17); | |
| 3565 | MD5STEP(F1, b, c, d, a, in[3] + 0xc1bdceee, 22); | |
| 3566 | MD5STEP(F1, a, b, c, d, in[4] + 0xf57c0faf, 7); | |
| 3567 | MD5STEP(F1, d, a, b, c, in[5] + 0x4787c62a, 12); | |
| 3568 | MD5STEP(F1, c, d, a, b, in[6] + 0xa8304613, 17); | |
| 3569 | MD5STEP(F1, b, c, d, a, in[7] + 0xfd469501, 22); | |
| 3570 | MD5STEP(F1, a, b, c, d, in[8] + 0x698098d8, 7); | |
| 3571 | MD5STEP(F1, d, a, b, c, in[9] + 0x8b44f7af, 12); | |
| 3572 | MD5STEP(F1, c, d, a, b, in[10] + 0xffff5bb1, 17); | |
| 3573 | MD5STEP(F1, b, c, d, a, in[11] + 0x895cd7be, 22); | |
| 3574 | MD5STEP(F1, a, b, c, d, in[12] + 0x6b901122, 7); | |
| 3575 | MD5STEP(F1, d, a, b, c, in[13] + 0xfd987193, 12); | |
| 3576 | MD5STEP(F1, c, d, a, b, in[14] + 0xa679438e, 17); | |
| 3577 | MD5STEP(F1, b, c, d, a, in[15] + 0x49b40821, 22); | |
| 3579 | 3578 | |
| 3580 | MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); | |
| 3581 | MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); | |
| 3582 | MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); | |
| 3583 | MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); | |
| 3584 | MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); | |
| 3585 | MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); | |
| 3586 | MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); | |
| 3587 | MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); | |
| 3588 | MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); | |
| 3589 | MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); | |
| 3590 | MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); | |
| 3591 | MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); | |
| 3592 | MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); | |
| 3593 | MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); | |
| 3594 | MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); | |
| 3595 | MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); | |
| 3579 | MD5STEP(F2, a, b, c, d, in[1] + 0xf61e2562, 5); | |
| 3580 | MD5STEP(F2, d, a, b, c, in[6] + 0xc040b340, 9); | |
| 3581 | MD5STEP(F2, c, d, a, b, in[11] + 0x265e5a51, 14); | |
| 3582 | MD5STEP(F2, b, c, d, a, in[0] + 0xe9b6c7aa, 20); | |
| 3583 | MD5STEP(F2, a, b, c, d, in[5] + 0xd62f105d, 5); | |
| 3584 | MD5STEP(F2, d, a, b, c, in[10] + 0x02441453, 9); | |
| 3585 | MD5STEP(F2, c, d, a, b, in[15] + 0xd8a1e681, 14); | |
| 3586 | MD5STEP(F2, b, c, d, a, in[4] + 0xe7d3fbc8, 20); | |
| 3587 | MD5STEP(F2, a, b, c, d, in[9] + 0x21e1cde6, 5); | |
| 3588 | MD5STEP(F2, d, a, b, c, in[14] + 0xc33707d6, 9); | |
| 3589 | MD5STEP(F2, c, d, a, b, in[3] + 0xf4d50d87, 14); | |
| 3590 | MD5STEP(F2, b, c, d, a, in[8] + 0x455a14ed, 20); | |
| 3591 | MD5STEP(F2, a, b, c, d, in[13] + 0xa9e3e905, 5); | |
| 3592 | MD5STEP(F2, d, a, b, c, in[2] + 0xfcefa3f8, 9); | |
| 3593 | MD5STEP(F2, c, d, a, b, in[7] + 0x676f02d9, 14); | |
| 3594 | MD5STEP(F2, b, c, d, a, in[12] + 0x8d2a4c8a, 20); | |
| 3596 | 3595 | |
| 3597 | MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); | |
| 3598 | MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); | |
| 3599 | MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); | |
| 3600 | MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); | |
| 3601 | MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); | |
| 3602 | MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); | |
| 3603 | MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); | |
| 3604 | MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); | |
| 3605 | MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); | |
| 3606 | MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); | |
| 3607 | MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); | |
| 3608 | MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); | |
| 3609 | MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); | |
| 3610 | MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); | |
| 3611 | MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); | |
| 3612 | MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); | |
| 3596 | MD5STEP(F3, a, b, c, d, in[5] + 0xfffa3942, 4); | |
| 3597 | MD5STEP(F3, d, a, b, c, in[8] + 0x8771f681, 11); | |
| 3598 | MD5STEP(F3, c, d, a, b, in[11] + 0x6d9d6122, 16); | |
| 3599 | MD5STEP(F3, b, c, d, a, in[14] + 0xfde5380c, 23); | |
| 3600 | MD5STEP(F3, a, b, c, d, in[1] + 0xa4beea44, 4); | |
| 3601 | MD5STEP(F3, d, a, b, c, in[4] + 0x4bdecfa9, 11); | |
| 3602 | MD5STEP(F3, c, d, a, b, in[7] + 0xf6bb4b60, 16); | |
| 3603 | MD5STEP(F3, b, c, d, a, in[10] + 0xbebfbc70, 23); | |
| 3604 | MD5STEP(F3, a, b, c, d, in[13] + 0x289b7ec6, 4); | |
| 3605 | MD5STEP(F3, d, a, b, c, in[0] + 0xeaa127fa, 11); | |
| 3606 | MD5STEP(F3, c, d, a, b, in[3] + 0xd4ef3085, 16); | |
| 3607 | MD5STEP(F3, b, c, d, a, in[6] + 0x04881d05, 23); | |
| 3608 | MD5STEP(F3, a, b, c, d, in[9] + 0xd9d4d039, 4); | |
| 3609 | MD5STEP(F3, d, a, b, c, in[12] + 0xe6db99e5, 11); | |
| 3610 | MD5STEP(F3, c, d, a, b, in[15] + 0x1fa27cf8, 16); | |
| 3611 | MD5STEP(F3, b, c, d, a, in[2] + 0xc4ac5665, 23); | |
| 3613 | 3612 | |
| 3614 | MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); | |
| 3615 | MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); | |
| 3616 | MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); | |
| 3617 | MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); | |
| 3618 | MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); | |
| 3619 | MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); | |
| 3620 | MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); | |
| 3621 | MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); | |
| 3622 | MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); | |
| 3623 | MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); | |
| 3624 | MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); | |
| 3625 | MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); | |
| 3626 | MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); | |
| 3627 | MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); | |
| 3628 | MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); | |
| 3629 | MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); | |
| 3613 | MD5STEP(F4, a, b, c, d, in[0] + 0xf4292244, 6); | |
| 3614 | MD5STEP(F4, d, a, b, c, in[7] + 0x432aff97, 10); | |
| 3615 | MD5STEP(F4, c, d, a, b, in[14] + 0xab9423a7, 15); | |
| 3616 | MD5STEP(F4, b, c, d, a, in[5] + 0xfc93a039, 21); | |
| 3617 | MD5STEP(F4, a, b, c, d, in[12] + 0x655b59c3, 6); | |
| 3618 | MD5STEP(F4, d, a, b, c, in[3] + 0x8f0ccc92, 10); | |
| 3619 | MD5STEP(F4, c, d, a, b, in[10] + 0xffeff47d, 15); | |
| 3620 | MD5STEP(F4, b, c, d, a, in[1] + 0x85845dd1, 21); | |
| 3621 | MD5STEP(F4, a, b, c, d, in[8] + 0x6fa87e4f, 6); | |
| 3622 | MD5STEP(F4, d, a, b, c, in[15] + 0xfe2ce6e0, 10); | |
| 3623 | MD5STEP(F4, c, d, a, b, in[6] + 0xa3014314, 15); | |
| 3624 | MD5STEP(F4, b, c, d, a, in[13] + 0x4e0811a1, 21); | |
| 3625 | MD5STEP(F4, a, b, c, d, in[4] + 0xf7537e82, 6); | |
| 3626 | MD5STEP(F4, d, a, b, c, in[11] + 0xbd3af235, 10); | |
| 3627 | MD5STEP(F4, c, d, a, b, in[2] + 0x2ad7d2bb, 15); | |
| 3628 | MD5STEP(F4, b, c, d, a, in[9] + 0xeb86d391, 21); | |
| 3630 | 3629 | |
| 3631 | buf[0] += a; | |
| 3632 | buf[1] += b; | |
| 3633 | buf[2] += c; | |
| 3634 | buf[3] += d; | |
| 3630 | buf[0] += a; | |
| 3631 | buf[1] += b; | |
| 3632 | buf[2] += c; | |
| 3633 | buf[3] += d; | |
| 3635 | 3634 | } |
| 3636 | 3635 | |
| 3637 | 3636 | static void MD5Update(MD5_CTX *ctx, unsigned char const *buf, unsigned len) { |
| 3638 | ||
| 3637 | uint32_t t; | |
| 3639 | 3638 | |
| 3640 | t = ctx->bits[0]; | |
| 3641 | if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) | |
| 3642 | ctx->bits[1]++; | |
| 3643 | ctx->bits[1] += len >> 29; | |
| 3639 | t = ctx->bits[0]; | |
| 3640 | if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t) | |
| 3641 | ctx->bits[1]++; | |
| 3642 | ctx->bits[1] += len >> 29; | |
| 3644 | 3643 | |
| 3645 | ||
| 3644 | t = (t >> 3) & 0x3f; | |
| 3646 | 3645 | |
| 3647 | if (t) { | |
| 3648 | unsigned char *p = (unsigned char *) ctx->in + t; | |
| 3646 | if (t) { | |
| 3647 | unsigned char *p = (unsigned char *) ctx->in + t; | |
| 3649 | 3648 | |
| 3650 | t = 64 - t; | |
| 3651 | if (len < t) { | |
| 3652 | memcpy(p, buf, len); | |
| 3653 | return; | |
| 3654 | } | |
| 3655 | memcpy(p, buf, t); | |
| 3656 | byteReverse(ctx->in, 16); | |
| 3657 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3658 | buf += t; | |
| 3659 | len -= t; | |
| 3660 | } | |
| 3649 | t = 64 - t; | |
| 3650 | if (len < t) { | |
| 3651 | memcpy(p, buf, len); | |
| 3652 | return; | |
| 3653 | } | |
| 3654 | memcpy(p, buf, t); | |
| 3655 | byteReverse(ctx->in, 16); | |
| 3656 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3657 | buf += t; | |
| 3658 | len -= t; | |
| 3659 | } | |
| 3661 | 3660 | |
| 3662 | while (len >= 64) { | |
| 3663 | memcpy(ctx->in, buf, 64); | |
| 3664 | byteReverse(ctx->in, 16); | |
| 3665 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3666 | buf += 64; | |
| 3667 | len -= 64; | |
| 3668 | } | |
| 3661 | while (len >= 64) { | |
| 3662 | memcpy(ctx->in, buf, 64); | |
| 3663 | byteReverse(ctx->in, 16); | |
| 3664 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3665 | buf += 64; | |
| 3666 | len -= 64; | |
| 3667 | } | |
| 3669 | 3668 | |
| 3670 | ||
| 3669 | memcpy(ctx->in, buf, len); | |
| 3671 | 3670 | } |
| 3672 | 3671 | |
| 3673 | 3672 | static void MD5Final(unsigned char digest[16], MD5_CTX *ctx) { |
| 3674 | unsigned count; | |
| 3675 | unsigned char *p; | |
| 3676 | uint32_t *a; | |
| 3673 | unsigned count; | |
| 3674 | unsigned char *p; | |
| 3675 | uint32_t *a; | |
| 3677 | 3676 | |
| 3678 | ||
| 3677 | count = (ctx->bits[0] >> 3) & 0x3F; | |
| 3679 | 3678 | |
| 3680 | p = ctx->in + count; | |
| 3681 | *p++ = 0x80; | |
| 3682 | count = 64 - 1 - count; | |
| 3683 | if (count < 8) { | |
| 3684 | memset(p, 0, count); | |
| 3685 | byteReverse(ctx->in, 16); | |
| 3686 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3687 | memset(ctx->in, 0, 56); | |
| 3688 | } else { | |
| 3689 | memset(p, 0, count - 8); | |
| 3690 | } | |
| 3691 | byteReverse(ctx->in, 14); | |
| 3679 | p = ctx->in + count; | |
| 3680 | *p++ = 0x80; | |
| 3681 | count = 64 - 1 - count; | |
| 3682 | if (count < 8) { | |
| 3683 | memset(p, 0, count); | |
| 3684 | byteReverse(ctx->in, 16); | |
| 3685 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3686 | memset(ctx->in, 0, 56); | |
| 3687 | } else { | |
| 3688 | memset(p, 0, count - 8); | |
| 3689 | } | |
| 3690 | byteReverse(ctx->in, 14); | |
| 3692 | 3691 | |
| 3693 | a = (uint32_t *)ctx->in; | |
| 3694 | a[14] = ctx->bits[0]; | |
| 3695 | a[15] = ctx->bits[1]; | |
| 3692 | a = (uint32_t *)ctx->in; | |
| 3693 | a[14] = ctx->bits[0]; | |
| 3694 | a[15] = ctx->bits[1]; | |
| 3696 | 3695 | |
| 3697 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3698 | byteReverse((unsigned char *) ctx->buf, 4); | |
| 3699 | memcpy(digest, ctx->buf, 16); | |
| 3700 | memset((char *) ctx, 0, sizeof(*ctx)); | |
| 3696 | MD5Transform(ctx->buf, (uint32_t *) ctx->in); | |
| 3697 | byteReverse((unsigned char *) ctx->buf, 4); | |
| 3698 | memcpy(digest, ctx->buf, 16); | |
| 3699 | memset((char *) ctx, 0, sizeof(*ctx)); | |
| 3701 | 3700 | } |
| 3702 | 3701 | #endif // !HAVE_MD5 |
| 3703 | 3702 | |
| r31373 | r31374 | |
| 3706 | 3705 | // Stringify binary data. Output buffer must be twice as big as input, |
| 3707 | 3706 | // because each byte takes 2 bytes in string representation |
| 3708 | 3707 | static void bin2str(char *to, const unsigned char *p, size_t len) { |
| 3709 | ||
| 3708 | static const char *hex = "0123456789abcdef"; | |
| 3710 | 3709 | |
| 3711 | for (; len--; p++) { | |
| 3712 | *to++ = hex[p[0] >> 4]; | |
| 3713 | *to++ = hex[p[0] & 0x0f]; | |
| 3714 | } | |
| 3715 | *to = '\0'; | |
| 3710 | for (; len--; p++) { | |
| 3711 | *to++ = hex[p[0] >> 4]; | |
| 3712 | *to++ = hex[p[0] & 0x0f]; | |
| 3713 | } | |
| 3714 | *to = '\0'; | |
| 3716 | 3715 | } |
| 3717 | 3716 | |
| 3718 | 3717 | // Return stringified MD5 hash for list of strings. Buffer must be 33 bytes. |
| 3719 | 3718 | char *mg_md5(char buf[33], ...) { |
| 3720 | unsigned char hash[16]; | |
| 3721 | const char *p; | |
| 3722 | va_list ap; | |
| 3723 | MD5_CTX ctx; | |
| 3719 | unsigned char hash[16]; | |
| 3720 | const char *p; | |
| 3721 | va_list ap; | |
| 3722 | MD5_CTX ctx; | |
| 3724 | 3723 | |
| 3725 | ||
| 3724 | MD5Init(&ctx); | |
| 3726 | 3725 | |
| 3727 | va_start(ap, buf); | |
| 3728 | while ((p = va_arg(ap, const char *)) != NULL) { | |
| 3729 | MD5Update(&ctx, (const unsigned char *) p, (unsigned) strlen(p)); | |
| 3730 | } | |
| 3731 | va_end(ap); | |
| 3726 | va_start(ap, buf); | |
| 3727 | while ((p = va_arg(ap, const char *)) != NULL) { | |
| 3728 | MD5Update(&ctx, (const unsigned char *) p, (unsigned) strlen(p)); | |
| 3729 | } | |
| 3730 | va_end(ap); | |
| 3732 | 3731 | |
| 3733 | MD5Final(hash, &ctx); | |
| 3734 | bin2str(buf, hash, sizeof(hash)); | |
| 3735 | return buf; | |
| 3732 | MD5Final(hash, &ctx); | |
| 3733 | bin2str(buf, hash, sizeof(hash)); | |
| 3734 | return buf; | |
| 3736 | 3735 | } |
| 3737 | 3736 | |
| 3738 | 3737 | // Check the user's password, return 1 if OK |
| 3739 | 3738 | static int check_password(const char *method, const char *ha1, const char *uri, |
| 3740 | const char *nonce, const char *nc, const char *cnonce, | |
| 3741 | const char *qop, const char *response) { | |
| 3742 | char ha2[32 + 1], expected_response[32 + 1]; | |
| 3739 | const char *nonce, const char *nc, const char *cnonce, | |
| 3740 | const char *qop, const char *response) { | |
| 3741 | char ha2[32 + 1], expected_response[32 + 1]; | |
| 3743 | 3742 | |
| 3744 | 3743 | #if 0 |
| 3745 | // Check for authentication timeout | |
| 3746 | if ((unsigned long) time(NULL) - (unsigned long) to64(nonce) > 3600 * 2) { | |
| 3747 | return 0; | |
| 3748 | } | |
| 3744 | // Check for authentication timeout | |
| 3745 | if ((unsigned long) time(NULL) - (unsigned long) to64(nonce) > 3600 * 2) { | |
| 3746 | return 0; | |
| 3747 | } | |
| 3749 | 3748 | #endif |
| 3750 | 3749 | |
| 3751 | mg_md5(ha2, method, ":", uri, NULL); | |
| 3752 | mg_md5(expected_response, ha1, ":", nonce, ":", nc, | |
| 3753 | ":", cnonce, ":", qop, ":", ha2, NULL); | |
| 3750 | mg_md5(ha2, method, ":", uri, NULL); | |
| 3751 | mg_md5(expected_response, ha1, ":", nonce, ":", nc, | |
| 3752 | ":", cnonce, ":", qop, ":", ha2, NULL); | |
| 3754 | 3753 | |
| 3755 | ||
| 3754 | return mg_strcasecmp(response, expected_response) == 0 ? MG_TRUE : MG_FALSE; | |
| 3756 | 3755 | } |
| 3757 | 3756 | |
| 3758 | 3757 | |
| 3759 | 3758 | // Authorize against the opened passwords file. Return 1 if authorized. |
| 3760 | 3759 | int mg_authorize_digest(struct mg_connection *c, FILE *fp) { |
| 3761 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 3762 | const char *hdr; | |
| 3763 | char line[256], f_user[256], ha1[256], f_domain[256], user[100], nonce[100], | |
| 3764 | uri[MAX_REQUEST_SIZE], cnonce[100], resp[100], qop[100], nc[100]; | |
| 3760 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 3761 | const char *hdr; | |
| 3762 | char line[256], f_user[256], ha1[256], f_domain[256], user[100], nonce[100], | |
| 3763 | uri[MAX_REQUEST_SIZE], cnonce[100], resp[100], qop[100], nc[100]; | |
| 3765 | 3764 | |
| 3766 | if (c == NULL || fp == NULL) return 0; | |
| 3767 | if ((hdr = mg_get_header(c, "Authorization")) == NULL || | |
| 3768 | mg_strncasecmp(hdr, "Digest ", 7) != 0) return 0; | |
| 3769 | if (!mg_parse_header(hdr, "username", user, sizeof(user))) return 0; | |
| 3770 | if (!mg_parse_header(hdr, "cnonce", cnonce, sizeof(cnonce))) return 0; | |
| 3771 | if (!mg_parse_header(hdr, "response", resp, sizeof(resp))) return 0; | |
| 3772 | if (!mg_parse_header(hdr, "uri", uri, sizeof(uri))) return 0; | |
| 3773 | if (!mg_parse_header(hdr, "qop", qop, sizeof(qop))) return 0; | |
| 3774 | if (!mg_parse_header(hdr, "nc", nc, sizeof(nc))) return 0; | |
| 3775 | if (!mg_parse_header(hdr, "nonce", nonce, sizeof(nonce))) return 0; | |
| 3765 | if (c == NULL || fp == NULL) return 0; | |
| 3766 | if ((hdr = mg_get_header(c, "Authorization")) == NULL || | |
| 3767 | mg_strncasecmp(hdr, "Digest ", 7) != 0) return 0; | |
| 3768 | if (!mg_parse_header(hdr, "username", user, sizeof(user))) return 0; | |
| 3769 | if (!mg_parse_header(hdr, "cnonce", cnonce, sizeof(cnonce))) return 0; | |
| 3770 | if (!mg_parse_header(hdr, "response", resp, sizeof(resp))) return 0; | |
| 3771 | if (!mg_parse_header(hdr, "uri", uri, sizeof(uri))) return 0; | |
| 3772 | if (!mg_parse_header(hdr, "qop", qop, sizeof(qop))) return 0; | |
| 3773 | if (!mg_parse_header(hdr, "nc", nc, sizeof(nc))) return 0; | |
| 3774 | if (!mg_parse_header(hdr, "nonce", nonce, sizeof(nonce))) return 0; | |
| 3776 | 3775 | |
| 3777 | while (fgets(line, sizeof(line), fp) != NULL) { | |
| 3778 | if (sscanf(line, "%[^:]:%[^:]:%s", f_user, f_domain, ha1) == 3 && | |
| 3779 | !strcmp(user, f_user) && | |
| 3780 | // NOTE(lsm): due to a bug in MSIE, we do not compare URIs | |
| 3781 | !strcmp(conn->server->config_options[AUTH_DOMAIN], f_domain)) | |
| 3782 | return check_password(c->request_method, ha1, uri, | |
| 3783 | nonce, nc, cnonce, qop, resp); | |
| 3784 | } | |
| 3785 | return MG_FALSE; | |
| 3776 | while (fgets(line, sizeof(line), fp) != NULL) { | |
| 3777 | if (sscanf(line, "%[^:]:%[^:]:%s", f_user, f_domain, ha1) == 3 && | |
| 3778 | !strcmp(user, f_user) && | |
| 3779 | // NOTE(lsm): due to a bug in MSIE, we do not compare URIs | |
| 3780 | !strcmp(conn->server->config_options[AUTH_DOMAIN], f_domain)) | |
| 3781 | return check_password(c->request_method, ha1, uri, | |
| 3782 | nonce, nc, cnonce, qop, resp); | |
| 3783 | } | |
| 3784 | return MG_FALSE; | |
| 3786 | 3785 | } |
| 3787 | 3786 | |
| 3788 | 3787 | |
| 3789 | 3788 | // Return 1 if request is authorised, 0 otherwise. |
| 3790 | 3789 | static int is_authorized(struct connection *conn, const char *path) { |
| 3791 | FILE *fp; | |
| 3792 | int authorized = MG_TRUE; | |
| 3790 | FILE *fp; | |
| 3791 | int authorized = MG_TRUE; | |
| 3793 | 3792 | |
| 3794 | if ((fp = open_auth_file(conn, path)) != NULL) { | |
| 3795 | authorized = mg_authorize_digest(&conn->mg_conn, fp); | |
| 3796 | fclose(fp); | |
| 3797 | } | |
| 3793 | if ((fp = open_auth_file(conn, path)) != NULL) { | |
| 3794 | authorized = mg_authorize_digest(&conn->mg_conn, fp); | |
| 3795 | fclose(fp); | |
| 3796 | } | |
| 3798 | 3797 | |
| 3799 | ||
| 3798 | return authorized; | |
| 3800 | 3799 | } |
| 3801 | 3800 | |
| 3802 | 3801 | static int is_authorized_for_dav(struct connection *conn) { |
| 3803 | const char *auth_file = conn->server->config_options[DAV_AUTH_FILE]; | |
| 3804 | const char *method = conn->mg_conn.request_method; | |
| 3805 | FILE *fp; | |
| 3806 | int authorized = MG_FALSE; | |
| 3802 | const char *auth_file = conn->server->config_options[DAV_AUTH_FILE]; | |
| 3803 | const char *method = conn->mg_conn.request_method; | |
| 3804 | FILE *fp; | |
| 3805 | int authorized = MG_FALSE; | |
| 3807 | 3806 | |
| 3808 | // If dav_auth_file is not set, allow non-authorized PROPFIND | |
| 3809 | if (method != NULL && !strcmp(method, "PROPFIND") && auth_file == NULL) { | |
| 3810 | authorized = MG_TRUE; | |
| 3811 | } else if (auth_file != NULL && (fp = fopen(auth_file, "r")) != NULL) { | |
| 3812 | authorized = mg_authorize_digest(&conn->mg_conn, fp); | |
| 3813 | fclose(fp); | |
| 3814 | } | |
| 3807 | // If dav_auth_file is not set, allow non-authorized PROPFIND | |
| 3808 | if (method != NULL && !strcmp(method, "PROPFIND") && auth_file == NULL) { | |
| 3809 | authorized = MG_TRUE; | |
| 3810 | } else if (auth_file != NULL && (fp = fopen(auth_file, "r")) != NULL) { | |
| 3811 | authorized = mg_authorize_digest(&conn->mg_conn, fp); | |
| 3812 | fclose(fp); | |
| 3813 | } | |
| 3815 | 3814 | |
| 3816 | ||
| 3815 | return authorized; | |
| 3817 | 3816 | } |
| 3818 | 3817 | |
| 3819 | 3818 | static int is_dav_request(const struct connection *conn) { |
| 3820 | const char *s = conn->mg_conn.request_method; | |
| 3821 | return !strcmp(s, "PUT") || !strcmp(s, "DELETE") || | |
| 3822 | !strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND"); | |
| 3819 | const char *s = conn->mg_conn.request_method; | |
| 3820 | return !strcmp(s, "PUT") || !strcmp(s, "DELETE") || | |
| 3821 | !strcmp(s, "MKCOL") || !strcmp(s, "PROPFIND"); | |
| 3823 | 3822 | } |
| 3824 | 3823 | #endif // MONGOOSE_NO_AUTH |
| 3825 | 3824 | |
| 3826 | 3825 | static int parse_header(const char *str, int str_len, const char *var_name, |
| 3827 | char *buf, size_t buf_size) { | |
| 3828 | int ch = ' ', len = 0, n = strlen(var_name); | |
| 3829 | const char *p, *end = str + str_len, *s = NULL; | |
| 3826 | char *buf, size_t buf_size) { | |
| 3827 | int ch = ' ', len = 0, n = strlen(var_name); | |
| 3828 | const char *p, *end = str + str_len, *s = NULL; | |
| 3830 | 3829 | |
| 3831 | ||
| 3830 | if (buf != NULL && buf_size > 0) buf[0] = '\0'; | |
| 3832 | 3831 | |
| 3833 | // Find where variable starts | |
| 3834 | for (s = str; s != NULL && s + n < end; s++) { | |
| 3835 | if ((s == str || s[-1] == ' ' || s[-1] == ',') && s[n] == '=' && | |
| 3836 | !memcmp(s, var_name, n)) break; | |
| 3837 | } | |
| 3832 | // Find where variable starts | |
| 3833 | for (s = str; s != NULL && s + n < end; s++) { | |
| 3834 | if ((s == str || s[-1] == ' ' || s[-1] == ',') && s[n] == '=' && | |
| 3835 | !memcmp(s, var_name, n)) break; | |
| 3836 | } | |
| 3838 | 3837 | |
| 3839 | if (s != NULL && &s[n + 1] < end) { | |
| 3840 | s += n + 1; | |
| 3841 | if (*s == '"' || *s == '\'') ch = *s++; | |
| 3842 | p = s; | |
| 3843 | while (p < end && p[0] != ch && p[0] != ',' && len < (int) buf_size) { | |
| 3844 | if (p[0] == '\\' && p[1] == ch) p++; | |
| 3845 | buf[len++] = *p++; | |
| 3846 | } | |
| 3847 | if (len >= (int) buf_size || (ch != ' ' && *p != ch)) { | |
| 3848 | len = 0; | |
| 3849 | } else { | |
| 3850 | if (len > 0 && s[len - 1] == ',') len--; | |
| 3851 | if (len > 0 && s[len - 1] == ';') len--; | |
| 3852 | buf[len] = '\0'; | |
| 3853 | } | |
| 3854 | } | |
| 3838 | if (s != NULL && &s[n + 1] < end) { | |
| 3839 | s += n + 1; | |
| 3840 | if (*s == '"' || *s == '\'') ch = *s++; | |
| 3841 | p = s; | |
| 3842 | while (p < end && p[0] != ch && p[0] != ',' && len < (int) buf_size) { | |
| 3843 | if (p[0] == '\\' && p[1] == ch) p++; | |
| 3844 | buf[len++] = *p++; | |
| 3845 | } | |
| 3846 | if (len >= (int) buf_size || (ch != ' ' && *p != ch)) { | |
| 3847 | len = 0; | |
| 3848 | } else { | |
| 3849 | if (len > 0 && s[len - 1] == ',') len--; | |
| 3850 | if (len > 0 && s[len - 1] == ';') len--; | |
| 3851 | buf[len] = '\0'; | |
| 3852 | } | |
| 3853 | } | |
| 3855 | 3854 | |
| 3856 | ||
| 3855 | return len; | |
| 3857 | 3856 | } |
| 3858 | 3857 | |
| 3859 | 3858 | int mg_parse_header(const char *s, const char *var_name, char *buf, |
| 3860 | size_t buf_size) { | |
| 3861 | return parse_header(s, s == NULL ? 0 : strlen(s), var_name, buf, buf_size); | |
| 3859 | size_t buf_size) { | |
| 3860 | return parse_header(s, s == NULL ? 0 : strlen(s), var_name, buf, buf_size); | |
| 3862 | 3861 | } |
| 3863 | 3862 | |
| 3864 | 3863 | #ifndef MONGOOSE_NO_SSI |
| 3865 | 3864 | static void send_ssi_file(struct mg_connection *, const char *, FILE *, int); |
| 3866 | 3865 | |
| 3867 | 3866 | static void send_file_data(struct mg_connection *conn, FILE *fp) { |
| 3868 | char buf[IOBUF_SIZE]; | |
| 3869 | int n; | |
| 3870 | while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) { | |
| 3871 | mg_write(conn, buf, n); | |
| 3872 | } | |
| 3867 | char buf[IOBUF_SIZE]; | |
| 3868 | int n; | |
| 3869 | while ((n = fread(buf, 1, sizeof(buf), fp)) > 0) { | |
| 3870 | mg_write(conn, buf, n); | |
| 3871 | } | |
| 3873 | 3872 | } |
| 3874 | 3873 | |
| 3875 | 3874 | static void do_ssi_include(struct mg_connection *conn, const char *ssi, |
| 3876 | char *tag, int include_level) { | |
| 3877 | char file_name[IOBUF_SIZE], path[MAX_PATH_SIZE], *p; | |
| 3878 | char **opts = (MG_CONN_2_CONN(conn))->server->config_options; | |
| 3879 | FILE *fp; | |
| 3875 | char *tag, int include_level) { | |
| 3876 | char file_name[IOBUF_SIZE], path[MAX_PATH_SIZE], *p; | |
| 3877 | char **opts = (MG_CONN_2_CONN(conn))->server->config_options; | |
| 3878 | FILE *fp; | |
| 3880 | 3879 | |
| 3881 | // sscanf() is safe here, since send_ssi_file() also uses buffer | |
| 3882 | // of size MG_BUF_LEN to get the tag. So strlen(tag) is always < MG_BUF_LEN. | |
| 3883 | if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) { | |
| 3884 | // File name is relative to the webserver root | |
| 3885 | mg_snprintf(path, sizeof(path), "%s%c%s", | |
| 3886 | opts[DOCUMENT_ROOT], '/', file_name); | |
| 3887 | } else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) { | |
| 3888 | // File name is relative to the webserver working directory | |
| 3889 | // or it is absolute system path | |
| 3890 | mg_snprintf(path, sizeof(path), "%s", file_name); | |
| 3891 | } else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 || | |
| 3892 | sscanf(tag, " \"%[^\"]\"", file_name) == 1) { | |
| 3893 | // File name is relative to the currect document | |
| 3894 | mg_snprintf(path, sizeof(path), "%s", ssi); | |
| 3895 | if ((p = strrchr(path, '/')) != NULL) { | |
| 3896 | p[1] = '\0'; | |
| 3897 | } | |
| 3898 | mg_snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", | |
| 3899 | file_name); | |
| 3900 | } else { | |
| 3901 | mg_printf(conn, "Bad SSI #include: [%s]", tag); | |
| 3902 | return; | |
| 3903 | } | |
| 3880 | // sscanf() is safe here, since send_ssi_file() also uses buffer | |
| 3881 | // of size MG_BUF_LEN to get the tag. So strlen(tag) is always < MG_BUF_LEN. | |
| 3882 | if (sscanf(tag, " virtual=\"%[^\"]\"", file_name) == 1) { | |
| 3883 | // File name is relative to the webserver root | |
| 3884 | mg_snprintf(path, sizeof(path), "%s%c%s", | |
| 3885 | opts[DOCUMENT_ROOT], '/', file_name); | |
| 3886 | } else if (sscanf(tag, " abspath=\"%[^\"]\"", file_name) == 1) { | |
| 3887 | // File name is relative to the webserver working directory | |
| 3888 | // or it is absolute system path | |
| 3889 | mg_snprintf(path, sizeof(path), "%s", file_name); | |
| 3890 | } else if (sscanf(tag, " file=\"%[^\"]\"", file_name) == 1 || | |
| 3891 | sscanf(tag, " \"%[^\"]\"", file_name) == 1) { | |
| 3892 | // File name is relative to the currect document | |
| 3893 | mg_snprintf(path, sizeof(path), "%s", ssi); | |
| 3894 | if ((p = strrchr(path, '/')) != NULL) { | |
| 3895 | p[1] = '\0'; | |
| 3896 | } | |
| 3897 | mg_snprintf(path + strlen(path), sizeof(path) - strlen(path), "%s", | |
| 3898 | file_name); | |
| 3899 | } else { | |
| 3900 | mg_printf(conn, "Bad SSI #include: [%s]", tag); | |
| 3901 | return; | |
| 3902 | } | |
| 3904 | 3903 | |
| 3905 | if ((fp = fopen(path, "rb")) == NULL) { | |
| 3906 | mg_printf(conn, "Cannot open SSI #include: [%s]: fopen(%s): %s", | |
| 3907 | tag, path, strerror(errno)); | |
| 3908 | } else { | |
| 3909 | ns_set_close_on_exec(fileno(fp)); | |
| 3910 | if (mg_match_prefix(opts[SSI_PATTERN], strlen(opts[SSI_PATTERN]), | |
| 3911 | path) > 0) { | |
| 3912 | send_ssi_file(conn, path, fp, include_level + 1); | |
| 3913 | } else { | |
| 3914 | send_file_data(conn, fp); | |
| 3915 | } | |
| 3916 | fclose(fp); | |
| 3917 | } | |
| 3904 | if ((fp = fopen(path, "rb")) == NULL) { | |
| 3905 | mg_printf(conn, "Cannot open SSI #include: [%s]: fopen(%s): %s", | |
| 3906 | tag, path, strerror(errno)); | |
| 3907 | } else { | |
| 3908 | ns_set_close_on_exec(fileno(fp)); | |
| 3909 | if (mg_match_prefix(opts[SSI_PATTERN], strlen(opts[SSI_PATTERN]), | |
| 3910 | path) > 0) { | |
| 3911 | send_ssi_file(conn, path, fp, include_level + 1); | |
| 3912 | } else { | |
| 3913 | send_file_data(conn, fp); | |
| 3914 | } | |
| 3915 | fclose(fp); | |
| 3916 | } | |
| 3918 | 3917 | } |
| 3919 | 3918 | |
| 3920 | 3919 | #ifndef MONGOOSE_NO_POPEN |
| 3921 | 3920 | static void do_ssi_exec(struct mg_connection *conn, char *tag) { |
| 3922 | char cmd[IOBUF_SIZE]; | |
| 3923 | FILE *fp; | |
| 3921 | char cmd[IOBUF_SIZE]; | |
| 3922 | FILE *fp; | |
| 3924 | 3923 | |
| 3925 | if (sscanf(tag, " \"%[^\"]\"", cmd) != 1) { | |
| 3926 | mg_printf(conn, "Bad SSI #exec: [%s]", tag); | |
| 3927 | } else if ((fp = popen(cmd, "r")) == NULL) { | |
| 3928 | mg_printf(conn, "Cannot SSI #exec: [%s]: %s", cmd, strerror(errno)); | |
| 3929 | } else { | |
| 3930 | send_file_data(conn, fp); | |
| 3931 | pclose(fp); | |
| 3932 | } | |
| 3924 | if (sscanf(tag, " \"%[^\"]\"", cmd) != 1) { | |
| 3925 | mg_printf(conn, "Bad SSI #exec: [%s]", tag); | |
| 3926 | } else if ((fp = popen(cmd, "r")) == NULL) { | |
| 3927 | mg_printf(conn, "Cannot SSI #exec: [%s]: %s", cmd, strerror(errno)); | |
| 3928 | } else { | |
| 3929 | send_file_data(conn, fp); | |
| 3930 | pclose(fp); | |
| 3931 | } | |
| 3933 | 3932 | } |
| 3934 | 3933 | #endif // !MONGOOSE_NO_POPEN |
| 3935 | 3934 | |
| 3936 | 3935 | static void send_ssi_file(struct mg_connection *conn, const char *path, |
| 3937 | FILE *fp, int include_level) { | |
| 3938 | char buf[IOBUF_SIZE]; | |
| 3939 | int ch, offset, len, in_ssi_tag; | |
| 3936 | FILE *fp, int include_level) { | |
| 3937 | char buf[IOBUF_SIZE]; | |
| 3938 | int ch, offset, len, in_ssi_tag; | |
| 3940 | 3939 | |
| 3941 | if (include_level > 10) { | |
| 3942 | mg_printf(conn, "SSI #include level is too deep (%s)", path); | |
| 3943 | return; | |
| 3944 | } | |
| 3940 | if (include_level > 10) { | |
| 3941 | mg_printf(conn, "SSI #include level is too deep (%s)", path); | |
| 3942 | return; | |
| 3943 | } | |
| 3945 | 3944 | |
| 3946 | in_ssi_tag = len = offset = 0; | |
| 3947 | while ((ch = fgetc(fp)) != EOF) { | |
| 3948 | if (in_ssi_tag && ch == '>') { | |
| 3949 | in_ssi_tag = 0; | |
| 3950 | buf[len++] = (char) ch; | |
| 3951 | buf[len] = '\0'; | |
| 3952 | assert(len <= (int) sizeof(buf)); | |
| 3953 | if (len < 6 || memcmp(buf, "<!--#", 5) != 0) { | |
| 3954 | // Not an SSI tag, pass it | |
| 3955 | (void) mg_write(conn, buf, (size_t) len); | |
| 3956 | } else { | |
| 3957 | if (!memcmp(buf + 5, "include", 7)) { | |
| 3958 | do_ssi_include(conn, path, buf + 12, include_level); | |
| 3945 | in_ssi_tag = len = offset = 0; | |
| 3946 | while ((ch = fgetc(fp)) != EOF) { | |
| 3947 | if (in_ssi_tag && ch == '>') { | |
| 3948 | in_ssi_tag = 0; | |
| 3949 | buf[len++] = (char) ch; | |
| 3950 | buf[len] = '\0'; | |
| 3951 | assert(len <= (int) sizeof(buf)); | |
| 3952 | if (len < 6 || memcmp(buf, "<!--#", 5) != 0) { | |
| 3953 | // Not an SSI tag, pass it | |
| 3954 | (void) mg_write(conn, buf, (size_t) len); | |
| 3955 | } else { | |
| 3956 | if (!memcmp(buf + 5, "include", 7)) { | |
| 3957 | do_ssi_include(conn, path, buf + 12, include_level); | |
| 3959 | 3958 | #if !defined(MONGOOSE_NO_POPEN) |
| 3960 | } else if (!memcmp(buf + 5, "exec", 4)) { | |
| 3961 | do_ssi_exec(conn, buf + 9); | |
| 3959 | } else if (!memcmp(buf + 5, "exec", 4)) { | |
| 3960 | do_ssi_exec(conn, buf + 9); | |
| 3962 | 3961 | #endif // !NO_POPEN |
| 3963 | } else { | |
| 3964 | mg_printf(conn, "%s: unknown SSI " "command: \"%s\"", path, buf); | |
| 3965 | } | |
| 3966 | } | |
| 3967 | len = 0; | |
| 3968 | } else if (in_ssi_tag) { | |
| 3969 | if (len == 5 && memcmp(buf, "<!--#", 5) != 0) { | |
| 3970 | // Not an SSI tag | |
| 3971 | in_ssi_tag = 0; | |
| 3972 | } else if (len == (int) sizeof(buf) - 2) { | |
| 3973 | mg_printf(conn, "%s: SSI tag is too large", path); | |
| 3974 | len = 0; | |
| 3975 | } | |
| 3976 | buf[len++] = ch & 0xff; | |
| 3977 | } else if (ch == '<') { | |
| 3978 | in_ssi_tag = 1; | |
| 3979 | if (len > 0) { | |
| 3980 | mg_write(conn, buf, (size_t) len); | |
| 3981 | } | |
| 3982 | len = 0; | |
| 3983 | buf[len++] = ch & 0xff; | |
| 3984 | } else { | |
| 3985 | buf[len++] = ch & 0xff; | |
| 3986 | if (len == (int) sizeof(buf)) { | |
| 3987 | mg_write(conn, buf, (size_t) len); | |
| 3988 | len = 0; | |
| 3989 | } | |
| 3990 | } | |
| 3991 | } | |
| 3962 | } else { | |
| 3963 | mg_printf(conn, "%s: unknown SSI " "command: \"%s\"", path, buf); | |
| 3964 | } | |
| 3965 | } | |
| 3966 | len = 0; | |
| 3967 | } else if (in_ssi_tag) { | |
| 3968 | if (len == 5 && memcmp(buf, "<!--#", 5) != 0) { | |
| 3969 | // Not an SSI tag | |
| 3970 | in_ssi_tag = 0; | |
| 3971 | } else if (len == (int) sizeof(buf) - 2) { | |
| 3972 | mg_printf(conn, "%s: SSI tag is too large", path); | |
| 3973 | len = 0; | |
| 3974 | } | |
| 3975 | buf[len++] = ch & 0xff; | |
| 3976 | } else if (ch == '<') { | |
| 3977 | in_ssi_tag = 1; | |
| 3978 | if (len > 0) { | |
| 3979 | mg_write(conn, buf, (size_t) len); | |
| 3980 | } | |
| 3981 | len = 0; | |
| 3982 | buf[len++] = ch & 0xff; | |
| 3983 | } else { | |
| 3984 | buf[len++] = ch & 0xff; | |
| 3985 | if (len == (int) sizeof(buf)) { | |
| 3986 | mg_write(conn, buf, (size_t) len); | |
| 3987 | len = 0; | |
| 3988 | } | |
| 3989 | } | |
| 3990 | } | |
| 3992 | 3991 | |
| 3993 | // Send the rest of buffered data | |
| 3994 | if (len > 0) { | |
| 3995 | mg_write(conn, buf, (size_t) len); | |
| 3996 | } | |
| 3992 | // Send the rest of buffered data | |
| 3993 | if (len > 0) { | |
| 3994 | mg_write(conn, buf, (size_t) len); | |
| 3995 | } | |
| 3997 | 3996 | } |
| 3998 | 3997 | |
| 3999 | 3998 | static void handle_ssi_request(struct connection *conn, const char *path) { |
| 4000 | FILE *fp; | |
| 4001 | struct vec mime_vec; | |
| 3999 | FILE *fp; | |
| 4000 | struct vec mime_vec; | |
| 4002 | 4001 | |
| 4003 | if ((fp = fopen(path, "rb")) == NULL) { | |
| 4004 | send_http_error(conn, 500, "fopen(%s): %s", path, strerror(errno)); | |
| 4005 | } else { | |
| 4006 | ns_set_close_on_exec(fileno(fp)); | |
| 4007 | get_mime_type(conn->server, path, &mime_vec); | |
| 4008 | conn->mg_conn.status_code = 200; | |
| 4009 | mg_printf(&conn->mg_conn, | |
| 4010 | "HTTP/1.1 %d OK\r\n" | |
| 4011 | "Content-Type: %.*s\r\n" | |
| 4012 | "Connection: close\r\n\r\n", | |
| 4013 | conn->mg_conn.status_code, (int) mime_vec.len, mime_vec.ptr); | |
| 4014 | send_ssi_file(&conn->mg_conn, path, fp, 0); | |
| 4015 | fclose(fp); | |
| 4016 | close_local_endpoint(conn); | |
| 4017 | } | |
| 4002 | if ((fp = fopen(path, "rb")) == NULL) { | |
| 4003 | send_http_error(conn, 500, "fopen(%s): %s", path, strerror(errno)); | |
| 4004 | } else { | |
| 4005 | ns_set_close_on_exec(fileno(fp)); | |
| 4006 | get_mime_type(conn->server, path, &mime_vec); | |
| 4007 | conn->mg_conn.status_code = 200; | |
| 4008 | mg_printf(&conn->mg_conn, | |
| 4009 | "HTTP/1.1 %d OK\r\n" | |
| 4010 | "Content-Type: %.*s\r\n" | |
| 4011 | "Connection: close\r\n\r\n", | |
| 4012 | conn->mg_conn.status_code, (int) mime_vec.len, mime_vec.ptr); | |
| 4013 | send_ssi_file(&conn->mg_conn, path, fp, 0); | |
| 4014 | fclose(fp); | |
| 4015 | close_local_endpoint(conn); | |
| 4016 | } | |
| 4018 | 4017 | } |
| 4019 | 4018 | #endif |
| 4020 | 4019 | |
| 4021 | 4020 | static void proxy_request(struct ns_connection *pc, struct mg_connection *c) { |
| 4022 | ||
| 4021 | int i, sent_close_header = 0; | |
| 4023 | 4022 | |
| 4024 | ns_printf(pc, "%s %s HTTP/%s\r\n", c->request_method, c->uri, | |
| 4025 | c->http_version); | |
| 4026 | for (i = 0; i < c->num_headers; i++) { | |
| 4027 | if (mg_strcasecmp(c->http_headers[i].name, "Connection") == 0) { | |
| 4028 | // Force connection close, cause we don't parse proxy replies | |
| 4029 | // therefore we don't know message boundaries | |
| 4030 | //ns_printf(pc, "%s: %s\r\n", "Connection", "close"); | |
| 4031 | sent_close_header = 1; | |
| 4032 | //} else { | |
| 4033 | } | |
| 4034 | ns_printf(pc, "%s: %s\r\n", c->http_headers[i].name, | |
| 4035 | c->http_headers[i].value); | |
| 4036 | } | |
| 4037 | if (!sent_close_header) { | |
| 4038 | ns_printf(pc, "%s: %s\r\n", "Connection", "close"); | |
| 4039 | } | |
| 4040 | ns_printf(pc, "%s", "\r\n"); | |
| 4041 | ns_send(pc, c->content, c->content_len); | |
| 4023 | ns_printf(pc, "%s %s HTTP/%s\r\n", c->request_method, c->uri, | |
| 4024 | c->http_version); | |
| 4025 | for (i = 0; i < c->num_headers; i++) { | |
| 4026 | if (mg_strcasecmp(c->http_headers[i].name, "Connection") == 0) { | |
| 4027 | // Force connection close, cause we don't parse proxy replies | |
| 4028 | // therefore we don't know message boundaries | |
| 4029 | //ns_printf(pc, "%s: %s\r\n", "Connection", "close"); | |
| 4030 | sent_close_header = 1; | |
| 4031 | //} else { | |
| 4032 | } | |
| 4033 | ns_printf(pc, "%s: %s\r\n", c->http_headers[i].name, | |
| 4034 | c->http_headers[i].value); | |
| 4035 | } | |
| 4036 | if (!sent_close_header) { | |
| 4037 | ns_printf(pc, "%s: %s\r\n", "Connection", "close"); | |
| 4038 | } | |
| 4039 | ns_printf(pc, "%s", "\r\n"); | |
| 4040 | ns_send(pc, c->content, c->content_len); | |
| 4042 | 4041 | |
| 4043 | 4042 | } |
| 4044 | 4043 | |
| 4045 | 4044 | #ifdef NS_ENABLE_SSL |
| 4046 | 4045 | int mg_terminate_ssl(struct mg_connection *c, const char *cert) { |
| 4047 | static const char ok[] = "HTTP/1.0 200 OK\r\n\r\n"; | |
| 4048 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 4049 | int n; | |
| 4050 | SSL_CTX *ctx; | |
| 4046 | static const char ok[] = "HTTP/1.0 200 OK\r\n\r\n"; | |
| 4047 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 4048 | int n; | |
| 4049 | SSL_CTX *ctx; | |
| 4051 | 4050 | |
| 4052 | DBG(("%p MITM", conn)); | |
| 4053 | SSL_library_init(); | |
| 4054 | if ((ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) return 0; | |
| 4051 | DBG(("%p MITM", conn)); | |
| 4052 | SSL_library_init(); | |
| 4053 | if ((ctx = SSL_CTX_new(SSLv23_server_method())) == NULL) return 0; | |
| 4055 | 4054 | |
| 4056 | SSL_CTX_use_certificate_file(ctx, cert, 1); | |
| 4057 | SSL_CTX_use_PrivateKey_file(ctx, cert, 1); | |
| 4058 | SSL_CTX_use_certificate_chain_file(ctx, cert); | |
| 4055 | SSL_CTX_use_certificate_file(ctx, cert, 1); | |
| 4056 | SSL_CTX_use_PrivateKey_file(ctx, cert, 1); | |
| 4057 | SSL_CTX_use_certificate_chain_file(ctx, cert); | |
| 4059 | 4058 | |
| 4060 | // When clear-text reply is pushed to client, switch to SSL mode. | |
| 4061 | n = send(conn->ns_conn->sock, ok, sizeof(ok) - 1, 0); | |
| 4062 | DBG(("%p %lu %d SEND", c, sizeof(ok) - 1, n)); | |
| 4063 | conn->ns_conn->send_iobuf.len = 0; | |
| 4064 | conn->endpoint_type = EP_USER; // To keep-alive in close_local_endpoint() | |
| 4065 | close_local_endpoint(conn); // Clean up current CONNECT request | |
| 4066 | if ((conn->ns_conn->ssl = SSL_new(ctx)) != NULL) { | |
| 4067 | SSL_set_fd(conn->ns_conn->ssl, conn->ns_conn->sock); | |
| 4068 | } | |
| 4069 | SSL_CTX_free(ctx); | |
| 4070 | return 1; | |
| 4059 | // When clear-text reply is pushed to client, switch to SSL mode. | |
| 4060 | n = send(conn->ns_conn->sock, ok, sizeof(ok) - 1, 0); | |
| 4061 | DBG(("%p %lu %d SEND", c, sizeof(ok) - 1, n)); | |
| 4062 | conn->ns_conn->send_iobuf.len = 0; | |
| 4063 | conn->endpoint_type = EP_USER; // To keep-alive in close_local_endpoint() | |
| 4064 | close_local_endpoint(conn); // Clean up current CONNECT request | |
| 4065 | if ((conn->ns_conn->ssl = SSL_new(ctx)) != NULL) { | |
| 4066 | SSL_set_fd(conn->ns_conn->ssl, conn->ns_conn->sock); | |
| 4067 | } | |
| 4068 | SSL_CTX_free(ctx); | |
| 4069 | return 1; | |
| 4071 | 4070 | } |
| 4072 | 4071 | #endif |
| 4073 | 4072 | |
| 4074 | 4073 | static void proxify_connection(struct connection *conn) { |
| 4075 | char proto[10], host[500], cert[500]; | |
| 4076 | unsigned short port = 80; | |
| 4077 | struct mg_connection *c = &conn->mg_conn; | |
| 4078 | struct ns_server *server = &conn->server->ns_server; | |
| 4079 | struct ns_connection *pc = NULL; | |
| 4080 | int n = 0; | |
| 4081 | const char *url = c->uri; | |
| 4074 | char proto[10], host[500], cert[500]; | |
| 4075 | unsigned short port = 80; | |
| 4076 | struct mg_connection *c = &conn->mg_conn; | |
| 4077 | struct ns_server *server = &conn->server->ns_server; | |
| 4078 | struct ns_connection *pc = NULL; | |
| 4079 | int n = 0; | |
| 4080 | const char *url = c->uri; | |
| 4082 | 4081 | |
| 4083 | proto[0] = host[0] = cert[0] = '\0'; | |
| 4084 | if (sscanf(url, "%499[^: ]:%hu%n", host, &port, &n) != 2 && | |
| 4085 | sscanf(url, "%9[a-z]://%499[^: ]:%hu%n", proto, host, &port, &n) != 3 && | |
| 4086 | sscanf(url, "%9[a-z]://%499[^/ ]%n", proto, host, &n) != 2) { | |
| 4087 | n = 0; | |
| 4088 | } | |
| 4082 | proto[0] = host[0] = cert[0] = '\0'; | |
| 4083 | if (sscanf(url, "%499[^: ]:%hu%n", host, &port, &n) != 2 && | |
| 4084 | sscanf(url, "%9[a-z]://%499[^: ]:%hu%n", proto, host, &port, &n) != 3 && | |
| 4085 | sscanf(url, "%9[a-z]://%499[^/ ]%n", proto, host, &n) != 2) { | |
| 4086 | n = 0; | |
| 4087 | } | |
| 4089 | 4088 | |
| 4090 | 4089 | #ifdef NS_ENABLE_SSL |
| 4091 | // Find out whether we should be in the MITM mode | |
| 4092 | { | |
| 4093 | const char *certs = conn->server->config_options[SSL_MITM_CERTS]; | |
| 4094 | int host_len = strlen(host); | |
| 4095 | struct vec a, b; | |
| 4090 | // Find out whether we should be in the MITM mode | |
| 4091 | { | |
| 4092 | const char *certs = conn->server->config_options[SSL_MITM_CERTS]; | |
| 4093 | int host_len = strlen(host); | |
| 4094 | struct vec a, b; | |
| 4096 | 4095 | |
| 4097 | while (conn->ns_conn->ssl == NULL && port != 80 && | |
| 4098 | (certs = next_option(certs, &a, &b)) != NULL) { | |
| 4099 | if (a.len != host_len || mg_strncasecmp(a.ptr, host, a.len)) continue; | |
| 4100 | snprintf(cert, sizeof(cert), "%.*s", b.len, b.ptr); | |
| 4101 | mg_terminate_ssl(&conn->mg_conn, cert); | |
| 4102 | return; | |
| 4103 | } | |
| 4104 | } | |
| 4096 | while (conn->ns_conn->ssl == NULL && port != 80 && | |
| 4097 | (certs = next_option(certs, &a, &b)) != NULL) { | |
| 4098 | if (a.len != host_len || mg_strncasecmp(a.ptr, host, a.len)) continue; | |
| 4099 | snprintf(cert, sizeof(cert), "%.*s", b.len, b.ptr); | |
| 4100 | mg_terminate_ssl(&conn->mg_conn, cert); | |
| 4101 | return; | |
| 4102 | } | |
| 4103 | } | |
| 4105 | 4104 | #endif |
| 4106 | 4105 | |
| 4107 | if (n > 0 && | |
| 4108 | (pc = ns_connect(server, host, port, conn->ns_conn->ssl != NULL, | |
| 4109 | conn)) != NULL) { | |
| 4110 | // Interlink two connections | |
| 4111 | pc->flags |= MG_PROXY_CONN; | |
| 4112 | conn->endpoint_type = EP_PROXY; | |
| 4113 | conn->endpoint.nc = pc; | |
| 4114 | DBG(("%p [%s] -> %p %p", conn, c->uri, pc, conn->ns_conn->ssl)); | |
| 4106 | if (n > 0 && | |
| 4107 | (pc = ns_connect(server, host, port, conn->ns_conn->ssl != NULL, | |
| 4108 | conn)) != NULL) { | |
| 4109 | // Interlink two connections | |
| 4110 | pc->flags |= MG_PROXY_CONN; | |
| 4111 | conn->endpoint_type = EP_PROXY; | |
| 4112 | conn->endpoint.nc = pc; | |
| 4113 | DBG(("%p [%s] -> %p %p", conn, c->uri, pc, conn->ns_conn->ssl)); | |
| 4115 | 4114 | |
| 4116 | if (strcmp(c->request_method, "CONNECT") == 0) { | |
| 4117 | // For CONNECT request, reply with 200 OK. Tunnel is established. | |
| 4118 | mg_printf(c, "%s", "HTTP/1.1 200 OK\r\n\r\n"); | |
| 4119 | conn->request_len = 0; | |
| 4120 | free(conn->request); | |
| 4121 | conn->request = NULL; | |
| 4122 | } else { | |
| 4123 | // For other methods, forward the request to the target host. | |
| 4124 | c->uri += n; | |
| 4125 | proxy_request(pc, c); | |
| 4126 | } | |
| 4127 | } else { | |
| 4128 | conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4129 | } | |
| 4115 | if (strcmp(c->request_method, "CONNECT") == 0) { | |
| 4116 | // For CONNECT request, reply with 200 OK. Tunnel is established. | |
| 4117 | mg_printf(c, "%s", "HTTP/1.1 200 OK\r\n\r\n"); | |
| 4118 | conn->request_len = 0; | |
| 4119 | free(conn->request); | |
| 4120 | conn->request = NULL; | |
| 4121 | } else { | |
| 4122 | // For other methods, forward the request to the target host. | |
| 4123 | c->uri += n; | |
| 4124 | proxy_request(pc, c); | |
| 4125 | } | |
| 4126 | } else { | |
| 4127 | conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4128 | } | |
| 4130 | 4129 | } |
| 4131 | 4130 | |
| 4132 | 4131 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4133 | 4132 | void mg_send_file(struct mg_connection *c, const char *file_name) { |
| 4134 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 4135 | file_stat_t st; | |
| 4136 | char path[MAX_PATH_SIZE]; | |
| 4137 | int exists = 0, is_directory = 0; | |
| 4133 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 4134 | file_stat_t st; | |
| 4135 | char path[MAX_PATH_SIZE]; | |
| 4136 | int exists = 0, is_directory = 0; | |
| 4138 | 4137 | #ifndef MONGOOSE_NO_CGI |
| 4139 | ||
| 4138 | const char *cgi_pat = conn->server->config_options[CGI_PATTERN]; | |
| 4140 | 4139 | #else |
| 4141 | ||
| 4140 | const char *cgi_pat = DEFAULT_CGI_PATTERN; | |
| 4142 | 4141 | #endif |
| 4143 | 4142 | #ifndef MONGOOSE_NO_DIRECTORY_LISTING |
| 4144 | ||
| 4143 | const char *dir_lst = conn->server->config_options[ENABLE_DIRECTORY_LISTING]; | |
| 4145 | 4144 | #else |
| 4146 | ||
| 4145 | const char *dir_lst = "yes"; | |
| 4147 | 4146 | #endif |
| 4148 | 4147 | |
| 4149 | mg_snprintf(path, sizeof(path), "%s", file_name); | |
| 4150 | exists = stat(path, &st) == 0; | |
| 4151 | is_directory = S_ISDIR(st.st_mode); | |
| 4152 | ||
| 4153 | if (!exists || must_hide_file(conn, path)) { | |
| 4154 | send_http_error(conn, 404, NULL); | |
| 4155 | } else if (is_directory && | |
| 4156 | conn->mg_conn.uri[strlen(conn->mg_conn.uri) - 1] != '/') { | |
| 4157 | conn->mg_conn.status_code = 301; | |
| 4158 | mg_printf(&conn->mg_conn, "HTTP/1.1 301 Moved Permanently\r\n" | |
| 4159 | "Location: %s/\r\n\r\n", conn->mg_conn.uri); | |
| 4160 | close_local_endpoint(conn); | |
| 4161 | } else if (is_directory && !find_index_file(conn, path, sizeof(path), &st)) { | |
| 4162 | if (!mg_strcasecmp(dir_lst, "yes")) { | |
| 4148 | mg_snprintf(path, sizeof(path), "%s", file_name); | |
| 4149 | exists = stat(path, &st) == 0; | |
| 4150 | is_directory = S_ISDIR(st.st_mode); | |
| 4151 | ||
| 4152 | if (!exists || must_hide_file(conn, path)) { | |
| 4153 | send_http_error(conn, 404, NULL); | |
| 4154 | } else if (is_directory && | |
| 4155 | conn->mg_conn.uri[strlen(conn->mg_conn.uri) - 1] != '/') { | |
| 4156 | conn->mg_conn.status_code = 301; | |
| 4157 | mg_printf(&conn->mg_conn, "HTTP/1.1 301 Moved Permanently\r\n" | |
| 4158 | "Location: %s/\r\n\r\n", conn->mg_conn.uri); | |
| 4159 | close_local_endpoint(conn); | |
| 4160 | } else if (is_directory && !find_index_file(conn, path, sizeof(path), &st)) { | |
| 4161 | if (!mg_strcasecmp(dir_lst, "yes")) { | |
| 4163 | 4162 | #ifndef MONGOOSE_NO_DIRECTORY_LISTING |
| 4164 | ||
| 4163 | send_directory_listing(conn, path); | |
| 4165 | 4164 | #else |
| 4166 | ||
| 4165 | send_http_error(conn, 501, NULL); | |
| 4167 | 4166 | #endif |
| 4168 | } else { | |
| 4169 | send_http_error(conn, 403, NULL); | |
| 4170 | } | |
| 4171 | } else if (mg_match_prefix(cgi_pat, strlen(cgi_pat), path) > 0) { | |
| 4167 | } else { | |
| 4168 | send_http_error(conn, 403, NULL); | |
| 4169 | } | |
| 4170 | } else if (mg_match_prefix(cgi_pat, strlen(cgi_pat), path) > 0) { | |
| 4172 | 4171 | #if !defined(MONGOOSE_NO_CGI) |
| 4173 | ||
| 4172 | open_cgi_endpoint(conn, path); | |
| 4174 | 4173 | #else |
| 4175 | ||
| 4174 | send_http_error(conn, 501, NULL); | |
| 4176 | 4175 | #endif // !MONGOOSE_NO_CGI |
| 4177 | 4176 | #ifndef MONGOOSE_NO_SSI |
| 4178 | } else if (mg_match_prefix(conn->server->config_options[SSI_PATTERN], | |
| 4179 | strlen(conn->server->config_options[SSI_PATTERN]), | |
| 4180 | path) > 0) { | |
| 4181 | handle_ssi_request(conn, path); | |
| 4177 | } else if (mg_match_prefix(conn->server->config_options[SSI_PATTERN], | |
| 4178 | strlen(conn->server->config_options[SSI_PATTERN]), | |
| 4179 | path) > 0) { | |
| 4180 | handle_ssi_request(conn, path); | |
| 4182 | 4181 | #endif |
| 4183 | } else if (is_not_modified(conn, &st)) { | |
| 4184 | send_http_error(conn, 304, NULL); | |
| 4185 | } else if ((conn->endpoint.fd = open(path, O_RDONLY | O_BINARY)) != -1) { | |
| 4186 | // O_BINARY is required for Windows, otherwise in default text mode | |
| 4187 | // two bytes \r\n will be read as one. | |
| 4188 | open_file_endpoint(conn, path, &st); | |
| 4189 | } else { | |
| 4190 | send_http_error(conn, 404, NULL); | |
| 4191 | } | |
| 4182 | } else if (is_not_modified(conn, &st)) { | |
| 4183 | send_http_error(conn, 304, NULL); | |
| 4184 | } else if ((conn->endpoint.fd = open(path, O_RDONLY | O_BINARY)) != -1) { | |
| 4185 | // O_BINARY is required for Windows, otherwise in default text mode | |
| 4186 | // two bytes \r\n will be read as one. | |
| 4187 | open_file_endpoint(conn, path, &st); | |
| 4188 | } else { | |
| 4189 | send_http_error(conn, 404, NULL); | |
| 4190 | } | |
| 4192 | 4191 | } |
| 4193 | 4192 | #endif // !MONGOOSE_NO_FILESYSTEM |
| 4194 | 4193 | |
| 4195 | 4194 | static void open_local_endpoint(struct connection *conn, int skip_user) { |
| 4196 | 4195 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4197 | char path[MAX_PATH_SIZE]; | |
| 4198 | file_stat_t st; | |
| 4199 | int exists = 0; | |
| 4196 | char path[MAX_PATH_SIZE]; | |
| 4197 | file_stat_t st; | |
| 4198 | int exists = 0; | |
| 4200 | 4199 | #endif |
| 4201 | 4200 | |
| 4202 | // If EP_USER was set in a prev call, reset it | |
| 4203 | conn->endpoint_type = EP_NONE; | |
| 4201 | // If EP_USER was set in a prev call, reset it | |
| 4202 | conn->endpoint_type = EP_NONE; | |
| 4204 | 4203 | |
| 4205 | 4204 | #ifndef MONGOOSE_NO_AUTH |
| 4206 | if (conn->server->event_handler && call_user(conn, MG_AUTH) == MG_FALSE) { | |
| 4207 | mg_send_digest_auth_request(&conn->mg_conn); | |
| 4208 | return; | |
| 4209 | } | |
| 4205 | if (conn->server->event_handler && call_user(conn, MG_AUTH) == MG_FALSE) { | |
| 4206 | mg_send_digest_auth_request(&conn->mg_conn); | |
| 4207 | return; | |
| 4208 | } | |
| 4210 | 4209 | #endif |
| 4211 | 4210 | |
| 4212 | // Call URI handler if one is registered for this URI | |
| 4213 | if (skip_user == 0 && conn->server->event_handler != NULL) { | |
| 4214 | conn->endpoint_type = EP_USER; | |
| 4211 | // Call URI handler if one is registered for this URI | |
| 4212 | if (skip_user == 0 && conn->server->event_handler != NULL) { | |
| 4213 | conn->endpoint_type = EP_USER; | |
| 4215 | 4214 | #if MONGOOSE_POST_SIZE_LIMIT > 1 |
| 4216 | { | |
| 4217 | const char *cl = mg_get_header(&conn->mg_conn, "Content-Length"); | |
| 4218 | if ((strcmp(conn->mg_conn.request_method, "POST") == 0 || | |
| 4219 | strcmp(conn->mg_conn.request_method, "PUT") == 0) && | |
| 4220 | (cl == NULL || to64(cl) > MONGOOSE_POST_SIZE_LIMIT)) { | |
| 4221 | send_http_error(conn, 500, "POST size > %zu", | |
| 4222 | (size_t) MONGOOSE_POST_SIZE_LIMIT); | |
| 4223 | } | |
| 4224 | } | |
| 4215 | { | |
| 4216 | const char *cl = mg_get_header(&conn->mg_conn, "Content-Length"); | |
| 4217 | if ((strcmp(conn->mg_conn.request_method, "POST") == 0 || | |
| 4218 | strcmp(conn->mg_conn.request_method, "PUT") == 0) && | |
| 4219 | (cl == NULL || to64(cl) > MONGOOSE_POST_SIZE_LIMIT)) { | |
| 4220 | send_http_error(conn, 500, "POST size > %zu", | |
| 4221 | (size_t) MONGOOSE_POST_SIZE_LIMIT); | |
| 4222 | } | |
| 4223 | } | |
| 4225 | 4224 | #endif |
| 4226 | return; | |
| 4227 | } | |
| 4225 | return; | |
| 4226 | } | |
| 4228 | 4227 | |
| 4229 | if (strcmp(conn->mg_conn.request_method, "CONNECT") == 0 || | |
| 4230 | memcmp(conn->mg_conn.uri, "http", 4) == 0) { | |
| 4231 | proxify_connection(conn); | |
| 4232 | return; | |
| 4233 | } | |
| 4234 | ||
| 4235 | if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) { | |
| 4236 | send_options(conn); | |
| 4237 | return; | |
| 4238 | } | |
| 4239 | ||
| 4228 | if (strcmp(conn->mg_conn.request_method, "CONNECT") == 0 || | |
| 4229 | memcmp(conn->mg_conn.uri, "http", 4) == 0) { | |
| 4230 | proxify_connection(conn); | |
| 4231 | return; | |
| 4232 | } | |
| 4233 | ||
| 4234 | if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) { | |
| 4235 | send_options(conn); | |
| 4236 | return; | |
| 4237 | } | |
| 4238 | ||
| 4240 | 4239 | #ifdef MONGOOSE_NO_FILESYSTEM |
| 4241 | ||
| 4240 | send_http_error(conn, 404, NULL); | |
| 4242 | 4241 | #else |
| 4243 | ||
| 4242 | exists = convert_uri_to_file_name(conn, path, sizeof(path), &st); | |
| 4244 | 4243 | |
| 4245 | if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) { | |
| 4246 | send_options(conn); | |
| 4247 | } else if (conn->server->config_options[DOCUMENT_ROOT] == NULL) { | |
| 4248 | send_http_error(conn, 404, NULL); | |
| 4244 | if (!strcmp(conn->mg_conn.request_method, "OPTIONS")) { | |
| 4245 | send_options(conn); | |
| 4246 | } else if (conn->server->config_options[DOCUMENT_ROOT] == NULL) { | |
| 4247 | send_http_error(conn, 404, NULL); | |
| 4249 | 4248 | #ifndef MONGOOSE_NO_AUTH |
| 4250 | } else if ((!is_dav_request(conn) && !is_authorized(conn, path)) || | |
| 4251 | (is_dav_request(conn) && !is_authorized_for_dav(conn))) { | |
| 4252 | mg_send_digest_auth_request(&conn->mg_conn); | |
| 4253 | close_local_endpoint(conn); | |
| 4249 | } else if ((!is_dav_request(conn) && !is_authorized(conn, path)) || | |
| 4250 | (is_dav_request(conn) && !is_authorized_for_dav(conn))) { | |
| 4251 | mg_send_digest_auth_request(&conn->mg_conn); | |
| 4252 | close_local_endpoint(conn); | |
| 4254 | 4253 | #endif |
| 4255 | 4254 | #ifndef MONGOOSE_NO_DAV |
| 4256 | } else if (!strcmp(conn->mg_conn.request_method, "PROPFIND")) { | |
| 4257 | handle_propfind(conn, path, &st, exists); | |
| 4258 | } else if (!strcmp(conn->mg_conn.request_method, "MKCOL")) { | |
| 4259 | handle_mkcol(conn, path); | |
| 4260 | } else if (!strcmp(conn->mg_conn.request_method, "DELETE")) { | |
| 4261 | handle_delete(conn, path); | |
| 4262 | } else if (!strcmp(conn->mg_conn.request_method, "PUT")) { | |
| 4263 | handle_put(conn, path); | |
| 4255 | } else if (!strcmp(conn->mg_conn.request_method, "PROPFIND")) { | |
| 4256 | handle_propfind(conn, path, &st, exists); | |
| 4257 | } else if (!strcmp(conn->mg_conn.request_method, "MKCOL")) { | |
| 4258 | handle_mkcol(conn, path); | |
| 4259 | } else if (!strcmp(conn->mg_conn.request_method, "DELETE")) { | |
| 4260 | handle_delete(conn, path); | |
| 4261 | } else if (!strcmp(conn->mg_conn.request_method, "PUT")) { | |
| 4262 | handle_put(conn, path); | |
| 4264 | 4263 | #endif |
| 4265 | } else { | |
| 4266 | mg_send_file(&conn->mg_conn, path); | |
| 4267 | } | |
| 4264 | } else { | |
| 4265 | mg_send_file(&conn->mg_conn, path); | |
| 4266 | } | |
| 4268 | 4267 | #endif // MONGOOSE_NO_FILESYSTEM |
| 4269 | 4268 | } |
| 4270 | 4269 | |
| 4271 | 4270 | static void send_continue_if_expected(struct connection *conn) { |
| 4272 | static const char expect_response[] = "HTTP/1.1 100 Continue\r\n\r\n"; | |
| 4273 | const char *expect_hdr = mg_get_header(&conn->mg_conn, "Expect"); | |
| 4271 | static const char expect_response[] = "HTTP/1.1 100 Continue\r\n\r\n"; | |
| 4272 | const char *expect_hdr = mg_get_header(&conn->mg_conn, "Expect"); | |
| 4274 | 4273 | |
| 4275 | if (expect_hdr != NULL && !mg_strcasecmp(expect_hdr, "100-continue")) { | |
| 4276 | ns_send(conn->ns_conn, expect_response, sizeof(expect_response) - 1); | |
| 4277 | } | |
| 4274 | if (expect_hdr != NULL && !mg_strcasecmp(expect_hdr, "100-continue")) { | |
| 4275 | ns_send(conn->ns_conn, expect_response, sizeof(expect_response) - 1); | |
| 4276 | } | |
| 4278 | 4277 | } |
| 4279 | 4278 | |
| 4280 | 4279 | // Conform to http://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html#sec5.1.2 |
| 4281 | 4280 | static int is_valid_uri(const char *uri) { |
| 4282 | unsigned short n; | |
| 4283 | return uri[0] == '/' || | |
| 4284 | strcmp(uri, "*") == 0 || // OPTIONS method can use asterisk URI | |
| 4285 | memcmp(uri, "http", 4) == 0 || // Naive check for the absolute URI | |
| 4286 | sscanf(uri, "%*[^ :]:%hu", &n) > 0; // CONNECT method can use host:port | |
| 4281 | unsigned short n; | |
| 4282 | return uri[0] == '/' || | |
| 4283 | strcmp(uri, "*") == 0 || // OPTIONS method can use asterisk URI | |
| 4284 | memcmp(uri, "http", 4) == 0 || // Naive check for the absolute URI | |
| 4285 | sscanf(uri, "%*[^ :]:%hu", &n) > 0; // CONNECT method can use host:port | |
| 4287 | 4286 | } |
| 4288 | 4287 | |
| 4289 | 4288 | static void try_parse(struct connection *conn) { |
| 4290 | ||
| 4289 | struct iobuf *io = &conn->ns_conn->recv_iobuf; | |
| 4291 | 4290 | |
| 4292 | if (conn->request_len == 0 && | |
| 4293 | (conn->request_len = get_request_len(io->buf, io->len)) > 0) { | |
| 4294 | // If request is buffered in, remove it from the iobuf. This is because | |
| 4295 | // iobuf could be reallocated, and pointers in parsed request could | |
| 4296 | // become invalid. | |
| 4297 | conn->request = (char *) malloc(conn->request_len); | |
| 4298 | memcpy(conn->request, io->buf, conn->request_len); | |
| 4299 | //DBG(("%p [%.*s]", conn, conn->request_len, conn->request)); | |
| 4300 | iobuf_remove(io, conn->request_len); | |
| 4301 | conn->request_len = parse_http_message(conn->request, conn->request_len, | |
| 4302 | &conn->mg_conn); | |
| 4303 | if (conn->request_len > 0) { | |
| 4304 | const char *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length"); | |
| 4305 | conn->cl = cl_hdr == NULL ? 0 : to64(cl_hdr); | |
| 4306 | conn->mg_conn.content_len = (size_t) conn->cl; | |
| 4307 | } | |
| 4308 | } | |
| 4291 | if (conn->request_len == 0 && | |
| 4292 | (conn->request_len = get_request_len(io->buf, io->len)) > 0) { | |
| 4293 | // If request is buffered in, remove it from the iobuf. This is because | |
| 4294 | // iobuf could be reallocated, and pointers in parsed request could | |
| 4295 | // become invalid. | |
| 4296 | conn->request = (char *) malloc(conn->request_len); | |
| 4297 | memcpy(conn->request, io->buf, conn->request_len); | |
| 4298 | //DBG(("%p [%.*s]", conn, conn->request_len, conn->request)); | |
| 4299 | iobuf_remove(io, conn->request_len); | |
| 4300 | conn->request_len = parse_http_message(conn->request, conn->request_len, | |
| 4301 | &conn->mg_conn); | |
| 4302 | if (conn->request_len > 0) { | |
| 4303 | const char *cl_hdr = mg_get_header(&conn->mg_conn, "Content-Length"); | |
| 4304 | conn->cl = cl_hdr == NULL ? 0 : to64(cl_hdr); | |
| 4305 | conn->mg_conn.content_len = (size_t) conn->cl; | |
| 4306 | } | |
| 4307 | } | |
| 4309 | 4308 | } |
| 4310 | 4309 | |
| 4311 | 4310 | static void do_proxy(struct connection *conn) { |
| 4312 | if (conn->request_len == 0) { | |
| 4313 | try_parse(conn); | |
| 4314 | DBG(("%p parsing -> %d", conn, conn->request_len)); | |
| 4315 | if (conn->request_len > 0 && call_user(conn, MG_REQUEST) == MG_FALSE) { | |
| 4316 | proxy_request(conn->endpoint.nc, &conn->mg_conn); | |
| 4317 | } else if (conn->request_len < 0) { | |
| 4318 | ns_forward(conn->ns_conn, conn->endpoint.nc); | |
| 4319 | } | |
| 4320 | } else { | |
| 4321 | DBG(("%p forwarding", conn)); | |
| 4322 | ns_forward(conn->ns_conn, conn->endpoint.nc); | |
| 4323 | } | |
| 4311 | if (conn->request_len == 0) { | |
| 4312 | try_parse(conn); | |
| 4313 | DBG(("%p parsing -> %d", conn, conn->request_len)); | |
| 4314 | if (conn->request_len > 0 && call_user(conn, MG_REQUEST) == MG_FALSE) { | |
| 4315 | proxy_request(conn->endpoint.nc, &conn->mg_conn); | |
| 4316 | } else if (conn->request_len < 0) { | |
| 4317 | ns_forward(conn->ns_conn, conn->endpoint.nc); | |
| 4318 | } | |
| 4319 | } else { | |
| 4320 | DBG(("%p forwarding", conn)); | |
| 4321 | ns_forward(conn->ns_conn, conn->endpoint.nc); | |
| 4322 | } | |
| 4324 | 4323 | } |
| 4325 | 4324 | |
| 4326 | 4325 | static void on_recv_data(struct connection *conn) { |
| 4327 | ||
| 4326 | struct iobuf *io = &conn->ns_conn->recv_iobuf; | |
| 4328 | 4327 | |
| 4329 | if (conn->endpoint_type == EP_PROXY && conn->endpoint.nc != NULL) { | |
| 4330 | do_proxy(conn); | |
| 4331 | return; | |
| 4332 | } | |
| 4328 | if (conn->endpoint_type == EP_PROXY && conn->endpoint.nc != NULL) { | |
| 4329 | do_proxy(conn); | |
| 4330 | return; | |
| 4331 | } | |
| 4333 | 4332 | |
| 4334 | try_parse(conn); | |
| 4335 | DBG(("%p %d %zu %d", conn, conn->request_len, io->len, conn->ns_conn->flags)); | |
| 4336 | if (conn->request_len < 0 || | |
| 4337 | (conn->request_len > 0 && !is_valid_uri(conn->mg_conn.uri))) { | |
| 4338 | send_http_error(conn, 400, NULL); | |
| 4339 | } else if (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE) { | |
| 4340 | send_http_error(conn, 413, NULL); | |
| 4341 | } else if (conn->request_len > 0 && | |
| 4342 | strcmp(conn->mg_conn.http_version, "1.0") != 0 && | |
| 4343 | strcmp(conn->mg_conn.http_version, "1.1") != 0) { | |
| 4344 | send_http_error(conn, 505, NULL); | |
| 4345 | } else if (conn->request_len > 0 && conn->endpoint_type == EP_NONE) { | |
| 4333 | try_parse(conn); | |
| 4334 | DBG(("%p %d %zu %d", conn, conn->request_len, io->len, conn->ns_conn->flags)); | |
| 4335 | if (conn->request_len < 0 || | |
| 4336 | (conn->request_len > 0 && !is_valid_uri(conn->mg_conn.uri))) { | |
| 4337 | send_http_error(conn, 400, NULL); | |
| 4338 | } else if (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE) { | |
| 4339 | send_http_error(conn, 413, NULL); | |
| 4340 | } else if (conn->request_len > 0 && | |
| 4341 | strcmp(conn->mg_conn.http_version, "1.0") != 0 && | |
| 4342 | strcmp(conn->mg_conn.http_version, "1.1") != 0) { | |
| 4343 | send_http_error(conn, 505, NULL); | |
| 4344 | } else if (conn->request_len > 0 && conn->endpoint_type == EP_NONE) { | |
| 4346 | 4345 | #ifndef MONGOOSE_NO_WEBSOCKET |
| 4347 | ||
| 4346 | send_websocket_handshake_if_requested(&conn->mg_conn); | |
| 4348 | 4347 | #endif |
| 4349 | send_continue_if_expected(conn); | |
| 4350 | open_local_endpoint(conn, 0); | |
| 4351 | } | |
| 4348 | send_continue_if_expected(conn); | |
| 4349 | open_local_endpoint(conn, 0); | |
| 4350 | } | |
| 4352 | 4351 | |
| 4353 | 4352 | #ifndef MONGOOSE_NO_CGI |
| 4354 | if (conn->endpoint_type == EP_CGI && conn->endpoint.nc != NULL) { | |
| 4355 | ns_forward(conn->ns_conn, conn->endpoint.nc); | |
| 4356 | } | |
| 4353 | if (conn->endpoint_type == EP_CGI && conn->endpoint.nc != NULL) { | |
| 4354 | ns_forward(conn->ns_conn, conn->endpoint.nc); | |
| 4355 | } | |
| 4357 | 4356 | #endif |
| 4358 | if (conn->endpoint_type == EP_USER) { | |
| 4359 | call_request_handler_if_data_is_buffered(conn); | |
| 4360 | } | |
| 4357 | if (conn->endpoint_type == EP_USER) { | |
| 4358 | call_request_handler_if_data_is_buffered(conn); | |
| 4359 | } | |
| 4361 | 4360 | #ifndef MONGOOSE_NO_DAV |
| 4362 | if (conn->endpoint_type == EP_PUT && io->len > 0) { | |
| 4363 | forward_put_data(conn); | |
| 4364 | } | |
| 4361 | if (conn->endpoint_type == EP_PUT && io->len > 0) { | |
| 4362 | forward_put_data(conn); | |
| 4363 | } | |
| 4365 | 4364 | #endif |
| 4366 | 4365 | } |
| 4367 | 4366 | |
| 4368 | 4367 | static void call_http_client_handler(struct connection *conn) { |
| 4369 | //conn->mg_conn.status_code = code; | |
| 4370 | // For responses without Content-Lengh, use the whole buffer | |
| 4371 | if (conn->cl == 0) { | |
| 4372 | conn->mg_conn.content_len = conn->ns_conn->recv_iobuf.len; | |
| 4373 | } | |
| 4374 | conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf; | |
| 4375 | if (call_user(conn, MG_REPLY) == MG_FALSE) { | |
| 4376 | conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4377 | } | |
| 4378 | iobuf_remove(&conn->ns_conn->recv_iobuf, conn->mg_conn.content_len); | |
| 4379 | conn->mg_conn.status_code = 0; | |
| 4380 | conn->cl = conn->num_bytes_sent = conn->request_len = 0; | |
| 4381 | free(conn->request); | |
| 4382 | conn->request = NULL; | |
| 4368 | //conn->mg_conn.status_code = code; | |
| 4369 | // For responses without Content-Lengh, use the whole buffer | |
| 4370 | if (conn->cl == 0) { | |
| 4371 | conn->mg_conn.content_len = conn->ns_conn->recv_iobuf.len; | |
| 4372 | } | |
| 4373 | conn->mg_conn.content = conn->ns_conn->recv_iobuf.buf; | |
| 4374 | if (call_user(conn, MG_REPLY) == MG_FALSE) { | |
| 4375 | conn->ns_conn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4376 | } | |
| 4377 | iobuf_remove(&conn->ns_conn->recv_iobuf, conn->mg_conn.content_len); | |
| 4378 | conn->mg_conn.status_code = 0; | |
| 4379 | conn->cl = conn->num_bytes_sent = conn->request_len = 0; | |
| 4380 | free(conn->request); | |
| 4381 | conn->request = NULL; | |
| 4383 | 4382 | } |
| 4384 | 4383 | |
| 4385 | 4384 | static void process_response(struct connection *conn) { |
| 4386 | ||
| 4385 | struct iobuf *io = &conn->ns_conn->recv_iobuf; | |
| 4387 | 4386 | |
| 4388 | try_parse(conn); | |
| 4389 | DBG(("%p %d %zu", conn, conn->request_len, io->len)); | |
| 4390 | if (conn->request_len < 0 || | |
| 4391 | (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE)) { | |
| 4392 | call_http_client_handler(conn); | |
| 4393 | } else if ((int64_t) io->len >= conn->cl) { | |
| 4394 | call_http_client_handler(conn); | |
| 4395 | } | |
| 4387 | try_parse(conn); | |
| 4388 | DBG(("%p %d %zu", conn, conn->request_len, io->len)); | |
| 4389 | if (conn->request_len < 0 || | |
| 4390 | (conn->request_len == 0 && io->len > MAX_REQUEST_SIZE)) { | |
| 4391 | call_http_client_handler(conn); | |
| 4392 | } else if ((int64_t) io->len >= conn->cl) { | |
| 4393 | call_http_client_handler(conn); | |
| 4394 | } | |
| 4396 | 4395 | } |
| 4397 | 4396 | |
| 4398 | 4397 | struct mg_connection *mg_connect(struct mg_server *server, const char *host, |
| 4399 | int port, int use_ssl) { | |
| 4400 | struct ns_connection *nsconn; | |
| 4401 | struct connection *conn; | |
| 4398 | int port, int use_ssl) { | |
| 4399 | struct ns_connection *nsconn; | |
| 4400 | struct connection *conn; | |
| 4402 | 4401 | |
| 4403 | nsconn = ns_connect(&server->ns_server, host, port, use_ssl, NULL); | |
| 4404 | if (nsconn == NULL) return 0; | |
| 4402 | nsconn = ns_connect(&server->ns_server, host, port, use_ssl, NULL); | |
| 4403 | if (nsconn == NULL) return 0; | |
| 4405 | 4404 | |
| 4406 | if ((conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) { | |
| 4407 | nsconn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4408 | return 0; | |
| 4409 | } | |
| 4405 | if ((conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) { | |
| 4406 | nsconn->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4407 | return 0; | |
| 4408 | } | |
| 4410 | 4409 | |
| 4411 | // Interlink two structs | |
| 4412 | conn->ns_conn = nsconn; | |
| 4413 | nsconn->connection_data = conn; | |
| 4410 | // Interlink two structs | |
| 4411 | conn->ns_conn = nsconn; | |
| 4412 | nsconn->connection_data = conn; | |
| 4414 | 4413 | |
| 4415 | conn->server = server; | |
| 4416 | conn->endpoint_type = EP_CLIENT; | |
| 4417 | //conn->handler = handler; | |
| 4418 | conn->mg_conn.server_param = server->ns_server.server_data; | |
| 4419 | conn->ns_conn->flags = NSF_CONNECTING; | |
| 4414 | conn->server = server; | |
| 4415 | conn->endpoint_type = EP_CLIENT; | |
| 4416 | //conn->handler = handler; | |
| 4417 | conn->mg_conn.server_param = server->ns_server.server_data; | |
| 4418 | conn->ns_conn->flags = NSF_CONNECTING; | |
| 4420 | 4419 | |
| 4421 | ||
| 4420 | return &conn->mg_conn; | |
| 4422 | 4421 | } |
| 4423 | 4422 | |
| 4424 | 4423 | #ifndef MONGOOSE_NO_LOGGING |
| 4425 | 4424 | static void log_header(const struct mg_connection *conn, const char *header, |
| 4426 | FILE *fp) { | |
| 4427 | const char *header_value; | |
| 4425 | FILE *fp) { | |
| 4426 | const char *header_value; | |
| 4428 | 4427 | |
| 4429 | if ((header_value = mg_get_header(conn, header)) == NULL) { | |
| 4430 | (void) fprintf(fp, "%s", " -"); | |
| 4431 | } else { | |
| 4432 | (void) fprintf(fp, " \"%s\"", header_value); | |
| 4433 | } | |
| 4428 | if ((header_value = mg_get_header(conn, header)) == NULL) { | |
| 4429 | (void) fprintf(fp, "%s", " -"); | |
| 4430 | } else { | |
| 4431 | (void) fprintf(fp, " \"%s\"", header_value); | |
| 4432 | } | |
| 4434 | 4433 | } |
| 4435 | 4434 | |
| 4436 | 4435 | static void log_access(const struct connection *conn, const char *path) { |
| 4437 | const struct mg_connection *c = &conn->mg_conn; | |
| 4438 | FILE *fp = (path == NULL) ? NULL : fopen(path, "a+"); | |
| 4439 | char date[64], user[100]; | |
| 4440 | time_t now; | |
| 4436 | const struct mg_connection *c = &conn->mg_conn; | |
| 4437 | FILE *fp = (path == NULL) ? NULL : fopen(path, "a+"); | |
| 4438 | char date[64], user[100]; | |
| 4439 | time_t now; | |
| 4441 | 4440 | |
| 4442 | if (fp == NULL) return; | |
| 4443 | now = time(NULL); | |
| 4444 | strftime(date, sizeof(date), "%d/%b/%Y:%H:%M:%S %z", localtime(&now)); | |
| 4441 | if (fp == NULL) return; | |
| 4442 | now = time(NULL); | |
| 4443 | strftime(date, sizeof(date), "%d/%b/%Y:%H:%M:%S %z", localtime(&now)); | |
| 4445 | 4444 | |
| 4446 | flockfile(fp); | |
| 4447 | mg_parse_header(mg_get_header(&conn->mg_conn, "Authorization"), "username", | |
| 4448 | user, sizeof(user)); | |
| 4449 | fprintf(fp, "%s - %s [%s] \"%s %s%s%s HTTP/%s\" %d %" INT64_FMT, | |
| 4450 | c->remote_ip, user[0] == '\0' ? "-" : user, date, | |
| 4451 | c->request_method ? c->request_method : "-", | |
| 4452 | c->uri ? c->uri : "-", c->query_string ? "?" : "", | |
| 4453 | c->query_string ? c->query_string : "", | |
| 4454 | c->http_version, c->status_code, conn->num_bytes_sent); | |
| 4455 | log_header(c, "Referer", fp); | |
| 4456 | log_header(c, "User-Agent", fp); | |
| 4457 | fputc('\n', fp); | |
| 4458 | fflush(fp); | |
| 4445 | flockfile(fp); | |
| 4446 | mg_parse_header(mg_get_header(&conn->mg_conn, "Authorization"), "username", | |
| 4447 | user, sizeof(user)); | |
| 4448 | fprintf(fp, "%s - %s [%s] \"%s %s%s%s HTTP/%s\" %d %" INT64_FMT, | |
| 4449 | c->remote_ip, user[0] == '\0' ? "-" : user, date, | |
| 4450 | c->request_method ? c->request_method : "-", | |
| 4451 | c->uri ? c->uri : "-", c->query_string ? "?" : "", | |
| 4452 | c->query_string ? c->query_string : "", | |
| 4453 | c->http_version, c->status_code, conn->num_bytes_sent); | |
| 4454 | log_header(c, "Referer", fp); | |
| 4455 | log_header(c, "User-Agent", fp); | |
| 4456 | fputc('\n', fp); | |
| 4457 | fflush(fp); | |
| 4459 | 4458 | |
| 4460 | funlockfile(fp); | |
| 4461 | fclose(fp); | |
| 4459 | funlockfile(fp); | |
| 4460 | fclose(fp); | |
| 4462 | 4461 | } |
| 4463 | 4462 | #endif |
| 4464 | 4463 | |
| 4465 | 4464 | static void close_local_endpoint(struct connection *conn) { |
| 4466 | struct mg_connection *c = &conn->mg_conn; | |
| 4467 | // Must be done before free() | |
| 4468 | int keep_alive = should_keep_alive(&conn->mg_conn) && | |
| 4469 | (conn->endpoint_type == EP_FILE || conn->endpoint_type == EP_USER); | |
| 4470 | DBG(("%p %d %d %d", conn, conn->endpoint_type, keep_alive, | |
| 4471 | conn->ns_conn->flags)); | |
| 4465 | struct mg_connection *c = &conn->mg_conn; | |
| 4466 | // Must be done before free() | |
| 4467 | int keep_alive = should_keep_alive(&conn->mg_conn) && | |
| 4468 | (conn->endpoint_type == EP_FILE || conn->endpoint_type == EP_USER); | |
| 4469 | DBG(("%p %d %d %d", conn, conn->endpoint_type, keep_alive, | |
| 4470 | conn->ns_conn->flags)); | |
| 4472 | 4471 | |
| 4473 | switch (conn->endpoint_type) { | |
| 4474 | case EP_PUT: | |
| 4475 | case EP_FILE: | |
| 4476 | close(conn->endpoint.fd); | |
| 4477 | break; | |
| 4478 | case EP_CGI: | |
| 4479 | case EP_PROXY: | |
| 4480 | if (conn->endpoint.nc != NULL) { | |
| 4481 | DBG(("%p %p %p :-)", conn, conn->ns_conn, conn->endpoint.nc)); | |
| 4482 | conn->endpoint.nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4483 | conn->endpoint.nc->connection_data = NULL; | |
| 4484 | } | |
| 4485 | break; | |
| 4486 | default: break; | |
| 4487 | } | |
| 4472 | switch (conn->endpoint_type) { | |
| 4473 | case EP_PUT: | |
| 4474 | case EP_FILE: | |
| 4475 | close(conn->endpoint.fd); | |
| 4476 | break; | |
| 4477 | case EP_CGI: | |
| 4478 | case EP_PROXY: | |
| 4479 | if (conn->endpoint.nc != NULL) { | |
| 4480 | DBG(("%p %p %p :-)", conn, conn->ns_conn, conn->endpoint.nc)); | |
| 4481 | conn->endpoint.nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4482 | conn->endpoint.nc->connection_data = NULL; | |
| 4483 | } | |
| 4484 | break; | |
| 4485 | default: break; | |
| 4486 | } | |
| 4488 | 4487 | |
| 4489 | 4488 | #ifndef MONGOOSE_NO_LOGGING |
| 4490 | if (c->status_code > 0 && conn->endpoint_type != EP_CLIENT && | |
| 4491 | c->status_code != 400) { | |
| 4492 | log_access(conn, conn->server->config_options[ACCESS_LOG_FILE]); | |
| 4493 | } | |
| 4489 | if (c->status_code > 0 && conn->endpoint_type != EP_CLIENT && | |
| 4490 | c->status_code != 400) { | |
| 4491 | log_access(conn, conn->server->config_options[ACCESS_LOG_FILE]); | |
| 4492 | } | |
| 4494 | 4493 | #endif |
| 4495 | 4494 | |
| 4496 | // Gobble possible POST data sent to the URI handler | |
| 4497 | iobuf_free(&conn->ns_conn->recv_iobuf); | |
| 4498 | free(conn->request); | |
| 4499 | free(conn->path_info); | |
| 4495 | // Gobble possible POST data sent to the URI handler | |
| 4496 | iobuf_free(&conn->ns_conn->recv_iobuf); | |
| 4497 | free(conn->request); | |
| 4498 | free(conn->path_info); | |
| 4500 | 4499 | |
| 4501 | conn->endpoint_type = EP_NONE; | |
| 4502 | conn->cl = conn->num_bytes_sent = conn->request_len = 0; | |
| 4503 | conn->ns_conn->flags &= ~(NSF_FINISHED_SENDING_DATA | | |
| 4504 | NSF_BUFFER_BUT_DONT_SEND | NSF_CLOSE_IMMEDIATELY | | |
| 4505 | MG_HEADERS_SENT | MG_LONG_RUNNING); | |
| 4506 | c->num_headers = c->status_code = c->is_websocket = c->content_len = 0; | |
| 4507 | conn->endpoint.nc = NULL; | |
| 4508 | c->request_method = c->uri = c->http_version = c->query_string = NULL; | |
| 4509 | conn->request = conn->path_info = NULL; | |
| 4500 | conn->endpoint_type = EP_NONE; | |
| 4501 | conn->cl = conn->num_bytes_sent = conn->request_len = 0; | |
| 4502 | conn->ns_conn->flags &= ~(NSF_FINISHED_SENDING_DATA | | |
| 4503 | NSF_BUFFER_BUT_DONT_SEND | NSF_CLOSE_IMMEDIATELY | | |
| 4504 | MG_HEADERS_SENT | MG_LONG_RUNNING); | |
| 4505 | c->num_headers = c->status_code = c->is_websocket = c->content_len = 0; | |
| 4506 | conn->endpoint.nc = NULL; | |
| 4507 | c->request_method = c->uri = c->http_version = c->query_string = NULL; | |
| 4508 | conn->request = conn->path_info = NULL; | |
| 4510 | 4509 | |
| 4511 | if (keep_alive) { | |
| 4512 | on_recv_data(conn); // Can call us recursively if pipelining is used | |
| 4513 | } else { | |
| 4514 | conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len == 0 ? | |
| 4515 | NSF_CLOSE_IMMEDIATELY : NSF_FINISHED_SENDING_DATA; | |
| 4516 | } | |
| 4510 | if (keep_alive) { | |
| 4511 | on_recv_data(conn); // Can call us recursively if pipelining is used | |
| 4512 | } else { | |
| 4513 | conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len == 0 ? | |
| 4514 | NSF_CLOSE_IMMEDIATELY : NSF_FINISHED_SENDING_DATA; | |
| 4515 | } | |
| 4517 | 4516 | } |
| 4518 | 4517 | |
| 4519 | 4518 | static void transfer_file_data(struct connection *conn) { |
| 4520 | char buf[IOBUF_SIZE]; | |
| 4521 | int n; | |
| 4519 | char buf[IOBUF_SIZE]; | |
| 4520 | int n; | |
| 4522 | 4521 | |
| 4523 | // If output buffer is too big, don't send anything. Wait until | |
| 4524 | // mongoose drains already buffered data to the client. | |
| 4525 | if (conn->ns_conn->send_iobuf.len > sizeof(buf) * 2) return; | |
| 4522 | // If output buffer is too big, don't send anything. Wait until | |
| 4523 | // mongoose drains already buffered data to the client. | |
| 4524 | if (conn->ns_conn->send_iobuf.len > sizeof(buf) * 2) return; | |
| 4526 | 4525 | |
| 4527 | // Do not send anyt | |
| 4528 | n = read(conn->endpoint.fd, buf, conn->cl < (int64_t) sizeof(buf) ? | |
| 4529 | (int) conn->cl : (int) sizeof(buf)); | |
| 4526 | // Do not send anyt | |
| 4527 | n = read(conn->endpoint.fd, buf, conn->cl < (int64_t) sizeof(buf) ? | |
| 4528 | (int) conn->cl : (int) sizeof(buf)); | |
| 4530 | 4529 | |
| 4531 | if (n <= 0) { | |
| 4532 | close_local_endpoint(conn); | |
| 4533 | } else if (n > 0) { | |
| 4534 | conn->cl -= n; | |
| 4535 | ns_send(conn->ns_conn, buf, n); | |
| 4536 | if (conn->cl <= 0) { | |
| 4537 | close_local_endpoint(conn); | |
| 4538 | } | |
| 4539 | } | |
| 4530 | if (n <= 0) { | |
| 4531 | close_local_endpoint(conn); | |
| 4532 | } else if (n > 0) { | |
| 4533 | conn->cl -= n; | |
| 4534 | ns_send(conn->ns_conn, buf, n); | |
| 4535 | if (conn->cl <= 0) { | |
| 4536 | close_local_endpoint(conn); | |
| 4537 | } | |
| 4538 | } | |
| 4540 | 4539 | } |
| 4541 | 4540 | |
| 4542 | 4541 | int mg_poll_server(struct mg_server *server, int milliseconds) { |
| 4543 | ||
| 4542 | return ns_server_poll(&server->ns_server, milliseconds); | |
| 4544 | 4543 | } |
| 4545 | 4544 | |
| 4546 | 4545 | void mg_destroy_server(struct mg_server **server) { |
| 4547 | if (server != NULL && *server != NULL) { | |
| 4548 | struct mg_server *s = *server; | |
| 4549 | int i; | |
| 4546 | if (server != NULL && *server != NULL) { | |
| 4547 | struct mg_server *s = *server; | |
| 4548 | int i; | |
| 4550 | 4549 | |
| 4551 | ns_server_free(&s->ns_server); | |
| 4552 | for (i = 0; i < (int) ARRAY_SIZE(s->config_options); i++) { | |
| 4553 | free(s->config_options[i]); // It is OK to free(NULL) | |
| 4554 | } | |
| 4555 | free(s); | |
| 4556 | *server = NULL; | |
| 4557 | } | |
| 4550 | ns_server_free(&s->ns_server); | |
| 4551 | for (i = 0; i < (int) ARRAY_SIZE(s->config_options); i++) { | |
| 4552 | free(s->config_options[i]); // It is OK to free(NULL) | |
| 4553 | } | |
| 4554 | free(s); | |
| 4555 | *server = NULL; | |
| 4556 | } | |
| 4558 | 4557 | } |
| 4559 | 4558 | |
| 4560 | 4559 | struct mg_iterator { |
| 4561 | mg_handler_t cb; | |
| 4562 | void *param; | |
| 4560 | mg_handler_t cb; | |
| 4561 | void *param; | |
| 4563 | 4562 | }; |
| 4564 | 4563 | |
| 4565 | 4564 | static void iter(struct ns_connection *nsconn, enum ns_event ev, void *param) { |
| 4566 | if (ev == NS_POLL) { | |
| 4567 | struct mg_iterator *it = (struct mg_iterator *) param; | |
| 4568 | struct connection *c = (struct connection *) nsconn->connection_data; | |
| 4569 | if (c != NULL) c->mg_conn.callback_param = it->param; | |
| 4570 | it->cb(&c->mg_conn, MG_POLL); | |
| 4571 | } | |
| 4565 | if (ev == NS_POLL) { | |
| 4566 | struct mg_iterator *it = (struct mg_iterator *) param; | |
| 4567 | struct connection *c = (struct connection *) nsconn->connection_data; | |
| 4568 | if (c != NULL) c->mg_conn.callback_param = it->param; | |
| 4569 | it->cb(&c->mg_conn, MG_POLL); | |
| 4570 | } | |
| 4572 | 4571 | } |
| 4573 | 4572 | |
| 4574 | 4573 | struct mg_connection *mg_next(struct mg_server *s, struct mg_connection *c) { |
| 4575 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 4576 | struct ns_connection *nc = ns_next(&s->ns_server, | |
| 4577 | c == NULL ? NULL : conn->ns_conn); | |
| 4578 | ||
| 4579 | return nc == NULL ? NULL : | |
| 4580 | & ((struct connection *) nc->connection_data)->mg_conn; | |
| 4574 | struct connection *conn = MG_CONN_2_CONN(c); | |
| 4575 | struct ns_connection *nc = ns_next(&s->ns_server, | |
| 4576 | c == NULL ? NULL : conn->ns_conn); | |
| 4577 | ||
| 4578 | return nc == NULL ? NULL : | |
| 4579 | & ((struct connection *) nc->connection_data)->mg_conn; | |
| 4581 | 4580 | } |
| 4582 | 4581 | |
| 4583 | 4582 | // Apply function to all active connections. |
| 4584 | 4583 | void mg_iterate_over_connections(struct mg_server *server, mg_handler_t cb, |
| 4585 | void *param) { | |
| 4586 | struct mg_iterator it = { cb, param }; | |
| 4587 | ns_iterate(&server->ns_server, iter, &it); | |
| 4584 | void *param) { | |
| 4585 | struct mg_iterator it = { cb, param }; | |
| 4586 | ns_iterate(&server->ns_server, iter, &it); | |
| 4588 | 4587 | } |
| 4589 | 4588 | |
| 4590 | 4589 | static int get_var(const char *data, size_t data_len, const char *name, |
| 4591 | char *dst, size_t dst_len) { | |
| 4592 | const char *p, *e, *s; | |
| 4593 | size_t name_len; | |
| 4594 | int len; | |
| 4590 | char *dst, size_t dst_len) { | |
| 4591 | const char *p, *e, *s; | |
| 4592 | size_t name_len; | |
| 4593 | int len; | |
| 4595 | 4594 | |
| 4596 | if (dst == NULL || dst_len == 0) { | |
| 4597 | len = -2; | |
| 4598 | } else if (data == NULL || name == NULL || data_len == 0) { | |
| 4599 | len = -1; | |
| 4600 | dst[0] = '\0'; | |
| 4601 | } else { | |
| 4602 | name_len = strlen(name); | |
| 4603 | e = data + data_len; | |
| 4604 | len = -1; | |
| 4605 | dst[0] = '\0'; | |
| 4595 | if (dst == NULL || dst_len == 0) { | |
| 4596 | len = -2; | |
| 4597 | } else if (data == NULL || name == NULL || data_len == 0) { | |
| 4598 | len = -1; | |
| 4599 | dst[0] = '\0'; | |
| 4600 | } else { | |
| 4601 | name_len = strlen(name); | |
| 4602 | e = data + data_len; | |
| 4603 | len = -1; | |
| 4604 | dst[0] = '\0'; | |
| 4606 | 4605 | |
| 4607 | // data is "var1=val1&var2=val2...". Find variable first | |
| 4608 | for (p = data; p + name_len < e; p++) { | |
| 4609 | if ((p == data || p[-1] == '&') && p[name_len] == '=' && | |
| 4610 | !mg_strncasecmp(name, p, name_len)) { | |
| 4606 | // data is "var1=val1&var2=val2...". Find variable first | |
| 4607 | for (p = data; p + name_len < e; p++) { | |
| 4608 | if ((p == data || p[-1] == '&') && p[name_len] == '=' && | |
| 4609 | !mg_strncasecmp(name, p, name_len)) { | |
| 4610 | // Point p to variable value | |
| 4611 | p += name_len + 1; | |
| 4611 | 4612 | |
| 4612 | // Point p to variable value | |
| 4613 | p += name_len + 1; | |
| 4613 | // Point s to the end of the value | |
| 4614 | s = (const char *) memchr(p, '&', (size_t)(e - p)); | |
| 4615 | if (s == NULL) { | |
| 4616 | s = e; | |
| 4617 | } | |
| 4618 | assert(s >= p); | |
| 4614 | 4619 | |
| 4615 | // Point s to the end of the value | |
| 4616 | s = (const char *) memchr(p, '&', (size_t)(e - p)); | |
| 4617 | if (s == NULL) { | |
| 4618 | s = e; | |
| 4619 | } | |
| 4620 | assert(s >= p); | |
| 4620 | // Decode variable into destination buffer | |
| 4621 | len = mg_url_decode(p, (size_t)(s - p), dst, dst_len, 1); | |
| 4621 | 4622 | |
| 4622 | // Decode variable into destination buffer | |
| 4623 | len = mg_url_decode(p, (size_t)(s - p), dst, dst_len, 1); | |
| 4623 | // Redirect error code from -1 to -2 (destination buffer too small). | |
| 4624 | if (len == -1) { | |
| 4625 | len = -2; | |
| 4626 | } | |
| 4627 | break; | |
| 4628 | } | |
| 4629 | } | |
| 4630 | } | |
| 4624 | 4631 | |
| 4625 | // Redirect error code from -1 to -2 (destination buffer too small). | |
| 4626 | if (len == -1) { | |
| 4627 | len = -2; | |
| 4628 | } | |
| 4629 | break; | |
| 4630 | } | |
| 4631 | } | |
| 4632 | } | |
| 4633 | ||
| 4634 | return len; | |
| 4632 | return len; | |
| 4635 | 4633 | } |
| 4636 | 4634 | |
| 4637 | 4635 | int mg_get_var(const struct mg_connection *conn, const char *name, |
| 4638 | char *dst, size_t dst_len) { | |
| 4639 | int len = get_var(conn->query_string, conn->query_string == NULL ? 0 : | |
| 4640 | strlen(conn->query_string), name, dst, dst_len); | |
| 4641 | if (len < 0) { | |
| 4642 | len = get_var(conn->content, conn->content_len, name, dst, dst_len); | |
| 4643 | } | |
| 4644 | return len; | |
| 4636 | char *dst, size_t dst_len) { | |
| 4637 | int len = get_var(conn->query_string, conn->query_string == NULL ? 0 : | |
| 4638 | strlen(conn->query_string), name, dst, dst_len); | |
| 4639 | if (len < 0) { | |
| 4640 | len = get_var(conn->content, conn->content_len, name, dst, dst_len); | |
| 4641 | } | |
| 4642 | return len; | |
| 4645 | 4643 | } |
| 4646 | 4644 | |
| 4647 | 4645 | static int get_line_len(const char *buf, int buf_len) { |
| 4648 | int len = 0; | |
| 4649 | while (len < buf_len && buf[len] != '\n') len++; | |
| 4650 | return buf[len] == '\n' ? len + 1: -1; | |
| 4646 | int len = 0; | |
| 4647 | while (len < buf_len && buf[len] != '\n') len++; | |
| 4648 | return buf[len] == '\n' ? len + 1: -1; | |
| 4651 | 4649 | } |
| 4652 | 4650 | |
| 4653 | 4651 | int mg_parse_multipart(const char *buf, int buf_len, |
| 4654 | char *var_name, int var_name_len, | |
| 4655 | char *file_name, int file_name_len, | |
| 4656 | const char **data, int *data_len) { | |
| 4657 | static const char cd[] = "Content-Disposition: "; | |
| 4658 | //struct mg_connection c; | |
| 4659 | int hl, bl, n, ll, pos, cdl = sizeof(cd) - 1; | |
| 4660 | //char *p; | |
| 4652 | char *var_name, int var_name_len, | |
| 4653 | char *file_name, int file_name_len, | |
| 4654 | const char **data, int *data_len) { | |
| 4655 | static const char cd[] = "Content-Disposition: "; | |
| 4656 | //struct mg_connection c; | |
| 4657 | int hl, bl, n, ll, pos, cdl = sizeof(cd) - 1; | |
| 4658 | //char *p; | |
| 4661 | 4659 | |
| 4662 | if (buf == NULL || buf_len <= 0) return 0; | |
| 4663 | if ((hl = get_request_len(buf, buf_len)) <= 0) return 0; | |
| 4664 | if (buf[0] != '-' || buf[1] != '-' || buf[2] == '\n') return 0; | |
| 4660 | if (buf == NULL || buf_len <= 0) return 0; | |
| 4661 | if ((hl = get_request_len(buf, buf_len)) <= 0) return 0; | |
| 4662 | if (buf[0] != '-' || buf[1] != '-' || buf[2] == '\n') return 0; | |
| 4665 | 4663 | |
| 4666 | // Get boundary length | |
| 4667 | bl = get_line_len(buf, buf_len); | |
| 4664 | // Get boundary length | |
| 4665 | bl = get_line_len(buf, buf_len); | |
| 4668 | 4666 | |
| 4669 | // Loop through headers, fetch variable name and file name | |
| 4670 | var_name[0] = file_name[0] = '\0'; | |
| 4671 | for (n = bl; (ll = get_line_len(buf + n, hl - n)) > 0; n += ll) { | |
| 4672 | if (mg_strncasecmp(cd, buf + n, cdl) == 0) { | |
| 4673 | parse_header(buf + n + cdl, ll - (cdl + 2), "name", | |
| 4674 | var_name, var_name_len); | |
| 4675 | parse_header(buf + n + cdl, ll - (cdl + 2), "filename", | |
| 4676 | file_name, file_name_len); | |
| 4677 | } | |
| 4678 | } | |
| 4667 | // Loop through headers, fetch variable name and file name | |
| 4668 | var_name[0] = file_name[0] = '\0'; | |
| 4669 | for (n = bl; (ll = get_line_len(buf + n, hl - n)) > 0; n += ll) { | |
| 4670 | if (mg_strncasecmp(cd, buf + n, cdl) == 0) { | |
| 4671 | parse_header(buf + n + cdl, ll - (cdl + 2), "name", | |
| 4672 | var_name, var_name_len); | |
| 4673 | parse_header(buf + n + cdl, ll - (cdl + 2), "filename", | |
| 4674 | file_name, file_name_len); | |
| 4675 | } | |
| 4676 | } | |
| 4679 | 4677 | |
| 4680 | // Scan body, search for terminating boundary | |
| 4681 | for (pos = hl; pos + (bl - 2) < buf_len; pos++) { | |
| 4682 | if (buf[pos] == '-' && !memcmp(buf, &buf[pos], bl - 2)) { | |
| 4683 | if (data_len != NULL) *data_len = (pos - 2) - hl; | |
| 4684 | if (data != NULL) *data = buf + hl; | |
| 4685 | return pos; | |
| 4686 | } | |
| 4687 | } | |
| 4678 | // Scan body, search for terminating boundary | |
| 4679 | for (pos = hl; pos + (bl - 2) < buf_len; pos++) { | |
| 4680 | if (buf[pos] == '-' && !memcmp(buf, &buf[pos], bl - 2)) { | |
| 4681 | if (data_len != NULL) *data_len = (pos - 2) - hl; | |
| 4682 | if (data != NULL) *data = buf + hl; | |
| 4683 | return pos; | |
| 4684 | } | |
| 4685 | } | |
| 4688 | 4686 | |
| 4689 | ||
| 4687 | return 0; | |
| 4690 | 4688 | } |
| 4691 | 4689 | |
| 4692 | 4690 | const char **mg_get_valid_option_names(void) { |
| 4693 | ||
| 4691 | return static_config_options; | |
| 4694 | 4692 | } |
| 4695 | 4693 | |
| 4696 | 4694 | static int get_option_index(const char *name) { |
| 4697 | ||
| 4695 | int i; | |
| 4698 | 4696 | |
| 4699 | for (i = 0; static_config_options[i * 2] != NULL; i++) { | |
| 4700 | if (strcmp(static_config_options[i * 2], name) == 0) { | |
| 4701 | return i; | |
| 4702 | } | |
| 4703 | } | |
| 4704 | return -1; | |
| 4697 | for (i = 0; static_config_options[i * 2] != NULL; i++) { | |
| 4698 | if (strcmp(static_config_options[i * 2], name) == 0) { | |
| 4699 | return i; | |
| 4700 | } | |
| 4701 | } | |
| 4702 | return -1; | |
| 4705 | 4703 | } |
| 4706 | 4704 | |
| 4707 | 4705 | static void set_default_option_values(char **opts) { |
| 4708 | const char *value, **all_opts = mg_get_valid_option_names(); | |
| 4709 | int i; | |
| 4706 | const char *value, **all_opts = mg_get_valid_option_names(); | |
| 4707 | int i; | |
| 4710 | 4708 | |
| 4711 | for (i = 0; all_opts[i * 2] != NULL; i++) { | |
| 4712 | value = all_opts[i * 2 + 1]; | |
| 4713 | if (opts[i] == NULL && value != NULL) { | |
| 4714 | opts[i] = mg_strdup(value); | |
| 4715 | } | |
| 4716 | } | |
| 4709 | for (i = 0; all_opts[i * 2] != NULL; i++) { | |
| 4710 | value = all_opts[i * 2 + 1]; | |
| 4711 | if (opts[i] == NULL && value != NULL) { | |
| 4712 | opts[i] = mg_strdup(value); | |
| 4713 | } | |
| 4714 | } | |
| 4717 | 4715 | } |
| 4718 | 4716 | |
| 4719 | 4717 | const char *mg_set_option(struct mg_server *server, const char *name, |
| 4720 | const char *value) { | |
| 4721 | int ind = get_option_index(name); | |
| 4722 | const char *error_msg = NULL; | |
| 4723 | char **v = NULL; | |
| 4718 | const char *value) { | |
| 4719 | int ind = get_option_index(name); | |
| 4720 | const char *error_msg = NULL; | |
| 4721 | char **v = NULL; | |
| 4724 | 4722 | |
| 4725 | if (ind < 0) return "No such option"; | |
| 4726 | v = &server->config_options[ind]; | |
| 4723 | if (ind < 0) return "No such option"; | |
| 4724 | v = &server->config_options[ind]; | |
| 4727 | 4725 | |
| 4728 | // Return success immediately if setting to the same value | |
| 4729 | if ((*v == NULL && value == NULL) || | |
| 4730 | (value != NULL && *v != NULL && !strcmp(value, *v))) { | |
| 4731 | return NULL; | |
| 4732 | } | |
| 4726 | // Return success immediately if setting to the same value | |
| 4727 | if ((*v == NULL && value == NULL) || | |
| 4728 | (value != NULL && *v != NULL && !strcmp(value, *v))) { | |
| 4729 | return NULL; | |
| 4730 | } | |
| 4733 | 4731 | |
| 4734 | if (*v != NULL) { | |
| 4735 | free(*v); | |
| 4736 | *v = NULL; | |
| 4737 | } | |
| 4732 | if (*v != NULL) { | |
| 4733 | free(*v); | |
| 4734 | *v = NULL; | |
| 4735 | } | |
| 4738 | 4736 | |
| 4739 | ||
| 4737 | if (value == NULL || value[0] == '\0') return NULL; | |
| 4740 | 4738 | |
| 4741 | *v = mg_strdup(value); | |
| 4742 | DBG(("%s [%s]", name, *v)); | |
| 4739 | *v = mg_strdup(value); | |
| 4740 | DBG(("%s [%s]", name, *v)); | |
| 4743 | 4741 | |
| 4744 | if (ind == LISTENING_PORT) { | |
| 4745 | int port = ns_bind(&server->ns_server, value); | |
| 4746 | if (port < 0) { | |
| 4747 | error_msg = "Cannot bind to port"; | |
| 4748 | } else { | |
| 4749 | char buf[100]; | |
| 4750 | ns_sock_to_str(server->ns_server.listening_sock, buf, sizeof(buf), 2); | |
| 4751 | free(*v); | |
| 4752 | *v = mg_strdup(buf); | |
| 4753 | } | |
| 4742 | if (ind == LISTENING_PORT) { | |
| 4743 | int port = ns_bind(&server->ns_server, value); | |
| 4744 | if (port < 0) { | |
| 4745 | error_msg = "Cannot bind to port"; | |
| 4746 | } else { | |
| 4747 | char buf[100]; | |
| 4748 | ns_sock_to_str(server->ns_server.listening_sock, buf, sizeof(buf), 2); | |
| 4749 | free(*v); | |
| 4750 | *v = mg_strdup(buf); | |
| 4751 | } | |
| 4754 | 4752 | #ifndef _WIN32 |
| 4755 | } else if (ind == RUN_AS_USER) { | |
| 4756 | struct passwd *pw; | |
| 4757 | if ((pw = getpwnam(value)) == NULL) { | |
| 4758 | error_msg = "Unknown user"; | |
| 4759 | } else if (setgid(pw->pw_gid) != 0) { | |
| 4760 | error_msg = "setgid() failed"; | |
| 4761 | } else if (setuid(pw->pw_uid) != 0) { | |
| 4762 | error_msg = "setuid() failed"; | |
| 4763 | } | |
| 4753 | } else if (ind == RUN_AS_USER) { | |
| 4754 | struct passwd *pw; | |
| 4755 | if ((pw = getpwnam(value)) == NULL) { | |
| 4756 | error_msg = "Unknown user"; | |
| 4757 | } else if (setgid(pw->pw_gid) != 0) { | |
| 4758 | error_msg = "setgid() failed"; | |
| 4759 | } else if (setuid(pw->pw_uid) != 0) { | |
| 4760 | error_msg = "setuid() failed"; | |
| 4761 | } | |
| 4764 | 4762 | #endif |
| 4765 | 4763 | #ifdef NS_ENABLE_SSL |
| 4766 | } else if (ind == SSL_CERTIFICATE) { | |
| 4767 | int res = ns_set_ssl_cert(&server->ns_server, value); | |
| 4768 | if (res == -2) { | |
| 4769 | error_msg = "Cannot load PEM"; | |
| 4770 | } else if (res == -3) { | |
| 4771 | error_msg = "SSL not enabled"; | |
| 4772 | } else if (res == -1) { | |
| 4773 | error_msg = "SSL_CTX_new() failed"; | |
| 4774 | } | |
| 4775 | } else if (ind == SSL_CA_CERTIFICATE) { | |
| 4776 | if (ns_set_ssl_ca_cert(&server->ns_server, value) != 0) { | |
| 4777 | error_msg = "Error setting CA cert"; | |
| 4778 | } | |
| 4764 | } else if (ind == SSL_CERTIFICATE) { | |
| 4765 | int res = ns_set_ssl_cert(&server->ns_server, value); | |
| 4766 | if (res == -2) { | |
| 4767 | error_msg = "Cannot load PEM"; | |
| 4768 | } else if (res == -3) { | |
| 4769 | error_msg = "SSL not enabled"; | |
| 4770 | } else if (res == -1) { | |
| 4771 | error_msg = "SSL_CTX_new() failed"; | |
| 4772 | } | |
| 4773 | } else if (ind == SSL_CA_CERTIFICATE) { | |
| 4774 | if (ns_set_ssl_ca_cert(&server->ns_server, value) != 0) { | |
| 4775 | error_msg = "Error setting CA cert"; | |
| 4776 | } | |
| 4779 | 4777 | #endif |
| 4780 | ||
| 4778 | } | |
| 4781 | 4779 | |
| 4782 | ||
| 4780 | return error_msg; | |
| 4783 | 4781 | } |
| 4784 | 4782 | |
| 4785 | 4783 | static void set_ips(struct ns_connection *nc, int is_rem) { |
| 4786 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4787 | struct mg_connection *c = &conn->mg_conn; | |
| 4788 | char buf[100]; | |
| 4784 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4785 | struct mg_connection *c = &conn->mg_conn; | |
| 4786 | char buf[100]; | |
| 4789 | 4787 | |
| 4790 | ns_sock_to_str(nc->sock, buf, sizeof(buf), is_rem ? 7 : 3); | |
| 4791 | sscanf(buf, "%47[^:]:%hu", | |
| 4792 | is_rem ? c->remote_ip : c->local_ip, | |
| 4793 | is_rem ? &c->remote_port : &c->local_port); | |
| 4794 | //DBG(("%p %s %s", conn, is_rem ? "rem" : "loc", buf)); | |
| 4788 | ns_sock_to_str(nc->sock, buf, sizeof(buf), is_rem ? 7 : 3); | |
| 4789 | sscanf(buf, "%47[^:]:%hu", | |
| 4790 | is_rem ? c->remote_ip : c->local_ip, | |
| 4791 | is_rem ? &c->remote_port : &c->local_port); | |
| 4792 | //DBG(("%p %s %s", conn, is_rem ? "rem" : "loc", buf)); | |
| 4795 | 4793 | } |
| 4796 | 4794 | |
| 4797 | 4795 | static void on_accept(struct ns_connection *nc, union socket_address *sa) { |
| 4798 | struct mg_server *server = (struct mg_server *) nc->server; | |
| 4799 | struct connection *conn; | |
| 4796 | struct mg_server *server = (struct mg_server *) nc->server; | |
| 4797 | struct connection *conn; | |
| 4800 | 4798 | |
| 4801 | if (!check_acl(server->config_options[ACCESS_CONTROL_LIST], | |
| 4802 | ntohl(* (uint32_t *) &sa->sin.sin_addr)) || | |
| 4803 | (conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) { | |
| 4804 | nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4805 | } else { | |
| 4806 | // Circularly link two connection structures | |
| 4807 | nc->connection_data = conn; | |
| 4808 | conn->ns_conn = nc; | |
| 4799 | if (!check_acl(server->config_options[ACCESS_CONTROL_LIST], | |
| 4800 | ntohl(* (uint32_t *) &sa->sin.sin_addr)) || | |
| 4801 | (conn = (struct connection *) calloc(1, sizeof(*conn))) == NULL) { | |
| 4802 | nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4803 | } else { | |
| 4804 | // Circularly link two connection structures | |
| 4805 | nc->connection_data = conn; | |
| 4806 | conn->ns_conn = nc; | |
| 4809 | 4807 | |
| 4810 | // Initialize the rest of connection attributes | |
| 4811 | conn->server = server; | |
| 4812 | conn->mg_conn.server_param = nc->server->server_data; | |
| 4813 | set_ips(nc, 1); | |
| 4814 | set_ips(nc, 0); | |
| 4815 | } | |
| 4808 | // Initialize the rest of connection attributes | |
| 4809 | conn->server = server; | |
| 4810 | conn->mg_conn.server_param = nc->server->server_data; | |
| 4811 | set_ips(nc, 1); | |
| 4812 | set_ips(nc, 0); | |
| 4813 | } | |
| 4816 | 4814 | } |
| 4817 | 4815 | |
| 4818 | 4816 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4819 | 4817 | static void hexdump(struct ns_connection *nc, const char *path, |
| 4820 | int num_bytes, int is_sent) { | |
| 4821 | const struct iobuf *io = is_sent ? &nc->send_iobuf : &nc->recv_iobuf; | |
| 4822 | FILE *fp; | |
| 4823 | char *buf, src[60], dst[60]; | |
| 4824 | int buf_size = num_bytes * 5 + 100; | |
| 4818 | int num_bytes, int is_sent) { | |
| 4819 | const struct iobuf *io = is_sent ? &nc->send_iobuf : &nc->recv_iobuf; | |
| 4820 | FILE *fp; | |
| 4821 | char *buf, src[60], dst[60]; | |
| 4822 | int buf_size = num_bytes * 5 + 100; | |
| 4825 | 4823 | |
| 4826 | if (path != NULL && (fp = fopen(path, "a")) != NULL) { | |
| 4827 | ns_sock_to_str(nc->sock, src, sizeof(src), 3); | |
| 4828 | ns_sock_to_str(nc->sock, dst, sizeof(dst), 7); | |
| 4829 | fprintf(fp, "%lu %p %s %s %s %d\n", (unsigned long) time(NULL), | |
| 4830 | nc->connection_data, src, | |
| 4831 | is_sent == 0 ? "<-" : is_sent == 1 ? "->" : | |
| 4832 | is_sent == 2 ? "<A" : "C>", dst, num_bytes); | |
| 4833 | if (num_bytes > 0 && (buf = (char *) malloc(buf_size)) != NULL) { | |
| 4834 | ns_hexdump(io->buf + (is_sent ? 0 : io->len) - (is_sent ? 0 : num_bytes), | |
| 4835 | num_bytes, buf, buf_size); | |
| 4836 | fprintf(fp, "%s", buf); | |
| 4837 | free(buf); | |
| 4838 | } | |
| 4839 | fclose(fp); | |
| 4840 | } | |
| 4824 | if (path != NULL && (fp = fopen(path, "a")) != NULL) { | |
| 4825 | ns_sock_to_str(nc->sock, src, sizeof(src), 3); | |
| 4826 | ns_sock_to_str(nc->sock, dst, sizeof(dst), 7); | |
| 4827 | fprintf(fp, "%lu %p %s %s %s %d\n", (unsigned long) time(NULL), | |
| 4828 | nc->connection_data, src, | |
| 4829 | is_sent == 0 ? "<-" : is_sent == 1 ? "->" : | |
| 4830 | is_sent == 2 ? "<A" : "C>", dst, num_bytes); | |
| 4831 | if (num_bytes > 0 && (buf = (char *) malloc(buf_size)) != NULL) { | |
| 4832 | ns_hexdump(io->buf + (is_sent ? 0 : io->len) - (is_sent ? 0 : num_bytes), | |
| 4833 | num_bytes, buf, buf_size); | |
| 4834 | fprintf(fp, "%s", buf); | |
| 4835 | free(buf); | |
| 4836 | } | |
| 4837 | fclose(fp); | |
| 4838 | } | |
| 4841 | 4839 | } |
| 4842 | 4840 | #endif |
| 4843 | 4841 | |
| 4844 | 4842 | static void mg_ev_handler(struct ns_connection *nc, enum ns_event ev, void *p) { |
| 4845 | ||
| 4843 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4846 | 4844 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4847 | ||
| 4845 | struct mg_server *server = (struct mg_server *) nc->server; | |
| 4848 | 4846 | #endif |
| 4849 | 4847 | |
| 4850 | // Send NS event to the handler. Note that call_user won't send an event | |
| 4851 | // if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well. | |
| 4848 | // Send NS event to the handler. Note that call_user won't send an event | |
| 4849 | // if conn == NULL. Therefore, repeat this for NS_ACCEPT event as well. | |
| 4852 | 4850 | #ifdef MONGOOSE_SEND_NS_EVENTS |
| 4853 | { | |
| 4854 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4855 | if (conn != NULL) conn->mg_conn.callback_param = p; | |
| 4856 | call_user(conn, (enum mg_event) ev); | |
| 4857 | } | |
| 4851 | { | |
| 4852 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4853 | if (conn != NULL) conn->mg_conn.callback_param = p; | |
| 4854 | call_user(conn, (enum mg_event) ev); | |
| 4855 | } | |
| 4858 | 4856 | #endif |
| 4859 | 4857 | |
| 4860 | switch (ev) { | |
| 4861 | case NS_ACCEPT: | |
| 4862 | on_accept(nc, (union socket_address *) p); | |
| 4858 | switch (ev) { | |
| 4859 | case NS_ACCEPT: | |
| 4860 | on_accept(nc, (union socket_address *) p); | |
| 4863 | 4861 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4864 | ||
| 4862 | hexdump(nc, server->config_options[HEXDUMP_FILE], 0, 2); | |
| 4865 | 4863 | #endif |
| 4866 | 4864 | #ifdef MONGOOSE_SEND_NS_EVENTS |
| 4867 | { | |
| 4868 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4869 | if (conn != NULL) conn->mg_conn.callback_param = p; | |
| 4870 | call_user(conn, (enum mg_event) ev); | |
| 4871 | } | |
| 4865 | { | |
| 4866 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4867 | if (conn != NULL) conn->mg_conn.callback_param = p; | |
| 4868 | call_user(conn, (enum mg_event) ev); | |
| 4869 | } | |
| 4872 | 4870 | #endif |
| 4873 | ||
| 4871 | break; | |
| 4874 | 4872 | |
| 4875 | case NS_CONNECT: | |
| 4876 | if (nc->connection_data != NULL) { | |
| 4877 | set_ips(nc, 1); | |
| 4878 | set_ips(nc, 0); | |
| 4879 | } | |
| 4873 | case NS_CONNECT: | |
| 4874 | if (nc->connection_data != NULL) { | |
| 4875 | set_ips(nc, 1); | |
| 4876 | set_ips(nc, 0); | |
| 4877 | } | |
| 4880 | 4878 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4881 | ||
| 4879 | hexdump(nc, server->config_options[HEXDUMP_FILE], 0, 3); | |
| 4882 | 4880 | #endif |
| 4883 | conn->mg_conn.status_code = * (int *) p; | |
| 4884 | if (conn->mg_conn.status_code != 0 || | |
| 4885 | (!(nc->flags & MG_PROXY_CONN) && | |
| 4886 | call_user(conn, MG_CONNECT) == MG_FALSE)) { | |
| 4887 | nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4888 | } | |
| 4889 | break; | |
| 4881 | conn->mg_conn.status_code = * (int *) p; | |
| 4882 | if (conn->mg_conn.status_code != 0 || | |
| 4883 | (!(nc->flags & MG_PROXY_CONN) && | |
| 4884 | call_user(conn, MG_CONNECT) == MG_FALSE)) { | |
| 4885 | nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4886 | } | |
| 4887 | break; | |
| 4890 | 4888 | |
| 4891 | ||
| 4889 | case NS_RECV: | |
| 4892 | 4890 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4893 | ||
| 4891 | hexdump(nc, server->config_options[HEXDUMP_FILE], * (int *) p, 0); | |
| 4894 | 4892 | #endif |
| 4895 | if (nc->flags & NSF_ACCEPTED) { | |
| 4896 | on_recv_data(conn); | |
| 4893 | if (nc->flags & NSF_ACCEPTED) { | |
| 4894 | on_recv_data(conn); | |
| 4897 | 4895 | #ifndef MONGOOSE_NO_CGI |
| 4898 | } else if (nc->flags & MG_CGI_CONN) { | |
| 4899 | on_cgi_data(nc); | |
| 4896 | } else if (nc->flags & MG_CGI_CONN) { | |
| 4897 | on_cgi_data(nc); | |
| 4900 | 4898 | #endif |
| 4901 | } else if (nc->flags & MG_PROXY_CONN) { | |
| 4902 | if (conn != NULL) { | |
| 4903 | ns_forward(nc, conn->ns_conn); | |
| 4904 | } | |
| 4905 | } else { | |
| 4906 | process_response(conn); | |
| 4907 | } | |
| 4908 | break; | |
| 4899 | } else if (nc->flags & MG_PROXY_CONN) { | |
| 4900 | if (conn != NULL) { | |
| 4901 | ns_forward(nc, conn->ns_conn); | |
| 4902 | } | |
| 4903 | } else { | |
| 4904 | process_response(conn); | |
| 4905 | } | |
| 4906 | break; | |
| 4909 | 4907 | |
| 4910 | ||
| 4908 | case NS_SEND: | |
| 4911 | 4909 | #ifndef MONGOOSE_NO_FILESYSTEM |
| 4912 | ||
| 4910 | hexdump(nc, server->config_options[HEXDUMP_FILE], * (int *) p, 1); | |
| 4913 | 4911 | #endif |
| 4914 | ||
| 4912 | break; | |
| 4915 | 4913 | |
| 4916 | case NS_CLOSE: | |
| 4917 | nc->connection_data = NULL; | |
| 4918 | if (nc->flags & (MG_CGI_CONN | MG_PROXY_CONN)) { | |
| 4919 | DBG(("%p %p closing cgi/proxy conn", conn, nc)); | |
| 4920 | if (conn && conn->ns_conn) { | |
| 4921 | conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND; | |
| 4922 | conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len > 0 ? | |
| 4923 | NSF_FINISHED_SENDING_DATA : NSF_CLOSE_IMMEDIATELY; | |
| 4924 | conn->endpoint.nc = NULL; | |
| 4925 | } | |
| 4926 | } else if (conn != NULL) { | |
| 4927 | DBG(("%p %p %d closing", conn, nc, conn->endpoint_type)); | |
| 4914 | case NS_CLOSE: | |
| 4915 | nc->connection_data = NULL; | |
| 4916 | if (nc->flags & (MG_CGI_CONN | MG_PROXY_CONN)) { | |
| 4917 | DBG(("%p %p closing cgi/proxy conn", conn, nc)); | |
| 4918 | if (conn && conn->ns_conn) { | |
| 4919 | conn->ns_conn->flags &= ~NSF_BUFFER_BUT_DONT_SEND; | |
| 4920 | conn->ns_conn->flags |= conn->ns_conn->send_iobuf.len > 0 ? | |
| 4921 | NSF_FINISHED_SENDING_DATA : NSF_CLOSE_IMMEDIATELY; | |
| 4922 | conn->endpoint.nc = NULL; | |
| 4923 | } | |
| 4924 | } else if (conn != NULL) { | |
| 4925 | DBG(("%p %p %d closing", conn, nc, conn->endpoint_type)); | |
| 4928 | 4926 | |
| 4929 | if (conn->endpoint_type == EP_CLIENT && nc->recv_iobuf.len > 0) { | |
| 4930 | call_http_client_handler(conn); | |
| 4931 | } | |
| 4927 | if (conn->endpoint_type == EP_CLIENT && nc->recv_iobuf.len > 0) { | |
| 4928 | call_http_client_handler(conn); | |
| 4929 | } | |
| 4932 | 4930 | |
| 4933 | call_user(conn, MG_CLOSE); | |
| 4934 | close_local_endpoint(conn); | |
| 4935 | conn->ns_conn = NULL; | |
| 4936 | free(conn); | |
| 4937 | } | |
| 4938 | break; | |
| 4931 | call_user(conn, MG_CLOSE); | |
| 4932 | close_local_endpoint(conn); | |
| 4933 | conn->ns_conn = NULL; | |
| 4934 | free(conn); | |
| 4935 | } | |
| 4936 | break; | |
| 4939 | 4937 | |
| 4940 | case NS_POLL: | |
| 4941 | if (call_user(conn, MG_POLL) == MG_TRUE) { | |
| 4942 | if (conn->ns_conn->flags & MG_HEADERS_SENT) { | |
| 4943 | write_terminating_chunk(conn); | |
| 4944 | } | |
| 4945 | close_local_endpoint(conn); | |
| 4946 | } | |
| 4938 | case NS_POLL: | |
| 4939 | if (call_user(conn, MG_POLL) == MG_TRUE) { | |
| 4940 | if (conn->ns_conn->flags & MG_HEADERS_SENT) { | |
| 4941 | write_terminating_chunk(conn); | |
| 4942 | } | |
| 4943 | close_local_endpoint(conn); | |
| 4944 | } | |
| 4947 | 4945 | |
| 4948 | if (conn != NULL && conn->endpoint_type == EP_FILE) { | |
| 4949 | transfer_file_data(conn); | |
| 4950 | } | |
| 4946 | if (conn != NULL && conn->endpoint_type == EP_FILE) { | |
| 4947 | transfer_file_data(conn); | |
| 4948 | } | |
| 4951 | 4949 | |
| 4952 | // Expire idle connections | |
| 4953 | { | |
| 4954 | time_t current_time = * (time_t *) p; | |
| 4950 | // Expire idle connections | |
| 4951 | { | |
| 4952 | time_t current_time = * (time_t *) p; | |
| 4955 | 4953 | |
| 4956 | if (conn != NULL && conn->mg_conn.is_websocket) { | |
| 4957 | ping_idle_websocket_connection(conn, current_time); | |
| 4958 | } | |
| 4954 | if (conn != NULL && conn->mg_conn.is_websocket) { | |
| 4955 | ping_idle_websocket_connection(conn, current_time); | |
| 4956 | } | |
| 4959 | 4957 | |
| 4960 | if (nc->last_io_time + MONGOOSE_IDLE_TIMEOUT_SECONDS < current_time) { | |
| 4961 | mg_ev_handler(nc, NS_CLOSE, NULL); | |
| 4962 | nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4963 | } | |
| 4964 | } | |
| 4965 | break; | |
| 4958 | if (nc->last_io_time + MONGOOSE_IDLE_TIMEOUT_SECONDS < current_time) { | |
| 4959 | mg_ev_handler(nc, NS_CLOSE, NULL); | |
| 4960 | nc->flags |= NSF_CLOSE_IMMEDIATELY; | |
| 4961 | } | |
| 4962 | } | |
| 4963 | break; | |
| 4966 | 4964 | |
| 4967 | default: | |
| 4968 | break; | |
| 4969 | } | |
| 4965 | default: | |
| 4966 | break; | |
| 4967 | } | |
| 4970 | 4968 | } |
| 4971 | 4969 | |
| 4972 | 4970 | static void iter2(struct ns_connection *nc, enum ns_event ev, void *param) { |
| 4973 | mg_handler_t func = NULL; | |
| 4974 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4975 | const char *msg = (const char *) param; | |
| 4976 | int n; | |
| 4977 | (void) ev; | |
| 4971 | mg_handler_t func = NULL; | |
| 4972 | struct connection *conn = (struct connection *) nc->connection_data; | |
| 4973 | const char *msg = (const char *) param; | |
| 4974 | int n; | |
| 4975 | (void) ev; | |
| 4978 | 4976 | |
| 4979 | //DBG(("%p [%s]", conn, msg)); | |
| 4980 | if (sscanf(msg, "%p %n", &func, &n) && func != NULL) { | |
| 4981 | conn->mg_conn.callback_param = (void *) (msg + n); | |
| 4982 | func(&conn->mg_conn, MG_POLL); | |
| 4983 | } | |
| 4977 | //DBG(("%p [%s]", conn, msg)); | |
| 4978 | if (sscanf(msg, "%p %n", &func, &n) && func != NULL) { | |
| 4979 | conn->mg_conn.callback_param = (void *) (msg + n); | |
| 4980 | func(&conn->mg_conn, MG_POLL); | |
| 4981 | } | |
| 4984 | 4982 | } |
| 4985 | 4983 | |
| 4986 | 4984 | void mg_wakeup_server_ex(struct mg_server *server, mg_handler_t cb, |
| 4987 | const char *fmt, ...) { | |
| 4988 | va_list ap; | |
| 4989 | char buf[8 * 1024]; | |
| 4990 | int len; | |
| 4985 | const char *fmt, ...) { | |
| 4986 | va_list ap; | |
| 4987 | char buf[8 * 1024]; | |
| 4988 | int len; | |
| 4991 | 4989 | |
| 4992 | // Encode callback (cb) into a buffer | |
| 4993 | len = snprintf(buf, sizeof(buf), "%p ", cb); | |
| 4994 | va_start(ap, fmt); | |
| 4995 | len += vsnprintf(buf + len, sizeof(buf) - len, fmt, ap); | |
| 4996 | va_end(ap); | |
| 4990 | // Encode callback (cb) into a buffer | |
| 4991 | len = snprintf(buf, sizeof(buf), "%p ", cb); | |
| 4992 | va_start(ap, fmt); | |
| 4993 | len += vsnprintf(buf + len, sizeof(buf) - len, fmt, ap); | |
| 4994 | va_end(ap); | |
| 4997 | 4995 | |
| 4998 | // "len + 1" is to include terminating \0 in the message | |
| 4999 | ns_server_wakeup_ex(&server->ns_server, iter2, buf, len + 1); | |
| 4996 | // "len + 1" is to include terminating \0 in the message | |
| 4997 | ns_server_wakeup_ex(&server->ns_server, iter2, buf, len + 1); | |
| 5000 | 4998 | } |
| 5001 | 4999 | |
| 5002 | 5000 | void mg_wakeup_server(struct mg_server *server) { |
| 5003 | ||
| 5001 | ns_server_wakeup_ex(&server->ns_server, NULL, (void *) "", 0); | |
| 5004 | 5002 | } |
| 5005 | 5003 | |
| 5006 | 5004 | void mg_set_listening_socket(struct mg_server *server, int sock) { |
| 5007 | if (server->ns_server.listening_sock != INVALID_SOCKET) { | |
| 5008 | closesocket(server->ns_server.listening_sock); | |
| 5009 | } | |
| 5010 | server->ns_server.listening_sock = (sock_t) sock; | |
| 5005 | if (server->ns_server.listening_sock != INVALID_SOCKET) { | |
| 5006 | closesocket(server->ns_server.listening_sock); | |
| 5007 | } | |
| 5008 | server->ns_server.listening_sock = (sock_t) sock; | |
| 5011 | 5009 | } |
| 5012 | 5010 | |
| 5013 | 5011 | int mg_get_listening_socket(struct mg_server *server) { |
| 5014 | ||
| 5012 | return server->ns_server.listening_sock; | |
| 5015 | 5013 | } |
| 5016 | 5014 | |
| 5017 | 5015 | const char *mg_get_option(const struct mg_server *server, const char *name) { |
| 5018 | const char **opts = (const char **) server->config_options; | |
| 5019 | int i = get_option_index(name); | |
| 5020 | return i == -1 ? NULL : opts[i] == NULL ? "" : opts[i]; | |
| 5016 | const char **opts = (const char **) server->config_options; | |
| 5017 | int i = get_option_index(name); | |
| 5018 | return i == -1 ? NULL : opts[i] == NULL ? "" : opts[i]; | |
| 5021 | 5019 | } |
| 5022 | 5020 | |
| 5023 | 5021 | struct mg_server *mg_create_server(void *server_data, mg_handler_t handler) { |
| 5024 | struct mg_server *server = (struct mg_server *) calloc(1, sizeof(*server)); | |
| 5025 | ns_server_init(&server->ns_server, server_data, mg_ev_handler); | |
| 5026 | set_default_option_values(server->config_options); | |
| 5027 | server->event_handler = handler; | |
| 5028 | return server; | |
| 5022 | struct mg_server *server = (struct mg_server *) calloc(1, sizeof(*server)); | |
| 5023 | ns_server_init(&server->ns_server, server_data, mg_ev_handler); | |
| 5024 | set_default_option_values(server->config_options); | |
| 5025 | server->event_handler = handler; | |
| 5026 | return server; | |
| 5029 | 5027 | } |
| r31373 | r31374 | |
|---|---|---|
| 9 | 9 | ***************************************************************************/ |
| 10 | 10 | |
| 11 | 11 | extern const char build_version[]; |
| 12 | const char build_version[] = "0.15 | |
| 12 | const char build_version[] = "0.154 ("__DATE__")"; |
| r31373 | r31374 | |
|---|---|---|
| 1122 | 1122 | *************************************/ |
| 1123 | 1123 | |
| 1124 | 1124 | static ADDRESS_MAP_START( aes_main_map, AS_PROGRAM, 16, ng_aes_state ) |
| 1125 | // | |
| 1125 | // AM_RANGE(0x000000, 0x00007f) AM_ROMBANK("vectors") | |
| 1126 | 1126 | AM_RANGE(0x000000, 0x00007f) AM_READ(neogeo_slot_rom_low_bectors_r) |
| 1127 | 1127 | AM_RANGE(0x000080, 0x0fffff) AM_ROM |
| 1128 | 1128 | AM_RANGE(0x100000, 0x10ffff) AM_MIRROR(0x0f0000) AM_RAM |
| r31373 | r31374 | |
| 1149 | 1149 | |
| 1150 | 1150 | |
| 1151 | 1151 | static ADDRESS_MAP_START( neocd_main_map, AS_PROGRAM, 16, ng_aes_state ) |
| 1152 | // AM_RANGE(0x000000, 0x00007f) AM_READ_BANK("vectors") // writes will fall through to area below | |
| 1153 | AM_RANGE(0x000000, 0x00007f) AM_READ(banked_vectors_r) | |
| 1152 | // AM_RANGE(0x000000, 0x00007f) AM_READ_BANK("vectors") // writes will fall through to area below | |
| 1153 | AM_RANGE(0x000000, 0x00007f) AM_READ(banked_vectors_r) | |
| 1154 | 1154 | AM_RANGE(0x000000, 0x1fffff) AM_RAM AM_REGION("maincpu", 0x00000) |
| 1155 | 1155 | |
| 1156 | 1156 | AM_RANGE(0x300000, 0x300001) AM_MIRROR(0x01fffe) AM_READ(aes_in0_r) |
| r31373 | r31374 | |
|---|---|---|
| 811 | 811 | MCFG_CASSETTE_ADD("cassette") |
| 812 | 812 | MCFG_CASSETTE_FORMATS(atom_cassette_formats) |
| 813 | 813 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 814 | ||
| 814 | ||
| 815 | 815 | MCFG_QUICKLOAD_ADD("quickload", atom_state, atom_atm, "atm", 0) |
| 816 | 816 | |
| 817 | 817 | /* cartridge */ |
| r31373 | r31374 | |
| 897 | 897 | |
| 898 | 898 | MCFG_CENTRONICS_OUTPUT_LATCH_ADD("cent_data_out", CENTRONICS_TAG) |
| 899 | 899 | |
| 900 | MCFG_CASSETTE_ADD("cassette") | |
| 900 | MCFG_CASSETTE_ADD("cassette") | |
| 901 | 901 | MCFG_CASSETTE_FORMATS(atom_cassette_formats) |
| 902 | 902 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 903 | 903 |
| r31373 | r31374 | |
|---|---|---|
| 732 | 732 | /* cassette */ |
| 733 | 733 | MCFG_CASSETTE_ADD( "cassette" ) |
| 734 | 734 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 735 | ||
| 735 | ||
| 736 | 736 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_p", super80_state, timer_p, attotime::from_hz(40000)) // cass read |
| 737 | 737 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_k", super80_state, timer_k, attotime::from_hz(300)) // keyb scan |
| 738 | 738 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_h", super80_state, timer_h, attotime::from_hz(100)) // half-speed |
| r31373 | r31374 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | /* |
| 12 | 12 | |
| 13 | ||
| 13 | TODO: | |
| 14 | 14 | |
| 15 | ||
| 15 | - video DMA is done line by line and needs to be in perfect sync | |
| 16 | 16 | |
| 17 | 17 | */ |
| 18 | 18 |
| r31373 | r31374 | |
|---|---|---|
| 433 | 433 | |
| 434 | 434 | MCFG_MC6845_ADD("crtc", MC6845, "svi806", XTAL_12MHz / 8) |
| 435 | 435 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 436 | MCFG_MC6845_CHAR_WIDTH(8) | |
| 436 | MCFG_MC6845_CHAR_WIDTH(8) /* ? */ | |
| 437 | 437 | MCFG_MC6845_UPDATE_ROW_CB(svi318_state, crtc_update_row) |
| 438 | 438 | |
| 439 | 439 | MCFG_VIDEO_START_OVERRIDE(svi318_state, svi328_806 ) |
| r31373 | r31374 | |
|---|---|---|
| 412 | 412 | |
| 413 | 413 | MCFG_CASSETTE_ADD("cassette") |
| 414 | 414 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 415 | ||
| 415 | ||
| 416 | 416 | MCFG_TIMER_DRIVER_ADD_PERIODIC("d6800_c", d6800_state, d6800_c, attotime::from_hz(4800)) |
| 417 | 417 | MCFG_TIMER_DRIVER_ADD_PERIODIC("d6800_p", d6800_state, d6800_p, attotime::from_hz(40000)) |
| 418 | 418 |
| r31373 | r31374 | |
|---|---|---|
| 88 | 88 | DECLARE_DRIVER_INIT(a310); |
| 89 | 89 | virtual void machine_start(); |
| 90 | 90 | virtual void machine_reset(); |
| 91 | ||
| 91 | DECLARE_INPUT_CHANGED_MEMBER(key_stroke); | |
| 92 | 92 | DECLARE_FLOPPY_FORMATS( floppy_formats ); |
| 93 | 93 | |
| 94 | 94 | |
| r31373 | r31374 | |
| 166 | 166 | |
| 167 | 167 | INPUT_CHANGED_MEMBER(a310_state::key_stroke) |
| 168 | 168 | { |
| 169 | UINT8 row_val = (UINT8)(FPTR)(param) >> 4; | |
| 170 | UINT8 col_val = (UINT8)(FPTR)(param) & 0xf; | |
| 169 | UINT8 row_val = (UINT8)(FPTR)(param) >> 4; | |
| 170 | UINT8 col_val = (UINT8)(FPTR)(param) & 0xf; | |
| 171 | 171 | |
| 172 | 172 | if(newval && !oldval) |
| 173 | 173 | m_kart->send_keycode_down(row_val,col_val); |
| r31373 | r31374 | |
| 214 | 214 | PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("TAB") PORT_CODE(KEYCODE_TAB) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x26) PORT_IMPULSE(1) |
| 215 | 215 | |
| 216 | 216 | PORT_START("key2") /* KEY ROW 2 */ |
| 217 | ||
| 217 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("q Q") PORT_CODE(KEYCODE_Q) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x27) PORT_IMPULSE(1) | |
| 218 | 218 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("w W") PORT_CODE(KEYCODE_W) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x28) PORT_IMPULSE(1) |
| 219 | 219 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("e E") PORT_CODE(KEYCODE_E) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x29) PORT_IMPULSE(1) |
| 220 | 220 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("r R") PORT_CODE(KEYCODE_R) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x2a) PORT_IMPULSE(1) |
| r31373 | r31374 | |
| 266 | 266 | PORT_START("key7") /* KEY ROW 7 */ |
| 267 | 267 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("LINE FEED") |
| 268 | 268 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("SPACE") PORT_CODE(KEYCODE_SPACE) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x5f) PORT_IMPULSE(1) |
| 269 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_MINUS_PAD) | |
| 270 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(", (KP)") PORT_CODE(KEYCODE_PLUS_PAD) | |
| 269 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("- (KP)") PORT_CODE(KEYCODE_MINUS_PAD) | |
| 270 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME(", (KP)") PORT_CODE(KEYCODE_PLUS_PAD) | |
| 271 | 271 | PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("ENTER (KP)") PORT_CODE(KEYCODE_ENTER_PAD) |
| 272 | 272 | PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME(". (KP)") PORT_CODE(KEYCODE_DEL_PAD) |
| 273 | 273 | PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("0 (KP)") PORT_CODE(KEYCODE_0_PAD) |
| 274 | 274 | PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("1 (KP)") PORT_CODE(KEYCODE_1_PAD) |
| 275 | 275 | |
| 276 | 276 | PORT_START("key8") /* KEY ROW 8 */ |
| 277 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("2 (KP)") PORT_CODE(KEYCODE_2_PAD) | |
| 278 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD) | |
| 279 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("4 (KP)") PORT_CODE(KEYCODE_4_PAD) | |
| 280 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("5 (KP)") PORT_CODE(KEYCODE_5_PAD) | |
| 281 | PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("6 (KP)") PORT_CODE(KEYCODE_6_PAD) | |
| 282 | PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("7 (KP)") PORT_CODE(KEYCODE_7_PAD) | |
| 283 | PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("8 (KP)") PORT_CODE(KEYCODE_8_PAD) | |
| 284 | PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("9 (KP)") PORT_CODE(KEYCODE_9_PAD) | |
| 277 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("2 (KP)") PORT_CODE(KEYCODE_2_PAD) | |
| 278 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("3 (KP)") PORT_CODE(KEYCODE_3_PAD) | |
| 279 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("4 (KP)") PORT_CODE(KEYCODE_4_PAD) | |
| 280 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("5 (KP)") PORT_CODE(KEYCODE_5_PAD) | |
| 281 | PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("6 (KP)") PORT_CODE(KEYCODE_6_PAD) | |
| 282 | PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("7 (KP)") PORT_CODE(KEYCODE_7_PAD) | |
| 283 | PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("8 (KP)") PORT_CODE(KEYCODE_8_PAD) | |
| 284 | PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("9 (KP)") PORT_CODE(KEYCODE_9_PAD) | |
| 285 | 285 | |
| 286 | PORT_START("key9") | |
| 287 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x20) PORT_IMPULSE(1) | |
| 288 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?) | |
| 289 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?) | |
| 286 | PORT_START("key9") | |
| 287 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("HOME") PORT_CODE(KEYCODE_HOME) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x20) PORT_IMPULSE(1) | |
| 288 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("*") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x24) PORT_IMPULSE(1) // (KP?) | |
| 289 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("#") PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x25) PORT_IMPULSE(1) // (KP?) | |
| 290 | 290 | |
| 291 | PORT_START("keya") | |
| 292 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x01) PORT_IMPULSE(1) | |
| 293 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x02) PORT_IMPULSE(1) | |
| 294 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x03) PORT_IMPULSE(1) | |
| 295 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x04) PORT_IMPULSE(1) | |
| 296 | PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x05) PORT_IMPULSE(1) | |
| 297 | PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x06) PORT_IMPULSE(1) | |
| 298 | PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x07) PORT_IMPULSE(1) | |
| 299 | PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x08) PORT_IMPULSE(1) | |
| 291 | PORT_START("keya") | |
| 292 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("F1") PORT_CODE(KEYCODE_F1) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x01) PORT_IMPULSE(1) | |
| 293 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("F2") PORT_CODE(KEYCODE_F2) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x02) PORT_IMPULSE(1) | |
| 294 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("F3") PORT_CODE(KEYCODE_F3) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x03) PORT_IMPULSE(1) | |
| 295 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("F4") PORT_CODE(KEYCODE_F4) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x04) PORT_IMPULSE(1) | |
| 296 | PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x05) PORT_IMPULSE(1) | |
| 297 | PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x06) PORT_IMPULSE(1) | |
| 298 | PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x07) PORT_IMPULSE(1) | |
| 299 | PORT_BIT(0x80, 0x00, IPT_KEYBOARD) PORT_NAME("F8") PORT_CODE(KEYCODE_F8) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x08) PORT_IMPULSE(1) | |
| 300 | 300 | |
| 301 | PORT_START("keyb") | |
| 302 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x09) PORT_IMPULSE(1) | |
| 303 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0a) PORT_IMPULSE(1) | |
| 304 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0b) PORT_IMPULSE(1) | |
| 305 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0c) PORT_IMPULSE(1) | |
| 301 | PORT_START("keyb") | |
| 302 | PORT_BIT(0x01, 0x00, IPT_KEYBOARD) PORT_NAME("F9") PORT_CODE(KEYCODE_F9) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x09) PORT_IMPULSE(1) | |
| 303 | PORT_BIT(0x02, 0x00, IPT_KEYBOARD) PORT_NAME("F10") PORT_CODE(KEYCODE_F10) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0a) PORT_IMPULSE(1) | |
| 304 | PORT_BIT(0x04, 0x00, IPT_KEYBOARD) PORT_NAME("F11") PORT_CODE(KEYCODE_F11) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0b) PORT_IMPULSE(1) | |
| 305 | PORT_BIT(0x08, 0x00, IPT_KEYBOARD) PORT_NAME("F12") PORT_CODE(KEYCODE_F12) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x0c) PORT_IMPULSE(1) | |
| 306 | 306 | // PORT_BIT(0x10, 0x00, IPT_KEYBOARD) PORT_NAME("F5") PORT_CODE(KEYCODE_F5) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x05) PORT_IMPULSE(1) |
| 307 | 307 | // PORT_BIT(0x20, 0x00, IPT_KEYBOARD) PORT_NAME("F6") PORT_CODE(KEYCODE_F6) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x06) PORT_IMPULSE(1) |
| 308 | 308 | // PORT_BIT(0x40, 0x00, IPT_KEYBOARD) PORT_NAME("F7") PORT_CODE(KEYCODE_F7) PORT_CHANGED_MEMBER(DEVICE_SELF, a310_state, key_stroke, 0x07) PORT_IMPULSE(1) |
| r31373 | r31374 | |
|---|---|---|
| 389 | 389 | MCFG_CASSETTE_FORMATS(rks_cassette_formats) |
| 390 | 390 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 391 | 391 | MCFG_CASSETTE_INTERFACE("special_cass") |
| 392 | ||
| 392 | ||
| 393 | 393 | MCFG_SOFTWARE_LIST_ADD("cass_list","special_cass") |
| 394 | 394 | MACHINE_CONFIG_END |
| 395 | 395 |
| r31373 | r31374 | |
|---|---|---|
| 321 | 321 | MCFG_CASSETTE_ADD("cassette") |
| 322 | 322 | MCFG_CASSETTE_FORMATS(phc25_cassette_formats) |
| 323 | 323 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 324 | ||
| 324 | ||
| 325 | 325 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") |
| 326 | 326 | MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(phc25_state, write_centronics_busy)) |
| 327 | 327 |
| r31373 | r31374 | |
|---|---|---|
| 749 | 749 | MCFG_CASSETTE_ADD( "tape" ) |
| 750 | 750 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 751 | 751 | MCFG_CASSETTE_INTERFACE("fc_cass") |
| 752 | ||
| 752 | ||
| 753 | 753 | MCFG_SOFTWARE_LIST_ADD("cass_list", "famicom_cass") |
| 754 | 754 | MACHINE_CONFIG_END |
| 755 | 755 |
| r31373 | r31374 | |
|---|---|---|
| 716 | 716 | MCFG_CASSETTE_FORMATS(tzx_cassette_formats) |
| 717 | 717 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 718 | 718 | MCFG_CASSETTE_INTERFACE("spectrum_cass") |
| 719 | ||
| 719 | ||
| 720 | 720 | MCFG_SOFTWARE_LIST_ADD("cass_list","spectrum_cass") |
| 721 | 721 | |
| 722 | 722 | /* cartridge */ |
| r31373 | r31374 | |
|---|---|---|
| 14 | 14 | * LCD works |
| 15 | 15 | |
| 16 | 16 | ================ |
| 17 | Messages displayed on screen are in brazilian portuguese. | |
| 18 | During boot, it says: | |
| 17 | Messages displayed on screen are in brazilian portuguese. | |
| 18 | During boot, it says: | |
| 19 | 19 | |
| 20 | 20 | "TI auto-test." |
| 21 | 21 | "Wait!" |
| 22 | 22 | |
| 23 | ||
| 23 | Then it says: | |
| 24 | 24 | |
| 25 | 25 | "Initializing..." |
| 26 | 26 | "Wait!" |
| 27 | 27 | |
| 28 | ||
| 28 | And finally: | |
| 29 | 29 | |
| 30 | 30 | "TI did not receive" |
| 31 | 31 | "the dial tone" |
| r31373 | r31374 | |
| 108 | 108 | |
| 109 | 109 | WRITE8_MEMBER(ti630_state::ti630_io_w) |
| 110 | 110 | { |
| 111 | static UINT8 p0=0, p1=0, p2=0, p3=0; | |
| 112 | switch (offset) | |
| 113 | { | |
| 114 | case 0x00: | |
| 115 | { | |
| 116 | if (data != p0) | |
| 117 | { | |
| 118 | p0=data; | |
| 111 | static UINT8 p0=0, p1=0, p2=0, p3=0; | |
| 112 | switch (offset) | |
| 113 | { | |
| 114 | case 0x00: | |
| 115 | { | |
| 116 | if (data != p0) | |
| 117 | { | |
| 118 | p0=data; | |
| 119 | 119 | #if LOG_IO_PORTS |
| 120 | ||
| 120 | printf("Write to P0: %02X\n", data); | |
| 121 | 121 | #endif |
| 122 | } | |
| 123 | break; | |
| 124 | } | |
| 125 | case 0x01: | |
| 126 | { | |
| 127 | if (data != p1) | |
| 128 | { | |
| 129 | p1=data; | |
| 122 | } | |
| 123 | break; | |
| 124 | } | |
| 125 | case 0x01: | |
| 126 | { | |
| 127 | if (data != p1) | |
| 128 | { | |
| 129 | p1=data; | |
| 130 | 130 | #if LOG_IO_PORTS |
| 131 | ||
| 131 | printf("Write to P1: %02X\n", data); | |
| 132 | 132 | #endif |
| 133 | } | |
| 134 | break; | |
| 135 | } | |
| 136 | case 0x02: | |
| 137 | { | |
| 138 | if (data != p2) | |
| 139 | { | |
| 140 | p2=data; | |
| 133 | } | |
| 134 | break; | |
| 135 | } | |
| 136 | case 0x02: | |
| 137 | { | |
| 138 | if (data != p2) | |
| 139 | { | |
| 140 | p2=data; | |
| 141 | 141 | #if LOG_IO_PORTS |
| 142 | ||
| 142 | printf("Write to P2: %02X\n", data); | |
| 143 | 143 | #endif |
| 144 | } | |
| 145 | break; | |
| 146 | } | |
| 147 | case 0x03: | |
| 148 | { | |
| 149 | if (data != p3) | |
| 150 | { | |
| 151 | p3=data; | |
| 144 | } | |
| 145 | break; | |
| 146 | } | |
| 147 | case 0x03: | |
| 148 | { | |
| 149 | if (data != p3) | |
| 150 | { | |
| 151 | p3=data; | |
| 152 | 152 | #if LOG_IO_PORTS |
| 153 | ||
| 153 | printf("Write to P3: %02X\n", data); | |
| 154 | 154 | #endif |
| 155 | } | |
| 156 | break; | |
| 157 | } | |
| 158 | } | |
| 155 | } | |
| 156 | break; | |
| 157 | } | |
| 158 | } | |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | PALETTE_INIT_MEMBER(ti630_state, ti630) |
| r31373 | r31374 | |
|---|---|---|
| 528 | 528 | MCFG_CASSETTE_ADD(CASSETTE1_TAG) |
| 529 | 529 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) |
| 530 | 530 | MCFG_CASSETTE_INTERFACE("ep64_cass") |
| 531 | ||
| 531 | ||
| 532 | 532 | MCFG_CASSETTE_ADD(CASSETTE2_TAG) |
| 533 | 533 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) |
| 534 | 534 | MCFG_CASSETTE_INTERFACE("ep64_cass") |
| r31373 | r31374 | |
|---|---|---|
| 1400 | 1400 | // external cassette |
| 1401 | 1401 | MCFG_CASSETTE_ADD("extcas") |
| 1402 | 1402 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_DISABLED) |
| 1403 | ||
| 1403 | ||
| 1404 | 1404 | MCFG_TIMER_DRIVER_ADD("extcas_timer", px4_state, ext_cassette_read) |
| 1405 | 1405 | |
| 1406 | 1406 | // sio port |
| r31373 | r31374 | |
|---|---|---|
| 237 | 237 | MCFG_CASSETTE_FORMATS(rkm_cassette_formats) |
| 238 | 238 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 239 | 239 | MCFG_CASSETTE_INTERFACE("mikrosha_cass") |
| 240 | ||
| 240 | ||
| 241 | 241 | MCFG_SOFTWARE_LIST_ADD("cass_list","mikrosha") |
| 242 | 242 | MACHINE_CONFIG_END |
| 243 | 243 |
| r31373 | r31374 | |
|---|---|---|
| 423 | 423 | MCFG_DEVICE_ADD( "uart", AY31015, 0 ) |
| 424 | 424 | MCFG_AY31015_TX_CLOCK(4800.0) |
| 425 | 425 | MCFG_AY31015_RX_CLOCK(4800.0) |
| 426 | ||
| 426 | ||
| 427 | 427 | /* printer */ |
| 428 | 428 | MCFG_CENTRONICS_ADD("centronics", centronics_printers, "covox") |
| 429 | 429 | MCFG_SLOT_OPTION_ADD( "covox", CENTRONICS_COVOX ) |
| r31373 | r31374 | |
| 442 | 442 | MCFG_CASSETTE_FORMATS(sorcerer_cassette_formats) |
| 443 | 443 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 444 | 444 | MCFG_CASSETTE_INTERFACE("sorcerer_cass") |
| 445 | ||
| 445 | ||
| 446 | 446 | MCFG_CASSETTE_ADD( "cassette2" ) |
| 447 | 447 | MCFG_CASSETTE_FORMATS(sorcerer_cassette_formats) |
| 448 | 448 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| r31373 | r31374 | |
|---|---|---|
| 501 | 501 | MCFG_CASSETTE_FORMATS(x1_cassette_formats) |
| 502 | 502 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 503 | 503 | MCFG_CASSETTE_INTERFACE("x1_cass") |
| 504 | ||
| 504 | ||
| 505 | 505 | MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass") |
| 506 | 506 | |
| 507 | 507 | MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface) |
| r31373 | r31374 | |
|---|---|---|
| 851 | 851 | |
| 852 | 852 | MCFG_CASSETTE_ADD("cassette") |
| 853 | 853 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 854 | ||
| 854 | ||
| 855 | 855 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") |
| 856 | 856 | MCFG_CENTRONICS_BUSY_HANDLER(DEVWRITELINE("cent_status_in", input_buffer_device, write_bit7)) |
| 857 | 857 |
| r31373 | r31374 | |
|---|---|---|
| 502 | 502 | |
| 503 | 503 | /* Devices */ |
| 504 | 504 | MCFG_DEVICE_ADD("i8279", I8279, 400000) // based on divider |
| 505 | MCFG_I8279_OUT_SL_CB(WRITE8(mmd1_state, mmd2_scanlines_w)) // scan SL lines | |
| 506 | MCFG_I8279_OUT_DISP_CB(WRITE8(mmd1_state, mmd2_digit_w)) // display A&B | |
| 507 | MCFG_I8279_IN_RL_CB(READ8(mmd1_state, mmd2_kbd_r)) // kbd RL lines | |
| 508 | MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key | |
| 505 | MCFG_I8279_OUT_SL_CB(WRITE8(mmd1_state, mmd2_scanlines_w)) // scan SL lines | |
| 506 | MCFG_I8279_OUT_DISP_CB(WRITE8(mmd1_state, mmd2_digit_w)) // display A&B | |
| 507 | MCFG_I8279_IN_RL_CB(READ8(mmd1_state, mmd2_kbd_r)) // kbd RL lines | |
| 508 | MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key | |
| 509 | 509 | MCFG_I8279_IN_CTRL_CB(VCC) |
| 510 | 510 | |
| 511 | 511 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 13 | 13 | Issues with this driver: |
| 14 | 14 | (1) Keyboard emulation incomplete (inhibits the system from booting with ERROR 50). |
| 15 | 15 | |
| 16 | (2) IRQ / DMA / arbitration logic should be verified | |
| 17 | DMA (needed for 'Extended communication option') or Z80-8088 arbitration is non-existent (E11/E13 dumps anyone?). | |
| 16 | (2) IRQ / DMA / arbitration logic should be verified | |
| 17 | DMA (needed for 'Extended communication option') or Z80-8088 arbitration is non-existent (E11/E13 dumps anyone?). | |
| 18 | 18 | |
| 19 | (3) Read errors when booting CPM 2 / DOS 2.x / DOS 3 (secondary boot loader finds errors on tracks >= 2). | |
| 19 | (3) Read errors when booting CPM 2 / DOS 2.x / DOS 3 (secondary boot loader finds errors on tracks >= 2). | |
| 20 | 20 | Seek (+ verify) and a number of signals (TRACK > 43 TG43, INDEX etc.) appear to be incorrect (-> diag.disk aborts drive test). |
| 21 | 21 | UCSD systems (fort_sys, pas_sys) and diag disks boot! |
| 22 | 22 | |
| r31373 | r31374 | |
| 28 | 28 | MHFU gets active if the 8088 has not acknowledged a video processor interrupt within approx. 108 milliseconds |
| 29 | 29 | |
| 30 | 30 | - TO BE IMPLEMENTED AS SLOT DEVICES (for now, DIP settings affect 'system_parameter_r' only and are disabled): |
| 31 | * Color graphics option (uses NEC upd7220 GDC). REFERENCE: Programmer's Reference: AA-AE36A-TV. | |
| 32 | Either 384 x 240 x 16 or 800 x 240 x 4 colors (out of 4096). 8 × 64 K video RAM. Pallette limited to 4 colors on 100-A. | |
| 31 | * Color graphics option (uses NEC upd7220 GDC). REFERENCE: Programmer's Reference: AA-AE36A-TV. | |
| 32 | Either 384 x 240 x 16 or 800 x 240 x 4 colors (out of 4096). 8 ? 64 K video RAM. Pallette limited to 4 colors on 100-A. | |
| 33 | 33 | |
| 34 | * Extended communication option (occupies BUNDLE_OPTION ports) | |
| 34 | * Extended communication option (occupies BUNDLE_OPTION ports) REFERENCE: AA-V172A-TV + Addendum AV-Y890A-TV. | |
| 35 | 35 | See also NEWCOM1.DOC in RBETECDOC.ZIP. Board connected to the front rightmost expansion slot (1 of the expansion |
| 36 | 36 | ports used by the hard disk controller). Thus can't be added to a system that includes the DEC RD50/51. |
| 37 | 37 | => 2 ports, a high-speed RS-422 half-duplex interface (port A) + lower-speed RS-423 full/half-duplex interface |
| r31373 | r31374 | |
| 42 | 42 | Plugs into the NVM chip socket on a 100-A and into the Boot ROM on the 100-B (there is a socket |
| 43 | 43 | on the ClikClok for the NVM / ROM chip). Came with software for 'all versions of MS-DOS'. |
| 44 | 44 | |
| 45 | * 8087 | |
| 45 | * 8087 Numerical Data Coprocessor daughterboard. REFERENCE: EK-PCNDP-IN-PRE | |
| 46 | 46 | Daughterboard, to be plugged into the expansion port where the memory expansion card usually sits. |
| 47 | 47 | If a memory adapter board is present, it has to be plugged into a connector atop the 8087 copro board. |
| 48 | 48 | The 8088 is put into the CPU socket on the coprocessor board. |
| 49 | ||
| 49 | => see MATH test on 'Design Maturity Diagnostics' disk <= | |
| 50 | 50 | |
| 51 | 51 | * Suitable Solutions TURBOW286: 12 Mhz, 68-pin, low power AMD N80L286-12 and WAYLAND/EDSUN EL286-88-10-B ( 80286 to 8088 Processor Signal Converter ) |
| 52 | 52 | plus DC 7174 or DT 7174 (barely readable). Add-on card, replaces main 8088 cpu (via ribbon cable). Patched V5.03 BOOT ROM labeled 'TBSS1.3 - 3ED4'. |
| r31373 | r31374 | |
| 207 | 207 | #include "video/vtvideo.h" |
| 208 | 208 | |
| 209 | 209 | #include "machine/wd_fdc.h" |
| 210 | #include "formats/rx50_dsk.h" | |
| 211 | #include "imagedev/flopdrv.h" | |
| 210 | #include "formats/rx50_dsk.h" | |
| 211 | #include "imagedev/flopdrv.h" | |
| 212 | 212 | |
| 213 | 213 | #include "machine/i8251.h" |
| 214 | 214 | #include "machine/clock.h" |
| r31373 | r31374 | |
| 218 | 218 | #include "rainbow.lh" // BEZEL - LAYOUT with LEDs for diag 1-7, keyboard 8-11 and floppy 20-23 |
| 219 | 219 | |
| 220 | 220 | #define LK201_TAG "lk201" |
| 221 | #define FD1793_TAG "fd1793x" | |
| 221 | #define FD1793_TAG "fd1793x" | |
| 222 | 222 | #define INVALID_DRIVE 255 |
| 223 | 223 | |
| 224 | 224 | class rainbow_state : public driver_device |
| r31373 | r31374 | |
| 243 | 243 | m_crtc(*this, "vt100_video"), |
| 244 | 244 | m_i8088(*this, "maincpu"), |
| 245 | 245 | m_z80(*this, "subcpu"), |
| 246 | m_fdc(*this, FD1793_TAG), | |
| 246 | m_fdc(*this, FD1793_TAG), | |
| 247 | 247 | m_kbd8251(*this, "kbdser"), |
| 248 | 248 | m_lk201(*this, LK201_TAG), |
| 249 | 249 | m_p_ram(*this, "p_ram"), |
| r31373 | r31374 | |
| 299 | 299 | DECLARE_WRITE_LINE_MEMBER(write_keyboard_clock); |
| 300 | 300 | TIMER_DEVICE_CALLBACK_MEMBER(motor_tick); |
| 301 | 301 | |
| 302 | DECLARE_FLOPPY_FORMATS( floppy_formats ); | |
| 302 | DECLARE_FLOPPY_FORMATS( floppy_formats ); | |
| 303 | 303 | protected: |
| 304 | 304 | virtual void machine_start(); |
| 305 | 305 | |
| 306 | 306 | private: |
| 307 | 307 | enum |
| 308 | 308 | { |
| 309 | IRQ_8088_MAILBOX = 0, // vector 0x27/a7 (lowest priority) | |
| 310 | IRQ_8088_KBD, // vector 0x26/a6 KEYBOARD (8251A) Interrupt | |
| 311 | // IRQ_EXT_COMM, // vector 0x25 [OPTION BOARD] Interrupt from external COMM.BOARD (non DMA) | |
| 312 | // IRQ_COMM_PRN_7201, // vector 0x24 COMM./PRINTER (7201) IRQ | |
| 313 | // IRQ_EXT_DMAC, // vector 0x23 [OPTION BOARD] : from external COMM.BOARD (DMA Control IRQ) | |
| 314 | // IRQ_GRF, // vector 0x22 GRAPHICS IRQ | |
| 315 | // IRQ_SH_10_BDL, // vector 0x21 BUNDLE IRQ (hard disc / COMM.BOARD) : Pin 23 of expansion connector J4 | |
| 316 | IRQ_8088_VBL, // vector 0x20/a0 (highest priority) | |
| 309 | IRQ_8088_MAILBOX = 0, // vector 0x27/a7 (lowest priority) | |
| 310 | IRQ_8088_KBD, // vector 0x26/a6 KEYBOARD (8251A) Interrupt | |
| 311 | // IRQ_EXT_COMM, // vector 0x25 [OPTION BOARD] Interrupt from external COMM.BOARD (non DMA) | |
| 312 | // IRQ_COMM_PRN_7201, // vector 0x24 COMM./PRINTER (7201) IRQ | |
| 313 | // IRQ_EXT_DMAC, // vector 0x23 [OPTION BOARD] : from external COMM.BOARD (DMA Control IRQ) | |
| 314 | // IRQ_GRF, // vector 0x22 GRAPHICS IRQ | |
| 315 | // IRQ_SH_10_BDL, // vector 0x21 BUNDLE IRQ (hard disc / COMM.BOARD) : Pin 23 of expansion connector J4 | |
| 316 | IRQ_8088_VBL, // vector 0x20/a0 (highest priority) | |
| 317 | 317 | IRQ_8088_MAX |
| 318 | 318 | }; |
| 319 | 319 | |
| r31373 | r31374 | |
| 381 | 381 | FLOPPY_RX50IMG_FORMAT |
| 382 | 382 | FLOPPY_FORMATS_END |
| 383 | 383 | |
| 384 | static SLOT_INTERFACE_START( rainbow_floppies ) | |
| 385 | SLOT_INTERFACE("525qd", FLOPPY_525_SSQD) | |
| 384 | static SLOT_INTERFACE_START( rainbow_floppies ) | |
| 385 | SLOT_INTERFACE("525qd", FLOPPY_525_SSQD) | |
| 386 | 386 | SLOT_INTERFACE_END |
| 387 | 387 | |
| 388 | 388 | |
| r31373 | r31374 | |
| 417 | 417 | |
| 418 | 418 | rom[0xf4000 + 0x363b]= 0xeb; // COND => JMPS |
| 419 | 419 | |
| 420 | ||
| 420 | if (rom[0xf4174] == 0x75) | |
| 421 | 421 | { |
| 422 | 422 | rom[0xf4174] = 0xeb; // jmps RAINBOW100_LOGO__loc_33D |
| 423 | rom[0xf4175] = 0x08; | |
| 424 | } | |
| 423 | rom[0xf4175] = 0x08; | |
| 424 | } | |
| 425 | 425 | |
| 426 | if (rom[0xf4000 + 0x3ffc] == 0x31) // 100-B | |
| 427 | rom[0xf4384] = 0xeb; // JMPS => BOOT80 | |
| 426 | if (rom[0xf4000 + 0x3ffc] == 0x31) // 100-B | |
| 427 | rom[0xf4384] = 0xeb; // JMPS => BOOT80 | |
| 428 | 428 | |
| 429 | if (rom[0xf4000 + 0x3ffc] == 0x35) // v5.05 | |
| 430 | rom[0xf437b] = 0xeb; | |
| 429 | if (rom[0xf4000 + 0x3ffc] == 0x35) // v5.05 | |
| 430 | rom[0xf437b] = 0xeb; | |
| 431 | 431 | #endif |
| 432 | 432 | |
| 433 | 433 | #ifdef KEYBOARD_WORKAROUND |
| r31373 | r31374 | |
| 482 | 482 | AM_RANGE(0x11, 0x11) AM_DEVREADWRITE("kbdser", i8251_device, status_r, control_w) |
| 483 | 483 | |
| 484 | 484 | // UNMAPPED: |
| 485 | // 0x20 -> 0x2f ***** EXTENDED COMM. OPTION / Option Select 1. | |
| 486 | // See boot rom @1EA6: 0x27 (<- RESET EXTENDED COMM OPTION ) | |
| 487 | // =========================================================== | |
| 485 | // 0x20 -> 0x2f ***** EXTENDED COMM. OPTION / Option Select 1. | |
| 486 | // See boot rom @1EA6: 0x27 (<- RESET EXTENDED COMM OPTION ) | |
| 487 | // =========================================================== | |
| 488 | 488 | // 0x30 -> 0x3f ***** EXTENDED COMM. OPTION / Option Select 3. |
| 489 | 489 | // =========================================================== |
| 490 | ||
| 490 | // 0x40 COMMUNICATIONS DATA REGISTER (MPSC) | |
| 491 | 491 | // 0x41 PRINTER DATA REGISTER (MPSC) |
| 492 | 492 | // 0x42 COMMUNICATIONS CONTROL / STATUS REGISTER (MPSC) |
| 493 | 493 | // 0x43 PRINTER CONTROL / STATUS REGISTER (MPSC) |
| 494 | // =========================================================== | |
| 495 | // 0x50 - 0x57 ***** COLOR GRAPHICS OPTION: | |
| 496 | // 50h Graphics option software reset. Any write to this | |
| 497 | // port also resynchronizes the read/modify/write memory | |
| 498 | // cycles of the Graphics Option to those of the GDC (*) | |
| 494 | // =========================================================== | |
| 495 | // 0x50 - 0x57 ***** COLOR GRAPHICS OPTION: | |
| 496 | // 50h Graphics option software reset. Any write to this | |
| 497 | // port also resynchronizes the read/modify/write memory | |
| 498 | // cycles of the Graphics Option to those of the GDC (*) | |
| 499 | 499 | // * see boot ROM @1EB4/8 |
| 500 | // 51h Data written to this port is loaded into the area | |
| 501 | // selected by the previous write to port 53h. | |
| 500 | // 51h Data written to this port is loaded into the area | |
| 501 | // selected by the previous write to port 53h. | |
| 502 | 502 | |
| 503 | ||
| 503 | // 52h Data written to this port is loaded into the Write Buffer. | |
| 504 | 504 | |
| 505 | // 53h Data written to this port provides address selection | |
| 506 | // for indirect addressing (see Indirect Register). | |
| 505 | // 53h Data written to this port provides address selection | |
| 506 | // for indirect addressing (see Indirect Register). | |
| 507 | 507 | |
| 508 | // 54h Data written to this port is loaded into the low-order | |
| 509 | // byte of the Write Mask. | |
| 508 | // 54h Data written to this port is loaded into the low-order | |
| 509 | // byte of the Write Mask. | |
| 510 | 510 | |
| 511 | // 55h Data written to this port is loaded into the high-order | |
| 512 | // byte of the Write Mask. | |
| 511 | // 55h Data written to this port is loaded into the high-order | |
| 512 | // byte of the Write Mask. | |
| 513 | 513 | |
| 514 | // 56h Data written to this port is loaded into the GDC's FIFO | |
| 515 | // Buffer and flagged as a parameter. | |
| 514 | // 56h Data written to this port is loaded into the GDC's FIFO | |
| 515 | // Buffer and flagged as a parameter. | |
| 516 | 516 | // =========================================================== |
| 517 | 517 | // 0x60 -> 0x6f ***** EXTENDED COMM. OPTION / Option Select 2. |
| 518 | 518 | // =========================================================== |
| r31373 | r31374 | |
| 520 | 520 | // ------ Rainbow uses 'WD 1010 AL' (Western Digital 1983) |
| 521 | 521 | // Register compatible to WD2010 (present in MESS) |
| 522 | 522 | // R/W REGISTERS 60 - 68 (?) |
| 523 | ||
| 523 | AM_RANGE (0x68, 0x68) AM_READ(hd_status_68_r) | |
| 524 | 524 | // =========================================================== |
| 525 | 525 | // HARD DISC SIZES AND LIMITS |
| 526 | 526 | // HARDWARE: |
| r31373 | r31374 | |
| 551 | 551 | AM_RANGE(0x20, 0x20) AM_READWRITE(z80_generalstat_r, z80_diskdiag_read_w) // read to port 0x20 used by MS-DOS 2.x diskette loader. |
| 552 | 552 | AM_RANGE(0x21, 0x21) AM_READWRITE(z80_generalstat_r, z80_diskdiag_write_w) |
| 553 | 553 | AM_RANGE(0x40, 0x40) AM_READWRITE(z80_diskstatus_r, z80_diskcontrol_w) |
| 554 | AM_RANGE(0x60, 0x63) AM_DEVREADWRITE(FD1793_TAG, fd1793_t, read, write) | |
| 554 | AM_RANGE(0x60, 0x63) AM_DEVREADWRITE(FD1793_TAG, fd1793_t, read, write) | |
| 555 | 555 | ADDRESS_MAP_END |
| 556 | 556 | |
| 557 | 557 | /* Input ports */ |
| r31373 | r31374 | |
| 572 | 572 | PORT_START("MEMORY PRESENT") |
| 573 | 573 | PORT_DIPNAME( 0xF0000, 0x20000, "MEMORY PRESENT") |
| 574 | 574 | PORT_DIPSETTING( 0x10000, "64 K (MINIMUM ON 100-A)" ) // see BOARD_RAM |
| 575 | ||
| 575 | PORT_DIPSETTING( 0x20000, "128 K (MINIMUM ON 100-B)" ) | |
| 576 | 576 | PORT_DIPSETTING( 0x30000, "192 K (MEMORY OPTION)" ) |
| 577 | 577 | PORT_DIPSETTING( 0x40000, "256 K (MEMORY OPTION)" ) |
| 578 | 578 | PORT_DIPSETTING( 0x50000, "320 K (MEMORY OPTION)" ) |
| r31373 | r31374 | |
| 589 | 589 | // Floppy is always 'on', BUNDLE + GRAPHICS are not implemented yet: |
| 590 | 590 | PORT_START("FLOPPY CONTROLLER") |
| 591 | 591 | PORT_DIPNAME( 0x01, 0x01, "FLOPPY CONTROLLER") PORT_TOGGLE |
| 592 | ||
| 592 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) | |
| 593 | 593 | |
| 594 | // BUNDLE_OPTION: EXT.COMM.card -or- hard disk controller (marketed later). | |
| 595 | // - hard disc and COMM.extension exclude each other! | |
| 596 | // - connector J4 has 4 select lines (Option Select 1-4) | |
| 594 | // BUNDLE_OPTION: EXT.COMM.card -or- hard disk controller (marketed later). | |
| 595 | // - hard disc and COMM.extension exclude each other! | |
| 596 | // - connector J4 has 4 select lines (Option Select 1-4) | |
| 597 | 597 | PORT_START("BUNDLE OPTION") |
| 598 | 598 | PORT_DIPNAME( 0x00, 0x00, "BUNDLE OPTION") PORT_TOGGLE |
| 599 | 599 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| r31373 | r31374 | |
| 604 | 604 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 605 | 605 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| 606 | 606 | |
| 607 | // W13 - W18 are used for factory tests and affect the boot process - | |
| 608 | PORT_START("W13") | |
| 607 | // W13 - W18 are used for factory tests and affect the boot process - | |
| 608 | PORT_START("W13") | |
| 609 | 609 | PORT_DIPNAME( 0x02, 0x02, "W13 (FACTORY TEST A, LEAVE OFF)") PORT_TOGGLE |
| 610 | 610 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 611 | 611 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| r31373 | r31374 | |
| 644 | 644 | |
| 645 | 645 | /* configure RAM */ |
| 646 | 646 | address_space &program = m_maincpu->space(AS_PROGRAM); |
| 647 | ||
| 647 | if (m_inp8->read() < END_OF_RAM) | |
| 648 | 648 | { |
| 649 | 649 | program.unmap_readwrite(m_inp8->read(), END_OF_RAM); |
| 650 | 650 | } |
| r31373 | r31374 | |
| 713 | 713 | // Interrupt handling and arbitration. See 3.1.3.8 OF PC-100 spec. |
| 714 | 714 | void rainbow_state::update_8088_irqs() |
| 715 | 715 | { |
| 716 | ||
| 716 | static const int vectors[] = { 0x27, 0x26, 0x20 }; | |
| 717 | 717 | |
| 718 | 718 | if (m_irq_mask != 0) |
| 719 | 719 | { |
| r31373 | r31374 | |
| 820 | 820 | B F G M |
| 821 | 821 | ( 1 means NOT present; 4-7 reserved ) |
| 822 | 822 | */ |
| 823 | return ( ((m_inp5->read() == 1) ? 0 : 1) | | |
| 824 | ((m_inp6->read() == 1) ? 0 : 2) | | |
| 825 | ((m_inp7->read() == 1) ? 0 : 4) | | |
| 826 | ((m_inp8->read() > BOARD_RAM) ? 0 : 8) | | |
| 827 | 16 | 32 | 64 | 128 // to be verified. | |
| 823 | return ( ((m_inp5->read() == 1) ? 0 : 1) | | |
| 824 | ((m_inp6->read() == 1) ? 0 : 2) | | |
| 825 | ((m_inp7->read() == 1) ? 0 : 4) | | |
| 826 | ((m_inp8->read() > BOARD_RAM) ? 0 : 8) | | |
| 827 | 16 | 32 | 64 | 128 // to be verified. | |
| 828 | 828 | ); |
| 829 | 829 | } |
| 830 | 830 | |
| r31373 | r31374 | |
| 842 | 842 | int data; |
| 843 | 843 | if (COLD_BOOT == 2) |
| 844 | 844 | data = 0; |
| 845 | else | |
| 845 | else | |
| 846 | 846 | data = m_crtc->MHFU(1); |
| 847 | ||
| 847 | ||
| 848 | 848 | return ( ( (data > 0) ? 0x00 : 0x20) |// (L): status of MHFU flag => bit pos.5 |
| 849 | 849 | ( (INT88) ? 0x00 : 0x40 ) | // (L) |
| 850 | 850 | ( (INTZ80) ? 0x00 : 0x80 ) // (L) |
| r31373 | r31374 | |
| 935 | 935 | D1 : INTZ80 L: (bit reads the INTZ80 bit sent by 8088 to interrupt Z80) |
| 936 | 936 | D0 : ZFLIP L: (read from the diagnostic control register of Z80A) |
| 937 | 937 | */ |
| 938 | ||
| 938 | static int last_track; | |
| 939 | 939 | int track = m_fdc->track_r( space, 0); |
| 940 | 940 | int fdc_step = 0; |
| 941 | int fdc_ready = 0; | |
| 942 | int tk00 = 0; | |
| 941 | int fdc_ready = 0; | |
| 942 | int tk00 = 0; | |
| 943 | 943 | |
| 944 | 944 | if(m_unit != INVALID_DRIVE) |
| 945 | 945 | { |
| r31373 | r31374 | |
| 947 | 947 | fdc_step = 1; |
| 948 | 948 | last_track = track; |
| 949 | 949 | |
| 950 | fdc_ready = m_floppy->ready_r(); | |
| 951 | tk00 = ( m_floppy->trk00_r() != CLEAR_LINE ); | |
| 950 | fdc_ready = m_floppy->ready_r(); | |
| 951 | tk00 = ( m_floppy->trk00_r() != CLEAR_LINE ); | |
| 952 | 952 | } |
| 953 | 953 | |
| 954 | 954 | int last_dir = 0; // FAKE LAST_DIR + WRITE_GATE FOR NOW. |
| 955 | 955 | int fdc_write_gate = 1; |
| 956 | 956 | |
| 957 | | |
| 957 | // ***** ALL LOW ACTIVE - EXCEPT tk00 : | |
| 958 | 958 | int data=( |
| 959 | ( (fdc_step) ? 0x00 : 0x80 ) | | |
| 960 | ( (fdc_write_gate == 1) ? 0x00 : 0x40 ) | | |
| 961 | ( (tk00) ? 0x20 : 0x00 ) | | |
| 962 | ( (last_dir == 1) ? 0x00 : 0x10 ) | | |
| 963 | ( (fdc_ready) ? 0x00 : 0x08 ) | | |
| 959 | ( (fdc_step) ? 0x00 : 0x80 ) | | |
| 960 | ( (fdc_write_gate == 1) ? 0x00 : 0x40 ) | | |
| 961 | ( (tk00) ? 0x20 : 0x00 ) | | |
| 962 | ( (last_dir == 1) ? 0x00 : 0x10 ) | | |
| 963 | ( (fdc_ready) ? 0x00 : 0x08 ) | | |
| 964 | 964 | ( (INT88) ? 0x00 : 0x04 ) | |
| 965 | 965 | ( (INTZ80) ? 0x00 : 0x02 ) | |
| 966 | 966 | ( (m_zflip) ? 0x00 : 0x01 ) |
| r31373 | r31374 | |
| 1052 | 1052 | { |
| 1053 | 1053 | m_floppy = con->get_device(); |
| 1054 | 1054 | if (m_floppy) |
| 1055 | { | |
| 1056 | selected_drive = drive; | |
| 1055 | { | |
| 1056 | selected_drive = drive; | |
| 1057 | 1057 | |
| 1058 | 1058 | m_fdc->set_floppy(m_floppy); // Sets new _image device_ |
| 1059 | 1059 | m_floppy->set_rpm(300.); |
| 1060 | 1060 | |
| 1061 | 1061 | // RX50 board has additional 'side select' - ignored by WD emulation? |
| 1062 | 1062 | m_floppy->ss_w((data & 20) ? 1 : 0); |
| 1063 | } | |
| 1064 | } | |
| 1063 | } | |
| 1064 | } | |
| 1065 | 1065 | |
| 1066 | 1066 | output_set_value("driveled0", (selected_drive == 0) ? 1 : 0 ); |
| 1067 | 1067 | output_set_value("driveled1", (selected_drive == 1) ? 1 : 0 ); |
| r31373 | r31374 | |
| 1074 | 1074 | m_unit = selected_drive; |
| 1075 | 1075 | |
| 1076 | 1076 | if (MOTOR_DISABLE_counter == 0) // "one shot" |
| 1077 | MOTOR_DISABLE_counter = 4800; // 2400 = 500 ms | |
| 1077 | MOTOR_DISABLE_counter = 4800; // 2400 = 500 ms | |
| 1078 | 1078 | |
| 1079 | // | |
| 1079 | // m_fdc->set_force_ready(force_ready); | |
| 1080 | 1080 | } |
| 1081 | 1081 | else |
| 1082 | 1082 | { |
| 1083 | // m_fdc->set_force_ready(false); | |
| 1084 | } | |
| 1083 | // m_fdc->set_force_ready(false); | |
| 1084 | } | |
| 1085 | 1085 | |
| 1086 | 1086 | for(int f_num=0; f_num <= 3; f_num++) |
| 1087 | 1087 | { |
| 1088 | 1088 | floppy_connector *con = machine().device<floppy_connector>(names[f_num]); |
| 1089 | floppy_image_device *tmp_floppy = con->get_device(); | |
| 1090 | tmp_floppy->mon_w( (f_num == m_unit) ? CLEAR_LINE : ASSERT_LINE ); | |
| 1089 | floppy_image_device *tmp_floppy = con->get_device(); | |
| 1090 | tmp_floppy->mon_w( (f_num == m_unit) ? CLEAR_LINE : ASSERT_LINE ); | |
| 1091 | 1091 | } |
| 1092 | 1092 | |
| 1093 | 1093 | if(m_unit == INVALID_DRIVE) |
| 1094 | { | |
| 1095 | data = data & (255 -3); | |
| 1094 | { | |
| 1095 | data = data & (255 -3); | |
| 1096 | 1096 | data = data | 8; // MOTOR 0 OFF |
| 1097 | 1097 | data = data | 16; // MOTOR 1 OFF |
| 1098 | 1098 | } |
| r31373 | r31374 | |
| 1100 | 1100 | { |
| 1101 | 1101 | data = (data & (255 - 3)) | m_unit; |
| 1102 | 1102 | |
| 1103 | ||
| 1103 | if(m_unit < 2) | |
| 1104 | 1104 | data = data & (255 - 8); // MOTOR 0 (for A or B) |
| 1105 | 1105 | |
| 1106 | 1106 | if(m_unit > 1) |
| r31373 | r31374 | |
| 1159 | 1159 | |
| 1160 | 1160 | if(m_unit != INVALID_DRIVE) |
| 1161 | 1161 | { |
| 1162 | if ( (m_diagnostic & 1) && !(data & 1) ) | |
| 1163 | { | |
| 1162 | if ( (m_diagnostic & 1) && !(data & 1) ) | |
| 1163 | { | |
| 1164 | 1164 | m_fdc->soft_reset(); |
| 1165 | } | |
| 1165 | } | |
| 1166 | 1166 | |
| 1167 | if ( !(m_diagnostic & 1) && (data & 1) ) | |
| 1168 | { | |
| 1167 | if ( !(m_diagnostic & 1) && (data & 1) ) | |
| 1168 | { | |
| 1169 | 1169 | m_fdc->soft_reset(); // See formatter description p.197 or 5-13 |
| 1170 | 1170 | } |
| 1171 | 1171 | } |
| 1172 | 1172 | // MISSING BITS (* not vital for normal operation, see diag.disk) - |
| 1173 | 1173 | // BIT 2: GRF VID SEL (0 = system module; 1 = graphics option) |
| 1174 | // BIT 3: PARITY TEST (1 = enables parity test on memory option board) | |
| 1174 | // BIT 3: PARITY TEST (1 = enables parity test on memory option board) | |
| 1175 | 1175 | // * BIT 4: DIAG LOOPBACK (0 at power-up; 1 directs RX50 and DC12 output to printer port) |
| 1176 | 1176 | // * BIT 5: PORT LOOPBACK (1 enables loopback for COMM, PRINTER, KEYBOARD ports) |
| 1177 | 1177 | |
| r31373 | r31374 | |
| 1308 | 1308 | MCFG_VT_VIDEO_RAM_CALLBACK(READ8(rainbow_state, read_video_ram_r)) |
| 1309 | 1309 | MCFG_VT_VIDEO_CLEAR_VIDEO_INTERRUPT_CALLBACK(WRITELINE(rainbow_state, clear_video_interrupt)) |
| 1310 | 1310 | |
| 1311 | MCFG_FD1793x_ADD(FD1793_TAG, XTAL_24_0734MHz / 24) // no separate 1 Mhz quartz | |
| 1311 | MCFG_FD1793x_ADD(FD1793_TAG, XTAL_24_0734MHz / 24) // no separate 1 Mhz quartz | |
| 1312 | 1312 | MCFG_WD_FDC_FORCE_READY |
| 1313 | 1313 | MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":0", rainbow_floppies, "525qd", rainbow_state::floppy_formats) |
| 1314 | 1314 | MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":1", rainbow_floppies, "525qd", rainbow_state::floppy_formats) |
| 1315 | MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":2", rainbow_floppies, "525qd", rainbow_state::floppy_formats) | |
| 1316 | MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":3", rainbow_floppies, "525qd", rainbow_state::floppy_formats) | |
| 1315 | MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":2", rainbow_floppies, "525qd", rainbow_state::floppy_formats) | |
| 1316 | MCFG_FLOPPY_DRIVE_ADD(FD1793_TAG ":3", rainbow_floppies, "525qd", rainbow_state::floppy_formats) | |
| 1317 | 1317 | MCFG_SOFTWARE_LIST_ADD("flop_list","rainbow") |
| 1318 | 1318 | |
| 1319 | 1319 | MCFG_DEVICE_ADD("kbdser", I8251, 0) |
| r31373 | r31374 | |
|---|---|---|
| 1334 | 1334 | // devices |
| 1335 | 1335 | MCFG_CASSETTE_ADD("cassette") |
| 1336 | 1336 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 1337 | ||
| 1337 | ||
| 1338 | 1338 | MCFG_CASSETTE_ADD("cassette2") |
| 1339 | 1339 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 1340 | 1340 |
| r31373 | r31374 | |
|---|---|---|
| 239 | 239 | MCFG_PIC8259_ADD( "pic8259", INPUTLINE(":maincpu", 0), VCC, NULL ) |
| 240 | 240 | |
| 241 | 241 | MCFG_DEVICE_ADD("ppi8255n1", I8255A, 0) |
| 242 | MCFG_I8255_IN_PORTA_CB(READ8(p1_state, p1_ppi_porta_r)) | |
| 242 | MCFG_I8255_IN_PORTA_CB(READ8(p1_state, p1_ppi_porta_r)) /*60H*/ | |
| 243 | 243 | MCFG_I8255_OUT_PORTA_CB(WRITE8(p1_state, p1_ppi_porta_w)) |
| 244 | MCFG_I8255_IN_PORTB_CB(READ8(p1_state, p1_ppi_portb_r)) | |
| 244 | MCFG_I8255_IN_PORTB_CB(READ8(p1_state, p1_ppi_portb_r)) /*69H*/ | |
| 245 | 245 | MCFG_I8255_IN_PORTC_CB(READ8(p1_state, p1_ppi_portc_r)) |
| 246 | MCFG_I8255_OUT_PORTC_CB(WRITE8(p1_state, p1_ppi_portc_w)) | |
| 246 | MCFG_I8255_OUT_PORTC_CB(WRITE8(p1_state, p1_ppi_portc_w)) /*6AH*/ | |
| 247 | 247 | |
| 248 | 248 | MCFG_DEVICE_ADD("ppi8255n2", I8255A, 0) |
| 249 | MCFG_I8255_OUT_PORTA_CB(WRITE8(p1_state, p1_ppi2_porta_w)) /*68H*/ | |
| 250 | MCFG_I8255_OUT_PORTB_CB(WRITE8(p1_state, p1_ppi2_portb_w)) /*61H*/ | |
| 251 | MCFG_I8255_IN_PORTC_CB(READ8(p1_state, p1_ppi2_portc_r)) /*62H*/ | |
| 249 | MCFG_I8255_OUT_PORTA_CB(WRITE8(p1_state, p1_ppi2_porta_w)) /*68H*/ | |
| 250 | MCFG_I8255_OUT_PORTB_CB(WRITE8(p1_state, p1_ppi2_portb_w)) /*61H*/ | |
| 251 | MCFG_I8255_IN_PORTC_CB(READ8(p1_state, p1_ppi2_portc_r)) /*62H*/ | |
| 252 | 252 | |
| 253 | 253 | MCFG_DEVICE_ADD("isa", ISA8, 0) |
| 254 | 254 | MCFG_ISA8_CPU(":maincpu") |
| r31373 | r31374 | |
|---|---|---|
| 705 | 705 | |
| 706 | 706 | MCFG_CASSETTE_ADD( "cassette" ) |
| 707 | 707 | MCFG_CASSETTE_FORMATS(mbee_cassette_formats) |
| 708 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) | |
| 708 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) | |
| 709 | 709 | MACHINE_CONFIG_END |
| 710 | 710 | |
| 711 | 711 | |
| r31373 | r31374 | |
| 763 | 763 | |
| 764 | 764 | MCFG_CASSETTE_ADD( "cassette" ) |
| 765 | 765 | MCFG_CASSETTE_FORMATS(mbee_cassette_formats) |
| 766 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) | |
| 766 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) | |
| 767 | 767 | MACHINE_CONFIG_END |
| 768 | 768 | |
| 769 | 769 | static MACHINE_CONFIG_DERIVED( mbeepc, mbeeic ) |
| r31373 | r31374 | |
|---|---|---|
| 2608 | 2608 | //MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") |
| 2609 | 2609 | MCFG_CASSETTE_ADD("cassette") |
| 2610 | 2610 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 2611 | ||
| 2611 | ||
| 2612 | 2612 | MCFG_SOFTWARE_LIST_ADD("tape_list","pc8801_cass") |
| 2613 | 2613 | |
| 2614 | 2614 | MCFG_DEVICE_ADD(I8251_TAG, I8251, 0) |
| r31373 | r31374 | |
|---|---|---|
| 166 | 166 | * - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte) |
| 167 | 167 | * |
| 168 | 168 | */ |
| 169 | ||
| 169 | /* | |
| 170 | 170 | static LEGACY_FLOPPY_OPTIONS_START(osborne1 ) |
| 171 | 171 | LEGACY_FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 172 | HEADS([1]) | |
| 173 | TRACKS([40]) | |
| 174 | SECTORS([10]) | |
| 175 | SECTOR_LENGTH([256]) | |
| 176 | FIRST_SECTOR_ID([1])) | |
| 172 | HEADS([1]) | |
| 173 | TRACKS([40]) | |
| 174 | SECTORS([10]) | |
| 175 | SECTOR_LENGTH([256]) | |
| 176 | FIRST_SECTOR_ID([1])) | |
| 177 | 177 | LEGACY_FLOPPY_OPTION( odd, "img", "Osborne double density", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 178 | HEADS([1]) | |
| 179 | TRACKS([40]) | |
| 180 | SECTORS([5]) | |
| 181 | SECTOR_LENGTH([1024]) | |
| 182 | FIRST_SECTOR_ID([1])) | |
| 178 | HEADS([1]) | |
| 179 | TRACKS([40]) | |
| 180 | SECTORS([5]) | |
| 181 | SECTOR_LENGTH([1024]) | |
| 182 | FIRST_SECTOR_ID([1])) | |
| 183 | 183 | LEGACY_FLOPPY_OPTION( ibm, "img", "IBM Personal Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 184 | HEADS([1]) | |
| 185 | TRACKS([40]) | |
| 186 | SECTORS([8]) | |
| 187 | SECTOR_LENGTH([512]) | |
| 188 | FIRST_SECTOR_ID([1])) | |
| 184 | HEADS([1]) | |
| 185 | TRACKS([40]) | |
| 186 | SECTORS([8]) | |
| 187 | SECTOR_LENGTH([512]) | |
| 188 | FIRST_SECTOR_ID([1])) | |
| 189 | 189 | LEGACY_FLOPPY_OPTION( xerox, "img", "Xerox 820 Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 190 | HEADS([1]) | |
| 191 | TRACKS([40]) | |
| 192 | SECTORS([18]) | |
| 193 | SECTOR_LENGTH([128]) | |
| 194 | FIRST_SECTOR_ID([1])) | |
| 190 | HEADS([1]) | |
| 191 | TRACKS([40]) | |
| 192 | SECTORS([18]) | |
| 193 | SECTOR_LENGTH([128]) | |
| 194 | FIRST_SECTOR_ID([1])) | |
| 195 | 195 | LEGACY_FLOPPY_OPTION( dec, "img", "DEC 1820 double density", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 196 | HEADS([1]) | |
| 197 | TRACKS([40]) | |
| 198 | SECTORS([9]) | |
| 199 | SECTOR_LENGTH([512]) | |
| 200 | FIRST_SECTOR_ID([1])) | |
| 196 | HEADS([1]) | |
| 197 | TRACKS([40]) | |
| 198 | SECTORS([9]) | |
| 199 | SECTOR_LENGTH([512]) | |
| 200 | FIRST_SECTOR_ID([1])) | |
| 201 | 201 | LEGACY_FLOPPY_OPTIONS_END |
| 202 | 202 | */ |
| 203 | 203 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*************************************************************************** |
| 2 | ||
| 2 | ||
| 3 | 3 | sun3.c: preliminary driver for Sun 3 and Sun 3x models. |
| 4 | ||
| 4 | ||
| 5 | 5 | status: 3/80 POSTs, 3/460 needs its unique RTC chip (also used by non-3x Sun 3s). |
| 6 | ||
| 6 | ||
| 7 | 7 | TODO: |
| 8 | 8 | - Z8530 SCC needs to actually speak serial so we can hook up the mouse and keyboard. |
| 9 | 9 | - Improve interrupt controller emulation. |
| r31373 | r31374 | |
| 13 | 13 | - AM7990 LANCE chip support for everyone. |
| 14 | 14 | - Figure out how the parallel printer port maps to Centronics and make it so. |
| 15 | 15 | - Much more... |
| 16 | ||
| 17 | ||
| 16 | ||
| 17 | ||
| 18 | 18 | Sun-3 Models |
| 19 | 19 | ------------ |
| 20 | 20 | |
| r31373 | r31374 | |
| 218 | 218 | factor. Serial and keyboard ports. External RAM, |
| 219 | 219 | framebuffer, and SCSI/ethernet boards |
| 220 | 220 | available. |
| 221 | ||
| 221 | ||
| 222 | 222 | Sun3X notes from NetBSD and Linux: |
| 223 | 223 | |
| 224 | 224 | RAM_END 0x40000000 |
| r31373 | r31374 | |
| 234 | 234 | IDPROM1 0x61000c00 (3/470) |
| 235 | 235 | MEMREG 0x61001000 |
| 236 | 236 | INTERREG 0x61001400 |
| 237 | SCC1 | |
| 237 | SCC1 0x62000000 (keyboard/mouse) | |
| 238 | 238 | SCC2 0x62002000 (serial console) |
| 239 | 239 | EEPROM 0x64000000 |
| 240 | 240 | IDPROM2 0x640007d8 (3/80) |
| r31373 | r31374 | |
| 261 | 261 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---.---.---+ |
| 262 | 262 | |BT |FPP|DMA| 0 |VID|RES|FPA|DIA| 0 |CCH|IOC|LBK|DCH| UNUSED | |
| 263 | 263 | +---+---+---+---+---+---+---+---+---+---+---+---+---+---.---.---+ |
| 264 | ||
| 264 | ||
| 265 | 265 | Where: DCH = debug mode for system cache |
| 266 | 266 | LBK = VME loopback |
| 267 | 267 | IOC = I/O cache enable |
| r31373 | r31374 | |
| 273 | 273 | DMA = enable system DVMA |
| 274 | 274 | FPP = enable 68881/2 FPU |
| 275 | 275 | BT = 0 for boot state, 1 for normal state |
| 276 | ||
| 276 | ||
| 277 | 277 | bad '030 MMU mapping: L fef82000 -> P 00000000 |
| 278 | ||
| 278 | ||
| 279 | 279 | ****************************************************************************/ |
| 280 | 280 | |
| 281 | 281 | #include "emu.h" |
| r31373 | r31374 | |
| 291 | 291 | #include "formats/mfi_dsk.h" |
| 292 | 292 | |
| 293 | 293 | #define TIMEKEEPER_TAG "timekpr" |
| 294 | #define SCC1_TAG "scc1" | |
| 295 | #define SCC2_TAG "scc2" | |
| 296 | #define ESP_TAG "esp" | |
| 297 | #define FDC_TAG "fdc" | |
| 294 | #define SCC1_TAG "scc1" | |
| 295 | #define SCC2_TAG "scc2" | |
| 296 | #define ESP_TAG "esp" | |
| 297 | #define FDC_TAG "fdc" | |
| 298 | 298 | |
| 299 | 299 | class sun3_state : public driver_device |
| 300 | 300 | { |
| 301 | 301 | public: |
| 302 | 302 | sun3_state(const machine_config &mconfig, device_type type, const char *tag) |
| 303 | | |
| 303 | : driver_device(mconfig, type, tag), | |
| 304 | 304 | m_maincpu(*this, "maincpu"), |
| 305 | 305 | m_scc1(*this, SCC1_TAG), |
| 306 | 306 | m_scc2(*this, SCC2_TAG), |
| r31373 | r31374 | |
| 376 | 376 | AM_RANGE(0x61000800, 0x61000803) AM_READWRITE(diag_r, diag_w) |
| 377 | 377 | AM_RANGE(0x61001000, 0x61001003) AM_READWRITE(memreg_r, memreg_w) |
| 378 | 378 | AM_RANGE(0x61001004, 0x61001007) AM_READWRITE(memrerraddr_r, memrerraddr_w) |
| 379 | AM_RANGE(0x61001400, 0x61001403) AM_READWRITE(irqctrl_r, irqctrl_w) | |
| 379 | AM_RANGE(0x61001400, 0x61001403) AM_READWRITE(irqctrl_r, irqctrl_w) | |
| 380 | 380 | AM_RANGE(0x62000000, 0x6200000f) AM_READWRITE8(scc1_r, scc1_w, 0xff00ff00) |
| 381 | 381 | AM_RANGE(0x62002000, 0x6200200f) AM_READWRITE8(scc2_r, scc2_w, 0xff00ff00) |
| 382 | 382 | AM_RANGE(0x63000000, 0x6301ffff) AM_ROM AM_REGION("user1",0) |
| r31373 | r31374 | |
| 400 | 400 | AM_RANGE(0x61000800, 0x61000803) AM_READWRITE(diag_r, diag_w) |
| 401 | 401 | AM_RANGE(0x61001000, 0x61001003) AM_READWRITE(memreg_r, memreg_w) |
| 402 | 402 | AM_RANGE(0x61001004, 0x61001007) AM_READWRITE(memrerraddr_r, memrerraddr_w) |
| 403 | AM_RANGE(0x61001400, 0x61001403) AM_READWRITE(irqctrl_r, irqctrl_w) | |
| 403 | AM_RANGE(0x61001400, 0x61001403) AM_READWRITE(irqctrl_r, irqctrl_w) | |
| 404 | 404 | AM_RANGE(0x62000000, 0x6200000f) AM_READWRITE8(scc1_r, scc1_w, 0xff00ff00) |
| 405 | 405 | AM_RANGE(0x62002000, 0x6200200f) AM_READWRITE8(scc2_r, scc2_w, 0xff00ff00) |
| 406 | 406 | AM_RANGE(0x63000000, 0x6301ffff) AM_ROM AM_REGION("user1",0) |
| r31373 | r31374 | |
| 411 | 411 | |
| 412 | 412 | READ32_MEMBER( sun3_state::p4id_r ) |
| 413 | 413 | { |
| 414 | return (1<<24); | |
| 414 | return (1<<24); // 0 = hires bw2 1600x1280, 1 = bw2 1152x900, 0x45 is "Ibis" color, blt 0x68 is "Lego" color | |
| 415 | 415 | } |
| 416 | 416 | |
| 417 | 417 | WRITE32_MEMBER( sun3_state::fdc_control_w ) |
| r31373 | r31374 | |
| 491 | 491 | m_memreg &= ~0x0c; |
| 492 | 492 | break; |
| 493 | 493 | |
| 494 | case 0xffffffff: | |
| 494 | case 0xffffffff: // no address adjust, show all 4 lanes as problematic | |
| 495 | 495 | break; |
| 496 | 496 | } |
| 497 | 497 | |
| 498 | m_bInBusErr = true; | |
| 498 | m_bInBusErr = true; // prevent recursion | |
| 499 | 499 | m_maincpu->set_input_line_and_vector(M68K_IRQ_7, ASSERT_LINE, 2); |
| 500 | 500 | } |
| 501 | 501 | |
| r31373 | r31374 | |
| 535 | 535 | |
| 536 | 536 | WRITE32_MEMBER(sun3_state::enable_w) |
| 537 | 537 | { |
| 538 | // | |
| 538 | // printf("sun3x: %08x to enable (mask %08x)\n", data, mem_mask); | |
| 539 | 539 | COMBINE_DATA(&m_enable); |
| 540 | 540 | } |
| 541 | 541 | |
| r31373 | r31374 | |
| 548 | 548 | |
| 549 | 549 | WRITE32_MEMBER(sun3_state::buserr_w) |
| 550 | 550 | { |
| 551 | // | |
| 551 | // printf("sun3x: %08x to buserr (mask %08x)\n", data, mem_mask); | |
| 552 | 552 | COMBINE_DATA(&m_buserr); |
| 553 | 553 | } |
| 554 | 554 | |
| r31373 | r31374 | |
| 559 | 559 | |
| 560 | 560 | WRITE32_MEMBER(sun3_state::diag_w) |
| 561 | 561 | { |
| 562 | // | |
| 562 | // printf("sun3x: %08x to diag (mask %08x)\n", data, mem_mask); | |
| 563 | 563 | COMBINE_DATA(&m_diag); |
| 564 | 564 | } |
| 565 | 565 | |
| r31373 | r31374 | |
| 570 | 570 | |
| 571 | 571 | WRITE32_MEMBER(sun3_state::printer_w) |
| 572 | 572 | { |
| 573 | // | |
| 573 | // printf("sun3x: %08x to printer (mask %08x)\n", data, mem_mask); | |
| 574 | 574 | COMBINE_DATA(&m_printer); |
| 575 | 575 | } |
| 576 | 576 | |
| r31373 | r31374 | |
| 581 | 581 | |
| 582 | 582 | WRITE32_MEMBER(sun3_state::irqctrl_w) |
| 583 | 583 | { |
| 584 | // | |
| 584 | // printf("sun3x: %08x to interrupt control (mask %08x)\n", data, mem_mask); | |
| 585 | 585 | COMBINE_DATA(&m_irqctrl); |
| 586 | 586 | |
| 587 | 587 | if (data & 0x01000000) |
| r31373 | r31374 | |
| 603 | 603 | m_maincpu->set_input_line(M68K_IRQ_7, CLEAR_LINE); |
| 604 | 604 | } |
| 605 | 605 | } |
| 606 | else | |
| 606 | else // master enable clear, clear all interrupts | |
| 607 | 607 | { |
| 608 | 608 | m_maincpu->set_input_line(M68K_IRQ_1, CLEAR_LINE); |
| 609 | 609 | m_maincpu->set_input_line(M68K_IRQ_2, CLEAR_LINE); |
| r31373 | r31374 | |
| 622 | 622 | |
| 623 | 623 | WRITE32_MEMBER(sun3_state::memreg_w) |
| 624 | 624 | { |
| 625 | // | |
| 625 | // printf("sun3x: %08x to memory control (mask %08x)\n", data, mem_mask); | |
| 626 | 626 | COMBINE_DATA(&m_memreg); |
| 627 | 627 | } |
| 628 | 628 | |
| r31373 | r31374 | |
| 635 | 635 | |
| 636 | 636 | WRITE32_MEMBER(sun3_state::memrerraddr_w) |
| 637 | 637 | { |
| 638 | // | |
| 638 | // printf("sun3x: %08x to memory error address (mask %08x)\n", data, mem_mask); | |
| 639 | 639 | COMBINE_DATA(&m_memerraddr); |
| 640 | 640 | } |
| 641 | 641 | |
| r31373 | r31374 | |
| 941 | 941 | |
| 942 | 942 | // default NVRAM: includes valid settings for console on framebuffer, boot from SCSI disk, Ethernet ID, more |
| 943 | 943 | ROM_REGION( 0x800, TIMEKEEPER_TAG, 0 ) |
| 944 | ROM_LOAD( "timekpr_380.bin", 0x000000, 0x000800, CRC(e76f1aae) SHA1(8e7c36e3928887a94a8133e8416ee4126c31edd7) ) | |
| 944 | ROM_LOAD( "timekpr_380.bin", 0x000000, 0x000800, CRC(e76f1aae) SHA1(8e7c36e3928887a94a8133e8416ee4126c31edd7) ) | |
| 945 | 945 | ROM_END |
| 946 | 946 | |
| 947 | 947 | ROM_START( sun3_460 ) |
| r31373 | r31374 | |
|---|---|---|
| 437 | 437 | * - DEC 1820 double density: 40 tracks, 9 sectors per track, 512-byte sectors (180 KByte) |
| 438 | 438 | * |
| 439 | 439 | */ |
| 440 | ||
| 440 | /* | |
| 441 | 441 | static LEGACY_FLOPPY_OPTIONS_START(osbexec ) |
| 442 | 442 | LEGACY_FLOPPY_OPTION( osd, "img", "Osborne single density", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 443 | HEADS([1]) | |
| 444 | TRACKS([40]) | |
| 445 | SECTORS([10]) | |
| 446 | SECTOR_LENGTH([256]) | |
| 447 | FIRST_SECTOR_ID([1])) | |
| 443 | HEADS([1]) | |
| 444 | TRACKS([40]) | |
| 445 | SECTORS([10]) | |
| 446 | SECTOR_LENGTH([256]) | |
| 447 | FIRST_SECTOR_ID([1])) | |
| 448 | 448 | LEGACY_FLOPPY_OPTION( odd, "img", "Osborne double density", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 449 | HEADS([1]) | |
| 450 | TRACKS([40]) | |
| 451 | SECTORS([5]) | |
| 452 | SECTOR_LENGTH([1024]) | |
| 453 | FIRST_SECTOR_ID([1])) | |
| 449 | HEADS([1]) | |
| 450 | TRACKS([40]) | |
| 451 | SECTORS([5]) | |
| 452 | SECTOR_LENGTH([1024]) | |
| 453 | FIRST_SECTOR_ID([1])) | |
| 454 | 454 | LEGACY_FLOPPY_OPTION( ibm, "img", "IBM Personal Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 455 | HEADS([1]) | |
| 456 | TRACKS([40]) | |
| 457 | SECTORS([8]) | |
| 458 | SECTOR_LENGTH([512]) | |
| 459 | FIRST_SECTOR_ID([1])) | |
| 455 | HEADS([1]) | |
| 456 | TRACKS([40]) | |
| 457 | SECTORS([8]) | |
| 458 | SECTOR_LENGTH([512]) | |
| 459 | FIRST_SECTOR_ID([1])) | |
| 460 | 460 | LEGACY_FLOPPY_OPTION( xerox, "img", "Xerox 820 Computer", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 461 | HEADS([1]) | |
| 462 | TRACKS([40]) | |
| 463 | SECTORS([18]) | |
| 464 | SECTOR_LENGTH([128]) | |
| 465 | FIRST_SECTOR_ID([1])) | |
| 461 | HEADS([1]) | |
| 462 | TRACKS([40]) | |
| 463 | SECTORS([18]) | |
| 464 | SECTOR_LENGTH([128]) | |
| 465 | FIRST_SECTOR_ID([1])) | |
| 466 | 466 | LEGACY_FLOPPY_OPTION( dec, "img", "DEC 1820 double density", basicdsk_identify_default, basicdsk_construct_default, NULL, |
| 467 | HEADS([1]) | |
| 468 | TRACKS([40]) | |
| 469 | SECTORS([9]) | |
| 470 | SECTOR_LENGTH([512]) | |
| 471 | FIRST_SECTOR_ID([1])) | |
| 467 | HEADS([1]) | |
| 468 | TRACKS([40]) | |
| 469 | SECTORS([9]) | |
| 470 | SECTOR_LENGTH([512]) | |
| 471 | FIRST_SECTOR_ID([1])) | |
| 472 | 472 | LEGACY_FLOPPY_OPTIONS_END |
| 473 | 473 | */ |
| 474 | 474 |
| r31373 | r31374 | |
|---|---|---|
| 269 | 269 | |
| 270 | 270 | MCFG_CASSETTE_ADD("cassette") |
| 271 | 271 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED ) |
| 272 | ||
| 272 | ||
| 273 | 273 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 274 | 274 | MCFG_SOUND_WAVE_ADD(WAVE_TAG, "cassette") |
| 275 | 275 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| r31373 | r31374 | |
|---|---|---|
| 340 | 340 | MCFG_CASSETTE_ADD( "cassette" ) |
| 341 | 341 | MCFG_CASSETTE_FORMATS(kim1_cassette_formats) |
| 342 | 342 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) |
| 343 | ||
| 343 | ||
| 344 | 344 | MCFG_TIMER_DRIVER_ADD_PERIODIC("led_timer", kim1_state, kim1_update_leds, attotime::from_hz(60)) |
| 345 | 345 | MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", kim1_state, kim1_cassette_input, attotime::from_hz(44100)) |
| 346 | 346 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 403 | 403 | MCFG_GFXDECODE_MODIFY("gfxdecode", zx81) |
| 404 | 404 | |
| 405 | 405 | MCFG_CASSETTE_MODIFY( "cassette" ) |
| 406 | MCFG_CASSETTE_FORMATS(zx81_p_format) | |
| 406 | MCFG_CASSETTE_FORMATS(zx81_p_format) | |
| 407 | 407 | MACHINE_CONFIG_END |
| 408 | 408 | |
| 409 | 409 | static MACHINE_CONFIG_DERIVED( ts1000, zx81 ) |
| r31373 | r31374 | |
|---|---|---|
| 266 | 266 | MCFG_CASSETTE_FORMATS(rka_cassette_formats) |
| 267 | 267 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 268 | 268 | MCFG_CASSETTE_INTERFACE("apogee_cass") |
| 269 | ||
| 269 | ||
| 270 | 270 | MCFG_SOFTWARE_LIST_ADD("cass_list","apogee") |
| 271 | 271 | MACHINE_CONFIG_END |
| 272 | 272 |
| r31373 | r31374 | |
|---|---|---|
| 134 | 134 | INPUT_PORTS_END |
| 135 | 135 | /* |
| 136 | 136 | static LEGACY_FLOPPY_OPTIONS_START(ms0515) |
| 137 | LEGACY_FLOPPY_OPTION(ms0515, "dsk", "MS0515 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, | |
| 138 | HEADS([1]) | |
| 139 | TRACKS([80]) | |
| 140 | SECTORS([10]) | |
| 141 | SECTOR_LENGTH([512]) | |
| 142 | FIRST_SECTOR_ID([0])) | |
| 137 | LEGACY_FLOPPY_OPTION(ms0515, "dsk", "MS0515 disk image", basicdsk_identify_default, basicdsk_construct_default, NULL, | |
| 138 | HEADS([1]) | |
| 139 | TRACKS([80]) | |
| 140 | SECTORS([10]) | |
| 141 | SECTOR_LENGTH([512]) | |
| 142 | FIRST_SECTOR_ID([0])) | |
| 143 | 143 | LEGACY_FLOPPY_OPTIONS_END |
| 144 | 144 | */ |
| 145 | 145 |
| r31373 | r31374 | |
|---|---|---|
| 547 | 547 | /* Devices */ |
| 548 | 548 | MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz) |
| 549 | 549 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 550 | MCFG_MC6845_CHAR_WIDTH(8) | |
| 550 | MCFG_MC6845_CHAR_WIDTH(8) /* ? */ | |
| 551 | 551 | MCFG_MC6845_UPDATE_ROW_CB(pyl601_state, pyl601_update_row) |
| 552 | 552 | |
| 553 | 553 | MCFG_UPD765A_ADD("upd765", true, true) |
| r31373 | r31374 | |
| 569 | 569 | MCFG_DEVICE_REMOVE("crtc") |
| 570 | 570 | MCFG_MC6845_ADD("crtc", MC6845, "screen", XTAL_2MHz) |
| 571 | 571 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 572 | MCFG_MC6845_CHAR_WIDTH(8) | |
| 572 | MCFG_MC6845_CHAR_WIDTH(8) /* ? */ | |
| 573 | 573 | MCFG_MC6845_UPDATE_ROW_CB(pyl601_state, pyl601a_update_row) |
| 574 | 574 | MACHINE_CONFIG_END |
| 575 | 575 |
| r31373 | r31374 | |
|---|---|---|
| 434 | 434 | { |
| 435 | 435 | // write to disk |
| 436 | 436 | m_fdc->data_w(m_ram->read(m_dma_current_addr)); |
| 437 | // | |
| 437 | // logerror("DMA: read from RAM %05x\n",m_dma_current_addr); | |
| 438 | 438 | } |
| 439 | 439 | else |
| 440 | 440 | { |
| 441 | 441 | // read from disk |
| 442 | 442 | m_ram->write(m_dma_current_addr,m_fdc->data_r()); |
| 443 | // | |
| 443 | // logerror("DMA: write to RAM %05x\n",m_dma_current_addr); | |
| 444 | 444 | } |
| 445 | 445 | m_dma_current_addr++; |
| 446 | 446 | } |
| r31373 | r31374 | |
| 621 | 621 | /* CPU board U4: gimixf8.bin - checksum 68DB - 2716 - GMXBUG09 V2.1 | (c)1981 GIMIX | $F800 I2716 */ |
| 622 | 622 | ROM_LOAD( "gimixf8.u4", 0x000000, 0x000800, CRC(7d60f838) SHA1(eb7546e8bbf50d33e181f3e86c3e4c5c9032cab2) ) |
| 623 | 623 | /* CPU board U5: gimixv14.bin - checksum 97E2 - 2716 - GIMIX 6809 | AUTOBOOT | V1.4 I2716 */ |
| 624 | ||
| 624 | ROM_LOAD( "gimixv14.u5", 0x000800, 0x000800, CRC(f795b8b9) SHA1(eda2de51cc298d94b36605437d900ce971b3b276) ) | |
| 625 | 625 | /* CPU board U6: os9l1v11.bin - checksum 2C84 - 2716 - OS-9tmL1 V1 | GIMIX P1 " (c)1982 MSC |
| 626 | 626 | CPU board U7: os9l1v12.bin - checksum 7694 - 2716 - OS-9tmL1 V1 | GIMIX P2-68 | (c)1982 MSC */ |
| 627 | ROM_LOAD( "os9l1v11.u6", 0x001000, 0x000800, CRC(0d6527a0) SHA1(1435a22581c6e9e0ae338071a72eed646f429530) ) | |
| 628 | ROM_LOAD( "os9l1v12.u7", 0x001800, 0x000800, CRC(b3c65feb) SHA1(19d1ea1e84473b25c95cbb8449e6b9828567e998) ) | |
| 627 | ROM_LOAD( "os9l1v11.u6", 0x001000, 0x000800, CRC(0d6527a0) SHA1(1435a22581c6e9e0ae338071a72eed646f429530) ) | |
| 628 | ROM_LOAD( "os9l1v12.u7", 0x001800, 0x000800, CRC(b3c65feb) SHA1(19d1ea1e84473b25c95cbb8449e6b9828567e998) ) | |
| 629 | 629 | |
| 630 | 630 | /* Hard drive controller board 2 (XEBEC board) 11H: gimixhd.bin - checksum 2436 - 2732 - 104521D */ |
| 631 | ROM_REGION( 0x10000, "xebec", 0) | |
| 632 | ROM_LOAD( "gimixhd.h11", 0x000000, 0x001000, CRC(35c12201) SHA1(51ac9052f9757d79c7f5bd3aa5d8421e98cfcc37) ) | |
| 631 | ROM_REGION( 0x10000, "xebec", 0) | |
| 632 | ROM_LOAD( "gimixhd.h11", 0x000000, 0x001000, CRC(35c12201) SHA1(51ac9052f9757d79c7f5bd3aa5d8421e98cfcc37) ) | |
| 633 | 633 | ROM_END |
| 634 | 634 | |
| 635 | 635 | COMP( 1980, gimix, 0, 0, gimix, gimix, driver_device, 0, "Gimix", "Gimix 6809 System", GAME_IS_SKELETON | GAME_NOT_WORKING | GAME_NO_SOUND ) |
| r31373 | r31374 | |
|---|---|---|
| 199 | 199 | MCFG_CPU_PROGRAM_MAP(isbc86_mem) |
| 200 | 200 | MCFG_CPU_IO_MAP(isbc_io) |
| 201 | 201 | MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic_0", pic8259_device, inta_cb) |
| 202 | ||
| 202 | ||
| 203 | 203 | MCFG_PIC8259_ADD("pic_0", INPUTLINE(":maincpu", 0), VCC, NULL) |
| 204 | 204 | |
| 205 | 205 | MCFG_DEVICE_ADD("pit", PIT8253, 0) |
| r31373 | r31374 | |
| 231 | 231 | MCFG_CPU_PROGRAM_MAP(rpc86_mem) |
| 232 | 232 | MCFG_CPU_IO_MAP(rpc86_io) |
| 233 | 233 | MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic_0", pic8259_device, inta_cb) |
| 234 | ||
| 234 | ||
| 235 | 235 | MCFG_PIC8259_ADD("pic_0", INPUTLINE(":maincpu", 0), VCC, NULL) |
| 236 | 236 | |
| 237 | 237 | MCFG_DEVICE_ADD("pit", PIT8253, 0) |
| r31373 | r31374 | |
| 266 | 266 | MCFG_CPU_PROGRAM_MAP(isbc286_mem) |
| 267 | 267 | MCFG_CPU_IO_MAP(isbc286_io) |
| 268 | 268 | MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pic_0", pic8259_device, inta_cb) |
| 269 | ||
| 269 | ||
| 270 | 270 | MCFG_PIC8259_ADD("pic_0", INPUTLINE(":maincpu", 0), VCC, READ8(isbc_state, get_slave_ack)) |
| 271 | 271 | MCFG_PIC8259_ADD("pic_1", DEVWRITELINE("pic_0", pic8259_device, ir7_w), GND, NULL) |
| 272 | 272 |
| r31373 | r31374 | |
|---|---|---|
| 140 | 140 | |
| 141 | 141 | void mbc200_state::machine_start() |
| 142 | 142 | { |
| 143 | // floppy_image_device *floppy = NULL; | |
| 144 | // floppy = m_floppy0->get_device(); | |
| 143 | // floppy_image_device *floppy = NULL; | |
| 144 | // floppy = m_floppy0->get_device(); | |
| 145 | 145 | // floppy1 not supported currently |
| 146 | // | |
| 146 | // m_fdc->set_floppy(floppy); | |
| 147 | 147 | |
| 148 | // if (floppy) | |
| 149 | // floppy->mon_w(0); | |
| 148 | // if (floppy) | |
| 149 | // floppy->mon_w(0); | |
| 150 | 150 | |
| 151 | 151 | m_floppy0->floppy_mon_w(0); |
| 152 | 152 | m_floppy1->floppy_mon_w(0); |
| r31373 | r31374 | |
| 169 | 169 | }; |
| 170 | 170 | |
| 171 | 171 | //static SLOT_INTERFACE_START( mbc200_floppies ) |
| 172 | // | |
| 172 | // SLOT_INTERFACE( "525dd", FLOPPY_525_SSDD ) | |
| 173 | 173 | //SLOT_INTERFACE_END |
| 174 | 174 | |
| 175 | 175 | MC6845_UPDATE_ROW( mbc200_state::update_row ) |
| r31373 | r31374 | |
|---|---|---|
| 776 | 776 | MCFG_PIC8259_ADD("pic8259_master", INPUTLINE("maincpu", 0), VCC, READ8(qx10_state, get_slave_ack)) |
| 777 | 777 | MCFG_PIC8259_ADD("pic8259_slave", DEVWRITELINE("pic8259_master", pic8259_device, ir7_w), GND, NULL) |
| 778 | 778 | |
| 779 | MCFG_UPD7201_ADD("upd7201", MAIN_CLK/4, 0, 0, 0, 0) | |
| 779 | MCFG_UPD7201_ADD("upd7201", MAIN_CLK/4, 0, 0, 0, 0) // channel b clock set by pit2 channel 2 | |
| 780 | 780 | // Channel A: Keyboard |
| 781 | 781 | MCFG_Z80DART_OUT_TXDA_CB(DEVWRITELINE("kbd", rs232_port_device, write_txd)) |
| 782 | 782 | // Channel B: RS232 |
| r31373 | r31374 | |
|---|---|---|
| 750 | 750 | MCFG_CASSETTE_ADD( "cassette" ) |
| 751 | 751 | MCFG_CASSETTE_FORMATS(sol20_cassette_formats) |
| 752 | 752 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 753 | ||
| 753 | ||
| 754 | 754 | MCFG_CASSETTE_ADD( "cassette2" ) |
| 755 | 755 | MCFG_CASSETTE_FORMATS(sol20_cassette_formats) |
| 756 | 756 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 757 | ||
| 757 | ||
| 758 | 758 | MCFG_DEVICE_ADD( "uart", AY31015, 0 ) |
| 759 | 759 | MCFG_AY31015_TX_CLOCK(4800.0) |
| 760 | 760 | MCFG_AY31015_RX_CLOCK(4800.0) |
| r31373 | r31374 | |
|---|---|---|
| 454 | 454 | static MACHINE_CONFIG_DERIVED( vt102, vt100 ) |
| 455 | 455 | MCFG_CPU_REPLACE("maincpu",I8085A, XTAL_24_8832MHz / 9) |
| 456 | 456 | MCFG_CPU_PROGRAM_MAP(vt100_mem) |
| 457 | MCFG_CPU_IO_MAP(vt100_io) | |
| 457 | MCFG_CPU_IO_MAP(vt100_io) | |
| 458 | 458 | MCFG_CPU_VBLANK_INT_DRIVER("screen", vt100_state, vt100_vertical_interrupt) |
| 459 | 459 | MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(vt100_state,vt100_irq_callback) |
| 460 | 460 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 367 | 367 | MCFG_CASSETTE_FORMATS(mz700_cassette_formats) |
| 368 | 368 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 369 | 369 | MCFG_CASSETTE_INTERFACE("mz_cass") |
| 370 | ||
| 370 | ||
| 371 | 371 | MCFG_SOFTWARE_LIST_ADD("cass_list","mz700_cass") |
| 372 | 372 | |
| 373 | 373 | /* internal ram */ |
| r31373 | r31374 | |
|---|---|---|
| 322 | 322 | /* devices */ |
| 323 | 323 | MCFG_DEVICE_ADD("dma", Z80DMA, XTAL_24MHz/6) |
| 324 | 324 | // busack on cpu connects to bai pin |
| 325 | MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(zorba_state, busreq_w)) //connects to busreq on cpu | |
| 326 | MCFG_Z80DMA_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) // connects to IRQ0 on cpu | |
| 325 | MCFG_Z80DMA_OUT_BUSREQ_CB(WRITELINE(zorba_state, busreq_w)) //connects to busreq on cpu | |
| 326 | MCFG_Z80DMA_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) // connects to IRQ0 on cpu | |
| 327 | 327 | //ba0 - not connected |
| 328 | 328 | MCFG_Z80DMA_IN_MREQ_CB(READ8(zorba_state, memory_read_byte)) |
| 329 | 329 | MCFG_Z80DMA_OUT_MREQ_CB(WRITE8(zorba_state, memory_write_byte)) |
| r31373 | r31374 | |
|---|---|---|
| 2 | 2 | // copyright-holders: Felipe Sanches |
| 3 | 3 | /*************************************************************************** |
| 4 | 4 | |
| 5 | Ultratec Minicom IV | |
| 6 | http://www.ultratec.com/ttys/non-printing/minicom.php | |
| 5 | Ultratec Minicom IV | |
| 6 | http://www.ultratec.com/ttys/non-printing/minicom.php | |
| 7 | 7 | |
| 8 | 8 | Driver by Felipe Sanches |
| 9 | 9 | |
| r31373 | r31374 | |
| 26 | 26 | toggling T0 and then the other half of data is written to P0 again but toggling T1 afterwards. |
| 27 | 27 | |
| 28 | 28 | Changelog: |
| 29 | ||
| 29 | ||
| 30 | 30 | 2014 JUL 19 [Felipe Sanches]: |
| 31 | 31 | * Got the display working except for a few glitches |
| 32 | 32 | |
| r31373 | r31374 | |
| 71 | 71 | memset(m_p, 0, 4); |
| 72 | 72 | m_digit_index = 0; |
| 73 | 73 | m_display_data = 0; |
| 74 | ||
| 74 | ||
| 75 | 75 | // register for savestates |
| 76 | 76 | save_item(NAME(m_p)); |
| 77 | 77 | save_item(NAME(m_digit_index)); |
| r31373 | r31374 | |
| 89 | 89 | |
| 90 | 90 | READ8_MEMBER(minicom_state::minicom_io_r) |
| 91 | 91 | { |
| 92 | switch (offset) | |
| 93 | { | |
| 92 | switch (offset) | |
| 93 | { | |
| 94 | 94 | case 1: |
| 95 | 95 | //P1.3 seems to be an indicator of whether or not we have a printer device attached. |
| 96 | 96 | // at address 0xABF the code checks this flag in order to decide which string to display: |
| 97 | 97 | // "MINIPRINT IS RESET" or "MINICOM IS RESET" |
| 98 | 98 | return PRINTER_ATTACHED << 3; |
| 99 | case 2: | |
| 100 | // return 0; //para a palestra no Garoa... :-) | |
| 99 | case 2: | |
| 100 | // return 0; //para a palestra no Garoa... :-) | |
| 101 | 101 | return 1; //to skip the "NO POWER" warning. I'm not sure why. |
| 102 | 102 | default: |
| 103 | 103 | #if LOG_IO_PORTS |
| r31373 | r31374 | |
| 122 | 122 | #define P3_UNKNOWN_BITS (0xFF & ~((1 << 4)|(1 << 5))) |
| 123 | 123 | WRITE8_MEMBER(minicom_state::minicom_io_w) |
| 124 | 124 | { |
| 125 | switch (offset) | |
| 126 | { | |
| 127 | case 0x00: | |
| 128 | { | |
| 129 | m_p[offset]=data; | |
| 130 | break; | |
| 131 | } | |
| 132 | case 0x01: | |
| 133 | { | |
| 134 | if (data != m_p[offset]) | |
| 135 | { | |
| 125 | switch (offset) | |
| 126 | { | |
| 127 | case 0x00: | |
| 128 | { | |
| 129 | m_p[offset]=data; | |
| 130 | break; | |
| 131 | } | |
| 132 | case 0x01: | |
| 133 | { | |
| 134 | if (data != m_p[offset]) | |
| 135 | { | |
| 136 | 136 | #if LOG_IO_PORTS |
| 137 | 137 | UINT8 changed = m_p[offset] ^ data; |
| 138 | 138 | if (changed ^ P1_UNKNOWN_BITS) |
| 139 | 139 | { |
| 140 | | |
| 140 | printf("Write to P1: %02X changed: ( ) (", data); | |
| 141 | 141 | printbits(changed); |
| 142 | 142 | printf(") ( ) ( )\n"); |
| 143 | 143 | } |
| r31373 | r31374 | |
| 147 | 147 | m_digit_index--; |
| 148 | 148 | if (m_digit_index<0) m_digit_index = 19; |
| 149 | 149 | } |
| 150 | m_p[offset]=data; | |
| 151 | } | |
| 152 | break; | |
| 153 | } | |
| 154 | case 0x02: | |
| 155 | { | |
| 156 | if (data != m_p[offset]) | |
| 157 | { | |
| 150 | m_p[offset]=data; | |
| 151 | } | |
| 152 | break; | |
| 153 | } | |
| 154 | case 0x02: | |
| 155 | { | |
| 156 | if (data != m_p[offset]) | |
| 157 | { | |
| 158 | 158 | #if LOG_IO_PORTS |
| 159 | 159 | UINT8 changed = m_p[offset] ^ data; |
| 160 | 160 | if (changed ^ P2_UNKNOWN_BITS) |
| 161 | 161 | { |
| 162 | | |
| 162 | printf("Write to P2: %02X changed: ( ) ( ) (", data); | |
| 163 | 163 | printbits(changed); |
| 164 | 164 | printf(") ( )\n"); |
| 165 | 165 | } |
| 166 | 166 | #endif |
| 167 | m_p[offset]=data; | |
| 168 | } | |
| 169 | break; | |
| 170 | } | |
| 171 | case 0x03: | |
| 172 | { | |
| 173 | if (data != m_p[offset]) | |
| 174 | { | |
| 167 | m_p[offset]=data; | |
| 168 | } | |
| 169 | break; | |
| 170 | } | |
| 171 | case 0x03: | |
| 172 | { | |
| 173 | if (data != m_p[offset]) | |
| 174 | { | |
| 175 | 175 | UINT8 changed = m_p[offset] ^ data; |
| 176 | 176 | #if LOG_IO_PORTS |
| 177 | 177 | if (changed ^ P3_UNKNOWN_BITS) |
| 178 | 178 | { |
| 179 | | |
| 179 | printf("Write to P3: %02X changed: ( ) ( ) ( ) (", data); | |
| 180 | 180 | printbits(changed); |
| 181 | 181 | printf(")\n"); |
| 182 | 182 | } |
| r31373 | r31374 | |
| 198 | 198 | { |
| 199 | 199 | output_set_digit_value(m_digit_index, BITSWAP16(m_display_data, 9, 1, 3, 11, 12, 4, 2, 10, 14, 6, 7, 5, 0, 15, 13, 8) & 0x3FFF); |
| 200 | 200 | } |
| 201 | m_p[offset]=data; | |
| 202 | } | |
| 203 | break; | |
| 204 | } | |
| 205 | } | |
| 201 | m_p[offset]=data; | |
| 202 | } | |
| 203 | break; | |
| 204 | } | |
| 205 | } | |
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | DRIVER_INIT_MEMBER( minicom_state, minicom ) |
| r31373 | r31374 | |
| 216 | 216 | |
| 217 | 217 | /* video hardware */ |
| 218 | 218 | /* fluorescent 14-segment display forming a row of 20 characters */ |
| 219 | MCFG_DEFAULT_LAYOUT(layout_minicom) | |
| 219 | MCFG_DEFAULT_LAYOUT(layout_minicom) | |
| 220 | 220 | |
| 221 | 221 | /* TODO: Map the keyboard rows/cols inputs (43-key, 4-row keyboard) */ |
| 222 | 222 | |
| r31373 | r31374 | |
| 230 | 230 | |
| 231 | 231 | /* YEAR NAME PARENT COMPAT MACHINE INPUT CLASS INIT COMPANY FULLNAME FLAGS */ |
| 232 | 232 | COMP( 1997, minicom, 0, 0, minicom, 0, minicom_state, minicom, "Ultratec", "Minicom IV", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND) /* fw release data: 11th Aug 1997 */ |
| 233 | //COMP( 2002, minicom, 0, 0, minicom, 0, minicom_state, minicom, "Ultratec", "Minicom IV", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND) /* fw release data: 19th Apr 2002 - Seen at a subway station in S | |
| 233 | //COMP( 2002, minicom, 0, 0, minicom, 0, minicom_state, minicom, "Ultratec", "Minicom IV", GAME_NOT_WORKING | GAME_IMPERFECT_GRAPHICS | GAME_NO_SOUND) /* fw release data: 19th Apr 2002 - Seen at a subway station in S??o Paulo, Brazil (Metr?? Trianon MASP) */ |
| r31373 | r31374 | |
|---|---|---|
| 1019 | 1019 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 1020 | 1020 | |
| 1021 | 1021 | /* slot devices */ |
| 1022 | MCFG_DEVICE_ADD("bml3bus", BML3BUS, 0) | |
| 1022 | MCFG_DEVICE_ADD("bml3bus", BML3BUS, 0) | |
| 1023 | 1023 | MCFG_BML3BUS_CPU("maincpu") |
| 1024 | 1024 | MCFG_BML3BUS_OUT_NMI_CB(WRITELINE(bml3_state, bml3bus_nmi_w)) |
| 1025 | 1025 | MCFG_BML3BUS_OUT_IRQ_CB(WRITELINE(bml3_state, bml3bus_irq_w)) |
| r31373 | r31374 | |
|---|---|---|
| 2749 | 2749 | MCFG_UPD71071_DMA_READ_1_CB(READ16(towns_state, towns_scsi_dma_r)) |
| 2750 | 2750 | MCFG_UPD71071_DMA_READ_3_CB(READ16(towns_state, towns_cdrom_dma_r)) |
| 2751 | 2751 | MCFG_UPD71071_DMA_WRITE_0_CB(WRITE16(towns_state, towns_fdc_dma_w)) |
| 2752 | MCFG_UPD71071_DMA_WRITE_1_CB(WRITE16(towns_state, towns_scsi_dma_w)) | |
| 2752 | MCFG_UPD71071_DMA_WRITE_1_CB(WRITE16(towns_state, towns_scsi_dma_w)) | |
| 2753 | 2753 | MCFG_DEVICE_ADD("dma_2", UPD71071, 0) |
| 2754 | 2754 | MCFG_UPD71071_CPU("maincpu") |
| 2755 | 2755 | MCFG_UPD71071_CLOCK(4000000) |
| r31373 | r31374 | |
| 2757 | 2757 | MCFG_UPD71071_DMA_READ_1_CB(READ16(towns_state, towns_scsi_dma_r)) |
| 2758 | 2758 | MCFG_UPD71071_DMA_READ_3_CB(READ16(towns_state, towns_cdrom_dma_r)) |
| 2759 | 2759 | MCFG_UPD71071_DMA_WRITE_0_CB(WRITE16(towns_state, towns_fdc_dma_w)) |
| 2760 | MCFG_UPD71071_DMA_WRITE_1_CB(WRITE16(towns_state, towns_scsi_dma_w)) | |
| 2760 | MCFG_UPD71071_DMA_WRITE_1_CB(WRITE16(towns_state, towns_scsi_dma_w)) | |
| 2761 | 2761 | |
| 2762 | 2762 | //MCFG_VIDEO_START_OVERRIDE(towns_state,towns) |
| 2763 | 2763 |
| r31373 | r31374 | |
|---|---|---|
| 281 | 281 | MCFG_AY31015_RX_CLOCK(( XTAL_16MHz / 16 ) / 256) |
| 282 | 282 | MCFG_AY51013_READ_SI_CB(READ8(nascom1_state, nascom1_hd6402_si)) |
| 283 | 283 | MCFG_AY51013_WRITE_SO_CB(WRITE8(nascom1_state, nascom1_hd6402_so)) |
| 284 | ||
| 284 | ||
| 285 | 285 | MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL_16MHz/8) |
| 286 | 286 | |
| 287 | 287 | /* devices */ |
| r31373 | r31374 | |
|---|---|---|
| 449 | 449 | /* devices */ |
| 450 | 450 | MCFG_CASSETTE_ADD("cassette") |
| 451 | 451 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 452 | ||
| 452 | ||
| 453 | 453 | MCFG_CENTRONICS_ADD(CENTRONICS_TAG, centronics_printers, "printer") |
| 454 | 454 | MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(mc1000_state, write_centronics_busy)) |
| 455 | 455 |
| r31373 | r31374 | |
|---|---|---|
| 15 | 15 | * new derivative "CARD II PCB rev.6" |
| 16 | 16 | * fixed LCD rendering (now both lines are displayed properly) |
| 17 | 17 | * inverted logic of the inputs so that now we can navigate the menu |
| 18 | ||
| 18 | ||
| 19 | 19 | 2014 JAN 03 [Felipe Sanches]: |
| 20 | 20 | * Initial driver skeleton |
| 21 | 21 | * Address lines bitswaping |
| r31373 | r31374 | |
| 126 | 126 | AM_RANGE(0xc020,0xc020) AM_MIRROR(0x13cf) AM_DEVREAD("hd44780", hd44780_device, control_read) |
| 127 | 127 | AM_RANGE(0xc030,0xc030) AM_MIRROR(0x13cf) AM_DEVREAD("hd44780", hd44780_device, data_read) |
| 128 | 128 | /*TODO: attach the watchdog/brownout reset device: |
| 129 | ||
| 129 | AM_RANGE(0xe000,0xe0??) AM_MIRROR(?) AM_DEVREAD("adm965an", adm965an_device, data_read) */ | |
| 130 | 130 | |
| 131 | 131 | //AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READWRITE(henry_io_r, henry_io_w) |
| 132 | 132 | AM_RANGE(MCS51_PORT_P0, MCS51_PORT_P3) AM_READ(henry_io_r) |
| r31373 | r31374 | |
| 147 | 147 | |
| 148 | 148 | static INPUT_PORTS_START( hprot_jumpers ) |
| 149 | 149 | /* |
| 150 | There is a set of 3 jumpers that switch the communications circuitry between a | |
| 150 | There is a set of 3 jumpers that switch the communications circuitry between a | |
| 151 | 151 | RS232 chip (U8: MAX232AN) and a differential bus transceiver (U7: SN65176BP) |
| 152 | 152 | |
| 153 | It seems that all three jumpers must select the same configuration: | |
| 153 | It seems that all three jumpers must select the same configuration: | |
| 154 | 154 | eighter differential bus or RS232. |
| 155 | 155 | And I don't see yet how this could affect the emulation of the device, so, for now, I'll |
| 156 | 156 | simply leave this note here but not actually include this details in the driver code. |
| 157 | 157 | |
| 158 | PORT_START("jumpers") | |
| 159 | PORT_DIPNAME( 0x01, 0x01, "TX") | |
| 160 | PORT_DIPSETTING( 0x01, "differential bus") | |
| 161 | PORT_DIPSETTING( 0x00, "RS232") | |
| 162 | PORT_DIPNAME( 0x02, 0x02, "RX") | |
| 163 | PORT_DIPSETTING( 0x02, "differential bus") | |
| 164 | PORT_DIPSETTING( 0x00, "RS232") | |
| 165 | PORT_DIPNAME( 0x04, 0x04, "CPU-TX") | |
| 166 | PORT_DIPSETTING( 0x04, "differential bus") | |
| 167 | PORT_DIPSETTING( 0x00, "RS232") | |
| 158 | PORT_START("jumpers") | |
| 159 | PORT_DIPNAME( 0x01, 0x01, "TX") | |
| 160 | PORT_DIPSETTING( 0x01, "differential bus") | |
| 161 | PORT_DIPSETTING( 0x00, "RS232") | |
| 162 | PORT_DIPNAME( 0x02, 0x02, "RX") | |
| 163 | PORT_DIPSETTING( 0x02, "differential bus") | |
| 164 | PORT_DIPSETTING( 0x00, "RS232") | |
| 165 | PORT_DIPNAME( 0x04, 0x04, "CPU-TX") | |
| 166 | PORT_DIPSETTING( 0x04, "differential bus") | |
| 167 | PORT_DIPSETTING( 0x00, "RS232") | |
| 168 | 168 | */ |
| 169 | 169 | INPUT_PORTS_END |
| 170 | 170 | |
| r31373 | r31374 | |
| 337 | 337 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 338 | 338 | |
| 339 | 339 | /* TODO: add an RS232 interface (emulate MAX232N chip) |
| 340 | ||
| 340 | (the board has GND/VCC/RX/TX pins available in a connector) */ | |
| 341 | 341 | |
| 342 | 342 | /* TODO: add an I2C interface (the board has GND/VCC/SDA/SCL pins available in a connector) */ |
| 343 | 343 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 697 | 697 | |
| 698 | 698 | MCFG_CASSETTE_ADD(CASSETTE_TAG) |
| 699 | 699 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) |
| 700 | ||
| 700 | ||
| 701 | 701 | MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", tiki100_state, tape_tick, attotime::from_hz(44100)) |
| 702 | 702 | |
| 703 | 703 | /* sound hardware */ |
| r31373 | r31374 | |
|---|---|---|
| 698 | 698 | MCFG_CASSETTE_ADD("cassette") |
| 699 | 699 | MCFG_CASSETTE_FORMATS(ace_cassette_formats) |
| 700 | 700 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) |
| 701 | ||
| 701 | ||
| 702 | 702 | MCFG_SNAPSHOT_ADD("snapshot", ace_state, ace, "ace", 1) |
| 703 | 703 | |
| 704 | 704 | MCFG_DEVICE_ADD(I8255_TAG, I8255A, 0) |
| r31373 | r31374 | |
|---|---|---|
| 880 | 880 | MCFG_Z80DART_OUT_DTRA_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_dtr)) |
| 881 | 881 | MCFG_Z80DART_OUT_RTSA_CB(DEVWRITELINE(RS232_B_TAG, rs232_port_device, write_rts)) |
| 882 | 882 | MCFG_Z80DART_OUT_TXDB_CB(DEVWRITELINE(ABC_KEYBOARD_PORT_TAG, abc_keyboard_port_device, txd_w)) |
| 883 | MCFG_Z80DART_OUT_INT_CB(INPUTLINE(MC68008P8_TAG, M68K_IRQ_5)) | |
| 883 | MCFG_Z80DART_OUT_INT_CB(INPUTLINE(MC68008P8_TAG, M68K_IRQ_5)) // shared with SCC | |
| 884 | 884 | |
| 885 | 885 | MCFG_DEVICE_ADD(Z8530B1_TAG, SCC8530, XTAL_64MHz/16) |
| 886 | 886 | MCFG_Z8530_INTRQ_CALLBACK(INPUTLINE(MC68008P8_TAG, M68K_IRQ_5)) |
| r31373 | r31374 | |
|---|---|---|
| 273 | 273 | MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(coco_state, cart_w)) |
| 274 | 274 | MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI)) |
| 275 | 275 | MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT)) |
| 276 | ||
| 276 | ||
| 277 | 277 | MCFG_COCO_VHD_ADD(VHD0_TAG) |
| 278 | 278 | MCFG_COCO_VHD_ADD(VHD1_TAG) |
| 279 | 279 |
| r31373 | r31374 | |
|---|---|---|
| 192 | 192 | |
| 193 | 193 | WRITE8_MEMBER( fp1100_state::main_to_sub_w ) |
| 194 | 194 | { |
| 195 | // machine().scheduler().synchronize(); // force resync | |
| 196 | // m_subcpu->set_input_line(UPD7810_INTF2, ASSERT_LINE); | |
| 195 | // machine().scheduler().synchronize(); // force resync | |
| 196 | // m_subcpu->set_input_line(UPD7810_INTF2, ASSERT_LINE); | |
| 197 | 197 | m_sub_latch = data; |
| 198 | if (LOG) printf("%s: From main:%X\n",machine().describe_context(),data); | |
| 198 | if (LOG) printf("%s: From main:%X\n",machine().describe_context(),data); | |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | READ8_MEMBER( fp1100_state::sub_to_main_r ) |
| 202 | 202 | { |
| 203 | // machine().scheduler().synchronize(); // force resync | |
| 204 | // m_maincpu->set_input_line(0, CLEAR_LINE); | |
| 203 | // machine().scheduler().synchronize(); // force resync | |
| 204 | // m_maincpu->set_input_line(0, CLEAR_LINE); | |
| 205 | 205 | if (LOG) printf("%s: To main:%X\n",machine().describe_context(),m_main_latch); |
| 206 | 206 | return m_main_latch; |
| 207 | 207 | } |
| r31373 | r31374 | |
| 235 | 235 | |
| 236 | 236 | READ8_MEMBER( fp1100_state::main_to_sub_r ) |
| 237 | 237 | { |
| 238 | // machine().scheduler().synchronize(); // force resync | |
| 239 | // m_subcpu->set_input_line(UPD7810_INTF2, CLEAR_LINE); | |
| 238 | // machine().scheduler().synchronize(); // force resync | |
| 239 | // m_subcpu->set_input_line(UPD7810_INTF2, CLEAR_LINE); | |
| 240 | 240 | if (LOG) printf("%s: To sub:%X\n",machine().describe_context(),m_sub_latch); |
| 241 | 241 | return m_sub_latch; |
| 242 | 242 | } |
| 243 | 243 | |
| 244 | 244 | WRITE8_MEMBER( fp1100_state::sub_to_main_w ) |
| 245 | 245 | { |
| 246 | // machine().scheduler().synchronize(); // force resync | |
| 247 | // m_maincpu->set_input_line_and_vector(0, ASSERT_LINE, 0xf0); | |
| 246 | // machine().scheduler().synchronize(); // force resync | |
| 247 | // m_maincpu->set_input_line_and_vector(0, ASSERT_LINE, 0xf0); | |
| 248 | 248 | m_main_latch = data; |
| 249 | 249 | if (LOG) printf("%s: From sub:%X\n",machine().describe_context(),data); |
| 250 | 250 | } |
| r31373 | r31374 | |
| 594 | 594 | |
| 595 | 595 | INTERRUPT_GEN_MEMBER(fp1100_state::fp1100_vblank_irq) |
| 596 | 596 | { |
| 597 | // if BIT(m_irq_mask, 4) | |
| 598 | // m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xf8); | |
| 597 | // if BIT(m_irq_mask, 4) | |
| 598 | // m_maincpu->set_input_line_and_vector(0, HOLD_LINE, 0xf8); | |
| 599 | 599 | } |
| 600 | 600 | |
| 601 | 601 | MACHINE_RESET_MEMBER( fp1100_state, fp1100 ) |
| r31373 | r31374 | |
|---|---|---|
| 11 | 11 | Notes: |
| 12 | 12 | One can induce the self-diagnose by booting the device holding LEARN and P2-RESET buttons togheter |
| 13 | 13 | With the default keyboard map, this can be done by holding keys L and S while pressing F3. |
| 14 | ||
| 14 | (Don't forget to unlock the keyboard by using the UI TOGGLE key) | |
| 15 | 15 | |
| 16 | ||
| 16 | This self-diagnose routine displays the value C817, which is the checksum value of the subcpu ROM | |
| 17 | 17 | and afterwards it displays the following message: |
| 18 | 18 | |
| 19 | 19 | SELFdIAG Error___ _F3 F3_CtC3c |
| r31373 | r31374 | |
| 21 | 21 | which means it detected an error in the CTC circuitry (it means we're emulating it wrong!) |
| 22 | 22 | F3 is the coordinate of the subcpu EEPROM chip in the PCB. |
| 23 | 23 | |
| 24 | ||
| 24 | According to the service manual, this error code means: "ICF3 CTC CH-3 counter operation failure (No interruption)" | |
| 25 | 25 | |
| 26 | 26 | Known issues: |
| 27 | 27 | There's still an annoying blinking in the 7-seg display. |
| 28 | 28 | |
| 29 | 29 | Changelog: |
| 30 | 30 | |
| 31 | ||
| 31 | 2014 JUN 24 [Felipe Sanches]: | |
| 32 | 32 | * figured out the multiplexing signals for the 7seg display |
| 33 | 33 | |
| 34 | ||
| 34 | 2014 JUN 23 [Felipe Sanches]: | |
| 35 | 35 | * hooked-up the RS422 ports |
| 36 | 36 | |
| 37 | 37 | 2014 JAN 14 [Felipe Sanches]: |
| r31373 | r31374 | |
| 269 | 269 | |
| 270 | 270 | READ8_MEMBER(pve500_state::io_expander_r) |
| 271 | 271 | { |
| 272 | // | |
| 272 | // printf("READ IO_EXPANDER_PORT%c\n", 'A'+offset); | |
| 273 | 273 | switch (offset){ |
| 274 | 274 | case IO_EXPANDER_PORTA: |
| 275 | 275 | return io_SC; |
| r31373 | r31374 | |
| 351 | 351 | } |
| 352 | 352 | |
| 353 | 353 | static MACHINE_CONFIG_START( pve500, pve500_state ) |
| 354 | ||
| 354 | /* Main CPU */ | |
| 355 | 355 | MCFG_CPU_ADD("maincpu", TMPZ84C015, XTAL_12MHz / 2) /* TMPZ84C015BF-6 */ |
| 356 | 356 | MCFG_CPU_PROGRAM_MAP(maincpu_prg) |
| 357 | 357 | MCFG_CPU_IO_MAP(maincpu_io) |
| r31373 | r31374 | |
| 369 | 369 | MCFG_Z80DART_OUT_TXDA_CB(DEVWRITELINE("player2", rs232_port_device, write_txd)) |
| 370 | 370 | MCFG_Z80DART_OUT_TXDB_CB(DEVWRITELINE("edl_inout", rs232_port_device, write_txd)) |
| 371 | 371 | |
| 372 | ||
| 372 | /* Secondary CPU */ | |
| 373 | 373 | MCFG_CPU_ADD("subcpu", TMPZ84C015, XTAL_12MHz / 2) /* TMPZ84C015BF-6 */ |
| 374 | 374 | MCFG_CPU_PROGRAM_MAP(subcpu_prg) |
| 375 | 375 | MCFG_CPU_IO_MAP(subcpu_io) |
| r31373 | r31374 | |
|---|---|---|
| 99 | 99 | UINT8 m_wx319; /* data of 74sl374 labeled wx319 */ |
| 100 | 100 | DECLARE_PALETTE_INIT(exelv); |
| 101 | 101 | TIMER_DEVICE_CALLBACK_MEMBER(exelv_hblank_interrupt); |
| 102 | ||
| 102 | ||
| 103 | 103 | DECLARE_DEVICE_IMAGE_LOAD_MEMBER( exelvision_cartridge ); |
| 104 | ||
| 104 | ||
| 105 | 105 | }; |
| 106 | 106 | |
| 107 | 107 | |
| r31373 | r31374 | |
| 223 | 223 | |
| 224 | 224 | READ8_MEMBER(exelv_state::mailbox_wx319_r) |
| 225 | 225 | { |
| 226 | ||
| 226 | logerror("[TMS7220] reading mailbox %d\n", m_wx319); | |
| 227 | 227 | return m_wx319; |
| 228 | 228 | } |
| 229 | 229 | |
| r31373 | r31374 | |
| 285 | 285 | READ8_MEMBER(exelv_state::tms7041_porta_r) |
| 286 | 286 | { |
| 287 | 287 | UINT8 data = 0x00; |
| 288 | ||
| 288 | static UINT8 data_last=0; | |
| 289 | 289 | |
| 290 | ||
| 290 | // TMS5220 OK | |
| 291 | 291 | data |= m_tms5220c->intq_r() ? 0x08 : 0x00; // A3 |
| 292 | 292 | data |= m_tms5220c->readyq_r() ? 0x80 : 0x00; // A7 |
| 293 | 293 | |
| 294 | ||
| 294 | // TMS7220 | |
| 295 | 295 | data |= (m_tms7020_portb & 0x01 ) ? 0x04 : 0x00; // A2 |
| 296 | 296 | data |= (m_tms7020_portb & 0x02) ? 0x10 : 0x00; // A4 |
| 297 | ||
| 297 | ||
| 298 | 298 | // SERIAL PORT |
| 299 | 299 | |
| 300 | if (data!=data_last) { | |
| 301 | logerror("tms7041_porta_r %x\n",data); | |
| 302 | } | |
| 303 | data_last=data; | |
| 304 | ||
| 300 | if (data!=data_last) { | |
| 301 | logerror("tms7041_porta_r %x\n",data); | |
| 302 | } | |
| 303 | data_last=data; | |
| 304 | ||
| 305 | 305 | return data; |
| 306 | 306 | } |
| 307 | 307 | |
| r31373 | r31374 | |
| 324 | 324 | m_tms5220c->wsq_w((data & 0x01) ? 1 : 0); |
| 325 | 325 | m_tms5220c->rsq_w((data & 0x02) ? 1 : 0); |
| 326 | 326 | |
| 327 | ||
| 327 | logerror("TMS7020 %s int1\n",((data & 0x04) ? "clear" : "assert")); | |
| 328 | 328 | m_maincpu->set_input_line(TMS7000_INT1_LINE, (data & 0x04) ? CLEAR_LINE : ASSERT_LINE); |
| 329 | 329 | |
| 330 | 330 | /* Check for low->high transition on B6 */ |
| r31373 | r31374 | |
| 375 | 375 | READ8_MEMBER(exelv_state::tms7041_portd_r) |
| 376 | 376 | { |
| 377 | 377 | UINT8 data = 0xff; |
| 378 | data=m_tms5220c->status_r(space, 0, data); | |
| 378 | data=m_tms5220c->status_r(space, 0, data); | |
| 379 | 379 | logerror("tms7041_portd_r\n"); |
| 380 | 380 | return data; |
| 381 | 381 | } |
| r31373 | r31374 | |
| 416 | 416 | |
| 417 | 417 | static ADDRESS_MAP_START(tms7020_mem, AS_PROGRAM, 8, exelv_state) |
| 418 | 418 | AM_RANGE(0x0080, 0x00ff) AM_NOP |
| 419 | AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r) | |
| 420 | AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r) | |
| 421 | AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) | |
| 422 | AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) | |
| 423 | AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) | |
| 419 | AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r) | |
| 420 | AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r) | |
| 421 | AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) | |
| 422 | AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) | |
| 423 | AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) | |
| 424 | 424 | |
| 425 | 425 | AM_RANGE(0x0130, 0x0130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w) |
| 426 | 426 | AM_RANGE(0x0200, 0x7fff) AM_ROMBANK("bank1") /* system ROM */ |
| r31373 | r31374 | |
| 444 | 444 | |
| 445 | 445 | static ADDRESS_MAP_START(tms7040_mem, AS_PROGRAM, 8, exelv_state) |
| 446 | 446 | AM_RANGE(0x0080, 0x00ff) AM_NOP |
| 447 | AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r) | |
| 448 | AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r) | |
| 449 | AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) | |
| 450 | AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) | |
| 451 | AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) | |
| 447 | AM_RANGE(0x0124, 0x0124) AM_DEVREAD("tms3556", tms3556_device, vram_r) | |
| 448 | AM_RANGE(0x0125, 0x0125) AM_DEVREAD("tms3556", tms3556_device, reg_r) | |
| 449 | AM_RANGE(0x0128, 0x0128) AM_DEVREAD("tms3556", tms3556_device, initptr_r) | |
| 450 | AM_RANGE(0x012d, 0x012d) AM_DEVWRITE("tms3556", tms3556_device, reg_w) | |
| 451 | AM_RANGE(0x012e, 0x012e) AM_DEVWRITE("tms3556", tms3556_device, vram_w) | |
| 452 | 452 | AM_RANGE(0x0130, 0x0130) AM_READWRITE(mailbox_wx319_r, mailbox_wx318_w) |
| 453 | 453 | AM_RANGE(0x0200, 0x7fff) AM_ROMBANK("bank1") /* system ROM */ |
| 454 | 454 | AM_RANGE(0x8000, 0xbfff) AM_NOP |
| r31373 | r31374 | |
| 537 | 537 | MCFG_SOUND_ADD("tms5220c", TMS5220C, 640000) |
| 538 | 538 | // MCFG_TMS52XX_SPEECHROM("vsm") |
| 539 | 539 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.00) |
| 540 | ||
| 540 | ||
| 541 | 541 | /* cartridge */ |
| 542 | 542 | MCFG_CARTSLOT_ADD("cart") |
| 543 | 543 | MCFG_CARTSLOT_EXTENSION_LIST("bin,rom") |
| r31373 | r31374 | |
| 600 | 600 | |
| 601 | 601 | ROM_REGION(0x10000, "tms7041", 0) |
| 602 | 602 | ROM_LOAD("exl100_7041.bin", 0xf000, 0x1000, CRC(38f6fc7a) SHA1(b71d545664a974d8ad39bdf600c5b9884c3efab6)) /* TMS7041 internal ROM, correct */ |
| 603 | // | |
| 603 | // ROM_REGION(0x8000, "vsm", 0) | |
| 604 | 604 | |
| 605 | 605 | ROM_REGION(0x10000, "user1", ROMREGION_ERASEFF) /* cartridge area */ |
| 606 | 606 | ROM_END |
| r31373 | r31374 | |
| 627 | 627 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME */ |
| 628 | 628 | COMP(1984, exl100, 0, 0, exl100, exelv, driver_device, 0, "Exelvision", "EXL 100", GAME_NOT_WORKING) |
| 629 | 629 | COMP(1986, exeltel, exl100, 0, exeltel, exelv, driver_device, 0, "Exelvision", "Exeltel", GAME_NOT_WORKING) |
| 630 |
| r31373 | r31374 | |
|---|---|---|
| 164 | 164 | |
| 165 | 165 | /* Devices */ |
| 166 | 166 | MCFG_DEVICE_ADD("i8279", I8279, 2500000) // based on divider |
| 167 | MCFG_I8279_OUT_SL_CB(WRITE8(selz80_state, scanlines_w)) // scan SL lines | |
| 168 | MCFG_I8279_OUT_DISP_CB(WRITE8(selz80_state, digit_w)) // display A&B | |
| 169 | MCFG_I8279_IN_RL_CB(READ8(selz80_state, kbd_r)) // kbd RL lines | |
| 170 | MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key | |
| 167 | MCFG_I8279_OUT_SL_CB(WRITE8(selz80_state, scanlines_w)) // scan SL lines | |
| 168 | MCFG_I8279_OUT_DISP_CB(WRITE8(selz80_state, digit_w)) // display A&B | |
| 169 | MCFG_I8279_IN_RL_CB(READ8(selz80_state, kbd_r)) // kbd RL lines | |
| 170 | MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key | |
| 171 | 171 | MCFG_I8279_IN_CTRL_CB(VCC) |
| 172 | 172 | MACHINE_CONFIG_END |
| 173 | 173 |
| r31373 | r31374 | |
|---|---|---|
| 1761 | 1761 | MCFG_SCREEN_VISIBLE_AREA(0, 320 - 1, 0, 250 - 1) |
| 1762 | 1762 | MCFG_SCREEN_UPDATE_DEVICE(MC6845_TAG, mc6845_device, screen_update) |
| 1763 | 1763 | MCFG_DEVICE_REMOVE("sync_timer") |
| 1764 | ||
| 1764 | ||
| 1765 | 1765 | MCFG_MC6845_ADD(MC6845_TAG, MC6845, SCREEN_TAG, XTAL_16MHz/16) |
| 1766 | 1766 | MCFG_MC6845_SHOW_BORDER_AREA(true) |
| 1767 | 1767 | MCFG_MC6845_CHAR_WIDTH(8) |
| r31373 | r31374 | |
|---|---|---|
| 731 | 731 | /* video hardware */ |
| 732 | 732 | MCFG_DEVICE_ADD( TMS9918A_TAG, TMS9918A, XTAL_10_738635MHz / 2 ) |
| 733 | 733 | MCFG_TMS9928A_VRAM_SIZE(0x4000) |
| 734 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(sg1000_state, sg1000_vdp_interrupt)) | |
| 734 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(sg1000_state, sg1000_vdp_interrupt)) | |
| 735 | 735 | MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) |
| 736 | 736 | MCFG_SCREEN_UPDATE_DEVICE( TMS9918A_TAG, tms9918a_device, screen_update ) |
| 737 | 737 |
| r31373 | r31374 | |
|---|---|---|
| 166 | 166 | /* Devices */ |
| 167 | 167 | MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL_16MHz / 4) |
| 168 | 168 | MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 169 | MCFG_Z80CTC_ZC0_CB(WRITELINE(ampro_state, ctc_z0_w)) // Z80DART Ch A, SIO Ch A | |
| 170 | MCFG_Z80CTC_ZC1_CB(DEVWRITELINE("z80dart", z80dart_device, rxtxcb_w)) // SIO Ch B | |
| 169 | MCFG_Z80CTC_ZC0_CB(WRITELINE(ampro_state, ctc_z0_w)) // Z80DART Ch A, SIO Ch A | |
| 170 | MCFG_Z80CTC_ZC1_CB(DEVWRITELINE("z80dart", z80dart_device, rxtxcb_w)) // SIO Ch B | |
| 171 | 171 | |
| 172 | 172 | MCFG_Z80DART_ADD("z80dart", XTAL_16MHz / 4, 0, 0, 0, 0 ) |
| 173 | 173 | MCFG_Z80DART_OUT_TXDA_CB(DEVWRITELINE("rs232", rs232_port_device, write_txd)) |
| r31373 | r31374 | |
|---|---|---|
| 312 | 312 | MCFG_COCO_CARTRIDGE_CART_CB(WRITELINE(coco_state, cart_w)) |
| 313 | 313 | MCFG_COCO_CARTRIDGE_NMI_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_NMI)) |
| 314 | 314 | MCFG_COCO_CARTRIDGE_HALT_CB(INPUTLINE(MAINCPU_TAG, INPUT_LINE_HALT)) |
| 315 | ||
| 315 | ||
| 316 | 316 | // video hardware |
| 317 | 317 | MCFG_SCREEN_MC6847_NTSC_ADD(SCREEN_TAG, VDG_TAG) |
| 318 | 318 |
| r31373 | r31374 | |
|---|---|---|
| 13 | 13 | |
| 14 | 14 | - Really implement the MO, it's only faking it for the startup test right now |
| 15 | 15 | |
| 16 | ||
| 16 | - Fix the networking | |
| 17 | 17 | |
| 18 | 18 | - Find out why netbsd goes to hell even before loading the kernel |
| 19 | 19 |
| r31373 | r31374 | |
|---|---|---|
| 1636 | 1636 | MCFG_CPU_ADD("maincpu", M68000, 10000000) /* 10 MHz */ |
| 1637 | 1637 | MCFG_CPU_PROGRAM_MAP(x68k_map) |
| 1638 | 1638 | MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(x68k_state,x68k_int_ack) |
| 1639 | ||
| 1639 | ||
| 1640 | 1640 | MCFG_QUANTUM_TIME(attotime::from_hz(60)) |
| 1641 | 1641 | |
| 1642 | 1642 | MCFG_MACHINE_START_OVERRIDE(x68k_state, x68000 ) |
| r31373 | r31374 | |
| 1661 | 1661 | MCFG_I8255_OUT_PORTC_CB(WRITE8(x68k_state, ppi_port_c_w)) |
| 1662 | 1662 | |
| 1663 | 1663 | MCFG_DEVICE_ADD("hd63450", HD63450, 0) |
| 1664 | MCFG_HD63450_CPU("maincpu") | |
| 1664 | MCFG_HD63450_CPU("maincpu") // CPU - 68000 | |
| 1665 | 1665 | MCFG_HD63450_CLOCKS(attotime::from_usec(2), attotime::from_nsec(450), attotime::from_usec(4), attotime::from_hz(15625/2)) |
| 1666 | 1666 | MCFG_HD63450_BURST_CLOCKS(attotime::from_usec(2), attotime::from_nsec(450), attotime::from_nsec(50), attotime::from_nsec(50)) |
| 1667 | 1667 | MCFG_HD63450_DMA_END_CB(WRITE8(x68k_state, dma_end)) |
| r31373 | r31374 | |
|---|---|---|
| 484 | 484 | MCFG_CASSETTE_ADD("cassette") |
| 485 | 485 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 486 | 486 | MCFG_CASSETTE_INTERFACE("alphatro_cass") |
| 487 | ||
| 487 | ||
| 488 | 488 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_c", alphatro_state, timer_c, attotime::from_hz(4800)) |
| 489 | 489 | MCFG_TIMER_DRIVER_ADD_PERIODIC("timer_p", alphatro_state, timer_p, attotime::from_hz(40000)) |
| 490 | 490 |
| r31373 | r31374 | |
|---|---|---|
| 1136 | 1136 | MCFG_Z80PIO_OUT_INT_CB(INPUTLINE(Z80_TAG, INPUT_LINE_IRQ0)) |
| 1137 | 1137 | MCFG_Z80PIO_OUT_PA_CB(DEVWRITE8("cent_data_out", output_latch_device, write)) |
| 1138 | 1138 | MCFG_Z80PIO_IN_PB_CB(READ8(bullet_state, pio_pb_r)) |
| 1139 | ||
| 1139 | ||
| 1140 | 1140 | MCFG_MB8877x_ADD(MB8877_TAG, XTAL_16MHz/16) |
| 1141 | 1141 | MCFG_WD_FDC_INTRQ_CALLBACK(DEVWRITELINE(Z80DART_TAG, z80dart_device, dcda_w)) |
| 1142 | 1142 | MCFG_WD_FDC_DRQ_CALLBACK(WRITELINE(bullet_state, fdc_drq_w)) |
| r31373 | r31374 | |
|---|---|---|
| 2499 | 2499 | MCFG_CASSETTE_ADD("cassette") |
| 2500 | 2500 | MCFG_CASSETTE_FORMATS(x1_cassette_formats) |
| 2501 | 2501 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 2502 | MCFG_CASSETTE_INTERFACE("x1_cass") | |
| 2503 | ||
| 2502 | MCFG_CASSETTE_INTERFACE("x1_cass") | |
| 2503 | ||
| 2504 | 2504 | MCFG_SOFTWARE_LIST_ADD("cass_list","x1_cass") |
| 2505 | 2505 | |
| 2506 | 2506 | MCFG_LEGACY_FLOPPY_4_DRIVES_ADD(x1_floppy_interface) |
| r31373 | r31374 | |
| 2531 | 2531 | MCFG_DEVICE_REMOVE("fdc") |
| 2532 | 2532 | MCFG_DEVICE_ADD("fdc", MB8877, 0) |
| 2533 | 2533 | MCFG_WD17XX_DEFAULT_DRIVE4_TAGS |
| 2534 | ||
| 2534 | MCFG_WD17XX_DRQ_CALLBACK(WRITELINE(x1_state,fdc_drq_w)) | |
| 2535 | 2535 | |
| 2536 | 2536 | MCFG_YM2151_ADD("ym", MAIN_CLOCK/8) //option board |
| 2537 | 2537 | MCFG_SOUND_ROUTE(0, "lspeaker", 0.50) |
| r31373 | r31374 | |
| 2647 | 2647 | // x1twin in x1twin.c |
| 2648 | 2648 | COMP( 1984, x1turbo, x1, 0, x1turbo, x1turbo, x1_state, x1_kanji, "Sharp", "X1 Turbo (CZ-850C)", GAME_NOT_WORKING ) //model 10 |
| 2649 | 2649 | COMP( 1985, x1turbo40, x1, 0, x1turbo, x1turbo, x1_state, x1_kanji, "Sharp", "X1 Turbo (CZ-862C)", 0 ) //model 40 |
| 2650 | //COMP( 1986, x1turboz, x1, 0, x1turbo, x1turbo, x1_state, x1_kanji, "Sharp", "X1 TurboZ", GAME_NOT_WORKING ) | |
| No newline at end of file | ||
| 2650 | //COMP( 1986, x1turboz, x1, 0, x1turbo, x1turbo, x1_state, x1_kanji, "Sharp", "X1 TurboZ", GAME_NOT_WORKING ) |
| r31373 | r31374 | |
|---|---|---|
| 512 | 512 | ROM_END |
| 513 | 513 | |
| 514 | 514 | #define rom_laser200 rom_laser110 |
| 515 | #define rom_fellow | |
| 515 | #define rom_fellow rom_laser110 | |
| 516 | 516 | |
| 517 | 517 | // It's possible that the Texet TX-8000 came with BASIC V1.0, but this needs to be verified |
| 518 | 518 | #define rom_tx8000 rom_laser110 |
| r31373 | r31374 | |
| 541 | 541 | ROMX_LOAD("vtechv21.u12", 0x0000, 0x4000, CRC(f7df980f) SHA1(5ba14a7a2eedca331b033901080fa5d205e245ea), ROM_BIOS(2)) |
| 542 | 542 | ROM_END |
| 543 | 543 | |
| 544 | #define rom_vz300 | |
| 544 | #define rom_vz300 rom_laser310 | |
| 545 | 545 | #define rom_laser310h rom_laser310 |
| 546 | 546 | |
| 547 | 547 |
| r31373 | r31374 | |
|---|---|---|
| 419 | 419 | |
| 420 | 420 | MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL_8MHz / 2) |
| 421 | 421 | MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 422 | MCFG_Z80CTC_ZC0_CB(DEVWRITELINE("z80sio", z80dart_device, rxtxcb_w)) // SIO Ch B | |
| 423 | MCFG_Z80CTC_ZC1_CB(WRITELINE(altos5_state, ctc_z1_w)) // Z80DART Ch A, SIO Ch A | |
| 424 | MCFG_Z80CTC_ZC2_CB(DEVWRITELINE("z80dart", z80dart_device, rxtxcb_w)) // Z80DART Ch B | |
| 422 | MCFG_Z80CTC_ZC0_CB(DEVWRITELINE("z80sio", z80dart_device, rxtxcb_w)) // SIO Ch B | |
| 423 | MCFG_Z80CTC_ZC1_CB(WRITELINE(altos5_state, ctc_z1_w)) // Z80DART Ch A, SIO Ch A | |
| 424 | MCFG_Z80CTC_ZC2_CB(DEVWRITELINE("z80dart", z80dart_device, rxtxcb_w)) // Z80DART Ch B | |
| 425 | 425 | |
| 426 | 426 | MCFG_RS232_PORT_ADD("rs232", default_rs232_devices, "terminal") |
| 427 | 427 | MCFG_RS232_RXD_HANDLER(DEVWRITELINE("z80sio", z80dart_device, rxb_w)) |
| r31373 | r31374 | |
|---|---|---|
| 207 | 207 | MCFG_CASSETTE_FORMATS(rkp_cassette_formats) |
| 208 | 208 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 209 | 209 | MCFG_CASSETTE_INTERFACE("partner_cass") |
| 210 | ||
| 210 | ||
| 211 | 211 | MCFG_SOFTWARE_LIST_ADD("cass_list","partner_cass") |
| 212 | 212 | |
| 213 | 213 | MCFG_FD1793x_ADD("wd1793", XTAL_16MHz / 16) |
| r31373 | r31374 | |
|---|---|---|
| 171 | 171 | MCFG_CPU_PROGRAM_MAP(galaxy_mem) |
| 172 | 172 | MCFG_CPU_VBLANK_INT_DRIVER("screen", galaxy_state, galaxy_interrupt) |
| 173 | 173 | MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(galaxy_state,galaxy_irq_callback) |
| 174 | ||
| 174 | ||
| 175 | 175 | MCFG_SCREEN_ADD("screen", RASTER) |
| 176 | 176 | MCFG_SCREEN_REFRESH_RATE(50) |
| 177 | 177 | MCFG_SCREEN_PALETTE("palette") |
| r31373 | r31374 | |
| 198 | 198 | MCFG_CASSETTE_FORMATS(gtp_cassette_formats) |
| 199 | 199 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 200 | 200 | MCFG_CASSETTE_INTERFACE("galaxy_cass") |
| 201 | ||
| 201 | ||
| 202 | 202 | MCFG_SOFTWARE_LIST_ADD("cass_list","galaxy") |
| 203 | 203 | |
| 204 | 204 | /* internal ram */ |
| r31373 | r31374 | |
| 214 | 214 | MCFG_CPU_IO_MAP(galaxyp_io) |
| 215 | 215 | MCFG_CPU_VBLANK_INT_DRIVER("screen", galaxy_state, galaxy_interrupt) |
| 216 | 216 | MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(galaxy_state,galaxy_irq_callback) |
| 217 | ||
| 217 | ||
| 218 | 218 | MCFG_SCREEN_ADD("screen", RASTER) |
| 219 | 219 | MCFG_SCREEN_REFRESH_RATE(50) |
| 220 | 220 | MCFG_SCREEN_PALETTE("palette") |
| r31373 | r31374 | |
| 242 | 242 | MCFG_CASSETTE_FORMATS(gtp_cassette_formats) |
| 243 | 243 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 244 | 244 | MCFG_CASSETTE_INTERFACE("galaxy_cass") |
| 245 | ||
| 245 | ||
| 246 | 246 | MCFG_SOFTWARE_LIST_ADD("cass_list","galaxy") |
| 247 | 247 | |
| 248 | 248 | /* internal ram */ |
| r31373 | r31374 | |
|---|---|---|
| 697 | 697 | |
| 698 | 698 | MCFG_CASSETTE_ADD(CASSETTE_TAG) |
| 699 | 699 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) |
| 700 | ||
| 700 | ||
| 701 | 701 | MCFG_TIMER_DRIVER_ADD_PERIODIC("tape", compis_state, tape_tick, attotime::from_hz(44100)) |
| 702 | 702 | |
| 703 | 703 | MCFG_RS232_PORT_ADD(RS232_A_TAG, default_rs232_devices, NULL) |
| r31373 | r31374 | |
|---|---|---|
| 2192 | 2192 | |
| 2193 | 2193 | /* |
| 2194 | 2194 | ROM_START( mactw ) |
| 2195 | ROM_REGION16_BE(0x20000, "bootrom", 0) | |
| 2196 | ROM_LOAD( "rom4.3t_07-04-83.bin", 0x0000, 0x10000, CRC(d2c42f18) SHA1(f868c09ca70383a69751c37a5a3110a9597462a4) ) | |
| 2195 | ROM_REGION16_BE(0x20000, "bootrom", 0) | |
| 2196 | ROM_LOAD( "rom4.3t_07-04-83.bin", 0x0000, 0x10000, CRC(d2c42f18) SHA1(f868c09ca70383a69751c37a5a3110a9597462a4) ) | |
| 2197 | 2197 | ROM_END |
| 2198 | 2198 | */ |
| 2199 | 2199 |
| r31373 | r31374 | |
|---|---|---|
| 706 | 706 | static MACHINE_CONFIG_START( at586, at586_state ) |
| 707 | 707 | MCFG_CPU_ADD("maincpu", PENTIUM, 60000000) |
| 708 | 708 | MCFG_CPU_PROGRAM_MAP(at586_map) |
| 709 | MCFG_CPU_IO_MAP(at586_io) | |
| 709 | MCFG_CPU_IO_MAP(at586_io) | |
| 710 | 710 | MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pcibus:1:i82371ab:pic8259_master", pic8259_device, inta_cb) |
| 711 | 711 | |
| 712 | 712 | MCFG_RAM_ADD(RAM_TAG) |
| r31373 | r31374 | |
| 730 | 730 | static MACHINE_CONFIG_START( at586x3, at586_state ) |
| 731 | 731 | MCFG_CPU_ADD("maincpu", PENTIUM, 60000000) |
| 732 | 732 | MCFG_CPU_PROGRAM_MAP(at586_map) |
| 733 | MCFG_CPU_IO_MAP(at586_io) | |
| 733 | MCFG_CPU_IO_MAP(at586_io) | |
| 734 | 734 | MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("pcibus:1:i82371sb:pic8259_master", pic8259_device, inta_cb) |
| 735 | 735 | |
| 736 | 736 | MCFG_RAM_ADD(RAM_TAG) |
| r31373 | r31374 | |
|---|---|---|
| 659 | 659 | MCFG_FLOPPY_DRIVE_ADD("wd1772:0", ensoniq_floppies, "35dd", esq5505_state::floppy_formats) |
| 660 | 660 | |
| 661 | 661 | MCFG_DEVICE_ADD("mc68450", HD63450, 0) // MC68450 compatible |
| 662 | MCFG_HD63450_CPU("maincpu") | |
| 662 | MCFG_HD63450_CPU("maincpu") // CPU - 68000 | |
| 663 | 663 | MCFG_HD63450_CLOCKS(attotime::from_usec(32), attotime::from_nsec(450), attotime::from_usec(4), attotime::from_hz(15625/2)) |
| 664 | 664 | MCFG_HD63450_BURST_CLOCKS(attotime::from_usec(32), attotime::from_nsec(450), attotime::from_nsec(50), attotime::from_nsec(50)) |
| 665 | 665 | MCFG_HD63450_DMA_END_CB(WRITE8(esq5505_state, dma_end)) |
| r31373 | r31374 | |
|---|---|---|
| 213 | 213 | MCFG_CASSETTE_FORMATS(rku_cassette_formats) |
| 214 | 214 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 215 | 215 | MCFG_CASSETTE_INTERFACE("ut88_cass") |
| 216 | ||
| 216 | ||
| 217 | 217 | MCFG_SOFTWARE_LIST_ADD("cass_list","ut88") |
| 218 | 218 | MACHINE_CONFIG_END |
| 219 | 219 | |
| r31373 | r31374 | |
| 237 | 237 | MCFG_CASSETTE_FORMATS(rku_cassette_formats) |
| 238 | 238 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 239 | 239 | MCFG_CASSETTE_INTERFACE("ut88_cass") |
| 240 | ||
| 240 | ||
| 241 | 241 | MCFG_SOFTWARE_LIST_ADD("cass_list","ut88") |
| 242 | 242 | MACHINE_CONFIG_END |
| 243 | 243 |
| r31373 | r31374 | |
|---|---|---|
| 159 | 159 | MCFG_CASSETTE_ADD("cassette") |
| 160 | 160 | MCFG_CASSETTE_FORMATS(coco_cassette_formats) |
| 161 | 161 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_MUTED) |
| 162 | ||
| 162 | ||
| 163 | 163 | MCFG_DEVICE_ADD(PRINTER_TAG, PRINTER, 0) |
| 164 | 164 | |
| 165 | 165 | // video hardware |
| r31373 | r31374 | |
|---|---|---|
| 176 | 176 | } |
| 177 | 177 | if (offset >= 0x20000 && offset < 0x40000) |
| 178 | 178 | { |
| 179 | | |
| 179 | m_zx8301->data_w(space, offset & 0x1ffff, data); | |
| 180 | 180 | } |
| 181 | 181 | if (m_qimi_enabled) |
| 182 | 182 | { |
| r31373 | r31374 | |
|---|---|---|
| 269 | 269 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 270 | 270 | MCFG_MC6845_CHAR_WIDTH(8) |
| 271 | 271 | |
| 272 | MCFG_DEVICE_ADD("fdc", MB8877x, 2000000) | |
| 272 | MCFG_DEVICE_ADD("fdc", MB8877x, 2000000) // unknown type | |
| 273 | 273 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", myb3k_floppies, "8dsdd", floppy_image_device::default_floppy_formats) |
| 274 | 274 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", myb3k_floppies, "8dsdd", floppy_image_device::default_floppy_formats) |
| 275 | 275 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 1949 | 1949 | MCFG_CASSETTE_ADD( "cassette" ) |
| 1950 | 1950 | MCFG_CASSETTE_FORMATS(a26_cassette_formats) |
| 1951 | 1951 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 1952 | MCFG_CASSETTE_INTERFACE("a2600_cass") | |
| 1952 | MCFG_CASSETTE_INTERFACE("a2600_cass") | |
| 1953 | 1953 | MACHINE_CONFIG_END |
| 1954 | 1954 | |
| 1955 | 1955 |
| r31373 | r31374 | |
|---|---|---|
| 186 | 186 | |
| 187 | 187 | MCFG_CASSETTE_ADD( "cassette" ) |
| 188 | 188 | MCFG_CASSETTE_FORMATS(rk8_cassette_formats) |
| 189 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) | |
| 189 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) | |
| 190 | 190 | MACHINE_CONFIG_END |
| 191 | 191 | |
| 192 | 192 | static MACHINE_CONFIG_DERIVED( radio99, mikro80 ) |
| r31373 | r31374 | |
|---|---|---|
| 885 | 885 | |
| 886 | 886 | MCFG_CASSETTE_ADD("cassette") |
| 887 | 887 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 888 | ||
| 888 | ||
| 889 | 889 | MCFG_WD1772x_ADD("fdc", XTAL_16MHz / 2) //connected to Z80H clock pin |
| 890 | 890 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", applix_floppies, "35dd", applix_state::floppy_formats) |
| 891 | 891 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", applix_floppies, "35dd", applix_state::floppy_formats) |
| r31373 | r31374 | |
|---|---|---|
| 125 | 125 | |
| 126 | 126 | /* Devices */ |
| 127 | 127 | MCFG_DEVICE_ADD("i8279", I8279, 3100000) // based on divider |
| 128 | MCFG_I8279_OUT_IRQ_CB(INPUTLINE("maincpu", I8085_RST55_LINE)) // irq | |
| 129 | MCFG_I8279_OUT_SL_CB(WRITE8(sdk85_state, scanlines_w)) // scan SL lines | |
| 130 | MCFG_I8279_OUT_DISP_CB(WRITE8(sdk85_state, digit_w)) // display A&B | |
| 131 | MCFG_I8279_IN_RL_CB(READ8(sdk85_state, kbd_r)) // kbd RL lines | |
| 132 | MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key | |
| 128 | MCFG_I8279_OUT_IRQ_CB(INPUTLINE("maincpu", I8085_RST55_LINE)) // irq | |
| 129 | MCFG_I8279_OUT_SL_CB(WRITE8(sdk85_state, scanlines_w)) // scan SL lines | |
| 130 | MCFG_I8279_OUT_DISP_CB(WRITE8(sdk85_state, digit_w)) // display A&B | |
| 131 | MCFG_I8279_IN_RL_CB(READ8(sdk85_state, kbd_r)) // kbd RL lines | |
| 132 | MCFG_I8279_IN_SHIFT_CB(VCC) // Shift key | |
| 133 | 133 | MCFG_I8279_IN_CTRL_CB(VCC) |
| 134 | 134 | MACHINE_CONFIG_END |
| 135 | 135 |
| r31373 | r31374 | |
|---|---|---|
| 1224 | 1224 | |
| 1225 | 1225 | /* cassette */ |
| 1226 | 1226 | MCFG_CASSETTE_ADD( "cassette" ) |
| 1227 | MCFG_CASSETTE_FORMATS(fmsx_cassette_formats) | |
| 1227 | MCFG_CASSETTE_FORMATS(fmsx_cassette_formats) | |
| 1228 | 1228 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) |
| 1229 | 1229 | MCFG_CASSETTE_INTERFACE("msx_cass") |
| 1230 | 1230 | |
| r31373 | r31374 | |
| 1236 | 1236 | static MACHINE_CONFIG_DERIVED( msx_ntsc, msx ) |
| 1237 | 1237 | /* Video hardware */ |
| 1238 | 1238 | MCFG_DEVICE_ADD( "tms9928a", TMS9928A, XTAL_10_738635MHz / 2 ) |
| 1239 | ||
| 1239 | MCFG_TMS9928A_VRAM_SIZE(0x4000) | |
| 1240 | 1240 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0)) |
| 1241 | 1241 | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 1242 | 1242 | MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update) |
| r31373 | r31374 | |
| 1246 | 1246 | static MACHINE_CONFIG_DERIVED( msx_pal, msx ) |
| 1247 | 1247 | /* Video hardware */ |
| 1248 | 1248 | MCFG_DEVICE_ADD( "tms9928a", TMS9929A, XTAL_10_738635MHz / 2 ) |
| 1249 | ||
| 1249 | MCFG_TMS9928A_VRAM_SIZE(0x4000) | |
| 1250 | 1250 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(msx_state,msx_irq_source0)) |
| 1251 | 1251 | MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" ) |
| 1252 | 1252 | MCFG_SCREEN_UPDATE_DEVICE("tms9928a", tms9928a_device, screen_update) |
| r31373 | r31374 | |
| 1316 | 1316 | |
| 1317 | 1317 | /* cassette */ |
| 1318 | 1318 | MCFG_CASSETTE_ADD( "cassette" ) |
| 1319 | MCFG_CASSETTE_FORMATS(fmsx_cassette_formats) | |
| 1319 | MCFG_CASSETTE_FORMATS(fmsx_cassette_formats) | |
| 1320 | 1320 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) |
| 1321 | 1321 | MCFG_CASSETTE_INTERFACE("msx_cass") |
| 1322 | 1322 | |
| r31373 | r31374 | |
| 1384 | 1384 | |
| 1385 | 1385 | /* cassette */ |
| 1386 | 1386 | MCFG_CASSETTE_ADD( "cassette" ) |
| 1387 | MCFG_CASSETTE_FORMATS(fmsx_cassette_formats) | |
| 1387 | MCFG_CASSETTE_FORMATS(fmsx_cassette_formats) | |
| 1388 | 1388 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) |
| 1389 | 1389 | MCFG_CASSETTE_INTERFACE("msx_cass") |
| 1390 | 1390 | |
| r31373 | r31374 | |
| 1462 | 1462 | // FDC: None, 0 drives |
| 1463 | 1463 | // 2 Cartridge slots |
| 1464 | 1464 | |
| 1465 | ||
| 1465 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) | |
| 1466 | 1466 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0) |
| 1467 | ||
| 1467 | MCFG_MSX_LAYOUT_RAM("ram", 2, 0, 3, 1) /* 16KB RAM */ | |
| 1468 | 1468 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot12", 3, 0) |
| 1469 | 1469 | |
| 1470 | 1470 | MCFG_FRAGMENT_ADD( msx1_cartlist ) |
| r31373 | r31374 | |
| 1481 | 1481 | // FDC: None, 0 drives |
| 1482 | 1482 | // 2 Cartridge slots |
| 1483 | 1483 | |
| 1484 | ||
| 1484 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) | |
| 1485 | 1485 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0) |
| 1486 | 1486 | MCFG_MSX_LAYOUT_RAM("ram", 2, 0, 0, 4) /* 64KB RAM */ |
| 1487 | 1487 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 3, 0) |
| r31373 | r31374 | |
| 1497 | 1497 | ROM_END |
| 1498 | 1498 | |
| 1499 | 1499 | static MACHINE_CONFIG_DERIVED( pv16, msx_ntsc ) |
| 1500 | ||
| 1500 | // AY8910 | |
| 1501 | 1501 | // FDC: None, 0 drives |
| 1502 | 1502 | // 1 Cartridge slot |
| 1503 | 1503 | // No printer port |
| r31373 | r31374 | |
| 2540 | 2540 | ROM_START (svi728) |
| 2541 | 2541 | ROM_REGION (0xc000, "maincpu", 0) |
| 2542 | 2542 | ROM_LOAD ("728bios.rom", 0x0000, 0x8000, CRC(1ce9246c) SHA1(ea6a82cf8c6e65eb30b98755c8577cde8d9186c0)) |
| 2543 | // | |
| 2543 | // ROM_LOAD ("707disk.rom", 0x8000, 0x4000, CRC(f9978853) SHA1(6aa856cc56eb98863c9da7a566571605682b5c6b)) | |
| 2544 | 2544 | ROM_END |
| 2545 | 2545 | |
| 2546 | 2546 | static MACHINE_CONFIG_DERIVED( svi728, msx_pal ) |
| r31373 | r31374 | |
| 4573 | 4573 | MCFG_MSX_LAYOUT_RAM("ram2", 0, 2, 0, 2) /* 32KB RAM */ |
| 4574 | 4574 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0) |
| 4575 | 4575 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot2", 2, 0) |
| 4576 | MCFG_MSX_LAYOUT_ROM("empty", 3, 0, 0, 4, "maincpu", 0x10000) | |
| 4576 | MCFG_MSX_LAYOUT_ROM("empty", 3, 0, 0, 4, "maincpu", 0x10000) // Empty? or is this the 3rd cartridge/expansion slot ? 0x10000 used to be the "special" loading spot for the fmpac rom | |
| 4577 | 4577 | |
| 4578 | 4578 | MCFG_FRAGMENT_ADD( msx2_cartlist ) |
| 4579 | 4579 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
| 4730 | 4730 | MCFG_MSX_LAYOUT_DISK1("disk", 3, 0, 1, 1, "maincpu", 0xc000) |
| 4731 | 4731 | MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 3, 1, 0x40000) /* 256KB Mapper RAM */ |
| 4732 | 4732 | MCFG_MSX_RAMIO_SET_BITS(0x80) |
| 4733 | MCFG_MSX_LAYOUT_ROM("empty", 3, 3, 1, 1, "maincpu", 0x10000) | |
| 4733 | MCFG_MSX_LAYOUT_ROM("empty", 3, 3, 1, 1, "maincpu", 0x10000) // Empty/unknown, optional fmpac rom used to be loaded here, or should the util rom be loaded? | |
| 4734 | 4734 | |
| 4735 | 4735 | MCFG_FRAGMENT_ADD( msx_wd2793_force_ready ) |
| 4736 | 4736 | MCFG_FRAGMENT_ADD( msx_2_35_dd_drive ) |
| r31373 | r31374 | |
| 4844 | 4844 | // YM2149 (in S-1985 MSX Engine) |
| 4845 | 4845 | // FDC: None, 0 drives |
| 4846 | 4846 | // 2 Cartridge slots |
| 4847 | ||
| 4847 | // S-1985 MSX Engine | |
| 4848 | 4848 | |
| 4849 | 4849 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) |
| 4850 | 4850 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0) |
| r31373 | r31374 | |
| 4955 | 4955 | |
| 4956 | 4956 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) |
| 4957 | 4957 | MCFG_MSX_LAYOUT_RAM_MM("ram_mm", 1, 0, 0x20000) /* 128KB Mapper RAM */ |
| 4958 | ||
| 4958 | MCFG_MSX_RAMIO_SET_BITS(0x80) | |
| 4959 | 4959 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot", 2, 0) |
| 4960 | 4960 | MCFG_MSX_LAYOUT_ROM("ext", 3, 0, 0, 1, "maincpu", 0x8000) |
| 4961 | 4961 | MCFG_MSX_LAYOUT_ROM("turbo", 3, 0, 1, 1, "maincpu", 0x20000) |
| r31373 | r31374 | |
| 5210 | 5210 | static MACHINE_CONFIG_DERIVED( expert3t, msx2p ) |
| 5211 | 5211 | // AY8910 |
| 5212 | 5212 | // FDC: wd2793?, 1 or 2? drives |
| 5213 | // 4 Cartridge/Expansion slots? | |
| 5214 | // FM/YM2413 built-in | |
| 5213 | // 4 Cartridge/Expansion slots? | |
| 5214 | // FM/YM2413 built-in | |
| 5215 | 5215 | |
| 5216 | 5216 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) |
| 5217 | 5217 | MCFG_MSX_LAYOUT_CARTRIDGE("cartslot1", 1, 0) |
| r31373 | r31374 | |
| 5750 | 5750 | static MACHINE_CONFIG_DERIVED( fsa1gt, msx2 ) |
| 5751 | 5751 | // AY8910/YM2149? |
| 5752 | 5752 | // FDC: tc8566af, 1 3.5" DSDD drive |
| 5753 | // 2 Cartridge slots | |
| 5754 | // FM built-in | |
| 5755 | // MIDI | |
| 5753 | // 2 Cartridge slots | |
| 5754 | // FM built-in | |
| 5755 | // MIDI | |
| 5756 | 5756 | |
| 5757 | 5757 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) |
| 5758 | 5758 | MCFG_MSX_LAYOUT_MUSIC("mus", 0, 2, 1, 1, "maincpu", 0x38000) |
| r31373 | r31374 | |
| 5793 | 5793 | static MACHINE_CONFIG_DERIVED( fsa1st, msx2 ) |
| 5794 | 5794 | // AY8910/YM2149? |
| 5795 | 5795 | // FDC: tc8566af, 1 3.5" DSDD drive |
| 5796 | // 2 Cartridge slots | |
| 5797 | // FM built-in | |
| 5796 | // 2 Cartridge slots | |
| 5797 | // FM built-in | |
| 5798 | 5798 | |
| 5799 | 5799 | MCFG_MSX_LAYOUT_ROM("bios", 0, 0, 0, 2, "maincpu", 0x0000) |
| 5800 | 5800 | MCFG_MSX_LAYOUT_MUSIC("mus", 0, 2, 1, 1, "maincpu", 0x38000) |
| r31373 | r31374 | |
|---|---|---|
| 535 | 535 | MCFG_CASSETTE_ADD("cassette") |
| 536 | 536 | MCFG_CASSETTE_FORMATS(fc100_cassette_formats) |
| 537 | 537 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 538 | ||
| 538 | ||
| 539 | 539 | MCFG_DEVICE_ADD("uart", I8251, 0) |
| 540 | 540 | MCFG_I8251_TXD_HANDLER(WRITELINE(fc100_state, txdata_callback)) |
| 541 | 541 | MCFG_DEVICE_ADD("uart_clock", CLOCK, XTAL_4_9152MHz/16/16) // gives 19200 |
| r31373 | r31374 | |
|---|---|---|
| 405 | 405 | // ocs chipset (agnus with support for 512k or 1mb chip ram, denise) |
| 406 | 406 | DRIVER_INIT_MEMBER( a1000_state, pal ) |
| 407 | 407 | { |
| 408 | m_agnus_id = AGNUS_PAL; // 8367 | |
| 409 | m_denise_id = DENISE; // 8362 | |
| 408 | m_agnus_id = AGNUS_PAL; // 8367 | |
| 409 | m_denise_id = DENISE; // 8362 | |
| 410 | 410 | } |
| 411 | 411 | |
| 412 | 412 | DRIVER_INIT_MEMBER( a1000_state, ntsc ) |
| 413 | 413 | { |
| 414 | m_agnus_id = AGNUS_NTSC; // 8361 | |
| 415 | m_denise_id = DENISE; // 8362 | |
| 414 | m_agnus_id = AGNUS_NTSC; // 8361 | |
| 415 | m_denise_id = DENISE; // 8362 | |
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | DRIVER_INIT_MEMBER( a2000_state, pal ) |
| 419 | 419 | { |
| 420 | m_agnus_id = AGNUS_PAL; // 8371 (later versions 8372A) | |
| 421 | m_denise_id = DENISE; // 8362 | |
| 420 | m_agnus_id = AGNUS_PAL; // 8371 (later versions 8372A) | |
| 421 | m_denise_id = DENISE; // 8362 | |
| 422 | 422 | } |
| 423 | 423 | |
| 424 | 424 | DRIVER_INIT_MEMBER( a2000_state, ntsc ) |
| 425 | 425 | { |
| 426 | m_agnus_id = AGNUS_NTSC; // 8370 (later versions 8372A) | |
| 427 | m_denise_id = DENISE; // 8362 | |
| 426 | m_agnus_id = AGNUS_NTSC; // 8370 (later versions 8372A) | |
| 427 | m_denise_id = DENISE; // 8362 | |
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | DRIVER_INIT_MEMBER( a500_state, pal ) |
| 431 | 431 | { |
| 432 | m_agnus_id = AGNUS_PAL; // 8371 (later versions 8372A) | |
| 433 | m_denise_id = DENISE; // 8362 | |
| 432 | m_agnus_id = AGNUS_PAL; // 8371 (later versions 8372A) | |
| 433 | m_denise_id = DENISE; // 8362 | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | DRIVER_INIT_MEMBER( a500_state, ntsc ) |
| 437 | 437 | { |
| 438 | m_agnus_id = AGNUS_NTSC; // 8370 (later versions 8372A) | |
| 439 | m_denise_id = DENISE; // 8362 | |
| 438 | m_agnus_id = AGNUS_NTSC; // 8370 (later versions 8372A) | |
| 439 | m_denise_id = DENISE; // 8362 | |
| 440 | 440 | } |
| 441 | 441 | |
| 442 | 442 | DRIVER_INIT_MEMBER( cdtv_state, pal ) |
| 443 | 443 | { |
| 444 | m_agnus_id = AGNUS_HR_PAL; // 8372A | |
| 445 | m_denise_id = DENISE; // 8362 | |
| 444 | m_agnus_id = AGNUS_HR_PAL; // 8372A | |
| 445 | m_denise_id = DENISE; // 8362 | |
| 446 | 446 | } |
| 447 | 447 | |
| 448 | 448 | DRIVER_INIT_MEMBER( cdtv_state, ntsc ) |
| 449 | 449 | { |
| 450 | m_agnus_id = AGNUS_HR_NTSC; // 8372A | |
| 451 | m_denise_id = DENISE; // 8362 | |
| 450 | m_agnus_id = AGNUS_HR_NTSC; // 8372A | |
| 451 | m_denise_id = DENISE; // 8362 | |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | 454 | // ecs chipset (agnus with support for 2mb chip ram, super denise) |
| 455 | 455 | DRIVER_INIT_MEMBER( a3000_state, pal ) |
| 456 | 456 | { |
| 457 | m_agnus_id = AGNUS_HR_PAL_NEW; // 8372B (early versions: 8372AB) | |
| 458 | m_denise_id = DENISE_HR; // 8373 | |
| 457 | m_agnus_id = AGNUS_HR_PAL_NEW; // 8372B (early versions: 8372AB) | |
| 458 | m_denise_id = DENISE_HR; // 8373 | |
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | DRIVER_INIT_MEMBER( a3000_state, ntsc ) |
| 462 | 462 | { |
| 463 | m_agnus_id = AGNUS_HR_NTSC_NEW; // 8372B (early versions: 8372AB) | |
| 464 | m_denise_id = DENISE_HR; // 8373 | |
| 463 | m_agnus_id = AGNUS_HR_NTSC_NEW; // 8372B (early versions: 8372AB) | |
| 464 | m_denise_id = DENISE_HR; // 8373 | |
| 465 | 465 | } |
| 466 | 466 | |
| 467 | 467 | DRIVER_INIT_MEMBER( a500p_state, pal ) |
| 468 | 468 | { |
| 469 | m_agnus_id = AGNUS_HR_PAL; // 8375 (390544-01) | |
| 470 | m_denise_id = DENISE_HR; // 8373 | |
| 469 | m_agnus_id = AGNUS_HR_PAL; // 8375 (390544-01) | |
| 470 | m_denise_id = DENISE_HR; // 8373 | |
| 471 | 471 | } |
| 472 | 472 | |
| 473 | 473 | DRIVER_INIT_MEMBER( a500p_state, ntsc ) |
| 474 | 474 | { |
| 475 | m_agnus_id = AGNUS_HR_NTSC; // 8375 (390544-02) | |
| 476 | m_denise_id = DENISE_HR; // 8373 | |
| 475 | m_agnus_id = AGNUS_HR_NTSC; // 8375 (390544-02) | |
| 476 | m_denise_id = DENISE_HR; // 8373 | |
| 477 | 477 | } |
| 478 | 478 | |
| 479 | 479 | DRIVER_INIT_MEMBER( a600_state, pal ) |
| 480 | 480 | { |
| 481 | m_agnus_id = AGNUS_HR_PAL; // 8375 (390544-01) | |
| 482 | m_denise_id = DENISE_HR; // 8373 | |
| 481 | m_agnus_id = AGNUS_HR_PAL; // 8375 (390544-01) | |
| 482 | m_denise_id = DENISE_HR; // 8373 | |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | 485 | DRIVER_INIT_MEMBER( a600_state, ntsc ) |
| 486 | 486 | { |
| 487 | m_agnus_id = AGNUS_HR_NTSC; // 8375 (390544-02) | |
| 488 | m_denise_id = DENISE_HR; // 8373 | |
| 487 | m_agnus_id = AGNUS_HR_NTSC; // 8375 (390544-02) | |
| 488 | m_denise_id = DENISE_HR; // 8373 | |
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | // aga chipset (alice and lisa) |
| r31373 | r31374 | |
| 2029 | 2029 | |
| 2030 | 2030 | ROM_START( cd32 ) |
| 2031 | 2031 | ROM_REGION32_BE(0x100000, "kickstart", 0) |
| 2032 | // | |
| 2032 | // ROM_LOAD16_WORD("391640-03.u6a", 0x000000, 0x100000, CRC(a4fbc94a) SHA1(816ce6c5077875850c7d43452230a9ba3a2902db)) // todo: this is the real dump | |
| 2033 | 2033 | ROM_LOAD16_WORD("391640-03.u6a", 0x000000, 0x100000, CRC(d3837ae4) SHA1(06807db3181637455f4d46582d9972afec8956d9)) |
| 2034 | 2034 | ROM_END |
| 2035 | 2035 |
| r31373 | r31374 | |
|---|---|---|
| 123 | 123 | MCFG_CASSETTE_FORMATS(rko_cassette_formats) |
| 124 | 124 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 125 | 125 | MCFG_CASSETTE_INTERFACE("orion_cass") |
| 126 | ||
| 126 | ||
| 127 | 127 | MCFG_SOFTWARE_LIST_ADD("cass_list","orion_cass") |
| 128 | 128 | |
| 129 | 129 | MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8) |
| r31373 | r31374 | |
| 202 | 202 | MCFG_CASSETTE_FORMATS(rko_cassette_formats) |
| 203 | 203 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 204 | 204 | MCFG_CASSETTE_INTERFACE("orion_cass") |
| 205 | ||
| 205 | ||
| 206 | 206 | MCFG_SOFTWARE_LIST_ADD("cass_list","orion_cass") |
| 207 | 207 | |
| 208 | 208 | MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8) |
| r31373 | r31374 | |
| 277 | 277 | MCFG_CASSETTE_FORMATS(rko_cassette_formats) |
| 278 | 278 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 279 | 279 | MCFG_CASSETTE_INTERFACE("orion_cass") |
| 280 | ||
| 280 | ||
| 281 | 281 | MCFG_SOFTWARE_LIST_ADD("cass_list","orion_cass") |
| 282 | 282 | |
| 283 | 283 | MCFG_FD1793x_ADD("fd1793", XTAL_8MHz / 8) |
| r31373 | r31374 | |
|---|---|---|
| 83 | 83 | |
| 84 | 84 | 2014/03/25 Mike Saarna Fixed Riot Timer |
| 85 | 85 | |
| 86 | 2014/05/06 Mike Saarna/Robert Tuccitto Brought initial Maria cycle counts | |
| 87 | + inline from measurements taken with logic analyzer and tests. | |
| 86 | 2014/05/06 Mike Saarna/Robert Tuccitto Brought initial Maria cycle counts | |
| 87 | + inline from measurements taken with logic analyzer and tests. | |
| 88 | 88 | ***************************************************************************/ |
| 89 | 89 | |
| 90 | 90 | #include "emu.h" |
| r31373 | r31374 | |
|---|---|---|
| 85 | 85 | /* video hardware */ |
| 86 | 86 | MCFG_DEVICE_ADD(TERMINAL_TAG, GENERIC_TERMINAL, 0) |
| 87 | 87 | MCFG_GENERIC_TERMINAL_KEYBOARD_CB(WRITE8(ms9540_state, kbd_put)) |
| 88 | ||
| 88 | ||
| 89 | 89 | MACHINE_CONFIG_END |
| 90 | 90 | |
| 91 | 91 | /* ROM definition */ |
| r31373 | r31374 | |
|---|---|---|
| 36 | 36 | required_shared_ptr<UINT8> m_lcd_data; |
| 37 | 37 | required_ioport_array<8> m_keyboard; |
| 38 | 38 | required_ioport m_io_on; |
| 39 | ||
| 39 | ||
| 40 | 40 | UINT8 m_kb_matrix; |
| 41 | 41 | |
| 42 | 42 | UINT32 screen_update(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| r31373 | r31374 | |
| 72 | 72 | UINT8 data = 0xff; |
| 73 | 73 | |
| 74 | 74 | if (!started()) return 0; |
| 75 | ||
| 75 | ||
| 76 | 76 | for (int i = 0; i < 8; i++) |
| 77 | 77 | { |
| 78 | 78 | if (!BIT(m_kb_matrix, i)) |
| r31373 | r31374 | |
|---|---|---|
| 170 | 170 | MCFG_CLOCK_SIGNAL_HANDLER(WRITELINE(sdk86_state, write_usart_clock)) |
| 171 | 171 | |
| 172 | 172 | MCFG_DEVICE_ADD("i8279", I8279, 2500000) // based on divider |
| 173 | MCFG_I8279_OUT_SL_CB(WRITE8(sdk86_state, scanlines_w)) // scan SL lines | |
| 174 | MCFG_I8279_OUT_DISP_CB(WRITE8(sdk86_state, digit_w)) // display A&B | |
| 175 | MCFG_I8279_IN_RL_CB(READ8(sdk86_state, kbd_r)) // kbd RL lines | |
| 176 | MCFG_I8279_IN_SHIFT_CB(GND) // Shift key | |
| 173 | MCFG_I8279_OUT_SL_CB(WRITE8(sdk86_state, scanlines_w)) // scan SL lines | |
| 174 | MCFG_I8279_OUT_DISP_CB(WRITE8(sdk86_state, digit_w)) // display A&B | |
| 175 | MCFG_I8279_IN_RL_CB(READ8(sdk86_state, kbd_r)) // kbd RL lines | |
| 176 | MCFG_I8279_IN_SHIFT_CB(GND) // Shift key | |
| 177 | 177 | MCFG_I8279_IN_CTRL_CB(GND) |
| 178 | 178 | |
| 179 | 179 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 491 | 491 | { |
| 492 | 492 | UINT8 *ROM = memregion("cart")->base(); |
| 493 | 493 | UINT32 cart_size; |
| 494 | ||
| 494 | ||
| 495 | 495 | if (image.software_entry() == NULL) |
| 496 | 496 | { |
| 497 | 497 | cart_size = image.length(); |
| r31373 | r31374 | |
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | image.fread(ROM, cart_size); |
| 505 | ||
| 505 | ||
| 506 | 506 | // attempt to identify Space Destroyer, which needs 1K of additional RAM |
| 507 | 507 | if (cart_size == 0x1800) |
| 508 | 508 | { |
| r31373 | r31374 | |
| 527 | 527 | m_cart_ram.resize(image.get_software_region_length("ram")); |
| 528 | 528 | } |
| 529 | 529 | } |
| 530 | ||
| 530 | ||
| 531 | 531 | return IMAGE_INIT_PASS; |
| 532 | 532 | } |
| 533 | 533 | |
| r31373 | r31374 | |
| 611 | 611 | MCFG_CASSETTE_ADD( "cassette" ) |
| 612 | 612 | MCFG_CASSETTE_FORMATS(apf_cassette_formats) |
| 613 | 613 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) |
| 614 | ||
| 614 | ||
| 615 | 615 | MCFG_FD1771x_ADD("fdc", 1000000) // guess |
| 616 | 616 | MCFG_FLOPPY_DRIVE_ADD("fdc:0", apf_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| 617 | 617 | MCFG_FLOPPY_DRIVE_ADD("fdc:1", apf_floppies, "525dd", floppy_image_device::default_floppy_formats) |
| r31373 | r31374 | |
|---|---|---|
| 717 | 717 | |
| 718 | 718 | /* video hardware */ |
| 719 | 719 | MCFG_DEVICE_ADD( "tms9929a", TMS9929A, XTAL_10_738635MHz / 2 ) |
| 720 | MCFG_TMS9928A_VRAM_SIZE(0x4000) | |
| 720 | MCFG_TMS9928A_VRAM_SIZE(0x4000) /* 16k RAM, provided by IC i040 and i041 */ | |
| 721 | 721 | MCFG_TMS9928A_SET_SCREEN( "screen" ) |
| 722 | 722 | MCFG_TMS9928A_SCREEN_ADD_PAL( "screen" ) |
| 723 | 723 | MCFG_SCREEN_UPDATE_DEVICE( "tms9929a", tms9929a_device, screen_update ) |
| r31373 | r31374 | |
|---|---|---|
| 592 | 592 | MCFG_CASSETTE_MODIFY( "cassette" ) |
| 593 | 593 | MCFG_CASSETTE_FORMATS(trs80l2_cassette_formats) |
| 594 | 594 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY) |
| 595 | ||
| 595 | ||
| 596 | 596 | MCFG_QUICKLOAD_ADD("quickload", trs80_state, trs80_cmd, "cmd", 0.5) |
| 597 | 597 | |
| 598 | 598 | MCFG_DEVICE_ADD("wd179x", FD1793, 0) // should be FD1771 or FD1791 but inverted data lines are too tricky to fix now |
| r31373 | r31374 | |
|---|---|---|
| 323 | 323 | MCFG_SNAPSHOT_ADD("snapshot", mtx_state, mtx, "mtx", 1) |
| 324 | 324 | MCFG_CASSETTE_ADD("cassette") |
| 325 | 325 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_MUTED) |
| 326 | ||
| 326 | ||
| 327 | 327 | MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", mtx_state, cassette_tick, attotime::from_hz(44100)) |
| 328 | 328 | |
| 329 | 329 | /* internal ram */ |
| r31373 | r31374 | |
|---|---|---|
| 9 | 9 | Many thanks to Guru, Fabien, Runik and Charles MacDonald for the help given. |
| 10 | 10 | |
| 11 | 11 | =================================================================================================== |
| 12 | ||
| 12 | ||
| 13 | 13 | Notes: |
| 14 | 14 | -To enter into an Advanced Test Mode,keep pressed the Test Button (F2) on the start-up. |
| 15 | 15 | -Memo: Some tests done on the original & working PCB,to be implemented: |
| r31373 | r31374 | |
|---|---|---|
| 558 | 558 | MCFG_CASSETTE_FORMATS(tzx_cassette_formats) |
| 559 | 559 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 560 | 560 | MCFG_CASSETTE_INTERFACE("samcoupe_cass") |
| 561 | ||
| 561 | ||
| 562 | 562 | MCFG_SOFTWARE_LIST_ADD("cass_list","samcoupe_cass") |
| 563 | 563 | |
| 564 | 564 | MCFG_WD1772x_ADD("wd1772", SAMCOUPE_XTAL_X1/3) |
| r31373 | r31374 | |
|---|---|---|
| 236 | 236 | MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 237 | 237 | MCFG_Z80PIO_OUT_PA_CB(WRITE8(z9001_state, port88_w)) |
| 238 | 238 | |
| 239 | MCFG_DEVICE_ADD("z80pio2", Z80PIO, XTAL_9_8304MHz / 4) | |
| 239 | MCFG_DEVICE_ADD("z80pio2", Z80PIO, XTAL_9_8304MHz / 4) // keyboard PIO | |
| 240 | 240 | MCFG_Z80PIO_OUT_INT_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 241 | 241 | |
| 242 | 242 | MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL_9_8304MHz / 4) |
| r31373 | r31374 | |
|---|---|---|
| 42 | 42 | AMI 1041036-1 - 68-pin QFP AMI Gate Array |
| 43 | 43 | HD44100H - 60-pin QFP Hitachi HD44100 LCD Driver |
| 44 | 44 | HD44780A00 - 80-pin TFP Hitachi HD44780 LCD Controller |
| 45 | ||
| 45 | ||
| 46 | 46 | * - indicates that it's on the other side of the PCB |
| 47 | ||
| 48 | ||
| 47 | ||
| 48 | ||
| 49 | 49 | CC-40 is powered by 4 AA batteries. These will also save internal RAM, |
| 50 | 50 | provided that the machine is turned off properly. If a program is running, |
| 51 | 51 | you may have to press [BREAK] before turning the CC-40 off. |
| 52 | ||
| 52 | ||
| 53 | 53 | To run a cartridge, usually the command RUN "DIR" shows which program(s) |
| 54 | 54 | can be loaded. Load a program by pressing the [RUN] key while viewing the list, |
| 55 | 55 | or manually with the command RUN "<shortname of program in list>" |
| r31373 | r31374 | |
| 90 | 90 | |
| 91 | 91 | required_device<tms70c20_device> m_maincpu; |
| 92 | 92 | required_device<dac_device> m_dac; |
| 93 | ||
| 93 | ||
| 94 | 94 | ioport_port *m_key_matrix[8]; |
| 95 | 95 | |
| 96 | 96 | UINT8 m_power; |
| 97 | 97 | UINT8 m_banks; |
| 98 | 98 | UINT8 m_clock_control; |
| 99 | 99 | UINT8 m_key_select; |
| 100 | ||
| 100 | ||
| 101 | 101 | void update_lcd_indicator(UINT8 y, UINT8 x, int state); |
| 102 | 102 | |
| 103 | 103 | DECLARE_READ8_MEMBER(bus_control_r); |
| r31373 | r31374 | |
| 215 | 215 | { |
| 216 | 216 | // d0: power-on hold latch |
| 217 | 217 | m_power = data & 1; |
| 218 | ||
| 218 | ||
| 219 | 219 | // stop running |
| 220 | 220 | if (!m_power) |
| 221 | 221 | m_maincpu->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); |
| r31373 | r31374 | |
| 242 | 242 | { |
| 243 | 243 | // d0-d1: system rom bankswitch |
| 244 | 244 | membank("sysbank")->set_entry(data & 3); |
| 245 | ||
| 245 | ||
| 246 | 246 | // d2-d3: cartridge rom bankswitch |
| 247 | 247 | membank("cartbank")->set_entry(data >> 2 & 3); |
| 248 | 248 | |
| r31373 | r31374 | |
| 271 | 271 | // high to low |
| 272 | 272 | m_maincpu->set_clock_scale(1); |
| 273 | 273 | } |
| 274 | ||
| 274 | ||
| 275 | 275 | m_clock_control = data & 0x0f; |
| 276 | 276 | } |
| 277 | 277 | |
| r31373 | r31374 | |
| 285 | 285 | if (m_key_select >> i & 1) |
| 286 | 286 | ret |= m_key_matrix[i]->read(); |
| 287 | 287 | } |
| 288 | ||
| 288 | ||
| 289 | 289 | return ret; |
| 290 | 290 | } |
| 291 | 291 | |
| r31373 | r31374 | |
| 427 | 427 | void cc40_state::machine_reset() |
| 428 | 428 | { |
| 429 | 429 | m_power = 1; |
| 430 | ||
| 430 | ||
| 431 | 431 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 432 | 432 | bankswitch_w(space, 0, 0); |
| 433 | 433 | } |
| r31373 | r31374 | |
| 437 | 437 | static const char *const tags[] = { "IN0", "IN1", "IN2", "IN3", "IN4", "IN5", "IN6", "IN7" }; |
| 438 | 438 | for (int i = 0; i < 8; i++) |
| 439 | 439 | m_key_matrix[i] = ioport(tags[i]); |
| 440 | ||
| 440 | ||
| 441 | 441 | membank("sysbank")->configure_entries(0, 4, memregion("system")->base(), 0x2000); |
| 442 | 442 | membank("cartbank")->configure_entries(0, 4, memregion("user1")->base(), 0x8000); |
| 443 | 443 | |
| r31373 | r31374 | |
| 446 | 446 | m_banks = 0; |
| 447 | 447 | m_clock_control = 0; |
| 448 | 448 | m_key_select = 0; |
| 449 | ||
| 449 | ||
| 450 | 450 | // register for savestates |
| 451 | 451 | save_item(NAME(m_power)); |
| 452 | 452 | save_item(NAME(m_banks)); |
| r31373 | r31374 | |
| 511 | 511 | |
| 512 | 512 | ROM_REGION( 0x8000, "system", 0 ) |
| 513 | 513 | ROM_LOAD( "cc40.bin", 0x0000, 0x8000, CRC(f5322fab) SHA1(1b5c4052a53654363c458f75eac7a27f0752def6) ) // system rom, banked |
| 514 | ||
| 514 | ||
| 515 | 515 | ROM_REGION( 0x20000, "user1", ROMREGION_ERASEFF ) // cartridge area, max 4*32KB |
| 516 | 516 | ROM_END |
| 517 | 517 |
| r31373 | r31374 | |
|---|---|---|
| 160 | 160 | MCFG_CASSETTE_FORMATS(hector_cassette_formats) |
| 161 | 161 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MASK_SPEAKER) |
| 162 | 162 | MCFG_CASSETTE_INTERFACE("interact_cass") |
| 163 | ||
| 163 | ||
| 164 | 164 | MCFG_SOFTWARE_LIST_ADD("cass_list","interact") |
| 165 | 165 | |
| 166 | 166 | /* printer */ |
| r31373 | r31374 | |
|---|---|---|
| 378 | 378 | MCFG_CASSETTE_FORMATS(rkr_cassette_formats) |
| 379 | 379 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 380 | 380 | MCFG_CASSETTE_INTERFACE("radio86_cass") |
| 381 | ||
| 381 | ||
| 382 | 382 | MCFG_SOFTWARE_LIST_ADD("cass_list","radio86") |
| 383 | 383 | MACHINE_CONFIG_END |
| 384 | 384 |
| r31373 | r31374 | |
|---|---|---|
| 938 | 938 | MCFG_DEVICE_ADD("z80ctc", Z80CTC, XTAL_4MHz) |
| 939 | 939 | MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 940 | 940 | MCFG_Z80CTC_ZC0_CB(DEVWRITELINE("z80ctc", z80ctc_device, trg1)) |
| 941 | MCFG_Z80CTC_ZC1_CB(DEVWRITELINE("z80ctc", z80ctc_device, trg2)) | |
| 941 | MCFG_Z80CTC_ZC1_CB(DEVWRITELINE("z80ctc", z80ctc_device, trg2)) // beep interface | |
| 942 | 942 | MCFG_Z80CTC_ZC2_CB(DEVWRITELINE("z80ctc", z80ctc_device, trg3)) |
| 943 | 943 | |
| 944 | 944 | MCFG_DEVICE_ADD("z80pio", Z80PIO, XTAL_4MHz) |
| r31373 | r31374 | |
|---|---|---|
| 65 | 65 | AM_RANGE(0x00, 0x00) AM_DEVWRITE("ym2164", ym2151_device, register_w) |
| 66 | 66 | AM_RANGE(0x01, 0x01) AM_DEVREADWRITE("ym2164", ym2151_device, status_r, data_w) |
| 67 | 67 | |
| 68 | ||
| 68 | // 10-11 USART uPD71051C 4MHz & 4MHz / 8 | |
| 69 | 69 | AM_RANGE(0x10, 0x10) AM_DEVREADWRITE("upd71051", i8251_device, data_r, data_w) |
| 70 | 70 | AM_RANGE(0x11, 0x11) AM_DEVREADWRITE("upd71051", i8251_device, status_r, control_w) |
| 71 | 71 | |
| r31373 | r31374 | |
| 224 | 224 | |
| 225 | 225 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT COMPANY FULLNAME FLAGS */ |
| 226 | 226 | CONS( 1986, fb01, 0, 0, fb01, fb01, driver_device, 0, "Yamaha", "FB-01", GAME_SUPPORTS_SAVE ) |
| 227 |
| r31373 | r31374 | |
|---|---|---|
| 13 | 13 | Apple 2 disc drives for storage. |
| 14 | 14 | |
| 15 | 15 | This driver originally by Paul Cook, rewritten by Kevin Thacker, |
| 16 | ||
| 16 | re-rewritten by Olivier Galibert. | |
| 17 | 17 | |
| 18 | 18 | *********************************************************************/ |
| 19 | 19 | |
| r31373 | r31374 | |
| 46 | 46 | |
| 47 | 47 | oric_state(const machine_config &mconfig, device_type type, const char *tag) |
| 48 | 48 | : driver_device(mconfig, type, tag), |
| 49 | m_maincpu(*this, "maincpu"), | |
| 50 | m_psg(*this, "ay8912"), | |
| 51 | m_centronics(*this, "centronics"), | |
| 52 | m_cent_data_out(*this, "cent_data_out"), | |
| 53 | m_cassette(*this, "cassette"), | |
| 54 | m_via(*this, "via6522"), | |
| 55 | m_ram(*this, "ram"), | |
| 56 | m_rom(*this, "maincpu"), | |
| 57 | m_bank_c000_r(*this, "bank_c000_r"), | |
| 58 | m_bank_e000_r(*this, "bank_e000_r"), | |
| 59 | m_bank_f800_r(*this, "bank_f800_r"), | |
| 60 | m_bank_c000_w(*this, "bank_c000_w"), | |
| 61 | m_bank_e000_w(*this, "bank_e000_w"), | |
| 62 | m_bank_f800_w(*this, "bank_f800_w"), | |
| 63 | m_config(*this, "CONFIG") { } | |
| 49 | m_maincpu(*this, "maincpu"), | |
| 50 | m_psg(*this, "ay8912"), | |
| 51 | m_centronics(*this, "centronics"), | |
| 52 | m_cent_data_out(*this, "cent_data_out"), | |
| 53 | m_cassette(*this, "cassette"), | |
| 54 | m_via(*this, "via6522"), | |
| 55 | m_ram(*this, "ram"), | |
| 56 | m_rom(*this, "maincpu"), | |
| 57 | m_bank_c000_r(*this, "bank_c000_r"), | |
| 58 | m_bank_e000_r(*this, "bank_e000_r"), | |
| 59 | m_bank_f800_r(*this, "bank_f800_r"), | |
| 60 | m_bank_c000_w(*this, "bank_c000_w"), | |
| 61 | m_bank_e000_w(*this, "bank_e000_w"), | |
| 62 | m_bank_f800_w(*this, "bank_f800_w"), | |
| 63 | m_config(*this, "CONFIG") { } | |
| 64 | 64 | |
| 65 | 65 | DECLARE_INPUT_CHANGED_MEMBER(nmi_pressed); |
| 66 | 66 | DECLARE_WRITE8_MEMBER(via_a_w); |
| r31373 | r31374 | |
| 120 | 120 | m_telmon24(*this, "telmon24"), |
| 121 | 121 | m_joy1(*this, "JOY1"), |
| 122 | 122 | m_joy2(*this, "JOY2") |
| 123 | ||
| 123 | { } | |
| 124 | 124 | |
| 125 | 125 | DECLARE_WRITE8_MEMBER(via2_a_w); |
| 126 | 126 | DECLARE_WRITE8_MEMBER(via2_b_w); |
| r31373 | r31374 | |
| 307 | 307 | |
| 308 | 308 | INPUT_CHANGED_MEMBER(oric_state::nmi_pressed) |
| 309 | 309 | { |
| 310 | m_maincpu->set_input_line(m6502_device::NMI_LINE, newval ? ASSERT_LINE : CLEAR_LINE); | |
| 310 | m_maincpu->set_input_line(m6502_device::NMI_LINE, newval ? ASSERT_LINE : CLEAR_LINE); | |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | WRITE8_MEMBER(oric_state::via_a_w) |
| r31373 | r31374 | |
| 323 | 323 | update_keyboard(); |
| 324 | 324 | m_centronics->write_strobe(data & 0x10 ? 1 : 0); |
| 325 | 325 | m_cassette->change_state(data & 0x40 ? CASSETTE_MOTOR_ENABLED : CASSETTE_MOTOR_DISABLED, |
| 326 | | |
| 326 | CASSETTE_MOTOR_DISABLED); | |
| 327 | 327 | m_cassette->output(data & 0x80 ? -1.0 : +1.0); |
| 328 | 328 | } |
| 329 | 329 | |
| r31373 | r31374 | |
| 426 | 426 | void telestrat_state::update_irq() |
| 427 | 427 | { |
| 428 | 428 | m_maincpu->set_input_line(m6502_device::IRQ_LINE, |
| 429 | m_via_irq || | |
| 430 | m_ext_irq || | |
| 431 | (m_fdc_irq && (m_port_314 & P_IRQEN)) || | |
| 432 | m_via2_irq || | |
| 433 | m_acia_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 429 | m_via_irq || | |
| 430 | m_ext_irq || | |
| 431 | (m_fdc_irq && (m_port_314 & P_IRQEN)) || | |
| 432 | m_via2_irq || | |
| 433 | m_acia_irq ? ASSERT_LINE : CLEAR_LINE); | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | WRITE8_MEMBER(telestrat_state::via2_a_w) |
| r31373 | r31374 | |
| 801 | 801 | MCFG_CASSETTE_ADD( "cassette" ) |
| 802 | 802 | MCFG_CASSETTE_FORMATS(oric_cassette_formats) |
| 803 | 803 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_PLAY | CASSETTE_MOTOR_DISABLED) |
| 804 | ||
| 804 | ||
| 805 | 805 | MCFG_TIMER_DRIVER_ADD_PERIODIC("tape_timer", oric_state, update_tape, attotime::from_hz(4800)) |
| 806 | 806 | |
| 807 | 807 | /* via */ |
| r31373 | r31374 | |
| 933 | 933 | ROM_START(prav8d) |
| 934 | 934 | ROM_REGION(0x4000, "maincpu", 0) /* 0x10000 + 0x04000 + 0x00100 + 0x00200 */ |
| 935 | 935 | ROM_LOAD( "pravetzt.rom", 0, 0x4000, CRC(58079502) SHA1(7afc276cb118adff72e4f16698f94bf3b2c64146) ) |
| 936 | // ROM_LOAD_OPTIONAL( "8ddoslo.rom", 0x014000, 0x0100, CRC(0c82f636) SHA1(b29d151a0dfa3c7cd50439b51d0a8f95559bc2b6) ) | |
| 937 | // ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) ) | |
| 936 | // ROM_LOAD_OPTIONAL( "8ddoslo.rom", 0x014000, 0x0100, CRC(0c82f636) SHA1(b29d151a0dfa3c7cd50439b51d0a8f95559bc2b6) ) | |
| 937 | // ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) ) | |
| 938 | 938 | ROM_END |
| 939 | 939 | |
| 940 | 940 | ROM_START(prav8dd) |
| r31373 | r31374 | |
| 943 | 943 | ROMX_LOAD( "8d.rom", 0, 0x4000, CRC(b48973ef) SHA1(fd47c977fc215a3b577596a7483df53e8a1e9c83), ROM_BIOS(1) ) |
| 944 | 944 | ROM_SYSTEM_BIOS( 1, "radosoft", "RadoSoft Disk ROM, 1992") |
| 945 | 945 | ROMX_LOAD( "pravetzd.rom", 0, 0x4000, CRC(f8d23821) SHA1(f87ad3c5832773b6e0614905552a80c98dc8e2a5), ROM_BIOS(2) ) |
| 946 | // ROM_LOAD_OPTIONAL( "8ddoslo.rom", 0x014000, 0x0100, CRC(0c82f636) SHA1(b29d151a0dfa3c7cd50439b51d0a8f95559bc2b6) ) | |
| 947 | // ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) ) | |
| 946 | // ROM_LOAD_OPTIONAL( "8ddoslo.rom", 0x014000, 0x0100, CRC(0c82f636) SHA1(b29d151a0dfa3c7cd50439b51d0a8f95559bc2b6) ) | |
| 947 | // ROM_LOAD_OPTIONAL( "8ddoshi.rom", 0x014100, 0x0200, CRC(66309641) SHA1(9c2e82b3c4d385ade6215fcb89f8b92e6fd2bf4b) ) | |
| 948 | 948 | ROM_END |
| 949 | 949 | |
| 950 | 950 |
| r31373 | r31374 | |
|---|---|---|
| 190 | 190 | MCFG_CASSETTE_FORMATS(orao_cassette_formats) |
| 191 | 191 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED | CASSETTE_MOTOR_ENABLED) |
| 192 | 192 | MCFG_CASSETTE_INTERFACE("orao_cass") |
| 193 | ||
| 193 | ||
| 194 | 194 | MCFG_SOFTWARE_LIST_ADD("cass_list","orao") |
| 195 | 195 | MACHINE_CONFIG_END |
| 196 | 196 |
| r31373 | r31374 | |
|---|---|---|
| 298 | 298 | MCFG_Z80CTC_INTR_CB(INPUTLINE("maincpu", INPUT_LINE_IRQ0)) |
| 299 | 299 | // ZC0 : SIO channel A clock |
| 300 | 300 | // ZC1 : SIO channel B clock |
| 301 | MCFG_Z80CTC_ZC2_CB(WRITELINE(pcm_state, pcm_82_w)) | |
| 301 | MCFG_Z80CTC_ZC2_CB(WRITELINE(pcm_state, pcm_82_w)) // speaker | |
| 302 | 302 | MACHINE_CONFIG_END |
| 303 | 303 | |
| 304 | 304 | /* ROM definition */ |
| r31373 | r31374 | |
|---|---|---|
| 154 | 154 | static ADDRESS_MAP_START( cybikoxt_io, AS_IO, 16, cybiko_state ) |
| 155 | 155 | AM_RANGE(h8_device::PORT_A, h8_device::PORT_A) AM_READ(xtpower_r) |
| 156 | 156 | AM_RANGE(h8_device::PORT_F, h8_device::PORT_F) AM_READWRITE(xtclock_r, xtclock_w) |
| 157 | ADDRESS_MAP_END | |
| 157 | ADDRESS_MAP_END | |
| 158 | 158 | |
| 159 | 159 | ///////////////// |
| 160 | 160 | // INPUT PORTS // |
| r31373 | r31374 | |
| 360 | 360 | MCFG_AT45DBXXX_SO_CALLBACK(DEVWRITELINE("maincpu:sci1", h8_sci_device, rx_w)) |
| 361 | 361 | |
| 362 | 362 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 363 | ||
| 363 | ||
| 364 | 364 | /* internal ram */ |
| 365 | 365 | MCFG_RAM_ADD(RAM_TAG) |
| 366 | 366 | MCFG_RAM_DEFAULT_SIZE("512K") |
| r31373 | r31374 | |
| 397 | 397 | |
| 398 | 398 | // machine |
| 399 | 399 | MCFG_DEVICE_REMOVE("flash1") |
| 400 | MCFG_SST_39VF400A_ADD("flashxt") | |
| 400 | MCFG_SST_39VF400A_ADD("flashxt") | |
| 401 | 401 | |
| 402 | 402 | /* internal ram */ |
| 403 | 403 | MCFG_RAM_MODIFY(RAM_TAG) |
| r31373 | r31374 | |
|---|---|---|
| 981 | 981 | SLOT_INTERFACE("corvus", A2BUS_CORVUS) /* Corvus flat-cable HDD interface (must go in slot 6) */ |
| 982 | 982 | SLOT_INTERFACE("mcms1", A2BUS_MCMS1) /* Mountain Computer Music System, card 1 of 2 */ |
| 983 | 983 | SLOT_INTERFACE("mcms2", A2BUS_MCMS2) /* Mountain Computer Music System, card 2 of 2. must be in card 1's slot + 1! */ |
| 984 | SLOT_INTERFACE("dx1", A2BUS_DX1) | |
| 984 | SLOT_INTERFACE("dx1", A2BUS_DX1) /* Decillonix DX-1 sampler card */ | |
| 985 | 985 | SLOT_INTERFACE_END |
| 986 | 986 | |
| 987 | 987 | static SLOT_INTERFACE_START(apple2eaux_cards) |
| r31373 | r31374 | |
| 1062 | 1062 | /* default configuration: on real machine is present also in configurations */ |
| 1063 | 1063 | /* with less memory, provided that the language card is installed */ |
| 1064 | 1064 | MCFG_CASSETTE_ADD( "cassette" ) |
| 1065 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) | |
| 1065 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) | |
| 1066 | 1066 | MACHINE_CONFIG_END |
| 1067 | 1067 | |
| 1068 | 1068 | static MACHINE_CONFIG_DERIVED( apple2p, apple2_common ) |
| r31373 | r31374 | |
| 1078 | 1078 | /* default configuration: on real machine is present also in configurations */ |
| 1079 | 1079 | /* with less memory, provided that the language card is installed */ |
| 1080 | 1080 | MCFG_CASSETTE_ADD( "cassette" ) |
| 1081 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) | |
| 1081 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) | |
| 1082 | 1082 | MACHINE_CONFIG_END |
| 1083 | 1083 | |
| 1084 | 1084 | static MACHINE_CONFIG_DERIVED( apple2e, apple2_common ) |
| r31373 | r31374 | |
| 1162 | 1162 | MCFG_A2BUS_SLOT_REMOVE("sl7") |
| 1163 | 1163 | |
| 1164 | 1164 | MCFG_DEVICE_ADD(IIC_ACIA1_TAG, MOS6551, 0) |
| 1165 | MCFG_MOS6551_XTAL(XTAL_14_31818MHz / 8) | |
| 1165 | MCFG_MOS6551_XTAL(XTAL_14_31818MHz / 8) // ~1.789 MHz | |
| 1166 | 1166 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE(PRINTER_PORT_TAG, rs232_port_device, write_txd)) |
| 1167 | 1167 | |
| 1168 | 1168 | MCFG_DEVICE_ADD(IIC_ACIA2_TAG, MOS6551, 0) |
| 1169 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) | |
| 1169 | MCFG_MOS6551_XTAL(XTAL_1_8432MHz) // matches SSC so modem software is compatible | |
| 1170 | 1170 | MCFG_MOS6551_TXD_HANDLER(DEVWRITELINE("modem", rs232_port_device, write_txd)) |
| 1171 | 1171 | |
| 1172 | 1172 | MCFG_RS232_PORT_ADD(PRINTER_PORT_TAG, default_rs232_devices, NULL) |
| r31373 | r31374 | |
|---|---|---|
| 456 | 456 | | /-->| Graphic memory|------| | |
| 457 | 457 | | | |---------------| | | |----------------| |
| 458 | 458 | | | | |--------| |<--->|RS232C interface|---CN2 |
| 459 | | | |
| 459 | | | | | BOOT |<-------->| |----------------| | |
| 460 | 460 | | | | | EPROM | | |
| 461 | 461 | | | |----------------| | |--------| | |----------------| |
| 462 | 462 | |<-----|-->|Character memory|--| | |<--->|RS232C interface|---CN3 |
| 463 | 463 | | |-->|----------------| | | |--------| | |----------------| |
| 464 | 464 | | | | | |Main RAM|<-------->| |
| 465 | 465 | | | | | |--------| | |----------------| |
| 466 | | | | |
| 466 | | | | | |<--->|RS232C interface|---CN4 | |
| 467 | 467 | | | | | | |----------------| |
| 468 | 468 | |---------| | | \/ \/ | |
| 469 | 469 | |Keyboard | \/ \---|---------------------------| | |-----------------| CN9 |--------| |
| r31373 | r31374 | |
| 485 | 485 | - Shared RAM is 8k, but there are 2 6264s on the sub board. Is shared RAM |
| 486 | 486 | banked? |
| 487 | 487 | |
| 488 | To boot a floppy put "bp fc5fa,1,{ip=c682;g}" and "bp fc6d7,1,{ip=c755;g}" | |
| 489 | into the debugger. | |
| 488 | To boot a floppy put "bp fc5fa,1,{ip=c682;g}" and "bp fc6d7,1,{ip=c755;g}" | |
| 489 | into the debugger. | |
| 490 | 490 | |
| 491 | At NMI: f8008 must have bit 7 clear and bit 6 set (e008 on 8085) | |
| 492 | f8009 must not equal 0x01 (e009 on 8085) | |
| 491 | At NMI: f8008 must have bit 7 clear and bit 6 set (e008 on 8085) | |
| 492 | f8009 must not equal 0x01 (e009 on 8085) | |
| 493 | 493 | |
| 494 | 8085 sets f8008 to keyboard row 0 AND 0xf3 | |
| 495 | " " f8009 to keyboard row 1 | |
| 496 | ||
| 494 | 8085 sets f8008 to keyboard row 0 AND 0xf3 | |
| 495 | " " f8009 to keyboard row 1 | |
| 496 | ||
| 497 | 497 | ****************************************************************************/ |
| 498 | 498 | |
| 499 | 499 | #include "emu.h" |
| r31373 | r31374 | |
| 671 | 671 | |
| 672 | 672 | READ16_MEMBER(fanucspmg_state::magic_r) |
| 673 | 673 | { |
| 674 | return 0x0041; | |
| 674 | return 0x0041; // 31 = memory error | |
| 675 | 675 | } |
| 676 | 676 | |
| 677 | 677 | static ADDRESS_MAP_START(maincpu_mem, AS_PROGRAM, 16, fanucspmg_state) |
| 678 | 678 | AM_RANGE(0x00000, 0x7ffff) AM_RAM // main RAM |
| 679 | 679 | |
| 680 | AM_RANGE(0x80000, 0x81fff) AM_RAM // believed to be shared RAM with a CPU inside the Program File | |
| 681 | AM_RANGE(0x88000, 0x88001) AM_NOP // Program File "ready" bit | |
| 680 | AM_RANGE(0x80000, 0x81fff) AM_RAM // believed to be shared RAM with a CPU inside the Program File | |
| 681 | AM_RANGE(0x88000, 0x88001) AM_NOP // Program File "ready" bit | |
| 682 | 682 | |
| 683 | 683 | AM_RANGE(0xf0000, 0xf0003) AM_DEVREADWRITE8(PIC0_TAG, pic8259_device, read, write, 0x00ff) |
| 684 | 684 | AM_RANGE(0xf0004, 0xf0007) AM_DEVICE8(FDC_TAG, upd765a_device, map, 0x00ff) |
| r31373 | r31374 | |
| 831 | 831 | if (m_video_ctrl & 0x02) |
| 832 | 832 | { |
| 833 | 833 | if (offset <= 0x5ff) |
| 834 | { | |
| 834 | { | |
| 835 | 835 | UINT8 chr = m_vram[offset + 0x600]; |
| 836 | 836 | UINT8 attr = m_vram[offset]; |
| 837 | 837 | UINT8 data = chargen[ chr + (ra * 256) ]; |
| r31373 | r31374 | |
| 879 | 879 | if (m_video_ctrl & 0x02) |
| 880 | 880 | { |
| 881 | 881 | if (offset <= 0x5ff) |
| 882 | { | |
| 882 | { | |
| 883 | 883 | UINT8 chr = m_vram[offset + 0x600]; |
| 884 | // | |
| 884 | // UINT8 attr = m_vram[offset]; | |
| 885 | 885 | UINT8 data = chargen[ chr + (ra * 256) ]; |
| 886 | 886 | UINT32 fg = 0xff00; |
| 887 | 887 | UINT32 bg = 0; |
| r31373 | r31374 | |
| 995 | 995 | |
| 996 | 996 | ROM_START( fanucspgm ) |
| 997 | 997 | ROM_REGION(0x4000, MAINCPU_TAG, 0) |
| 998 | ROM_LOAD16_BYTE( "a25_001a.33e", 0x000000, 0x002000, CRC(81159267) SHA1(f5d53cc6e929f57e8c3747f80fc74d4b1643222d) ) | |
| 999 | ROM_LOAD16_BYTE( "a25_002a.35e", 0x000001, 0x002000, CRC(4fb82c4d) SHA1(eb75e9a2d3c8e4ad56a74624ee8c52c785bd0da6) ) | |
| 998 | ROM_LOAD16_BYTE( "a25_001a.33e", 0x000000, 0x002000, CRC(81159267) SHA1(f5d53cc6e929f57e8c3747f80fc74d4b1643222d) ) | |
| 999 | ROM_LOAD16_BYTE( "a25_002a.35e", 0x000001, 0x002000, CRC(4fb82c4d) SHA1(eb75e9a2d3c8e4ad56a74624ee8c52c785bd0da6) ) | |
| 1000 | 1000 | |
| 1001 | 1001 | ROM_REGION(0x4000, SUBCPU_TAG, 0) |
| 1002 | ROM_LOAD( "a21_010f.17d", 0x000000, 0x002000, CRC(ef192717) SHA1(7fb3f7ca290d2437ae5956700f88c801018ce1cc) ) | |
| 1002 | ROM_LOAD( "a21_010f.17d", 0x000000, 0x002000, CRC(ef192717) SHA1(7fb3f7ca290d2437ae5956700f88c801018ce1cc) ) | |
| 1003 | 1003 | |
| 1004 | 1004 | ROM_REGION(0x8000, CHARGEN_TAG, 0) |
| 1005 | ROM_LOAD( "a22_020b.5g", 0x000000, 0x002000, CRC(7b5f8e20) SHA1(9de607e541d8aad2d1ea56321270bb8466b16e3d) ) | |
| 1005 | ROM_LOAD( "a22_020b.5g", 0x000000, 0x002000, CRC(7b5f8e20) SHA1(9de607e541d8aad2d1ea56321270bb8466b16e3d) ) | |
| 1006 | 1006 | ROM_END |
| 1007 | 1007 | |
| 1008 | 1008 | /* Driver */ |
| r31373 | r31374 | |
|---|---|---|
| 139 | 139 | MCFG_CASSETTE_ADD( "cassette" ) |
| 140 | 140 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 141 | 141 | MCFG_CASSETTE_INTERFACE("ondra_cass") |
| 142 | ||
| 142 | ||
| 143 | 143 | MCFG_SOFTWARE_LIST_ADD("cass_list","ondra") |
| 144 | 144 | |
| 145 | 145 | /* internal ram */ |
| r31373 | r31374 | |
|---|---|---|
| 829 | 829 | MCFG_CASSETTE_FORMATS(mz700_cassette_formats) |
| 830 | 830 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 831 | 831 | MCFG_CASSETTE_INTERFACE("mz_cass") |
| 832 | ||
| 832 | ||
| 833 | 833 | MCFG_SOFTWARE_LIST_ADD("cass_list","mz2000_cass") |
| 834 | 834 | |
| 835 | 835 | /* video hardware */ |
| r31373 | r31374 | |
|---|---|---|
| 883 | 883 | MCFG_CASSETTE_FORMATS(cdt_cassette_formats) |
| 884 | 884 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_DISABLED | CASSETTE_SPEAKER_ENABLED) |
| 885 | 885 | MCFG_CASSETTE_INTERFACE("cpc_cass") |
| 886 | ||
| 886 | ||
| 887 | 887 | MCFG_SOFTWARE_LIST_ADD("cass_list","cpc_cass") |
| 888 | 888 | |
| 889 | 889 | MCFG_DEVICE_ADD("exp", CPC_EXPANSION_SLOT, 0) |
| r31373 | r31374 | |
| 991 | 991 | MCFG_CPC_EXPANSION_SLOT_OUT_IRQ_CB(INPUTLINE("maincpu", 0)) |
| 992 | 992 | MCFG_CPC_EXPANSION_SLOT_OUT_NMI_CB(INPUTLINE("maincpu", INPUT_LINE_NMI)) |
| 993 | 993 | MCFG_CPC_EXPANSION_SLOT_OUT_ROMDIS_CB(WRITELINE(amstrad_state, cpc_romdis)) // ROMDIS |
| 994 | MCFG_CPC_EXPANSION_SLOT_OUT_ROMEN_CB(WRITELINE(amstrad_state, cpc_romen)) // /ROMEN | |
| 994 | MCFG_CPC_EXPANSION_SLOT_OUT_ROMEN_CB(WRITELINE(amstrad_state, cpc_romen)) // /ROMEN | |
| 995 | 995 | |
| 996 | 996 | /* internal ram */ |
| 997 | 997 | MCFG_RAM_ADD(RAM_TAG) |
| r31373 | r31374 | |
|---|---|---|
| 1230 | 1230 | MCFG_I8237_OUT_IOW_0_CB(WRITE8(pc1512_state, iow0_w)) |
| 1231 | 1231 | MCFG_I8237_OUT_IOW_1_CB(WRITE8(pc1512_state, iow1_w)) |
| 1232 | 1232 | MCFG_I8237_OUT_IOW_2_CB(WRITE8(pc1512_state, iow2_w)) |
| 1233 | MCFG_I8237_OUT_IOW_3_CB(WRITE8(pc1512_state, iow3_w)) | |
| 1233 | MCFG_I8237_OUT_IOW_3_CB(WRITE8(pc1512_state, iow3_w)) | |
| 1234 | 1234 | MCFG_I8237_OUT_DACK_0_CB(WRITELINE(pc1512_state, dack0_w)) |
| 1235 | 1235 | MCFG_I8237_OUT_DACK_1_CB(WRITELINE(pc1512_state, dack1_w)) |
| 1236 | 1236 | MCFG_I8237_OUT_DACK_2_CB(WRITELINE(pc1512_state, dack2_w)) |
| r31373 | r31374 | |
| 1257 | 1257 | MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) |
| 1258 | 1258 | MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) |
| 1259 | 1259 | MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A2_TAG, pic8259_device, ir4_w)) |
| 1260 | ||
| 1260 | ||
| 1261 | 1261 | MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") |
| 1262 | 1262 | MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pc1512_state, write_centronics_ack)) |
| 1263 | 1263 | MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pc1512_state, write_centronics_busy)) |
| r31373 | r31374 | |
| 1350 | 1350 | MCFG_I8237_OUT_IOW_0_CB(WRITE8(pc1512_state, iow0_w)) |
| 1351 | 1351 | MCFG_I8237_OUT_IOW_1_CB(WRITE8(pc1512_state, iow1_w)) |
| 1352 | 1352 | MCFG_I8237_OUT_IOW_2_CB(WRITE8(pc1512_state, iow2_w)) |
| 1353 | MCFG_I8237_OUT_IOW_3_CB(WRITE8(pc1512_state, iow3_w)) | |
| 1353 | MCFG_I8237_OUT_IOW_3_CB(WRITE8(pc1512_state, iow3_w)) | |
| 1354 | 1354 | MCFG_I8237_OUT_DACK_0_CB(WRITELINE(pc1512_state, dack0_w)) |
| 1355 | 1355 | MCFG_I8237_OUT_DACK_1_CB(WRITELINE(pc1512_state, dack1_w)) |
| 1356 | 1356 | MCFG_I8237_OUT_DACK_2_CB(WRITELINE(pc1512_state, dack2_w)) |
| r31373 | r31374 | |
| 1377 | 1377 | MCFG_INS8250_OUT_DTR_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_dtr)) |
| 1378 | 1378 | MCFG_INS8250_OUT_RTS_CB(DEVWRITELINE(RS232_TAG, rs232_port_device, write_rts)) |
| 1379 | 1379 | MCFG_INS8250_OUT_INT_CB(DEVWRITELINE(I8259A2_TAG, pic8259_device, ir4_w)) |
| 1380 | ||
| 1381 | 1380 | |
| 1381 | ||
| 1382 | 1382 | MCFG_CENTRONICS_ADD("centronics", centronics_printers, "printer") |
| 1383 | 1383 | MCFG_CENTRONICS_ACK_HANDLER(WRITELINE(pc1512_state, write_centronics_ack)) |
| 1384 | 1384 | MCFG_CENTRONICS_BUSY_HANDLER(WRITELINE(pc1512_state, write_centronics_busy)) |
| r31373 | r31374 | |
|---|---|---|
| 231 | 231 | MCFG_KBDC8042_KEYBOARD_TYPE(KBDC8042_STANDARD) |
| 232 | 232 | MCFG_KBDC8042_SYSTEM_RESET_CB(INPUTLINE("ppc1", INPUT_LINE_RESET)) |
| 233 | 233 | MCFG_KBDC8042_INPUT_BUFFER_FULL_CB(WRITELINE(bebox_state, bebox_keyboard_interrupt)) |
| 234 | ||
| 234 | ||
| 235 | 235 | /* internal ram */ |
| 236 | 236 | MCFG_RAM_ADD(RAM_TAG) |
| 237 | 237 | MCFG_RAM_DEFAULT_SIZE("32M") |
| r31373 | r31374 | |
|---|---|---|
| 411 | 411 | MCFG_CASSETTE_ADD( "cassette" ) |
| 412 | 412 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED) |
| 413 | 413 | MCFG_CASSETTE_INTERFACE("iq151_cass") |
| 414 | ||
| 414 | ||
| 415 | 415 | MCFG_TIMER_DRIVER_ADD_PERIODIC("cassette_timer", iq151_state, cassette_timer, attotime::from_hz(2000)) |
| 416 | 416 | |
| 417 | 417 | /* cartridge */ |
| r31373 | r31374 | |
|---|---|---|
| 5 | 5 | TECNBRAS dot matrix display (70x7 pixels) |
| 6 | 6 | Driver by Felipe Correa da Silva Sanches <juca@members.fsf.org> |
| 7 | 7 | |
| 8 | ||
| 8 | The display is composed of 14 blocks of 5x7 LEDs | |
| 9 | 9 | |
| 10 | These LEDs are driven by several 74xx chips: | |
| 11 | * one 74138 | |
| 12 | * several 74164 and ULN2003 chips | |
| 10 | These LEDs are driven by several 74xx chips: | |
| 11 | * one 74138 | |
| 12 | * several 74164 and ULN2003 chips | |
| 13 | 13 | |
| 14 | 14 | Changelog: |
| 15 | 15 | |
| r31373 | r31374 | |
| 34 | 34 | DECLARE_WRITE8_MEMBER(set_x_position_w); |
| 35 | 35 | DECLARE_WRITE8_MEMBER(print_column_w); |
| 36 | 36 | |
| 37 | // DECLARE_WRITE8_MEMBER(tecnbras_io_w); | |
| 38 | // DECLARE_READ8_MEMBER(tecnbras_io_r); | |
| 37 | // DECLARE_WRITE8_MEMBER(tecnbras_io_w); | |
| 38 | // DECLARE_READ8_MEMBER(tecnbras_io_r); | |
| 39 | 39 | DECLARE_DRIVER_INIT(tecnbras); |
| 40 | 40 | private: |
| 41 | int m_xcoord; | |
| 41 | int m_xcoord; | |
| 42 | 42 | char m_digit[14][7]; |
| 43 | 43 | virtual void machine_start(); |
| 44 | 44 | virtual void machine_reset(); |
| r31373 | r31374 | |
| 84 | 84 | void tecnbras_state::machine_start() |
| 85 | 85 | { |
| 86 | 86 | /* |
| 87 | for (int x=0; x<14; x++){ | |
| 88 | for (int y=0; y<7; y++){ | |
| 89 | output_set_indexed_value("dmd_", x*7 + y, y); | |
| 90 | } | |
| 91 | } | |
| 87 | for (int x=0; x<14; x++){ | |
| 88 | for (int y=0; y<7; y++){ | |
| 89 | output_set_indexed_value("dmd_", x*7 + y, y); | |
| 90 | } | |
| 91 | } | |
| 92 | 92 | */ |
| 93 | 93 | } |
| 94 | 94 | |
| r31373 | r31374 | |
| 103 | 103 | MCFG_CPU_IO_MAP(i80c31_io) |
| 104 | 104 | |
| 105 | 105 | /* TODO: Add an I2C RTC (Phillips PCF8583P) |
| 106 | pin 6 (SCL): cpu T0/P3.4 (pin 14) | |
| 106 | pin 6 (SCL): cpu T0/P3.4 (pin 14) | |
| 107 | 107 | pin 5 (SDA): cpu T1/P3.5 (pin 15) |
| 108 | 108 | */ |
| 109 | 109 | |
| 110 | 110 | /* |
| 111 | TODO: Add a speaker | |
| 112 | CPU P1.0 (pin 1) | |
| 111 | TODO: Add a speaker | |
| 112 | CPU P1.0 (pin 1) | |
| 113 | 113 | */ |
| 114 | 114 | |
| 115 | 115 | /* |
| 116 | ||
| 116 | TODO: Add a communications port to receive commands from the remote control | |
| 117 | 117 | */ |
| 118 | 118 | |
| 119 | 119 | /* video hardware */ |
| r31373 | r31374 | |
|---|---|---|
| 185 | 185 | MCFG_CASSETTE_ADD( "cassette" ) |
| 186 | 186 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_MOTOR_ENABLED | CASSETTE_SPEAKER_ENABLED) |
| 187 | 187 | MCFG_CASSETTE_INTERFACE("pecom_cass") |
| 188 | ||
| 188 | ||
| 189 | 189 | MCFG_SOFTWARE_LIST_ADD("cass_list","pecom_cass") |
| 190 | 190 | |
| 191 | 191 | /* internal ram */ |
| r31373 | r31374 | |
|---|---|---|
| 1447 | 1447 | |
| 1448 | 1448 | ROM_REGION( 0x200, "v50", 0 ) |
| 1449 | 1449 | ROM_LOAD( "60 90242-01.7e", 0x000, 0x200, CRC(788a56d8) SHA1(d81e55cdddc36f5d41bf0a33104c75fac590b764) ) // "V50" 7621 (82S131), HR vertical timing 50Hz |
| 1450 | ||
| 1450 | ||
| 1451 | 1451 | //ROM_REGION( 0x200, "v60", 0 ) |
| 1452 | 1452 | //ROM_LOAD( "60 90319-01.7e", 0x000, 0x200, NO_DUMP ) // "V60" 7621 (82S131), HR vertical timing 60Hz |
| 1453 | 1453 | |
| 1454 | 1454 | ROM_REGION( 0x400, "att_hand", 0 ) |
| 1455 | 1455 | /* |
| 1456 | 1 E6P (RAD A8) | |
| 1457 | 2 THP (chargen A12) | |
| 1458 | 3 CCLK | |
| 1459 | 4 B0 (TX ATT 6) | |
| 1460 | 5 B1 (TX ATT 7) | |
| 1461 | 6 CONDP (40/80) | |
| 1462 | 7 B2 (TX ATT 0) | |
| 1463 | 8 B3 (TX ATT 1) | |
| 1464 | 9 ULP (RAD A5) | |
| 1465 | 10 FLP (RAD A6) | |
| 1466 | 11 F2P (RTF) | |
| 1467 | 12 GND | |
| 1468 | 13 F3P (GTF) | |
| 1469 | 14 F4P (BTF) | |
| 1470 | 15 B5P (RTB) | |
| 1471 | 16 B4 (TX ATT 2) | |
| 1472 | 17 B5 (TX ATT 3) | |
| 1473 | 18 B6 (TX ATT 4) | |
| 1474 | 19 B7 (TX ATT 5) | |
| 1475 | 20 LP (*DEN+3) | |
| 1476 | 21 B6P (GTB) | |
| 1477 | 22 B7P (BTB) | |
| 1478 | 23 E5P (RAD A7) | |
| 1479 | 24 Vcc | |
| 1456 | 1 E6P (RAD A8) | |
| 1457 | 2 THP (chargen A12) | |
| 1458 | 3 CCLK | |
| 1459 | 4 B0 (TX ATT 6) | |
| 1460 | 5 B1 (TX ATT 7) | |
| 1461 | 6 CONDP (40/80) | |
| 1462 | 7 B2 (TX ATT 0) | |
| 1463 | 8 B3 (TX ATT 1) | |
| 1464 | 9 ULP (RAD A5) | |
| 1465 | 10 FLP (RAD A6) | |
| 1466 | 11 F2P (RTF) | |
| 1467 | 12 GND | |
| 1468 | 13 F3P (GTF) | |
| 1469 | 14 F4P (BTF) | |
| 1470 | 15 B5P (RTB) | |
| 1471 | 16 B4 (TX ATT 2) | |
| 1472 | 17 B5 (TX ATT 3) | |
| 1473 | 18 B6 (TX ATT 4) | |
| 1474 | 19 B7 (TX ATT 5) | |
| 1475 | 20 LP (*DEN+3) | |
| 1476 | 21 B6P (GTB) | |
| 1477 | 22 B7P (BTB) | |
| 1478 | 23 E5P (RAD A7) | |
| 1479 | 24 Vcc | |
| 1480 | 1480 | */ |
| 1481 | 1481 | ROM_LOAD( "60 90225-01.11c", 0x000, 0x400, NO_DUMP ) // "VIDEO ATTRIBUTE" 40033A (?) |
| 1482 | 1482 |
| r31373 | r31374 | |
|---|---|---|
| 328 | 328 | |
| 329 | 329 | bit description |
| 330 | 330 | |
| 331 | | |
| 331 | 0 NBSY | |
| 332 | 332 | 1 NMSG |
| 333 | 333 | 2 NC/D |
| 334 | 334 | 3 NREQ |
| r31373 | r31374 | |
|---|---|---|
| 466 | 466 | MCFG_CASSETTE_FORMATS(lviv_lvt_format) |
| 467 | 467 | MCFG_CASSETTE_DEFAULT_STATE(CASSETTE_STOPPED | CASSETTE_SPEAKER_ENABLED) |
| 468 | 468 | MCFG_CASSETTE_INTERFACE("lviv_cass") |
| 469 | ||
| 469 | ||
| 470 | 470 | MCFG_SOFTWARE_LIST_ADD("cass_list","lviv") |
| 471 | 471 | |
| 472 | 472 | /* internal ram */ |
| r31373 | r31374 | |
|---|---|---|
| 88 | 88 | {"rka", rka_cassette_formats ,"Apogee"}, |
| 89 | 89 | {"rkm", rkm_cassette_formats ,"Mikrosha"}, |
| 90 | 90 | {"rkp", rkp_cassette_formats ,"Partner"}, |
| 91 | {"sc3000", sc3000_cassette_formats | |
| 91 | {"sc3000", sc3000_cassette_formats ,"Sega SC-3000"}, | |
| 92 | 92 | {"sordm5", sordm5_cassette_formats ,"Sord M5"}, |
| 93 | 93 | {"svi", svi_cassette_formats ,"SVI"}, |
| 94 | 94 | {"to7", to7_cassette_formats ,"Thomson TO"}, |
| r31373 | r31374 | |
|---|---|---|
| 21 | 21 | |
| 22 | 22 | Currently, we only support storing host files into backup objects and |
| 23 | 23 | retreiving backup objects into files. |
| 24 | For attached library objects in the memory card, we only show their name, but | |
| 24 | For attached library objects in the memory card, we only show their name, but | |
| 25 | 25 | cannot retrieve their contents. |
| 26 | 26 | |
| 27 | 27 | To install a library contained in a host file, copy it with imgtool to |
| 28 | 28 | the card; it creates a backup object visible in the "PORTS" menu; |
| 29 | then evalue the object, store it into some port (e.g, 0 STO), | |
| 30 | turn off the HP48 and back on; the library should now be attached and | |
| 31 | visible in the "LIBRARY" menu. | |
| 32 | (The process is similar to installing a library from a file you get | |
| 29 | then evalue the object, store it into some port (e.g, 0 STO), | |
| 30 | turn off the HP48 and back on; the library should now be attached and | |
| 31 | visible in the "LIBRARY" menu. | |
| 32 | (The process is similar to installing a library from a file you get | |
| 33 | 33 | from the serial interface.) |
| 34 | 34 | */ |
| 35 | 35 | |
| r31373 | r31374 | |
| 60 | 60 | |
| 61 | 61 | total length: len+4 |
| 62 | 62 | |
| 63 | i.e., the backup object is a container containing the object name | |
| 64 | and two objects: the backuped object itself and a system integer | |
| 63 | i.e., the backup object is a container containing the object name | |
| 64 | and two objects: the backuped object itself and a system integer | |
| 65 | 65 | that contains the CRC. |
| 66 | 66 | |
| 67 | HP48 host files start with a "HPHP48-X" header (where X can be any | |
| 68 | single letter, which denotes a ROM revision and, implicitly, whether | |
| 67 | HP48 host files start with a "HPHP48-X" header (where X can be any | |
| 68 | single letter, which denotes a ROM revision and, implicitly, whether | |
| 69 | 69 | the program is for the S/SX or the G/GX family). |
| 70 | When storing a file to the memory card, we strip the header and | |
| 70 | When storing a file to the memory card, we strip the header and | |
| 71 | 71 | embed the object into a backup object with the correct CRC. |
| 72 | When copying from the memory card to a host file, we extract the object | |
| 72 | When copying from the memory card to a host file, we extract the object | |
| 73 | 73 | from the backup container, stripping its CRC, and add the HPHP48-X header. |
| 74 | 74 | |
| 75 | 75 | */ |
| r31373 | r31374 | |
| 91 | 91 | *****************************************************************************/ |
| 92 | 92 | |
| 93 | 93 | |
| 94 | struct hp48_card | |
| 94 | struct hp48_card | |
| 95 | 95 | { |
| 96 | 96 | imgtool_stream *stream; |
| 97 | int modified; | |
| 98 | ||
| 99 | /* size, in bytes of card data: from 32 KB to 4 MB */ | |
| 100 | int size; | |
| 101 | ||
| 102 | /* we store each nibble (4-bit) into its own byte, for simpler addressing; | |
| 103 | hence, data has 2*size | |
| 104 | */ | |
| 105 | UINT8* data; | |
| 106 | ||
| 97 | int modified; | |
| 98 | ||
| 99 | /* size, in bytes of card data: from 32 KB to 4 MB */ | |
| 100 | int size; | |
| 101 | ||
| 102 | /* we store each nibble (4-bit) into its own byte, for simpler addressing; | |
| 103 | hence, data has 2*size | |
| 104 | */ | |
| 105 | UINT8* data; | |
| 106 | ||
| 107 | 107 | }; |
| 108 | 108 | |
| 109 | 109 | struct hp48_partition |
| 110 | 110 | { |
| 111 | /* pointer to the begining of the partition inside the hp48_card */ | |
| 112 | UINT8* data; | |
| 111 | /* pointer to the begining of the partition inside the hp48_card */ | |
| 112 | UINT8* data; | |
| 113 | 113 | |
| 114 | /* size, in bytes (128 KB or less) */ | |
| 115 | int size; | |
| 116 | ||
| 114 | /* size, in bytes (128 KB or less) */ | |
| 115 | int size; | |
| 116 | ||
| 117 | 117 | }; |
| 118 | 118 | |
| 119 | struct hp48_directory | |
| 119 | struct hp48_directory | |
| 120 | 120 | { |
| 121 | ||
| 121 | int pos; | |
| 122 | 122 | }; |
| 123 | 123 | |
| 124 | 124 | |
| r31373 | r31374 | |
| 146 | 146 | /***************************************************************************** |
| 147 | 147 | Utility functions |
| 148 | 148 | *****************************************************************************/ |
| 149 | ||
| 150 | 149 | |
| 150 | ||
| 151 | 151 | /* byes to nibbles */ |
| 152 | 152 | static void unpack(UINT8* dst, UINT8* src, int nsize) |
| 153 | 153 | { |
| 154 | ||
| 154 | int i; | |
| 155 | 155 | |
| 156 | if ( nsize & 1 ) | |
| 157 | { | |
| 158 | dst[nsize-1] = src[nsize/2] & 0xf; | |
| 159 | } | |
| 156 | if ( nsize & 1 ) | |
| 157 | { | |
| 158 | dst[nsize-1] = src[nsize/2] & 0xf; | |
| 159 | } | |
| 160 | 160 | |
| 161 | for ( i = nsize/2-1; i >= 0; i-- ) | |
| 162 | { | |
| 163 | dst[2*i+1] = src[i] >> 4; | |
| 164 | dst[2*i ] = src[i] & 0xf; | |
| 165 | } | |
| 161 | for ( i = nsize/2-1; i >= 0; i-- ) | |
| 162 | { | |
| 163 | dst[2*i+1] = src[i] >> 4; | |
| 164 | dst[2*i ] = src[i] & 0xf; | |
| 165 | } | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | /* nibbles to bytes */ |
| 169 | 169 | static void pack(UINT8* dst, UINT8* src, int nsize) |
| 170 | 170 | { |
| 171 | ||
| 171 | int i; | |
| 172 | 172 | |
| 173 | for ( i = 0 ; i < nsize/2; i++ ) | |
| 174 | { | |
| 175 | dst[i] = (src[2*i] & 0xf) | (src[2*i+1] << 4); | |
| 176 | } | |
| 173 | for ( i = 0 ; i < nsize/2; i++ ) | |
| 174 | { | |
| 175 | dst[i] = (src[2*i] & 0xf) | (src[2*i+1] << 4); | |
| 176 | } | |
| 177 | 177 | |
| 178 | if ( nsize & 1 ) | |
| 179 | { | |
| 180 | dst[nsize/2] = src[nsize-1] & 0xf; | |
| 181 | } | |
| 182 | } | |
| 178 | if ( nsize & 1 ) | |
| 179 | { | |
| 180 | dst[nsize/2] = src[nsize-1] & 0xf; | |
| 181 | } | |
| 182 | } | |
| 183 | 183 | |
| 184 | 184 | |
| 185 | 185 | static int read20(UINT8* data) |
| 186 | 186 | { |
| 187 | ||
| 187 | return data[0] | (data[1] << 4) | (data[2] << 8) | (data[3] << 12) | (data[4] << 16); | |
| 188 | 188 | } |
| 189 | 189 | |
| 190 | 190 | static int read8(UINT8* data) |
| 191 | 191 | { |
| 192 | ||
| 192 | return data[0] | (data[1] << 4); | |
| 193 | 193 | } |
| 194 | 194 | |
| 195 | 195 | static void readstring(char* dst, UINT8* data, int nb) |
| 196 | 196 | { |
| 197 | int i; | |
| 198 | for ( i = 0; i < nb; i++ ) | |
| 199 | { | |
| 200 | dst[i] = read8( data + 2*i ); | |
| 201 | } | |
| 202 | dst[nb] = 0; | |
| 197 | int i; | |
| 198 | for ( i = 0; i < nb; i++ ) | |
| 199 | { | |
| 200 | dst[i] = read8( data + 2*i ); | |
| 201 | } | |
| 202 | dst[nb] = 0; | |
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | static void write20(UINT8* data, int v) |
| 206 | 206 | { |
| 207 | data[0] = v & 0xf; | |
| 208 | data[1] = (v >> 4) & 0xf; | |
| 209 | data[2] = (v >> 8) & 0xf; | |
| 210 | data[3] = (v >> 12) & 0xf; | |
| 211 | data[4] = (v >> 16) & 0xf; | |
| 207 | data[0] = v & 0xf; | |
| 208 | data[1] = (v >> 4) & 0xf; | |
| 209 | data[2] = (v >> 8) & 0xf; | |
| 210 | data[3] = (v >> 12) & 0xf; | |
| 211 | data[4] = (v >> 16) & 0xf; | |
| 212 | 212 | } |
| 213 | 213 | |
| 214 | 214 | static void write8(UINT8* data, int v) |
| 215 | 215 | { |
| 216 | data[0] = v & 0xf; | |
| 217 | data[1] = (v >> 4) & 0xf; | |
| 216 | data[0] = v & 0xf; | |
| 217 | data[1] = (v >> 4) & 0xf; | |
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | static void writestring(UINT8* data, const char* str, int nb) |
| 221 | 221 | { |
| 222 | int i; | |
| 223 | for ( i = 0; i < nb; i++ ) | |
| 224 | { | |
| 225 | write8( data + 2*i, str[i] ); | |
| 226 | } | |
| 222 | int i; | |
| 223 | for ( i = 0; i < nb; i++ ) | |
| 224 | { | |
| 225 | write8( data + 2*i, str[i] ); | |
| 226 | } | |
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | |
| 230 | 230 | /* go to the end, return its offset */ |
| 231 | 231 | static int find_end(hp48_partition* p) |
| 232 | 232 | { |
| 233 | int pos = 0; | |
| 234 | while (1) | |
| 235 | { | |
| 236 | if ( pos + 10 > 2*p->size) break; | |
| 237 | ||
| 238 | int prolog = read20( p->data + pos ); | |
| 239 | if ( !IS_OBJECT( prolog )) break; | |
| 240 | ||
| 241 | pos += read20( p->data + pos + 5 ) + 5; | |
| 242 | } | |
| 243 | ||
| 244 | if ( pos > 2*p->size ) pos = 2*p->size; | |
| 245 | return pos; | |
| 233 | int pos = 0; | |
| 234 | while (1) | |
| 235 | { | |
| 236 | if ( pos + 10 > 2*p->size) break; | |
| 237 | ||
| 238 | int prolog = read20( p->data + pos ); | |
| 239 | if ( !IS_OBJECT( prolog )) break; | |
| 240 | ||
| 241 | pos += read20( p->data + pos + 5 ) + 5; | |
| 242 | } | |
| 243 | ||
| 244 | if ( pos > 2*p->size ) pos = 2*p->size; | |
| 245 | return pos; | |
| 246 | 246 | } |
| 247 | 247 | |
| 248 | 248 | |
| 249 | 249 | /* find the backup object with the given name, returns its offset or -1 (not found) */ |
| 250 | 250 | static int find_file(hp48_partition* p, const char* filename, int *ptotalsize, int* pstart, int* pcontentsize) |
| 251 | 251 | { |
| 252 | UINT8* data = p->data; | |
| 253 | int pos = 0; | |
| 252 | UINT8* data = p->data; | |
| 253 | int pos = 0; | |
| 254 | 254 | |
| 255 | /* find file */ | |
| 256 | while (1) | |
| 257 | { | |
| 258 | if ( pos + 10 > 2*p->size) return -1; | |
| 259 | ||
| 260 | /* get prolog */ | |
| 261 | int prolog = read20( data+pos ); | |
| 262 | if ( !IS_OBJECT(prolog)) return -1; | |
| 255 | /* find file */ | |
| 256 | while (1) | |
| 257 | { | |
| 258 | if ( pos + 10 > 2*p->size) return -1; | |
| 263 | 259 | |
| 264 | /* get size */ | |
| 265 | int totalsize = read20( data+pos+5 ); | |
| 266 | if ( totalsize < 14) return -1; | |
| 267 | if ( pos + 5 + totalsize > 2*p->size ) return -1; | |
| 260 | /* get prolog */ | |
| 261 | int prolog = read20( data+pos ); | |
| 262 | if ( !IS_OBJECT(prolog)) return -1; | |
| 268 | 263 | |
| 269 | if ( prolog == PROLOG_BACKUP ) | |
| 270 | { | |
| 271 | /* get name */ | |
| 272 | int namelen = read8( data + pos + 10 ); | |
| 273 | char name[257]; | |
| 274 | if ( 9 + 2*namelen > totalsize ) return -1; | |
| 275 | readstring( name, data + pos + 12, namelen ); | |
| 264 | /* get size */ | |
| 265 | int totalsize = read20( data+pos+5 ); | |
| 266 | if ( totalsize < 14) return -1; | |
| 267 | if ( pos + 5 + totalsize > 2*p->size ) return -1; | |
| 276 | 268 | |
| 277 | /* check name */ | |
| 278 | if ( !strcmp( name, filename ) ) | |
| 279 | { | |
| 280 | /* found! */ | |
| 281 | if ( ptotalsize ) *ptotalsize = totalsize; | |
| 282 | if ( pstart ) *pstart = pos + 14 + 2*namelen; | |
| 283 | if ( pcontentsize ) *pcontentsize = totalsize - (9 + 2*namelen); | |
| 284 | return pos; | |
| 285 | } | |
| 286 | else | |
| 287 | { | |
| 288 | /* skip */ | |
| 289 | pos += totalsize + 5; | |
| 290 | } | |
| 291 | } | |
| 292 | else | |
| 293 | { | |
| 294 | /* skip */ | |
| 295 | pos += totalsize + 5; | |
| 296 | } | |
| 269 | if ( prolog == PROLOG_BACKUP ) | |
| 270 | { | |
| 271 | /* get name */ | |
| 272 | int namelen = read8( data + pos + 10 ); | |
| 273 | char name[257]; | |
| 274 | if ( 9 + 2*namelen > totalsize ) return -1; | |
| 275 | readstring( name, data + pos + 12, namelen ); | |
| 297 | 276 | |
| 298 | } | |
| 277 | /* check name */ | |
| 278 | if ( !strcmp( name, filename ) ) | |
| 279 | { | |
| 280 | /* found! */ | |
| 281 | if ( ptotalsize ) *ptotalsize = totalsize; | |
| 282 | if ( pstart ) *pstart = pos + 14 + 2*namelen; | |
| 283 | if ( pcontentsize ) *pcontentsize = totalsize - (9 + 2*namelen); | |
| 284 | return pos; | |
| 285 | } | |
| 286 | else | |
| 287 | { | |
| 288 | /* skip */ | |
| 289 | pos += totalsize + 5; | |
| 290 | } | |
| 291 | } | |
| 292 | else | |
| 293 | { | |
| 294 | /* skip */ | |
| 295 | pos += totalsize + 5; | |
| 296 | } | |
| 299 | 297 | |
| 300 | return -1; | |
| 298 | } | |
| 299 | ||
| 300 | return -1; | |
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
| 304 | /* CRC computing. | |
| 304 | /* CRC computing. | |
| 305 | 305 | This is the same CRC that is computed by the HP48 hardware. |
| 306 | 306 | */ |
| 307 | 307 | static UINT16 crc(UINT8* data, int len) |
| 308 | 308 | { |
| 309 | UINT16 crc = 0; | |
| 310 | int i; | |
| 309 | UINT16 crc = 0; | |
| 310 | int i; | |
| 311 | 311 | |
| 312 | for ( i = 0; i < len; i++ ) | |
| 313 | { | |
| 314 | crc = (crc >> 4) ^ (((crc ^ data[i]) & 0xf) * 0x1081); | |
| 315 | } | |
| 316 | ||
| 317 | return crc; | |
| 312 | for ( i = 0; i < len; i++ ) | |
| 313 | { | |
| 314 | crc = (crc >> 4) ^ (((crc ^ data[i]) & 0xf) * 0x1081); | |
| 315 | } | |
| 316 | ||
| 317 | return crc; | |
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | |
| r31373 | r31374 | |
| 329 | 329 | hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); |
| 330 | 330 | int size = stream_size( stream ); |
| 331 | 331 | |
| 332 | /* check that size is a power of 2 between 32 KB and 4 MG */ | |
| 333 | if ( (size < 32 * 1024) || | |
| 334 | (size > 4 * 1024 * 1024) || | |
| 335 | (size & (size-1)) ) | |
| 336 | { | |
| 337 | return IMGTOOLERR_CORRUPTIMAGE; | |
| 338 | } | |
| 332 | /* check that size is a power of 2 between 32 KB and 4 MG */ | |
| 333 | if ( (size < 32 * 1024) || | |
| 334 | (size > 4 * 1024 * 1024) || | |
| 335 | (size & (size-1)) ) | |
| 336 | { | |
| 337 | return IMGTOOLERR_CORRUPTIMAGE; | |
| 338 | } | |
| 339 | 339 | |
| 340 | ||
| 340 | /* store info */ | |
| 341 | 341 | c->stream = stream; |
| 342 | 342 | c->modified = 0; |
| 343 | c->size = size; | |
| 344 | c->data = (UINT8*) malloc( 2 * size ); | |
| 345 | if ( !c->data ) | |
| 346 | { | |
| 347 | return IMGTOOLERR_READERROR; | |
| 348 | } | |
| 343 | c->size = size; | |
| 344 | c->data = (UINT8*) malloc( 2 * size ); | |
| 345 | if ( !c->data ) | |
| 346 | { | |
| 347 | return IMGTOOLERR_READERROR; | |
| 348 | } | |
| 349 | 349 | |
| 350 | ||
| 350 | /* fully load image */ | |
| 351 | 351 | stream_seek( stream, 0, SEEK_SET ); |
| 352 | 352 | if ( stream_read( stream, c->data, size ) < size ) |
| 353 | { | |
| 354 | return IMGTOOLERR_READERROR; | |
| 355 | } | |
| 356 | unpack( c->data, c->data, 2 * size ); | |
| 353 | { | |
| 354 | return IMGTOOLERR_READERROR; | |
| 355 | } | |
| 356 | unpack( c->data, c->data, 2 * size ); | |
| 357 | 357 | |
| 358 | 358 | return IMGTOOLERR_SUCCESS; |
| 359 | 359 | } |
| r31373 | r31374 | |
| 367 | 367 | hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); |
| 368 | 368 | int size; |
| 369 | 369 | |
| 370 | ||
| 370 | size = option_resolution_lookup_int(opts, 'S'); | |
| 371 | 371 | |
| 372 | c->stream = stream; | |
| 373 | c->modified = 1; | |
| 374 | c->size = size * 1024; | |
| 375 | c->data = (UINT8*) malloc( 2 * c->size ); | |
| 376 | if ( !c->data ) | |
| 377 | { | |
| 378 | return IMGTOOLERR_READERROR; | |
| 379 | } | |
| 372 | c->stream = stream; | |
| 373 | c->modified = 1; | |
| 374 | c->size = size * 1024; | |
| 375 | c->data = (UINT8*) malloc( 2 * c->size ); | |
| 376 | if ( !c->data ) | |
| 377 | { | |
| 378 | return IMGTOOLERR_READERROR; | |
| 379 | } | |
| 380 | 380 | |
| 381 | /* zeroing the image seems fine */ | |
| 382 | memset( c->data, 0, 2 * c->size ); | |
| 381 | /* zeroing the image seems fine */ | |
| 382 | memset( c->data, 0, 2 * c->size ); | |
| 383 | 383 | |
| 384 | 384 | return IMGTOOLERR_SUCCESS; |
| 385 | 385 | } |
| r31373 | r31374 | |
| 390 | 390 | { |
| 391 | 391 | hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); |
| 392 | 392 | |
| 393 | if ( c->modified ) | |
| 394 | { | |
| 395 | /* save image */ | |
| 396 | pack( c->data, c->data, 2 * c->size ); | |
| 397 | stream_seek( c->stream, 0, SEEK_SET ); | |
| 398 | stream_write( c->stream, c->data, c->size ); | |
| 399 | } | |
| 393 | if ( c->modified ) | |
| 394 | { | |
| 395 | /* save image */ | |
| 396 | pack( c->data, c->data, 2 * c->size ); | |
| 397 | stream_seek( c->stream, 0, SEEK_SET ); | |
| 398 | stream_write( c->stream, c->data, c->size ); | |
| 399 | } | |
| 400 | 400 | |
| 401 | /* clean up */ | |
| 402 | free( c->data ); | |
| 401 | /* clean up */ | |
| 402 | free( c->data ); | |
| 403 | 403 | stream_close( c->stream ); |
| 404 | 404 | } |
| 405 | 405 | |
| r31373 | r31374 | |
| 411 | 411 | void hp48_partition_get_info(const imgtool_class *imgclass, UINT32 state, union imgtoolinfo *info); |
| 412 | 412 | |
| 413 | 413 | static imgtoolerr_t hp48_list_partitions(imgtool_image *img, |
| 414 | imgtool_partition_info *partitions, | |
| 415 | size_t len) | |
| 416 | { | |
| 414 | imgtool_partition_info *partitions, | |
| 415 | size_t len) | |
| 416 | { | |
| 417 | 417 | hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); |
| 418 | 418 | |
| 419 | int i; | |
| 420 | for ( i = 0; i < len && i * MAX_PORT_SIZE < c->size ; i++ ) | |
| 421 | { | |
| 422 | /* offset and size in bytes */ | |
| 423 | partitions[i].base_block = i * MAX_PORT_SIZE; | |
| 424 | partitions[i].block_count = c->size - partitions[i].base_block; | |
| 425 | if ( partitions[i].block_count > MAX_PORT_SIZE ) | |
| 426 | { | |
| 427 | partitions[i].block_count = MAX_PORT_SIZE; | |
| 428 | } | |
| 419 | int i; | |
| 420 | for ( i = 0; i < len && i * MAX_PORT_SIZE < c->size ; i++ ) | |
| 421 | { | |
| 422 | /* offset and size in bytes */ | |
| 423 | partitions[i].base_block = i * MAX_PORT_SIZE; | |
| 424 | partitions[i].block_count = c->size - partitions[i].base_block; | |
| 425 | if ( partitions[i].block_count > MAX_PORT_SIZE ) | |
| 426 | { | |
| 427 | partitions[i].block_count = MAX_PORT_SIZE; | |
| 428 | } | |
| 429 | 429 | |
| 430 | partitions[i].get_info = hp48_partition_get_info; | |
| 431 | } | |
| 430 | partitions[i].get_info = hp48_partition_get_info; | |
| 431 | } | |
| 432 | 432 | |
| 433 | 433 | return IMGTOOLERR_SUCCESS; |
| 434 | 434 | } |
| r31373 | r31374 | |
| 436 | 436 | static imgtoolerr_t hp48_open_partition(imgtool_partition *part, |
| 437 | 437 | UINT64 first_block, UINT64 block_count) |
| 438 | 438 | { |
| 439 | ||
| 440 | 439 | imgtool_image* img = imgtool_partition_image( part ); |
| 441 | 440 | hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); |
| 442 | 441 | hp48_partition* p = (hp48_partition*) imgtool_partition_extra_bytes( part ); |
| 443 | 442 | |
| 444 | if ( first_block + block_count > c->size ) | |
| 445 | return IMGTOOLERR_INVALIDPARTITION; | |
| 443 | if ( first_block + block_count > c->size ) | |
| 444 | return IMGTOOLERR_INVALIDPARTITION; | |
| 446 | 445 | |
| 447 | /* store partition position */ | |
| 448 | p->data = c->data + first_block; | |
| 449 | p->size = block_count; | |
| 446 | /* store partition position */ | |
| 447 | p->data = c->data + first_block; | |
| 448 | p->size = block_count; | |
| 450 | 449 | |
| 451 | 450 | return IMGTOOLERR_SUCCESS; |
| 452 | 451 | } |
| r31373 | r31374 | |
| 454 | 453 | |
| 455 | 454 | |
| 456 | 455 | static imgtoolerr_t hp48_beginenum(imgtool_directory *enumeration, |
| 457 | ||
| 456 | const char *path) | |
| 458 | 457 | { |
| 459 | 458 | hp48_directory* d = (hp48_directory*) imgtool_directory_extrabytes( enumeration ); |
| 460 | 459 | |
| 461 | ||
| 460 | d->pos = 0; | |
| 462 | 461 | |
| 463 | 462 | return IMGTOOLERR_SUCCESS; |
| 464 | 463 | } |
| r31373 | r31374 | |
| 466 | 465 | |
| 467 | 466 | |
| 468 | 467 | static imgtoolerr_t hp48_nextenum(imgtool_directory *enumeration, |
| 469 | ||
| 468 | imgtool_dirent *ent) | |
| 470 | 469 | { |
| 471 | 470 | imgtool_partition *part = imgtool_directory_partition( enumeration ); |
| 472 | 471 | //imgtool_image* img = imgtool_partition_image( part ); |
| r31373 | r31374 | |
| 474 | 473 | hp48_partition* p = (hp48_partition*) imgtool_partition_extra_bytes( part ); |
| 475 | 474 | hp48_directory* d = (hp48_directory*) imgtool_directory_extrabytes( enumeration ); |
| 476 | 475 | |
| 477 | UINT8* data = p->data; | |
| 478 | int pos = d->pos; | |
| 476 | UINT8* data = p->data; | |
| 477 | int pos = d->pos; | |
| 479 | 478 | |
| 480 | if ( pos < 0 || pos+12 > 2*p->size ) | |
| 481 | { | |
| 482 | ent->eof = 1; | |
| 483 | return IMGTOOLERR_SUCCESS; | |
| 484 | } | |
| 485 | ||
| 486 | int prolog = read20( data+pos ); | |
| 479 | if ( pos < 0 || pos+12 > 2*p->size ) | |
| 480 | { | |
| 481 | ent->eof = 1; | |
| 482 | return IMGTOOLERR_SUCCESS; | |
| 483 | } | |
| 487 | 484 | |
| 488 | if ( IS_OBJECT(prolog) ) | |
| 489 | { | |
| 490 | pos += 5; | |
| 491 | int totalsize = read20( data+pos ); | |
| 492 | pos += 5; | |
| 485 | int prolog = read20( data+pos ); | |
| 493 | 486 | |
| 494 | int namelen = read8( data+pos ); | |
| 495 | pos += 2; | |
| 496 | if ( (pos + 2*namelen > 2*p->size) || | |
| 497 | (namelen >= sizeof(ent->filename)) ) | |
| 498 | { | |
| 499 | ent->eof = 1; | |
| 500 | return IMGTOOLERR_CORRUPTFILE; | |
| 501 | } | |
| 502 | readstring( ent->filename, data+pos, namelen ); | |
| 487 | if ( IS_OBJECT(prolog) ) | |
| 488 | { | |
| 489 | pos += 5; | |
| 490 | int totalsize = read20( data+pos ); | |
| 491 | pos += 5; | |
| 503 | 492 | |
| 504 | /* compute size in bytes, removing name, length & CRC fields */ | |
| 493 | int namelen = read8( data+pos ); | |
| 494 | pos += 2; | |
| 495 | if ( (pos + 2*namelen > 2*p->size) || | |
| 496 | (namelen >= sizeof(ent->filename)) ) | |
| 497 | { | |
| 498 | ent->eof = 1; | |
| 499 | return IMGTOOLERR_CORRUPTFILE; | |
| 500 | } | |
| 501 | readstring( ent->filename, data+pos, namelen ); | |
| 502 | ||
| 503 | /* compute size in bytes, removing name, length & CRC fields */ | |
| 505 | 504 | ent->filesize = ((totalsize - 19 - 2*namelen) + 1) / 2; |
| 506 | 505 | |
| 507 | switch (prolog) | |
| 508 | { | |
| 509 | case PROLOG_LIBRARY: strncpy( ent->attr, "LIB", sizeof(ent->attr) ); break; | |
| 510 | case PROLOG_BACKUP: strncpy( ent->attr, "BAK", sizeof(ent->attr) ); break; | |
| 511 | default: strncpy( ent->attr, "?", sizeof(ent->attr) ); | |
| 512 | } | |
| 506 | switch (prolog) | |
| 507 | { | |
| 508 | case PROLOG_LIBRARY: strncpy( ent->attr, "LIB", sizeof(ent->attr) ); break; | |
| 509 | case PROLOG_BACKUP: strncpy( ent->attr, "BAK", sizeof(ent->attr) ); break; | |
| 510 | default: strncpy( ent->attr, "?", sizeof(ent->attr) ); | |
| 511 | } | |
| 513 | 512 | |
| 514 | d->pos = d->pos + totalsize + 5; | |
| 515 | } | |
| 516 | else | |
| 517 | { | |
| 518 | /* 0 or unknown object => end */ | |
| 519 | ent->eof = 1; | |
| 520 | } | |
| 513 | d->pos = d->pos + totalsize + 5; | |
| 514 | } | |
| 515 | else | |
| 516 | { | |
| 517 | /* 0 or unknown object => end */ | |
| 518 | ent->eof = 1; | |
| 519 | } | |
| 521 | 520 | |
| 522 | 521 | return IMGTOOLERR_SUCCESS; |
| 523 | 522 | } |
| 524 | 523 | |
| 525 | 524 | |
| 526 | ||
| 525 | ||
| 527 | 526 | static imgtoolerr_t hp48_freespace(imgtool_partition *part, UINT64 *size) |
| 528 | 527 | { |
| 529 | 528 | //imgtool_image* img = imgtool_partition_image( part ); |
| 530 | ||
| 529 | //hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); | |
| 531 | 530 | hp48_partition* p = (hp48_partition*) imgtool_partition_extra_bytes( part ); |
| 532 | 531 | |
| 533 | ||
| 532 | *size = p->size - (find_end(p)+1)/2; | |
| 534 | 533 | |
| 535 | 534 | return IMGTOOLERR_SUCCESS; |
| 536 | 535 | } |
| r31373 | r31374 | |
| 538 | 537 | |
| 539 | 538 | |
| 540 | 539 | static imgtoolerr_t hp48_readfile(imgtool_partition *part, |
| 541 | const char *filename, | |
| 542 | const char *fork, | |
| 543 | imgtool_stream *destf) | |
| 540 | const char *filename, | |
| 541 | const char *fork, | |
| 542 | imgtool_stream *destf) | |
| 544 | 543 | { |
| 545 | 544 | //imgtool_image* img = imgtool_partition_image( part ); |
| 546 | 545 | //hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); |
| 547 | 546 | hp48_partition* p = (hp48_partition*) imgtool_partition_extra_bytes( part ); |
| 548 | 547 | |
| 549 | /* find entry */ | |
| 550 | int totalsize, start, size; | |
| 551 | int pos = find_file(p, filename, &totalsize, &start, &size); | |
| 552 | if ( pos == -1 ) | |
| 553 | { | |
| 554 | return IMGTOOLERR_FILENOTFOUND; | |
| 555 | } | |
| 548 | /* find entry */ | |
| 549 | int totalsize, start, size; | |
| 550 | int pos = find_file(p, filename, &totalsize, &start, &size); | |
| 551 | if ( pos == -1 ) | |
| 552 | { | |
| 553 | return IMGTOOLERR_FILENOTFOUND; | |
| 554 | } | |
| 556 | 555 | |
| 557 | /* CRC check */ | |
| 558 | UINT16 objcrc = read20( p->data + pos + totalsize ) >> 4; | |
| 559 | UINT16 mycrc = crc( p->data + pos + 5, totalsize - 4); | |
| 560 | if ( objcrc != mycrc ) | |
| 561 | { | |
| 562 | return IMGTOOLERR_CORRUPTIMAGE; | |
| 563 | } | |
| 564 | size -= 10; | |
| 556 | /* CRC check */ | |
| 557 | UINT16 objcrc = read20( p->data + pos + totalsize ) >> 4; | |
| 558 | UINT16 mycrc = crc( p->data + pos + 5, totalsize - 4); | |
| 559 | if ( objcrc != mycrc ) | |
| 560 | { | |
| 561 | return IMGTOOLERR_CORRUPTIMAGE; | |
| 562 | } | |
| 563 | size -= 10; | |
| 565 | 564 | |
| 566 | /* save header */ | |
| 567 | stream_write( destf, hp48_prefix, 8); | |
| 565 | /* save header */ | |
| 566 | stream_write( destf, hp48_prefix, 8); | |
| 568 | 567 | |
| 569 | /* save contents to host file */ | |
| 570 | int bytesize = (size + 1) / 2; | |
| 571 | UINT8* buf = (UINT8*) malloc( bytesize ); | |
| 572 | if (!buf) | |
| 573 | { | |
| 574 | return IMGTOOLERR_FILENOTFOUND; | |
| 575 | } | |
| 576 | pack( buf, p->data + start, size ); | |
| 577 | stream_write( destf, buf, bytesize ); | |
| 578 | free( buf ); | |
| 579 | ||
| 580 | return IMGTOOLERR_SUCCESS; | |
| 568 | /* save contents to host file */ | |
| 569 | int bytesize = (size + 1) / 2; | |
| 570 | UINT8* buf = (UINT8*) malloc( bytesize ); | |
| 571 | if (!buf) | |
| 572 | { | |
| 573 | return IMGTOOLERR_FILENOTFOUND; | |
| 574 | } | |
| 575 | pack( buf, p->data + start, size ); | |
| 576 | stream_write( destf, buf, bytesize ); | |
| 577 | free( buf ); | |
| 578 | ||
| 579 | return IMGTOOLERR_SUCCESS; | |
| 581 | 580 | } |
| 582 | 581 | |
| 583 | 582 | |
| 584 | 583 | |
| 585 | 584 | static imgtoolerr_t hp48_deletefile(imgtool_partition *part, |
| 586 | ||
| 585 | const char *filename) | |
| 587 | 586 | { |
| 588 | 587 | imgtool_image* img = imgtool_partition_image( part ); |
| 589 | ||
| 588 | hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); | |
| 590 | 589 | hp48_partition* p = (hp48_partition*) imgtool_partition_extra_bytes( part ); |
| 591 | 590 | |
| 592 | /* find entry */ | |
| 593 | int totalsize; | |
| 594 | int pos = find_file(p, filename, &totalsize, NULL, NULL ); | |
| 595 | if ( pos == -1 ) | |
| 596 | { | |
| 597 | return IMGTOOLERR_FILENOTFOUND; | |
| 598 | } | |
| 591 | /* find entry */ | |
| 592 | int totalsize; | |
| 593 | int pos = find_file(p, filename, &totalsize, NULL, NULL ); | |
| 594 | if ( pos == -1 ) | |
| 595 | { | |
| 596 | return IMGTOOLERR_FILENOTFOUND; | |
| 597 | } | |
| 599 | 598 | |
| 600 | /* move */ | |
| 601 | totalsize += 5; | |
| 602 | memmove( p->data+pos, p->data+pos+totalsize, 2*p->size-(pos+totalsize) ); | |
| 603 | memset( p->data + 2*p->size-totalsize, 0, totalsize); | |
| 604 | c->modified = 1; | |
| 599 | /* move */ | |
| 600 | totalsize += 5; | |
| 601 | memmove( p->data+pos, p->data+pos+totalsize, 2*p->size-(pos+totalsize) ); | |
| 602 | memset( p->data + 2*p->size-totalsize, 0, totalsize); | |
| 603 | c->modified = 1; | |
| 605 | 604 | |
| 606 | 605 | return IMGTOOLERR_SUCCESS; |
| 607 | 606 | } |
| r31373 | r31374 | |
| 609 | 608 | |
| 610 | 609 | |
| 611 | 610 | static imgtoolerr_t hp48_writefile(imgtool_partition *part, |
| 612 | const char *filename, | |
| 613 | const char *fork, | |
| 614 | imgtool_stream *sourcef, | |
| 615 | option_resolution *opts) | |
| 611 | const char *filename, | |
| 612 | const char *fork, | |
| 613 | imgtool_stream *sourcef, | |
| 614 | option_resolution *opts) | |
| 616 | 615 | { |
| 617 | 616 | imgtool_image* img = imgtool_partition_image( part ); |
| 618 | ||
| 617 | hp48_card* c = (hp48_card*) imgtool_image_extra_bytes( img ); | |
| 619 | 618 | hp48_partition* p = (hp48_partition*) imgtool_partition_extra_bytes( part ); |
| 620 | 619 | |
| 621 | /* check header */ | |
| 622 | char head[8]; | |
| 623 | stream_read( sourcef, head, 8 ); | |
| 624 | if ( memcmp( head, hp48_prefix, 7) ) | |
| 625 | { | |
| 626 | return IMGTOOLERR_READERROR; | |
| 627 | } | |
| 620 | /* check header */ | |
| 621 | char head[8]; | |
| 622 | stream_read( sourcef, head, 8 ); | |
| 623 | if ( memcmp( head, hp48_prefix, 7) ) | |
| 624 | { | |
| 625 | return IMGTOOLERR_READERROR; | |
| 626 | } | |
| 628 | 627 | |
| 629 | /* ensure that the file does not exist */ | |
| 630 | /* TODO: resize the existing file instead, to keep it in place? */ | |
| 631 | hp48_deletefile( part, filename ); | |
| 628 | /* ensure that the file does not exist */ | |
| 629 | /* TODO: resize the existing file instead, to keep it in place? */ | |
| 630 | hp48_deletefile( part, filename ); | |
| 632 | 631 | |
| 633 | /* goto end */ | |
| 634 | //UINT8* data = p->data; | |
| 635 | int pos = find_end(p); | |
| 632 | /* goto end */ | |
| 633 | //UINT8* data = p->data; | |
| 634 | int pos = find_end(p); | |
| 636 | 635 | |
| 637 | int len = strlen( filename ); | |
| 638 | if ( len > 255 ) len = 255; | |
| 636 | int len = strlen( filename ); | |
| 637 | if ( len > 255 ) len = 255; | |
| 639 | 638 | |
| 640 | ||
| 639 | /* check size */ | |
| 641 | 640 | int filesize = stream_size( sourcef ) - 8; |
| 642 | if ( pos + 2*filesize + 24 + 2*len > 2 * p->size ) | |
| 643 | { | |
| 644 | return IMGTOOLERR_NOSPACE; | |
| 645 | } | |
| 641 | if ( pos + 2*filesize + 24 + 2*len > 2 * p->size ) | |
| 642 | { | |
| 643 | return IMGTOOLERR_NOSPACE; | |
| 644 | } | |
| 646 | 645 | |
| 647 | /* load file */ | |
| 648 | UINT8* buf = (UINT8*) malloc( filesize ); | |
| 649 | if ( !buf ) return IMGTOOLERR_NOSPACE; | |
| 650 | stream_read( sourcef, buf, filesize ); | |
| 646 | /* load file */ | |
| 647 | UINT8* buf = (UINT8*) malloc( filesize ); | |
| 648 | if ( !buf ) return IMGTOOLERR_NOSPACE; | |
| 649 | stream_read( sourcef, buf, filesize ); | |
| 651 | 650 | |
| 652 | /* store backup object */ | |
| 653 | int org = pos; | |
| 654 | int totalsize = 2*filesize + 19 + 2*len; | |
| 655 | write20( p->data+pos, PROLOG_BACKUP ); | |
| 656 | pos +=5; | |
| 657 | write20( p->data+pos, totalsize ); | |
| 658 | pos +=5; | |
| 659 | write8( p->data+pos, len ); | |
| 660 | pos += 2; | |
| 661 | writestring( p->data+pos, filename, len ); | |
| 662 | pos += 2*len; | |
| 663 | write8( p->data+pos, len ); | |
| 664 | pos += 2; | |
| 665 | unpack( p->data+pos, buf, 2*filesize ); | |
| 666 | pos += 2*filesize; | |
| 651 | /* store backup object */ | |
| 652 | int org = pos; | |
| 653 | int totalsize = 2*filesize + 19 + 2*len; | |
| 654 | write20( p->data+pos, PROLOG_BACKUP ); | |
| 655 | pos +=5; | |
| 656 | write20( p->data+pos, totalsize ); | |
| 657 | pos +=5; | |
| 658 | write8( p->data+pos, len ); | |
| 659 | pos += 2; | |
| 660 | writestring( p->data+pos, filename, len ); | |
| 661 | pos += 2*len; | |
| 662 | write8( p->data+pos, len ); | |
| 663 | pos += 2; | |
| 664 | unpack( p->data+pos, buf, 2*filesize ); | |
| 665 | pos += 2*filesize; | |
| 667 | 666 | |
| 668 | /* store crc */ | |
| 669 | write20( p->data+pos, PROLOG_SYSINT ); | |
| 670 | pos += 5; | |
| 671 | p->data[pos] = 0; | |
| 672 | write20( p->data+pos, crc(p->data+org+5, totalsize-4) << 4 ); | |
| 667 | /* store crc */ | |
| 668 | write20( p->data+pos, PROLOG_SYSINT ); | |
| 669 | pos += 5; | |
| 670 | p->data[pos] = 0; | |
| 671 | write20( p->data+pos, crc(p->data+org+5, totalsize-4) << 4 ); | |
| 673 | 672 | |
| 674 | ||
| 673 | free(buf); | |
| 675 | 674 | |
| 676 | ||
| 675 | c->modified = 1; | |
| 677 | 676 | |
| 678 | 677 | return IMGTOOLERR_SUCCESS; |
| 679 | 678 | } |
| r31373 | r31374 | |
| 705 | 704 | case IMGTOOLINFO_PTR_FREE_SPACE: info->free_space = hp48_freespace; break; |
| 706 | 705 | case IMGTOOLINFO_PTR_READ_FILE: info->read_file = hp48_readfile; break; |
| 707 | 706 | case IMGTOOLINFO_PTR_WRITE_FILE: info->write_file = hp48_writefile; break; |
| 708 | ||
| 707 | case IMGTOOLINFO_PTR_DELETE_FILE: info->delete_file = hp48_deletefile; break; | |
| 709 | 708 | |
| 710 | 709 | case IMGTOOLINFO_INT_PARTITION_EXTRA_BYTES: info->i = sizeof(hp48_partition); break; |
| 711 | 710 | case IMGTOOLINFO_INT_DIRECTORY_EXTRA_BYTES: info->i = sizeof(hp48_directory); break; |
| r31373 | r31374 | |
| 730 | 729 | case IMGTOOLINFO_PTR_OPEN: info->open = hp48_open; break; |
| 731 | 730 | case IMGTOOLINFO_PTR_CREATE: info->create = hp48_create; break; |
| 732 | 731 | case IMGTOOLINFO_PTR_CLOSE: info->close = hp48_close; break; |
| 733 | ||
| 732 | case IMGTOOLINFO_PTR_LIST_PARTITIONS: info->list_partitions = hp48_list_partitions; break; | |
| 734 | 733 | |
| 735 | 734 | case IMGTOOLINFO_INT_IMAGE_EXTRA_BYTES: info->i = sizeof(hp48_card); break; |
| 736 | ||
| 735 | } | |
| 737 | 736 | } |
| r31373 | r31374 | |
|---|---|---|
| 221 | 221 | { |
| 222 | 222 | m_charmap = memregion("gfx1")->base(); |
| 223 | 223 | } |
| 224 |
| r31373 | r31374 | |
|---|---|---|
| 422 | 422 | MCFG_I8237_OUT_DACK_1_CB(WRITELINE(ibm5160_mb_device, pc_dack1_w)) |
| 423 | 423 | MCFG_I8237_OUT_DACK_2_CB(WRITELINE(ibm5160_mb_device, pc_dack2_w)) |
| 424 | 424 | MCFG_I8237_OUT_DACK_3_CB(WRITELINE(ibm5160_mb_device, pc_dack3_w)) |
| 425 | ||
| 425 | ||
| 426 | 426 | MCFG_PIC8259_ADD( "pic8259", INPUTLINE(":maincpu", 0), VCC, NULL ) |
| 427 | 427 | |
| 428 | 428 | MCFG_DEVICE_ADD("ppi8255", I8255A, 0) |
| r31373 | r31374 | |
|---|---|---|
| 2822 | 2822 | 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0, 8, 0, 0, 0 |
| 2823 | 2823 | }; |
| 2824 | 2824 | |
| 2825 | #define NEXT_ROM_SLOT | |
| 2825 | #define NEXT_ROM_SLOT m_rom_count++; \ | |
| 2826 | 2826 | if(slot3 && m_rom_count == 3) m_rom_count++; \ |
| 2827 | 2827 | if(slot7 && m_rom_count == 7) m_rom_count++; |
| 2828 | 2828 |
| r31373 | r31374 | |
|---|---|---|
| 18 | 18 | space.install_read_handler(start, end, read8_delegate(FUNC(msx_switched_device::io_read), this)); |
| 19 | 19 | space.install_write_handler(start, end, write8_delegate(FUNC(msx_switched_device::io_write), this)); |
| 20 | 20 | } |
| 21 |
| r31373 | r31374 | |
|---|---|---|
| 230 | 230 | |
| 231 | 231 | DEC omitted terms like 'Interrupt', 'Break' and 'Data / Talk' on some keyboards, |
| 232 | 232 | so Fn numbers are definitely important for end users. |
| 233 | ||
| 233 | ||
| 234 | 234 | === CURRENT SPECIAL KEYS === |
| 235 | [PC-AT] ......=> [DEC] | |
| 236 | LEFT CONTROL..=> Control | |
| 237 | LEFT ALT .....=> Compose | |
| 238 | ||
| 239 | RIGHT ALT ....=> Help | |
| 240 | RIGHT CONTROL => Do | |
| 235 | [PC-AT] ......=> [DEC] | |
| 236 | LEFT CONTROL..=> Control | |
| 237 | LEFT ALT .....=> Compose | |
| 238 | ||
| 239 | RIGHT ALT ....=> Help | |
| 240 | RIGHT CONTROL => Do | |
| 241 | 241 | ============================================================================================== |
| 242 | 242 | === (PC - AT ) keys above cursor block === |
| 243 | 243 | * KEYCODE_INSERT * KEYCODE_HOME * KEYCODE_PGUP |
| r31373 | r31374 | |
| 249 | 249 | ============================================================================================== |
| 250 | 250 | === CURRENT NUM PAD ASSIGNMENTS === |
| 251 | 251 | [PF1] to [PF4] are mapped to NUM LOCK, SLASH etc. (=> 4 keys on top on num pad). |
| 252 | Num pad '+' gives ',' on the DEC. | |
| 252 | Num pad '+' gives ',' on the DEC. | |
| 253 | 253 | ',' translates to '.' (=> more or less the layout of model 'LK-201-AG') |
| 254 | ||
| 254 | ||
| 255 | 255 | Switch between 'full' and 'partial keyboard emulation' with Scroll Lock. |
| 256 | 256 | */ |
| 257 | 257 | |
| r31373 | r31374 | |
| 276 | 276 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 277 | 277 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Compose") PORT_CODE(KEYCODE_LALT) |
| 278 | 278 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Caps Lock") PORT_CODE(KEYCODE_CAPSLOCK) |
| 279 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) | |
| 279 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Ctrl") PORT_CODE(KEYCODE_LCONTROL) | |
| 280 | 280 | |
| 281 | 281 | PORT_START("KBD2") |
| 282 | 282 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Z") PORT_CODE(KEYCODE_Z) |
| r31373 | r31374 | |
| 369 | 369 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 370 | 370 | |
| 371 | 371 | PORT_START("KBD11") |
| 372 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) | |
| 373 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) | |
| 372 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("/") PORT_CODE(KEYCODE_SLASH) | |
| 373 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME(";") PORT_CODE(KEYCODE_COLON) | |
| 374 | 374 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNUSED ) // FIXME - duplicate "Return" |
| 375 | 375 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("P") PORT_CODE(KEYCODE_P) |
| 376 | 376 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("0") PORT_CODE(KEYCODE_0) |
| r31373 | r31374 | |
| 394 | 394 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("'") PORT_CODE(KEYCODE_QUOTE) |
| 395 | 395 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("[") PORT_CODE(KEYCODE_OPENBRACE) |
| 396 | 396 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Previous [^]") PORT_CODE(KEYCODE_END) |
| 397 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Do (F16) [Ausfuehren]") PORT_CODE(KEYCODE_RCONTROL) | |
| 397 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Do (F16) [Ausfuehren]") PORT_CODE(KEYCODE_RCONTROL) | |
| 398 | 398 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("-") PORT_CODE(KEYCODE_MINUS) |
| 399 | 399 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Insert Here") PORT_CODE(KEYCODE_HOME) |
| 400 | 400 | |
| r31373 | r31374 | |
| 433 | 433 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("Num ,") PORT_CODE(KEYCODE_PLUS_PAD) |
| 434 | 434 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_KEYBOARD ) // PORT_NAME("Num -") = duplicate...see KBD13 |
| 435 | 435 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("PF4") PORT_CODE(KEYCODE_MINUS_PAD) |
| 436 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F20") | |
| 436 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F20") | |
| 437 | 437 | PORT_BIT( 0x20, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 438 | 438 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_KEYBOARD ) PORT_NAME("F19") |
| 439 | 439 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| r31373 | r31374 | |
| 755 | 755 | |
| 756 | 756 | // printf("SPI %02x to %x (PC=%x)\n", data, offset, m_maincpu->pc()); |
| 757 | 757 | } |
| 758 |
| r31373 | r31374 | |
|---|---|---|
| 158 | 158 | m_ppu->set_latch(ppu2c0x_latch_delegate(FUNC(device_nes_cart_interface::ppu_latch),m_cartslot->m_cart)); |
| 159 | 159 | |
| 160 | 160 | // install additional handlers (read_h, read_ex, write_ex) |
| 161 | if (m_cartslot->get_pcb_id() == STD_EXROM || m_cartslot->get_pcb_id() == STD_NROM368 | |
| 161 | if (m_cartslot->get_pcb_id() == STD_EXROM || m_cartslot->get_pcb_id() == STD_NROM368 | |
| 162 | 162 | || m_cartslot->get_pcb_id() == GG_NROM || m_cartslot->get_pcb_id() == CAMERICA_ALADDIN || m_cartslot->get_pcb_id() == SUNSOFT_DCS |
| 163 | 163 | || m_cartslot->get_pcb_id() == BANDAI_DATACH || m_cartslot->get_pcb_id() == BANDAI_KARAOKE || m_cartslot->get_pcb_id() == BTL_2A03_PURITANS || m_cartslot->get_pcb_id() == AVE_MAXI15 |
| 164 | 164 | || m_cartslot->get_pcb_id() == KAISER_KS7022 || m_cartslot->get_pcb_id() == KAISER_KS7031 || m_cartslot->get_pcb_id() == BMC_VT5201 |
| r31373 | r31374 | |
|---|---|---|
| 527 | 527 | this->space().write_byte( (m_current_switched_device << 8) | offset, data ); |
| 528 | 528 | } |
| 529 | 529 | } |
| 530 |
| r31373 | r31374 | |
|---|---|---|
| 97 | 97 | PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) |
| 98 | 98 | PORT_CONFSETTING(APOLLO_CONF_25_YEARS_AGO, DEF_STR ( On ) ) |
| 99 | 99 | |
| 100 | // PORT_CONFNAME(APOLLO_CONF_NODE_ID, APOLLO_CONF_NODE_ID, "Node ID from Disk") | |
| 101 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 102 | // PORT_CONFSETTING(APOLLO_CONF_NODE_ID, DEF_STR ( On ) ) | |
| 100 | // PORT_CONFNAME(APOLLO_CONF_NODE_ID, APOLLO_CONF_NODE_ID, "Node ID from Disk") | |
| 101 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 102 | // PORT_CONFSETTING(APOLLO_CONF_NODE_ID, DEF_STR ( On ) ) | |
| 103 | 103 | |
| 104 | // PORT_CONFNAME(APOLLO_CONF_IDLE_SLEEP, 0x00, "Idle Sleep") | |
| 105 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 106 | // PORT_CONFSETTING(APOLLO_CONF_IDLE_SLEEP, DEF_STR ( On ) ) | |
| 104 | // PORT_CONFNAME(APOLLO_CONF_IDLE_SLEEP, 0x00, "Idle Sleep") | |
| 105 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 106 | // PORT_CONFSETTING(APOLLO_CONF_IDLE_SLEEP, DEF_STR ( On ) ) | |
| 107 | 107 | |
| 108 | 108 | PORT_CONFNAME(APOLLO_CONF_TRAP_TRACE, 0x00, "Trap Trace") |
| 109 | 109 | PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) |
| r31373 | r31374 | |
| 113 | 113 | PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) |
| 114 | 114 | PORT_CONFSETTING(APOLLO_CONF_FPU_TRACE, DEF_STR ( On ) ) |
| 115 | 115 | |
| 116 | // PORT_CONFNAME(APOLLO_CONF_DISK_TRACE, 0x00, "Disk Trace") | |
| 117 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 118 | // PORT_CONFSETTING(APOLLO_CONF_DISK_TRACE, DEF_STR ( On ) ) | |
| 116 | // PORT_CONFNAME(APOLLO_CONF_DISK_TRACE, 0x00, "Disk Trace") | |
| 117 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 118 | // PORT_CONFSETTING(APOLLO_CONF_DISK_TRACE, DEF_STR ( On ) ) | |
| 119 | 119 | |
| 120 | // PORT_CONFNAME(APOLLO_CONF_NET_TRACE, 0x00, "Network Trace") | |
| 121 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 122 | // PORT_CONFSETTING(APOLLO_CONF_NET_TRACE, DEF_STR ( On ) ) | |
| 120 | // PORT_CONFNAME(APOLLO_CONF_NET_TRACE, 0x00, "Network Trace") | |
| 121 | // PORT_CONFSETTING(0x00, DEF_STR ( Off ) ) | |
| 122 | // PORT_CONFSETTING(APOLLO_CONF_NET_TRACE, DEF_STR ( On ) ) | |
| 123 | 123 | |
| 124 | 124 | INPUT_PORTS_END |
| 125 | 125 | |
| r31373 | r31374 | |
| 740 | 740 | ip3_w((input_data & 0x08) ? ASSERT_LINE : CLEAR_LINE); |
| 741 | 741 | ip4_w((input_data & 0x10) ? ASSERT_LINE : CLEAR_LINE); |
| 742 | 742 | ip5_w((input_data & 0x20) ? ASSERT_LINE : CLEAR_LINE); |
| 743 | // | |
| 743 | // ip6_w((input_data & 0x40) ? ASSERT_LINE : CLEAR_LINE); | |
| 744 | 744 | |
| 745 | 745 | // MC2681 has IP[6] (instead of /IACK on MC68681) |
| 746 | 746 | m_ip6 = (input_data & 0x40) ? ASSERT_LINE : CLEAR_LINE; |
| r31373 | r31374 | |
| 829 | 829 | |
| 830 | 830 | WRITE8_MEMBER(apollo_state::sio_output) |
| 831 | 831 | { |
| 832 | // | |
| 832 | // CLOG2(("apollo_sio - sio_output %02x", data)); | |
| 833 | 833 | |
| 834 | 834 | if ((data & 0x80) != (sio_output_data & 0x80)) |
| 835 | 835 | { |
| r31373 | r31374 | |
|---|---|---|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | /* cassette load circuit |
| 60 | This "emulates" U79 CD4046BCN PLL chip and U1 LM311P op-amp. U79 converts a frequency to a voltage, | |
| 61 | and U1 amplifies that voltage to digital levels. U1 has a trimpot connected, to set the midpoint. | |
| 60 | This "emulates" U79 CD4046BCN PLL chip and U1 LM311P op-amp. U79 converts a frequency to a voltage, | |
| 61 | and U1 amplifies that voltage to digital levels. U1 has a trimpot connected, to set the midpoint. | |
| 62 | 62 | |
| 63 | The MDS homebrew input circuit consists of 2 op-amps followed by a D-flipflop. | |
| 64 | The "read-any-system" cassette circuit is a CA3140 op-amp, the smarts being done in software. | |
| 63 | The MDS homebrew input circuit consists of 2 op-amps followed by a D-flipflop. | |
| 64 | The "read-any-system" cassette circuit is a CA3140 op-amp, the smarts being done in software. | |
| 65 | 65 | |
| 66 | bit 0 = original system (U79 and U1) | |
| 67 | bit 1 = MDS fast system | |
| 68 | bit 2 = CA3140 */ | |
| 66 | bit 0 = original system (U79 and U1) | |
| 67 | bit 1 = MDS fast system | |
| 68 | bit 2 = CA3140 */ | |
| 69 | 69 | TIMER_DEVICE_CALLBACK_MEMBER( super80_state::timer_p ) |
| 70 | 70 | { |
| 71 | 71 | UINT8 cass_ws=0; |
| r31373 | r31374 | |
|---|---|---|
| 142 | 142 | { |
| 143 | 143 | const char *floppy_tags[4] = { FLOPPY_0, FLOPPY_1, FLOPPY_2, FLOPPY_3 }; |
| 144 | 144 | |
| 145 | if (m_betadisk_active == 1) | |
| 145 | if (m_betadisk_active == 1) | |
| 146 | 146 | { |
| 147 | 147 | m_wd179x->set_drive(data & 3); |
| 148 | 148 | m_wd179x->set_side ((data & 0x10) ? 0 : 1 ); |
| r31373 | r31374 | |
|---|---|---|
| 400 | 400 | another display write. */ |
| 401 | 401 | pia->cb1_w(1); |
| 402 | 402 | } |
| 403 | ||
| 404 |
| r31373 | r31374 | |
|---|---|---|
| 62 | 62 | break; |
| 63 | 63 | } |
| 64 | 64 | } |
| 65 |
| r31373 | r31374 | |
|---|---|---|
| 178 | 178 | |
| 179 | 179 | void rmnimbus_state::external_int(UINT8 vector, bool state) |
| 180 | 180 | { |
| 181 | ||
| 182 | 181 | if(!state && (vector != m_vector)) |
| 183 | 182 | return; |
| 184 | 183 |
| r31373 | r31374 | |
|---|---|---|
| 354 | 354 | offset &= 0xf; |
| 355 | 355 | if (offset >= 8 && offset <= 0xb) |
| 356 | 356 | { |
| 357 | return m_acia1->read(space, offset-8); | |
| 357 | return m_acia1->read(space, offset-8); | |
| 358 | 358 | } |
| 359 | 359 | } |
| 360 | 360 | else if (slot == 2) |
| r31373 | r31374 | |
| 362 | 362 | offset &= 0xf; |
| 363 | 363 | if (offset >= 8 && offset <= 0xb) |
| 364 | 364 | { |
| 365 | return m_acia2->read(space, offset-8); | |
| 365 | return m_acia2->read(space, offset-8); | |
| 366 | 366 | } |
| 367 | 367 | } |
| 368 | 368 | } |
| r31373 | r31374 | |
|---|---|---|
| 165 | 165 | break; |
| 166 | 166 | } |
| 167 | 167 | } |
| 168 |
| r31373 | r31374 | |
|---|---|---|
| 682 | 682 | NCE1 256KB ROM 512KB ROM 2MB flash ROM |
| 683 | 683 | |
| 684 | 684 | |
| 685 | - NCE1 (ROM) cannot be configured, it is always visible at addresses | |
| 685 | - NCE1 (ROM) cannot be configured, it is always visible at addresses | |
| 686 | 686 | 00000-7ffff not covered by higher priority modules. |
| 687 | 687 | |
| 688 | 688 | - only the address of HDW (I/O) can be configured, its size is constant |
| r31373 | r31374 | |
| 712 | 712 | LOG(( "hp48_apply_modules: high ROM bank is %i\n", bank_hi )); |
| 713 | 713 | space.install_read_bank( 0x00000, 0x3ffff, 0, 0x80000, "bank5" ); |
| 714 | 714 | space.install_read_bank( 0x40000, 0x7ffff, 0, 0x80000, "bank6" ); |
| 715 | if ( m_rom ) | |
| 715 | if ( m_rom ) | |
| 716 | 716 | { |
| 717 | 717 | membank("bank5")->set_base( m_rom + bank_lo * 0x40000 ); |
| 718 | 718 | membank("bank6")->set_base( m_rom + bank_hi * 0x40000 ); |
| r31373 | r31374 | |
| 743 | 743 | LOG(( "hp48_apply_modules: A19 disabled, NCE3 %s\n", nce3_enable ? "enabled" : "disabled" )); |
| 744 | 744 | space.install_read_bank( 0, 0x7ffff, 0, 0x80000, "bank5" ); |
| 745 | 745 | } |
| 746 | if ( m_rom ) | |
| 746 | if ( m_rom ) | |
| 747 | 747 | membank("bank5")->set_base( m_rom ); |
| 748 | 748 | } |
| 749 | 749 | else |
| r31373 | r31374 | |
|---|---|---|
| 39 | 39 | bits 0-5: 6-bit audio DAC output |
| 40 | 40 | bit 6: screen blank |
| 41 | 41 | bit 7: OR of NMI from slots |
| 42 | ||
| 42 | ||
| 43 | 43 | ***************************************************************************/ |
| 44 | 44 | |
| 45 | 45 | #include "emu.h" |
| r31373 | r31374 | |
| 157 | 157 | pdl_handler(offset); |
| 158 | 158 | break; |
| 159 | 159 | |
| 160 | case 0x60: | |
| 160 | case 0x60: // joystick switch 0 | |
| 161 | 161 | case 0x68: |
| 162 | 162 | result = (m_joybuttons->read() & 1) ? 0x80 : 0x00; |
| 163 | 163 | break; |
| 164 | 164 | |
| 165 | case 0x61: | |
| 165 | case 0x61: // joystick switch 1 (margin switch for Silentype) | |
| 166 | 166 | case 0x69: |
| 167 | 167 | result = (m_joybuttons->read() & 4) ? 0x80 : 0x00; |
| 168 | 168 | break; |
| 169 | 169 | |
| 170 | case 0x62: | |
| 170 | case 0x62: // joystick switch 2 | |
| 171 | 171 | case 0x6a: |
| 172 | 172 | result = (m_joybuttons->read() & 2) ? 0x80 : 0x00; |
| 173 | 173 | break; |
| 174 | 174 | |
| 175 | case 0x63: | |
| 175 | case 0x63: // joystick switch 3 (serial clock for silentype) | |
| 176 | 176 | case 0x6b: |
| 177 | 177 | result = (m_joybuttons->read() & 8) ? 0x80 : 0x00; |
| 178 | 178 | break; |
| 179 | 179 | |
| 180 | case 0x66: | |
| 180 | case 0x66: // paddle A/D conversion done (bit 7 = 1 while counting, 0 when done) | |
| 181 | 181 | case 0x6e: |
| 182 | 182 | return m_ramp_active ? 0x80 : 0x00; |
| 183 | 183 | break; |
| r31373 | r31374 | |
| 1197 | 1197 | } |
| 1198 | 1198 | m_pdltimer->adjust(attotime::from_hz(1000000.0)); |
| 1199 | 1199 | m_ramp_active = true; |
| 1200 | break; | |
| 1200 | break; | |
| 1201 | 1201 | |
| 1202 | 1202 | case 0x5e: |
| 1203 | 1203 | m_analog_sel &= ~2; |
| r31373 | r31374 | |
| 1231 | 1231 | m_pdltimer->adjust(attotime::from_hz(1000000.0)); |
| 1232 | 1232 | } |
| 1233 | 1233 | } |
| 1234 |
| r31373 | r31374 | |
|---|---|---|
| 36 | 36 | { |
| 37 | 37 | m_system_flags = data; |
| 38 | 38 | } |
| 39 |
| r31373 | r31374 | |
|---|---|---|
| 165 | 165 | { |
| 166 | 166 | int x = 0; |
| 167 | 167 | const pen_t *pen = m_palette->pens(); |
| 168 | ||
| 168 | ||
| 169 | 169 | for (int column = 0; column < x_count; column += 2) |
| 170 | 170 | { |
| 171 | 171 | UINT16 dma = get_crtca(ma, ra, column); |
| 172 | ||
| 172 | ||
| 173 | 173 | // data is read out of video RAM in nibble mode by strobing CAS 4 times |
| 174 | 174 | for (int cas = 0; cas < 4; cas++) |
| 175 | 175 | { |
| 176 | 176 | UINT16 data = read_videoram(dma + cas); |
| 177 | ||
| 177 | ||
| 178 | 178 | for (int bit = 0; bit < 16; bit++) |
| 179 | 179 | { |
| 180 | 180 | int color = ((BIT(data, 15) ^ PIX_POL) && !BLANK) && de; |
| 181 | ||
| 181 | ||
| 182 | 182 | bitmap.pix32(vbp + y, hbp + x++) = pen[color]; |
| 183 | ||
| 183 | ||
| 184 | 184 | data <<= 1; |
| 185 | 185 | } |
| 186 | 186 | } |
| r31373 | r31374 | |
|---|---|---|
| 4 | 4 | |
| 5 | 5 | Routines to control the Atari 7800 video hardware |
| 6 | 6 | |
| 7 | 2014-05-06 Mike Saarna Added interrupts to DMA cycle eating. Updates to | |
| 8 | LL, OL, and spin accounting for HALT behavior. | |
| 7 | 2014-05-06 Mike Saarna Added interrupts to DMA cycle eating. Updates to | |
| 8 | LL, OL, and spin accounting for HALT behavior. | |
| 9 | 9 | |
| 10 | 10 | 2014-03-24 Mike Saarna Fixed DMA regarding startup, shutdown and |
| 11 | 11 | cycle stealing. |
| r31373 | r31374 | |
| 133 | 133 | { |
| 134 | 134 | if(READ_MEM(m_maria_dll+3) & 0x80) |
| 135 | 135 | maria_cycles=40; // DMA + maria interrupt overhead |
| 136 | ||
| 136 | else | |
| 137 | 137 | maria_cycles=19; // DMA |
| 138 | } | |
| 139 | else | |
| 140 | { | |
| 141 | maria_cycles = 16; // DMA | |
| 142 | } | |
| 138 | } | |
| 139 | else | |
| 140 | { | |
| 141 | maria_cycles = 16; // DMA | |
| 142 | } | |
| 143 | 143 | |
| 144 | 144 | cells = 0; |
| 145 | 145 | |
| r31373 | r31374 | |
| 215 | 215 | // Spin the CPU for Maria DMA, if it's not already spinning for WSYNC. |
| 216 | 216 | // MARIA generates the 6502 clock by dividing its own clock by 4. It needs to HALT and unHALT |
| 217 | 217 | // the 6502 on ths same clock phase, so MARIA will wait until its clock divides evenly by 4. |
| 218 | // To spin until an even divisor, we just round-up any would-be truncations by adding 3. | |
| 218 | // To spin until an even divisor, we just round-up any would-be truncations by adding 3. | |
| 219 | 219 | if ( ! m_maria_wsync ) |
| 220 | 220 | m_maincpu->spin_until_time(m_maincpu->cycles_to_attotime((maria_cycles+3)/4)); |
| 221 | 221 |
| r31373 | r31374 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | #define FG_COLOUR (m_colours&0x0F) |
| 33 | 33 | #define BG_COLOUR ((m_colours&0xF0)>>4) |
| 34 | #define SELECT_COL(x,c) (IS_80COL ? ((((x) & 1) ? ((c) << 2) : (c)) & 0xC) : (c)) | |
| 35 | #define FILL_WORD(c) (((c) << 12) | ((c) << 8) | ((c) << 4) | (c)) | |
| 34 | #define SELECT_COL(x,c) (IS_80COL ? ((((x) & 1) ? ((c) << 2) : (c)) & 0xC) : (c)) | |
| 35 | #define FILL_WORD(c) (((c) << 12) | ((c) << 8) | ((c) << 4) | (c)) | |
| 36 | 36 | |
| 37 | 37 | #define IS_80COL (m_mode&0x10) |
| 38 | 38 | #define IS_XOR (m_op&8) |
| r31373 | r31374 | |
|---|---|---|
| 427 | 427 | { |
| 428 | 428 | if (m_update_row_type == -1) |
| 429 | 429 | return; |
| 430 | ||
| 430 | ||
| 431 | 431 | switch (m_update_row_type) |
| 432 | 432 | { |
| 433 | 433 | case T1000_TEXT_INTEN: |
| r31373 | r31374 | |
| 456 | 456 | { |
| 457 | 457 | if (m_update_row_type == -1) |
| 458 | 458 | return; |
| 459 | ||
| 459 | ||
| 460 | 460 | switch (m_update_row_type) |
| 461 | 461 | { |
| 462 | 462 | case PCJX_TEXT: |
| r31373 | r31374 | |
|---|---|---|
| 10 | 10 | |
| 11 | 11 | TODO: |
| 12 | 12 | |
| 13 | ||
| 13 | - hook up RAD prom | |
| 14 | 14 | - flashing |
| 15 | 15 | - double height |
| 16 | 16 | - underline |
| r31373 | r31374 | |
|---|---|---|
| 180 | 180 | if (((ma>>13)&1)==0) |
| 181 | 181 | { |
| 182 | 182 | m_Teletext_Latch=0; |
| 183 | } | |
| 184 | else | |
| 183 | } | |
| 184 | else | |
| 185 | 185 | { |
| 186 | 186 | m_Teletext_Latch=(m_BBC_Video_RAM[calculate_video_address(ma+x_pos,ra)]); |
| 187 | 187 | } |
| r31373 | r31374 | |
|---|---|---|
| 21 | 21 | - REQUIRED TODOS / TESTS : |
| 22 | 22 | * do line and character attributes (plus combinations) match real hardware? |
| 23 | 23 | * how does the AVO fit in? |
| 24 | ||
| 24 | ||
| 25 | 25 | - SCROLLING REGIONS / SPLIT SCREEN SCROLLING UNTESTED (if you open > 1 file with the VAX editor EDT) |
| 26 | 26 | See VT100 Technical Manual: 4.7.4 Address Shuffling to 4.7.9 Split Screen Smooth Scrolling. |
| 27 | 27 | More on scrolling regions: Rainbow 100 B technical documentation (QV069-GZ) April 1985 page 22 |
| 28 | ||
| 28 | ||
| 29 | 29 | - NEW - INTERLACED MODE (Rainbow only): |
| 30 | 30 | Vertical resolution increases from 240 to 480, while the refresh rate halves (flickers on CRTs). |
| 31 | 31 | To accomplish this, the display controller repeats even lines in odd scans. |
| 32 | 32 | VTVIDEO activates line doubling in 24 line, interlaced mode only. |
| 33 | ||
| 33 | ||
| 34 | 34 | Although the DC12 has the ability to display 48 lines, most units are low on screen RAM and |
| 35 | won't even show 80 x 48. -> REASON: (83 x 48 = 3984 Byte) > (screen RAM) minus 'scratch area' | |
| 35 | won't even show 80 x 48. -> REASON: (83 x 48 = 3984 Byte) > (screen RAM) minus 'scratch area' | |
| 36 | 36 | On a VT-180, BIOS scratch requires up to 700 bytes used for SETUP, flags, SILO, keyboard. |
| 37 | ||
| 37 | ||
| 38 | 38 | - POSSIBLE IMPROVEMENTS: |
| 39 | ||
| 39 | ||
| 40 | 40 | * exact colors for different VR201 monitors ('paper white', green and amber) |
| 41 | 41 | |
| 42 | 42 | * ACCURATE VIDEO DELAYS: |
| 43 | Position of the first visible scanline (relative to the vertical reset) depends on | |
| 44 | content of fill bytes at the beginning of screen RAM. | |
| 43 | Position of the first visible scanline (relative to the vertical reset) depends on | |
| 44 | content of fill bytes at the beginning of screen RAM. | |
| 45 | 45 | |
| 46 | 46 | Six invisible, linked lines are initially provided (at location $EE000+ on a Rainbow). |
| 47 | 47 | Real-world DC hardware parses the (circular) chain until interrupted by blanking. |
| r31373 | r31374 | |
| 185 | 185 | m_basic_attribute = 0; |
| 186 | 186 | |
| 187 | 187 | m_columns = 80; |
| 188 | ||
| 189 | m_frequency = 60; | |
| 190 | 188 | |
| 191 | m_interlaced = 1; | |
| 189 | m_frequency = 60; | |
| 190 | ||
| 191 | m_interlaced = 1; | |
| 192 | 192 | m_fill_lines = 2; // for 60Hz (not in use any longer -> detected) |
| 193 | 193 | recompute_parameters(); |
| 194 | 194 | } |
| r31373 | r31374 | |
| 210 | 210 | |
| 211 | 211 | int vert_pix_total = ((m_linedoubler == false) ? m_height : m_height_MAX) * 10; |
| 212 | 212 | |
| 213 | if (m_columns == 132) | |
| 214 | horiz_pix_total = m_columns * 9; // display 1 less filler pixel in 132 char. mode | |
| 213 | if (m_columns == 132) | |
| 214 | horiz_pix_total = m_columns * 9; // display 1 less filler pixel in 132 char. mode | |
| 215 | 215 | else |
| 216 | 216 | horiz_pix_total = m_columns * 10; // normal 80 character mode. |
| 217 | 217 | |
| r31373 | r31374 | |
| 239 | 239 | // Also used by Rainbow-100 ************ |
| 240 | 240 | WRITE8_MEMBER(vt100_video_device::dc012_w) |
| 241 | 241 | { |
| 242 | ||
| 243 | 242 | // TODO: writes to 10C/0C should be treated differently (emulation disables the watchdog too often). |
| 244 | 243 | // - see 3.1.3.9.5 DC012 Programming Information (PC-100 spec) |
| 245 | 244 | if (data == 0) // MHFU is disabled by writing 00 to port 010C. |
| r31373 | r31374 | |
| 254 | 253 | } |
| 255 | 254 | } |
| 256 | 255 | else |
| 257 | { | |
| 256 | { | |
| 258 | 257 | // RESET |
| 259 | 258 | MHFU_FLAG = true; |
| 260 | 259 | MHFU_counter = 0; |
| r31373 | r31374 | |
| 343 | 342 | // Writing to DC011 resets internal counters (& disturbs display) on real hardware. |
| 344 | 343 | WRITE8_MEMBER(vt100_video_device::dc011_w) |
| 345 | 344 | { |
| 346 | if (!BIT(data, 5)) | |
| 345 | if (!BIT(data, 5)) | |
| 347 | 346 | { |
| 348 | m_interlaced = 1; | |
| 347 | m_interlaced = 1; | |
| 349 | 348 | |
| 350 | 349 | if (!BIT(data, 4)) |
| 351 | 350 | m_columns = 80; |
| r31373 | r31374 | |
| 359 | 358 | if (!BIT(data, 4)) |
| 360 | 359 | { |
| 361 | 360 | m_frequency = 60; |
| 362 | m_fill_lines = 2; | |
| 361 | m_fill_lines = 2; | |
| 363 | 362 | } |
| 364 | 363 | else |
| 365 | 364 | { |
| 366 | 365 | m_frequency = 50; |
| 367 | m_fill_lines = 5; | |
| 366 | m_fill_lines = 5; | |
| 368 | 367 | } |
| 369 | 368 | } |
| 370 | 369 | |
| 371 | recompute_parameters(); | |
| 370 | recompute_parameters(); | |
| 372 | 371 | } |
| 373 | 372 | |
| 374 | 373 | WRITE8_MEMBER(vt100_video_device::brightness_w) |
| r31373 | r31374 | |
| 534 | 533 | |
| 535 | 534 | UINT16 y_preset; |
| 536 | 535 | |
| 537 | UINT16 CHARPOS_y_preset = y << 3; // CHARPOS_y_preset = y * 10; | |
| 536 | UINT16 CHARPOS_y_preset = y << 3; // CHARPOS_y_preset = y * 10; | |
| 538 | 537 | CHARPOS_y_preset += y; |
| 539 | 538 | CHARPOS_y_preset += y; |
| 540 | 539 | |
| r31373 | r31374 | |
| 546 | 545 | int back_intensity, back_default_intensity; |
| 547 | 546 | |
| 548 | 547 | int invert = (display_type & 8) ? 1 : 0; // REVERSE |
| 549 | int bold = (display_type & 16) ? 0 : 1; // BIT 4 | |
| 548 | int bold = (display_type & 16) ? 0 : 1; // BIT 4 | |
| 550 | 549 | int blink = (display_type & 32) ? 0 : 1; // BIT 5 |
| 551 | int underline = (display_type & 64) ? 0 : 1; // BIT 6 | |
| 552 | bool blank = (display_type & 128) ? true : false; // BIT 7 | |
| 550 | int underline = (display_type & 64) ? 0 : 1; // BIT 6 | |
| 551 | bool blank = (display_type & 128) ? true : false; // BIT 7 | |
| 553 | 552 | |
| 554 | 553 | display_type = display_type & 3; |
| 555 | 554 | |
| r31373 | r31374 | |
| 730 | 729 | // Skip fill (0xFF) lines and put result in ADDR. |
| 731 | 730 | for (int xp = 1; xp <= 6; xp += 1) // beware of circular references |
| 732 | 731 | { |
| 733 | // Fetch LINE ATTRIBUTE before it is gone | |
| 732 | // Fetch LINE ATTRIBUTE before it is gone | |
| 734 | 733 | attr_addr = 0x1000 | ((addr + 1) & 0x0fff); |
| 735 | 734 | |
| 736 | 735 | temp = m_read_ram(addr + 2) * 256 + m_read_ram(addr + 1); |
| r31373 | r31374 | |
|---|---|---|
| 360 | 360 | |
| 361 | 361 | |
| 362 | 362 | //------------------------------------------------- |
| 363 | // mc6845 | |
| 363 | // mc6845 | |
| 364 | 364 | //------------------------------------------------- |
| 365 | 365 | |
| 366 | 366 | int pc1512_state::get_display_mode(UINT8 mode) |
| r31373 | r31374 | |
|---|---|---|
| 44 | 44 | READ8_MEMBER( k1ge_device::read ) |
| 45 | 45 | { |
| 46 | 46 | assert(offset < 0x4000); |
| 47 | ||
| 47 | ||
| 48 | 48 | UINT8 data = m_vram[offset]; |
| 49 | 49 | |
| 50 | 50 | switch( offset ) |
| r31373 | r31374 | |
| 63 | 63 | WRITE8_MEMBER( k1ge_device::write ) |
| 64 | 64 | { |
| 65 | 65 | assert(offset < 0x4000); |
| 66 | ||
| 66 | ||
| 67 | 67 | switch( offset ) |
| 68 | 68 | { |
| 69 | 69 | case 0x000: |
| r31373 | r31374 | |
|---|---|---|
| 687 | 687 | { |
| 688 | 688 | m_u11_a = data; |
| 689 | 689 | m_pia_u7->ca1_w(BIT(data, 1)); |
| 690 | ||
| 690 | m_pia_u7->ca2_w(BIT(data, 2)); | |
| 691 | 691 | } |
| 692 | 692 | |
| 693 | 693 | READ8_MEMBER( by133_state::u11_b_r ) |
| r31373 | r31374 | |
| 705 | 705 | { |
| 706 | 706 | m_u10_timer ^= 1; |
| 707 | 707 | m_pia_u10->cb1_w(m_u10_timer); |
| 708 | } | |
| 708 | } | |
| 709 | 709 | |
| 710 | 710 | // 555 timer for display refresh |
| 711 | 711 | TIMER_DEVICE_CALLBACK_MEMBER( by133_state::u11_timer ) |
| r31373 | r31374 | |
|---|---|---|
| 151 | 151 | int r = m_paletteram[3 * i + 0]; |
| 152 | 152 | int g = m_paletteram[3 * i + 1]; |
| 153 | 153 | int b = m_paletteram[3 * i + 2]; |
| 154 | ||
| 154 | ||
| 155 | 155 | r = pal6bit(r); |
| 156 | 156 | g = pal6bit(g); |
| 157 | 157 | b = pal6bit(b); |
| 158 | ||
| 158 | ||
| 159 | 159 | m_pens[i] = rgb_t(r, g, b); |
| 160 | 160 | } |
| 161 | 161 | } |
| r31373 | r31374 | |
| 513 | 513 | MCFG_QUANTUM_PERFECT_CPU("maincpu") |
| 514 | 514 | |
| 515 | 515 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 516 | ||
| 516 | ||
| 517 | 517 | MCFG_MC6845_ADD("crtc", H46505, "screen", XTAL_24MHz / 16) |
| 518 | 518 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| 519 | 519 | MCFG_MC6845_CHAR_WIDTH(5) |
| r31373 | r31374 | |
|---|---|---|
| 1045 | 1045 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", meritm_state, meritm_interrupt, "screen", 0, 1) |
| 1046 | 1046 | |
| 1047 | 1047 | MCFG_DEVICE_ADD("ppi8255", I8255, 0) |
| 1048 | MCFG_I8255_OUT_PORTB_CB(WRITE8(meritm_state, meritm_crt250_port_b_w)) | |
| 1048 | MCFG_I8255_OUT_PORTB_CB(WRITE8(meritm_state, meritm_crt250_port_b_w)) // used LMP x DRIVE | |
| 1049 | 1049 | MCFG_I8255_IN_PORTC_CB(READ8(meritm_state, meritm_8255_port_c_r)) |
| 1050 | 1050 | |
| 1051 | 1051 | MCFG_DEVICE_ADD("z80pio_0", Z80PIO, SYSTEM_CLK/6) |
| r31373 | r31374 | |
|---|---|---|
| 818 | 818 | case 0x8000: return 0xf0 | 0xcc; |
| 819 | 819 | case 0xc000: return 0xf0 | 0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ |
| 820 | 820 | } |
| 821 | ||
| 821 | ||
| 822 | 822 | return 0; |
| 823 | 823 | } |
| 824 | 824 |
| r31373 | r31374 | |
|---|---|---|
| 124 | 124 | D8 | 9 |
| 125 | 125 | D7 | 10 |
| 126 | 126 | D6 | 11 |
| 127 | D5 | 12 | |
| 127 | D5 | 12 | |
| 128 | 128 | D4 | 13 |
| 129 | 129 | D3 | 14 |
| 130 | 130 | D2 | 15 |
| r31373 | r31374 | |
| 152 | 152 | m_to_68k_cmd_low(0), |
| 153 | 153 | m_to_68k_cmd_d9(0), |
| 154 | 154 | m_to_68k_cmd_req(0), |
| 155 | m_to_68k_cmd_LVm(0), | |
| 155 | m_to_68k_cmd_LVm(0), | |
| 156 | 156 | m_from68k_ack(0), |
| 157 | 157 | m_from68k_st4(0), |
| 158 | 158 | m_from68k_st3(0), |
| 159 | 159 | m_from68k_st2(0) |
| 160 | 160 | |
| 161 | { | |
| 161 | { | |
| 162 | 162 | for (int i = 0; i < 6; i++) |
| 163 | 163 | { |
| 164 | 164 | mole_state_a[i] = 0x00; |
| r31373 | r31374 | |
| 190 | 190 | sprintf(temp, "molea_%d", i); |
| 191 | 191 | output_set_value(temp, mole_state_a[i]); |
| 192 | 192 | } |
| 193 | ||
| 193 | ||
| 194 | 194 | for (int i = 0; i < 6; i++) |
| 195 | 195 | { |
| 196 | 196 | char temp[32]; |
| r31373 | r31374 | |
| 226 | 226 | UINT8 m_to_68k_cmd_d9; |
| 227 | 227 | UINT8 m_to_68k_cmd_req; |
| 228 | 228 | UINT8 m_to_68k_cmd_LVm; |
| 229 | ||
| 230 | 229 | |
| 230 | ||
| 231 | 231 | int m_from68k_ack; |
| 232 | 232 | int m_from68k_st4; |
| 233 | 233 | int m_from68k_st3; |
| r31373 | r31374 | |
| 258 | 258 | void kenseim_state::set_leds(UINT32 ledstates) |
| 259 | 259 | { |
| 260 | 260 | for (int i=0; i<20; i++) |
| 261 | output_set_lamp_value(i+1, ((ledstates & (1 << i)) != 0)); | |
| 261 | output_set_lamp_value(i+1, ((ledstates & (1 << i)) != 0)); | |
| 262 | 262 | } |
| 263 | 263 | |
| 264 | 264 | // could be wrong |
| r31373 | r31374 | |
| 266 | 266 | { |
| 267 | 267 | // I'm guessing these are the 20 'power meter' LEDs, 10 for each player? (it writes 42 times, with the last write being some terminator?) |
| 268 | 268 | |
| 269 | // | |
| 269 | // printf("%s mb8936 write %02x to port C but no handler assigned (serial data?)\n", machine().describe_context(), data); | |
| 270 | 270 | |
| 271 | 271 | if (data & 0x08) |
| 272 | 272 | { |
| 273 | ||
| 274 | 273 | if (data & 0x02) |
| 275 | 274 | { |
| 276 | 275 | if (data & 0x04) |
| r31373 | r31374 | |
| 317 | 316 | |
| 318 | 317 | update_moles(); |
| 319 | 318 | |
| 320 | } | |
| 319 | } | |
| 321 | 320 | |
| 322 | 321 | WRITE8_MEMBER(kenseim_state::mb8936_portb_w) // maybe molesb output? (6-bits?) |
| 323 | 322 | { |
| r31373 | r31374 | |
| 503 | 502 | PORT_START("IN0") |
| 504 | 503 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_COIN1*/ ) // n/c |
| 505 | 504 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_COIN2*/ ) // n/c |
| 506 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_9_r, NULL) // | |
| 505 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_9_r, NULL) // PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_SERVICE1 ) // D9 | |
| 507 | 506 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c? |
| 508 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_req_r, NULL) // PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // REQ | |
| 509 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_LVm_r, NULL) // PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) // LVm | |
| 507 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_req_r, NULL) // PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_START1 ) // REQ | |
| 508 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_LVm_r, NULL) // PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_START2 ) // LVm | |
| 510 | 509 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) // PORT_SERVICE( 0x40, IP_ACTIVE_LOW ) n/c |
| 511 | 510 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c? |
| 512 | 511 | |
| 513 | 512 | PORT_START("IN1") |
| 514 | // PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) // D5 | |
| 515 | // PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) // D6 | |
| 516 | // PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) // D7 | |
| 517 | // PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) // D8 | |
| 513 | // PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(1) // D5 | |
| 514 | // PORT_BIT( 0x0002, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(1) // D6 | |
| 515 | // PORT_BIT( 0x0004, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(1) // D7 | |
| 516 | // PORT_BIT( 0x0008, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(1) // D8 | |
| 518 | 517 | PORT_BIT( 0x000f, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_5678_r, NULL) |
| 519 | 518 | PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_UNUSED/*IPT_BUTTON1*/ ) /*PORT_PLAYER(1)*/ // n/c |
| 520 | 519 | PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED/*IPT_BUTTON2*/ ) /*PORT_PLAYER(1)*/ // n/c |
| 521 | 520 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED/*IPT_BUTTON3*/ ) /*PORT_PLAYER(1)*/ // n/c |
| 522 | 521 | PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c? |
| 523 | 522 | |
| 524 | // PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) // D1 | |
| 525 | // PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) // D2 | |
| 526 | // PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) // D3 | |
| 527 | // PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) // D4 | |
| 523 | // PORT_BIT( 0x0100, IP_ACTIVE_LOW, IPT_JOYSTICK_RIGHT ) PORT_8WAY PORT_PLAYER(2) // D1 | |
| 524 | // PORT_BIT( 0x0200, IP_ACTIVE_LOW, IPT_JOYSTICK_LEFT ) PORT_8WAY PORT_PLAYER(2) // D2 | |
| 525 | // PORT_BIT( 0x0400, IP_ACTIVE_LOW, IPT_JOYSTICK_DOWN ) PORT_8WAY PORT_PLAYER(2) // D3 | |
| 526 | // PORT_BIT( 0x0800, IP_ACTIVE_LOW, IPT_JOYSTICK_UP ) PORT_8WAY PORT_PLAYER(2) // D4 | |
| 528 | 527 | PORT_BIT( 0x0f00, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_CUSTOM_MEMBER(DEVICE_SELF, kenseim_state, kenseim_cmd_1234_r, NULL) |
| 529 | 528 | PORT_BIT( 0x1000, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_BUTTON1*/ ) /*PORT_PLAYER(2)*/ // n/c |
| 530 | 529 | PORT_BIT( 0x2000, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_BUTTON2*/ ) /*PORT_PLAYER(2)*/ // n/c |
| 531 | 530 | PORT_BIT( 0x4000, IP_ACTIVE_LOW, IPT_UNUSED /*IPT_BUTTON3*/ ) /*PORT_PLAYER(2)*/ // n/c |
| 532 | 531 | PORT_BIT( 0x8000, IP_ACTIVE_LOW, IPT_UNKNOWN ) // n/c? |
| 533 | 532 | |
| 534 | // most of the regular CPS1 dips are unused | |
| 533 | // most of the regular CPS1 dips are unused | |
| 535 | 534 | PORT_START("DSWA") |
| 536 | 535 | PORT_DIPUNUSED_DIPLOC( 0x01, 0x01, "CPSA SW(A):1" ) |
| 537 | 536 | PORT_DIPUNUSED_DIPLOC( 0x02, 0x02, "CPSA SW(A):2" ) |
| r31373 | r31374 | |
| 699 | 698 | // 1994.04.18 is from extra PCB rom, Siguma or Sigma? (Siguma is in the ROM) |
| 700 | 699 | // the CPS1 board roms contain "M O G U R A 9 2 0 9 2 4" strings suggesting that part of the code was developed earlier |
| 701 | 700 | GAMEL( 1994, kenseim, 0, kenseim, kenseim, kenseim_state, kenseim, ROT0, "Capcom / Togo / Sigma", "Ken Sei Mogura: Street Fighter II (Japan 940418, Ver 1.00)", GAME_CLICKABLE_ARTWORK, layout_kenseim ) |
| 702 |
| r31373 | r31374 | |
|---|---|---|
| 355 | 355 | |
| 356 | 356 | WRITE8_MEMBER(bfm_sc1_state::vfd_w) |
| 357 | 357 | { |
| 358 | /* | |
| 358 | /* int changed = m_vfd_latch ^ data; | |
| 359 | 359 | |
| 360 | ||
| 360 | m_vfd_latch = data; | |
| 361 | 361 | |
| 362 | if ( changed ) | |
| 363 | { | |
| 364 | if ( changed & VFD_RESET ) | |
| 365 | { // vfd reset line changed | |
| 366 | if ( !(data & VFD_RESET) ) | |
| 367 | { // reset the vfd | |
| 368 | m_vfd0->reset(); | |
| 369 | } | |
| 370 | } | |
| 371 | if ( changed & VFD_CLOCK1 ) | |
| 372 | { // clock line changed | |
| 373 | if ( !(data & VFD_CLOCK1) && (data & VFD_RESET) ) | |
| 374 | { // new data clocked into vfd | |
| 375 | m_vfd0->shift_data(data & VFD_DATA ); | |
| 376 | } | |
| 377 | } | |
| 378 | } | |
| 362 | if ( changed ) | |
| 363 | { | |
| 364 | if ( changed & VFD_RESET ) | |
| 365 | { // vfd reset line changed | |
| 366 | if ( !(data & VFD_RESET) ) | |
| 367 | { // reset the vfd | |
| 368 | m_vfd0->reset(); | |
| 369 | } | |
| 370 | } | |
| 371 | if ( changed & VFD_CLOCK1 ) | |
| 372 | { // clock line changed | |
| 373 | if ( !(data & VFD_CLOCK1) && (data & VFD_RESET) ) | |
| 374 | { // new data clocked into vfd | |
| 375 | m_vfd0->shift_data(data & VFD_DATA ); | |
| 376 | } | |
| 377 | } | |
| 378 | } | |
| 379 | 379 | */ |
| 380 | 380 | m_vfd0->por(data & VFD_RESET); |
| 381 | 381 | m_vfd0->data(data & VFD_DATA); |
| r31373 | r31374 | |
|---|---|---|
| 642 | 642 | { |
| 643 | 643 | m_segaic16vid->segaic16_tilemap_reset(*m_screen); |
| 644 | 644 | |
| 645 | // hook the RESET line, which resets CPU #1 | |
| 645 | // hook the RESET line, which resets CPU #1 | |
| 646 | 646 | m_maincpu->set_reset_callback(write_line_delegate(FUNC(segaxbd_state::m68k_reset_callback),this)); |
| 647 | 647 | |
| 648 | 648 | // start timers to track interrupts |
| r31373 | r31374 | |
|---|---|---|
| 3118 | 3118 | ROM_LOAD( "gw-5.21f", 0x080000, 0x20000, CRC(9ef36031) SHA1(2faeb6a769991ab11403c6c37507b706a61bad69) ) |
| 3119 | 3119 | ROM_LOAD( "guernica-c2.18h", 0x100000, 0x80000, CRC(2fcbea97) SHA1(eb60bf374ef771e379030d2b660a813be76bed5e) ) |
| 3120 | 3120 | ROM_LOAD( "gw-6.20f", 0x180000, 0x20000, CRC(ddbbcda7) SHA1(1c368ad2a4ed31748c94545fc7c808aa53d76f64) ) |
| 3121 | ROM_LOAD( "guernica-c1.20h", 0x200000, 0x80000, CRC(b0fd1c23) SHA1(a6dbed81b751c1f662f63a7426d8333aca866d79) ) | |
| 3121 | ROM_LOAD( "guernica-c1.20h", 0x200000, 0x80000, CRC(b0fd1c23) SHA1(a6dbed81b751c1f662f63a7426d8333aca866d79) ) | |
| 3122 | 3122 | ROM_LOAD( "gw-7.18f", 0x280000, 0x20000, CRC(4656d377) SHA1(67d6f714cca3891be0173c543ece5e8ab699f645) ) |
| 3123 | 3123 | ROM_LOAD( "guernica-c0.21h", 0x300000, 0x80000, CRC(e60c9882) SHA1(8cf1d9cf0db72977b303fd6b469611600631ab9a) ) |
| 3124 | 3124 | ROM_LOAD( "gw-8.17f", 0x380000, 0x20000, CRC(798ed82a) SHA1(1932131e05aae0a77ba8d8ef947c1a3b0b5e3d43) ) |
| r31373 | r31374 | |
| 3151 | 3151 | ROM_LOAD( "u5", 0x080000, 0x20000, CRC(94612190) SHA1(dd7818744b1b6738d268044f13e0647e7a3b2d1e) ) // this set of u5,u6,u7,u8 have a one-way sign, used on stage 3 |
| 3152 | 3152 | ROM_LOAD( "guernica-c2.18h", 0x100000, 0x80000, CRC(2fcbea97) SHA1(eb60bf374ef771e379030d2b660a813be76bed5e) ) |
| 3153 | 3153 | ROM_LOAD( "u6", 0x180000, 0x20000, CRC(5a4ea0f0) SHA1(7ea8b3f66f32ab9b33a522edca6d5c6416fd7a9b) ) |
| 3154 | ROM_LOAD( "guernica-c1.20h", 0x200000, 0x80000, CRC(b0fd1c23) SHA1(a6dbed81b751c1f662f63a7426d8333aca866d79) ) | |
| 3154 | ROM_LOAD( "guernica-c1.20h", 0x200000, 0x80000, CRC(b0fd1c23) SHA1(a6dbed81b751c1f662f63a7426d8333aca866d79) ) | |
| 3155 | 3155 | ROM_LOAD( "u7", 0x280000, 0x20000, CRC(33f324cb) SHA1(c00f55ce85749cbbb9569a22cc6c9c886ed9ab78) ) |
| 3156 | 3156 | ROM_LOAD( "guernica-c0.21h", 0x300000, 0x80000, CRC(e60c9882) SHA1(8cf1d9cf0db72977b303fd6b469611600631ab9a) ) |
| 3157 | 3157 | ROM_LOAD( "u8", 0x380000, 0x20000, CRC(c1995c2c) SHA1(909e1070b4ec28a1f4a2cd9fbc3bde781ffbdda8) ) |
| r31373 | r31374 | |
|---|---|---|
| 3 | 3 | /* |
| 4 | 4 | the MSM6376 is on the ROM board, so some games might not have it |
| 5 | 5 | the YM2149F is on the MAIN board, but it seems very rarely used for sound. |
| 6 | ||
| 6 | ||
| 7 | 7 | On various PCBs, I've seen the AY slot filled with AY8913's, 8910's, |
| 8 | 8 | YM2419s and even AY8930s. |
| 9 | 9 |
| r31373 | r31374 | |
|---|---|---|
| 3175 | 3175 | |
| 3176 | 3176 | ROM_START( tazzmang2 ) // Original Sparcade set |
| 3177 | 3177 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 3178 | ROM_LOAD( "tazmania.1", 0x000000, 0x000800, CRC(6ecc84a2) SHA1(6f31e69bd613b93e1fac26163f39676299c65a76) ) | |
| 3179 | ROM_LOAD( "tazmania.2", 0x000800, 0x000800, CRC(e27b09f6) SHA1(1a419c8f45639e2c2351eeb94bf62fca35d5928e) ) | |
| 3180 | ROM_LOAD( "tazmania.3", 0x001000, 0x000800, CRC(954868f3) SHA1(3882e17ffd9bcfcff383ed95279606962f89dafd) ) | |
| 3181 | ROM_LOAD( "tazmania.4", 0x001800, 0x000800, CRC(238520e6) SHA1(eec76b54058a6a6139f13f188d243f20d1a7aa12) ) | |
| 3182 | ROM_LOAD( "tazmania.5", 0x002000, 0x000800, CRC(0527e513) SHA1(20175c293f1cf45fa21dd400cb2718dd8ee0dcea) ) | |
| 3183 | ROM_LOAD( "tazmania.6", 0x002800, 0x000800, CRC(af2b92d8) SHA1(5642666eb66d549390cd5b13a7029daede6d3ff8) ) | |
| 3184 | ROM_LOAD( "tazmania.7", 0x003000, 0x000800, CRC(bbdc41d3) SHA1(17de825efd56541dbdbacdc83f77f3ccaef2d07f) ) | |
| 3185 | ROM_LOAD( "tazmania.8", 0x003800, 0x000800, CRC(eb35f49c) SHA1(0f2bf1043092e746fdbc5d2e0292aeaa7b7f0218) ) | |
| 3186 | ROM_LOAD( "tazmania.a", 0x004000, 0x001000, CRC(38f326f8) SHA1(5c5463666b6ed15cbcc874faf79cc06ae1cba59a) ) | |
| 3187 | ROM_LOAD( "tazmania.b", 0x005000, 0x001000, CRC(2a22a9dc) SHA1(07aecdff852065671e488682cf710fd48273b88c) ) | |
| 3178 | ROM_LOAD( "tazmania.1", 0x000000, 0x000800, CRC(6ecc84a2) SHA1(6f31e69bd613b93e1fac26163f39676299c65a76) ) | |
| 3179 | ROM_LOAD( "tazmania.2", 0x000800, 0x000800, CRC(e27b09f6) SHA1(1a419c8f45639e2c2351eeb94bf62fca35d5928e) ) | |
| 3180 | ROM_LOAD( "tazmania.3", 0x001000, 0x000800, CRC(954868f3) SHA1(3882e17ffd9bcfcff383ed95279606962f89dafd) ) | |
| 3181 | ROM_LOAD( "tazmania.4", 0x001800, 0x000800, CRC(238520e6) SHA1(eec76b54058a6a6139f13f188d243f20d1a7aa12) ) | |
| 3182 | ROM_LOAD( "tazmania.5", 0x002000, 0x000800, CRC(0527e513) SHA1(20175c293f1cf45fa21dd400cb2718dd8ee0dcea) ) | |
| 3183 | ROM_LOAD( "tazmania.6", 0x002800, 0x000800, CRC(af2b92d8) SHA1(5642666eb66d549390cd5b13a7029daede6d3ff8) ) | |
| 3184 | ROM_LOAD( "tazmania.7", 0x003000, 0x000800, CRC(bbdc41d3) SHA1(17de825efd56541dbdbacdc83f77f3ccaef2d07f) ) | |
| 3185 | ROM_LOAD( "tazmania.8", 0x003800, 0x000800, CRC(eb35f49c) SHA1(0f2bf1043092e746fdbc5d2e0292aeaa7b7f0218) ) | |
| 3186 | ROM_LOAD( "tazmania.a", 0x004000, 0x001000, CRC(38f326f8) SHA1(5c5463666b6ed15cbcc874faf79cc06ae1cba59a) ) | |
| 3187 | ROM_LOAD( "tazmania.b", 0x005000, 0x001000, CRC(2a22a9dc) SHA1(07aecdff852065671e488682cf710fd48273b88c) ) | |
| 3188 | 3188 | |
| 3189 | 3189 | ROM_REGION( 0x1000, "gfx1", 0 ) |
| 3190 | 3190 | ROM_LOAD( "tazm8.1lk", 0x0000, 0x0800, CRC(2c5b612b) SHA1(32e3a41a9a4a8b1285b6a195213ff0d98012360a) ) // tazmania.g1 |
| r31373 | r31374 | |
|---|---|---|
| 30 | 30 | *************************************************************************************** |
| 31 | 31 | |
| 32 | 32 | PCB Layout... |
| 33 | ||
| 33 | ||
| 34 | 34 | .------------------------------------------------------------------------------------. |
| 35 | 35 | | A B C D E F | |
| 36 | 36 | | .-----. .-----. .-----. .-----. .-----. .-----. | |
| r31373 | r31374 | |
| 125 | 125 | | | 0.1 uf | | |
| 126 | 126 | | R 2.2 '--| |---' -+- |
| 127 | 127 | '--/\/\/\/--. GND |
| 128 | | | |
| 128 | | | |
| 129 | 129 | -+- |
| 130 | 130 | GND |
| 131 | 131 | |
| r31373 | r31374 | |
| 211 | 211 | |
| 212 | 212 | static NETLIST_START(nl_cocoloco) |
| 213 | 213 | |
| 214 | ||
| 214 | /* Standard stuff */ | |
| 215 | 215 | |
| 216 | SOLVER(Solver, 48000) | |
| 217 | PARAM(Solver.ACCURACY, 1e-5) | |
| 218 | ANALOG_INPUT(V5, 5) | |
| 216 | SOLVER(Solver, 48000) | |
| 217 | PARAM(Solver.ACCURACY, 1e-5) | |
| 218 | ANALOG_INPUT(V5, 5) | |
| 219 | 219 | |
| 220 | ||
| 220 | /* AY 8910 internal resistors */ | |
| 221 | 221 | |
| 222 | RES(R_AY1_1, 1000); | |
| 223 | RES(R_AY1_2, 1000); | |
| 224 | RES(R_AY1_3, 1000); | |
| 222 | RES(R_AY1_1, 1000); | |
| 223 | RES(R_AY1_2, 1000); | |
| 224 | RES(R_AY1_3, 1000); | |
| 225 | 225 | |
| 226 | RES(R1, 4700) | |
| 227 | RES(R2, 4700) | |
| 228 | RES(R3, 4700) | |
| 229 | RES(RAMP, 150000) | |
| 230 | //RES(RAMP, 150) | |
| 231 | POT(P1, 5000) | |
| 232 | PARAM(P1.DIAL, 0.5) // 50% | |
| 226 | RES(R1, 4700) | |
| 227 | RES(R2, 4700) | |
| 228 | RES(R3, 4700) | |
| 229 | RES(RAMP, 150000) | |
| 230 | //RES(RAMP, 150) | |
| 231 | POT(P1, 5000) | |
| 232 | PARAM(P1.DIAL, 0.5) // 50% | |
| 233 | 233 | |
| 234 | ||
| 234 | CAP(C1, 10e-6) | |
| 235 | 235 | |
| 236 | ||
| 236 | NET_C(V5, R_AY1_1.1, R_AY1_2.1, R_AY1_3.1) | |
| 237 | 237 | |
| 238 | NET_C(R_AY1_1.2, R1.1) | |
| 239 | NET_C(R_AY1_2.2, R2.1) | |
| 240 | NET_C(R_AY1_3.2, R3.1) | |
| 238 | NET_C(R_AY1_1.2, R1.1) | |
| 239 | NET_C(R_AY1_2.2, R2.1) | |
| 240 | NET_C(R_AY1_3.2, R3.1) | |
| 241 | 241 | |
| 242 | ||
| 242 | NET_C(R1.2, R2.2, R3.2, P1.1) | |
| 243 | 243 | |
| 244 | NET_C(P1.3, RAMP.2, GND) | |
| 245 | NET_C(P1.2, C1.1) | |
| 246 | NET_C(C1.2, RAMP.1) | |
| 244 | NET_C(P1.3, RAMP.2, GND) | |
| 245 | NET_C(P1.2, C1.1) | |
| 246 | NET_C(C1.2, RAMP.1) | |
| 247 | 247 | #if 0 |
| 248 | CAP(C2, 0.1e-6) | |
| 249 | NET_C(C2.2, GND) | |
| 250 | NET_C(C2.1, RAMP.1) | |
| 248 | CAP(C2, 0.1e-6) | |
| 249 | NET_C(C2.2, GND) | |
| 250 | NET_C(C2.1, RAMP.1) | |
| 251 | 251 | #endif |
| 252 | 252 | NETLIST_END() |
| 253 | 253 | |
| r31373 | r31374 | |
| 339 | 339 | WRITE8_MEMBER( cocoloco_state::cocoloco_vram_clear_w ) |
| 340 | 340 | { |
| 341 | 341 | /* ??? */ |
| 342 | // for(int i=0;i<0x8000;i++) | |
| 343 | // m_videoram[i] = 0; | |
| 342 | // for(int i=0;i<0x8000;i++) | |
| 343 | // m_videoram[i] = 0; | |
| 344 | 344 | |
| 345 | // | |
| 345 | // popmessage("A005 writes: %02X", data); | |
| 346 | 346 | } |
| 347 | 347 | |
| 348 | 348 | |
| r31373 | r31374 | |
| 354 | 354 | xxxx -xxx Unknown. |
| 355 | 355 | |
| 356 | 356 | The coin counter gives 2 pulses for each coin inserted. |
| 357 | They explain in a sheet that the coin in for 50 pesetas | |
| 358 | behaves like 2x 25 pesetas (1 duro) coins, so has sense. | |
| 357 | They explain in a sheet that the coin in for 50 pesetas | |
| 358 | behaves like 2x 25 pesetas (1 duro) coins, so has sense. | |
| 359 | 359 | */ |
| 360 | 360 | coin_counter_w(machine(), 0, data & 0x08); |
| 361 | 361 | } |
| r31373 | r31374 | |
| 367 | 367 | |
| 368 | 368 | static ADDRESS_MAP_START( cocoloco_map, AS_PROGRAM, 8, cocoloco_state ) |
| 369 | 369 | AM_RANGE(0x0000, 0x1fff) AM_RAM |
| 370 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(cocoloco_vram_r, cocoloco_vram_w) | |
| 370 | AM_RANGE(0x2000, 0x3fff) AM_READWRITE(cocoloco_vram_r, cocoloco_vram_w) // 256 x 256 x 1 | |
| 371 | 371 | AM_RANGE(0x6001, 0x6001) AM_DEVREAD("ay8910", ay8910_device, data_r) |
| 372 | 372 | AM_RANGE(0x6002, 0x6002) AM_DEVWRITE("ay8910", ay8910_device, data_w) |
| 373 | 373 | AM_RANGE(0x6003, 0x6003) AM_DEVWRITE("ay8910", ay8910_device, address_w) |
| r31373 | r31374 | |
| 414 | 414 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_CUSTOM ) PORT_VBLANK("screen") |
| 415 | 415 | |
| 416 | 416 | PORT_START("DSW1") // DSW1 @4B |
| 417 | PORT_DIPNAME( 0x01, 0x00, "Char Speed" ) | |
| 417 | PORT_DIPNAME( 0x01, 0x00, "Char Speed" ) PORT_DIPLOCATION("DSW1:!1") | |
| 418 | 418 | PORT_DIPSETTING( 0x00, "Fast" ) |
| 419 | 419 | PORT_DIPSETTING( 0x01, "Slow" ) |
| 420 | PORT_DIPNAME( 0x02, 0x00, "Monsters Speed" ) | |
| 420 | PORT_DIPNAME( 0x02, 0x00, "Monsters Speed" ) PORT_DIPLOCATION("DSW1:!2") | |
| 421 | 421 | PORT_DIPSETTING( 0x00, "Fast" ) |
| 422 | 422 | PORT_DIPSETTING( 0x02, "Slow" ) |
| 423 | PORT_DIPNAME( 0x0c, 0x00, "Monsters: Time before go out" ) | |
| 423 | PORT_DIPNAME( 0x0c, 0x00, "Monsters: Time before go out" ) PORT_DIPLOCATION("DSW1:!3,!4") | |
| 424 | 424 | PORT_DIPSETTING( 0x00, "Long" ) |
| 425 | 425 | PORT_DIPSETTING( 0x04, "Medium-Long" ) |
| 426 | 426 | PORT_DIPSETTING( 0x08, "Medium-Short" ) |
| 427 | 427 | PORT_DIPSETTING( 0x0c, "Short" ) |
| 428 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) | |
| 428 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) // switches 5-6-7-8 marked as unused. | |
| 429 | 429 | |
| 430 | 430 | PORT_START("DSW2") // DSW2 @5C |
| 431 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) | |
| 431 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Coinage ) ) PORT_DIPLOCATION("DSW2:!1,!2") | |
| 432 | 432 | PORT_DIPSETTING( 0x00, DEF_STR( 1C_2C ) ) |
| 433 | 433 | PORT_DIPSETTING( 0x02, DEF_STR( 1C_3C ) ) |
| 434 | 434 | PORT_DIPSETTING( 0x01, DEF_STR( 1C_4C ) ) |
| 435 | 435 | PORT_DIPSETTING( 0x03, DEF_STR( 1C_5C ) ) |
| 436 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) | |
| 436 | PORT_DIPNAME( 0x0c, 0x00, DEF_STR( Bonus_Life ) ) PORT_DIPLOCATION("DSW2:!3,!4") | |
| 437 | 437 | PORT_DIPSETTING( 0x00, "10000 Points" ) |
| 438 | 438 | PORT_DIPSETTING( 0x04, "15000 Points" ) |
| 439 | 439 | PORT_DIPSETTING( 0x08, "20000 Points" ) |
| 440 | 440 | PORT_DIPSETTING( 0x0c, "30000 Points" ) |
| 441 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Lives ) ) | |
| 441 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Lives ) ) PORT_DIPLOCATION("DSW2:!5") | |
| 442 | 442 | PORT_DIPSETTING( 0x00, "2" ) |
| 443 | 443 | PORT_DIPSETTING( 0x10, "3" ) |
| 444 | PORT_DIPNAME( 0x20, 0x00, "Monsters" ) | |
| 444 | PORT_DIPNAME( 0x20, 0x00, "Monsters" ) PORT_DIPLOCATION("DSW2:!6") | |
| 445 | 445 | PORT_DIPSETTING( 0x00, "4" ) |
| 446 | 446 | PORT_DIPSETTING( 0x20, "5" ) |
| 447 | PORT_DIPNAME( 0xc0, 0x00, "Vitamine Time" ) | |
| 447 | PORT_DIPNAME( 0xc0, 0x00, "Vitamine Time" ) PORT_DIPLOCATION("DSW2:!7,!8") | |
| 448 | 448 | PORT_DIPSETTING( 0x00, "Long" ) |
| 449 | 449 | PORT_DIPSETTING( 0x40, "Medium-Long" ) |
| 450 | 450 | PORT_DIPSETTING( 0x80, "Medium-Short" ) |
| r31373 | r31374 | |
| 459 | 459 | static MACHINE_CONFIG_START( cocoloco, cocoloco_state ) |
| 460 | 460 | |
| 461 | 461 | /* basic machine hardware */ |
| 462 | MCFG_CPU_ADD("maincpu", M6502, CPU_CLOCK) | |
| 462 | MCFG_CPU_ADD("maincpu", M6502, CPU_CLOCK) /* confirmed */ | |
| 463 | 463 | MCFG_CPU_PROGRAM_MAP(cocoloco_map) |
| 464 | 464 | |
| 465 | 465 | /* video hardware */ |
| r31373 | r31374 | |
| 473 | 473 | |
| 474 | 474 | /* sound hardware */ |
| 475 | 475 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 476 | MCFG_SOUND_ADD("ay8910", AY8910, SND_CLOCK) | |
| 476 | MCFG_SOUND_ADD("ay8910", AY8910, SND_CLOCK) /* confirmed */ | |
| 477 | 477 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW1")) |
| 478 | 478 | MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW2")) |
| 479 | MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT) | |
| 480 | MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0) | |
| 481 | MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1) | |
| 482 | MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2) | |
| 479 | MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT) | |
| 480 | MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0) | |
| 481 | MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1) | |
| 482 | MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2) | |
| 483 | 483 | |
| 484 | ||
| 484 | /* NETLIST configuration using internal AY8910 resistor values */ | |
| 485 | 485 | |
| 486 | MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000) | |
| 487 | MCFG_NETLIST_SETUP(nl_cocoloco) | |
| 488 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 486 | MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, 48000) | |
| 487 | MCFG_NETLIST_SETUP(nl_cocoloco) | |
| 488 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) | |
| 489 | 489 | |
| 490 | MCFG_NETLIST_STREAM_INPUT("snd_nl", 0, "R_AY1_1.R") | |
| 491 | MCFG_NETLIST_STREAM_INPUT("snd_nl", 1, "R_AY1_2.R") | |
| 492 | MCFG_NETLIST_STREAM_INPUT("snd_nl", 2, "R_AY1_3.R") | |
| 490 | MCFG_NETLIST_STREAM_INPUT("snd_nl", 0, "R_AY1_1.R") | |
| 491 | MCFG_NETLIST_STREAM_INPUT("snd_nl", 1, "R_AY1_2.R") | |
| 492 | MCFG_NETLIST_STREAM_INPUT("snd_nl", 2, "R_AY1_3.R") | |
| 493 | 493 | |
| 494 | MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "RAMP.1") | |
| 495 | MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0 * 1.5, 0) | |
| 494 | MCFG_NETLIST_STREAM_OUTPUT("snd_nl", 0, "RAMP.1") | |
| 495 | MCFG_NETLIST_ANALOG_MULT_OFFSET(30000.0 * 1.5, 0) | |
| 496 | 496 | |
| 497 | 497 | MACHINE_CONFIG_END |
| 498 | 498 |
| r31373 | r31374 | |
|---|---|---|
| 2101 | 2101 | MCFG_DEVICE_ADD("nmk112", NMK112, 0) |
| 2102 | 2102 | MCFG_NMK112_ROM0("oki1") |
| 2103 | 2103 | MCFG_NMK112_ROM1("oki2") |
| 2104 | MCFG_NMK112_DISABLE_PAGEMASK(1 << 0) | |
| 2104 | MCFG_NMK112_DISABLE_PAGEMASK(1 << 0) // chip #0 (music) is not paged | |
| 2105 | 2105 | MACHINE_CONFIG_END |
| 2106 | 2106 | |
| 2107 | 2107 |
| r31373 | r31374 | |
|---|---|---|
| 1033 | 1033 | |
| 1034 | 1034 | |
| 1035 | 1035 | static MACHINE_CONFIG_DERIVED( crusnwld, midvunit ) |
| 1036 | /* valid values are 450 or 460 */ | |
| 1037 | MCFG_DEVICE_ADD("serial_pic", MIDWAY_SERIAL_PIC, 0) | |
| 1036 | /* valid values are 450 or 460 */ | |
| 1037 | MCFG_DEVICE_ADD("serial_pic", MIDWAY_SERIAL_PIC, 0) | |
| 1038 | 1038 | MCFG_MIDWAY_SERIAL_PIC_UPPER(450) |
| 1039 | 1039 | MACHINE_CONFIG_END |
| 1040 | 1040 | |
| 1041 | 1041 | static MACHINE_CONFIG_DERIVED( offroadc, midvunit ) |
| 1042 | 1042 | /* valid values are 230 or 234 */ |
| 1043 | MCFG_DEVICE_ADD("serial_pic2", MIDWAY_SERIAL_PIC2, 0) | |
| 1043 | MCFG_DEVICE_ADD("serial_pic2", MIDWAY_SERIAL_PIC2, 0) | |
| 1044 | 1044 | MCFG_MIDWAY_SERIAL_PIC2_UPPER(230) |
| 1045 | MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(94) | |
| 1045 | MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(94) | |
| 1046 | 1046 | MACHINE_CONFIG_END |
| 1047 | 1047 | |
| 1048 | 1048 | |
| r31373 | r31374 | |
| 1062 | 1062 | MCFG_MIDWAY_IOASIC_SHUFFLE(0) |
| 1063 | 1063 | MCFG_MIDWAY_IOASIC_UPPER(452) /* no alternates */ |
| 1064 | 1064 | MCFG_MIDWAY_IOASIC_YEAR_OFFS(94) |
| 1065 | ||
| 1065 | ||
| 1066 | 1066 | /* sound hardware */ |
| 1067 | 1067 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2115, 0) |
| 1068 | 1068 | MCFG_DCS2_AUDIO_DRAM_IN_MB(2) |
| r31373 | r31374 | |
|---|---|---|
| 294 | 294 | |
| 295 | 295 | MCFG_SOUND_ADD("aysnd", AY8910, 2000000) |
| 296 | 296 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSWA")) |
| 297 | MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) | |
| 297 | MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSWB")) | |
| 298 | 298 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 299 | 299 | |
| 300 | 300 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 102 | 102 | required_device<timer_device> m_tms_timer1; |
| 103 | 103 | required_device<timer_device> m_tms_tx_timer; |
| 104 | 104 | required_device<palette_device> m_palette; |
| 105 | required_device<nvram_device> | |
| 105 | required_device<nvram_device> m_nvram; | |
| 106 | 106 | |
| 107 | 107 | DECLARE_WRITE32_MEMBER(cyrix_cache_w); |
| 108 | 108 | DECLARE_READ8_MEMBER(nvram_r); |
| r31373 | r31374 | |
|---|---|---|
| 56 | 56 | |
| 57 | 57 | /* |
| 58 | 58 | PPC -> TLCS Commands: |
| 59 | 0x5010: ? RTC? | |
| 60 | 0x5020: ? RTC? | |
| 61 | 0x6000: ? Backup RAM init? | |
| 59 | 0x5010: ? RTC? | |
| 60 | 0x5020: ? RTC? | |
| 61 | 0x6000: ? Backup RAM init? | |
| 62 | 62 | 0x6010: ? Backup RAM Read. Address in io_shared[0x1d00]. |
| 63 | 63 | 0x6020: ? Backup RAM Write. Address in io_shared[0x1d00]. |
| 64 | 0x6030: ? ? | |
| 65 | 0x6040: ? ? | |
| 66 | 0x4000: ? Sound? | |
| 67 | 0x4001: ? | |
| 68 | 0x4002: ? | |
| 69 | 0x4003: ? | |
| 70 | 0x4004: ? | |
| 71 | 0xf055: | |
| 72 | 0xf0ff: | |
| 73 | 0xf000: | |
| 74 | 0xf001: | |
| 75 | 0xf010: | |
| 76 | 0xf020: | |
| 64 | 0x6030: ? ? | |
| 65 | 0x6040: ? ? | |
| 66 | 0x4000: ? Sound? | |
| 67 | 0x4001: ? | |
| 68 | 0x4002: ? | |
| 69 | 0x4003: ? | |
| 70 | 0x4004: ? | |
| 71 | 0xf055: | |
| 72 | 0xf0ff: | |
| 73 | 0xf000: | |
| 74 | 0xf001: | |
| 75 | 0xf010: | |
| 76 | 0xf020: | |
| 77 | 77 | |
| 78 | 78 | */ |
| 79 | 79 | |
| r31373 | r31374 | |
| 83 | 83 | #include "cpu/mn10200/mn10200.h" |
| 84 | 84 | #include "machine/nvram.h" |
| 85 | 85 | |
| 86 | #define LOG_TLCS_TO_PPC_COMMANDS 1 | |
| 87 | #define LOG_PPC_TO_TLCS_COMMANDS 1 | |
| 86 | #define LOG_TLCS_TO_PPC_COMMANDS 1 | |
| 87 | #define LOG_PPC_TO_TLCS_COMMANDS 1 | |
| 88 | 88 | |
| 89 | 89 | |
| 90 | 90 | static UINT32 jc_char_ram[0x2000]; |
| r31373 | r31374 | |
| 269 | 269 | { |
| 270 | 270 | UINT32 address = offset * 2; |
| 271 | 271 | |
| 272 | // | |
| 272 | // logerror("ppc_common_w: %08X, %I64X, %I64X\n", offset, data, mem_mask); | |
| 273 | 273 | |
| 274 | 274 | if (ACCESSING_BITS_48_63) |
| 275 | 275 | { |
| r31373 | r31374 | |
| 422 | 422 | #if LOG_TLCS_TO_PPC_COMMANDS |
| 423 | 423 | printf("TLCS -> PPC cmd %04X\n", m_io_share_ram[0xffe]); |
| 424 | 424 | #endif |
| 425 | ||
| 425 | ||
| 426 | 426 | m_iocpu->set_input_line(TLCS900_INT1, CLEAR_LINE); |
| 427 | 427 | m_maincpu->set_input_line(INPUT_LINE_IRQ0, ASSERT_LINE); |
| 428 | 428 | } |
| r31373 | r31374 | |
| 472 | 472 | static ADDRESS_MAP_START( tlcs900h_mem, AS_PROGRAM, 16, taitopjc_state ) |
| 473 | 473 | AM_RANGE(0x010000, 0x02ffff) AM_RAM // Work RAM |
| 474 | 474 | AM_RANGE(0x040000, 0x0400ff) AM_READWRITE8(tlcs_sound_r, tlcs_sound_w, 0xffff) |
| 475 | AM_RANGE(0x044000, 0x045fff) AM_RAM AM_SHARE("nvram") | |
| 475 | AM_RANGE(0x044000, 0x045fff) AM_RAM AM_SHARE("nvram") | |
| 476 | 476 | AM_RANGE(0x060000, 0x061fff) AM_READWRITE8(tlcs_common_r, tlcs_common_w, 0xffff) |
| 477 | 477 | AM_RANGE(0x06c000, 0x06c00f) AM_WRITE(tlcs_unk_w) |
| 478 | 478 | AM_RANGE(0xfc0000, 0xffffff) AM_ROM AM_REGION("io_cpu", 0) |
| r31373 | r31374 | |
| 536 | 536 | DRIVER_INIT_MEMBER(taitopjc_state, optiger) |
| 537 | 537 | { |
| 538 | 538 | UINT8 *rom = (UINT8*)memregion("io_cpu")->base(); |
| 539 | ||
| 539 | ||
| 540 | 540 | // skip sound check |
| 541 | 541 | rom[0x217] = 0x00; |
| 542 | 542 | rom[0x218] = 0x00; |
| r31373 | r31374 | |
|---|---|---|
| 259 | 259 | ROM_LOAD32_BYTE( "770c12-b.e5", 0x040002, 0x010000, CRC(5f221cc6) SHA1(9a7a9c7853a3b582c4034b773cef08aee5391d6e) ) |
| 260 | 260 | ROM_LOAD32_BYTE( "770c12-d.e6", 0x040003, 0x010000, CRC(f1edb2f4) SHA1(3e66cc711e25cbf6e6a747d43a9efec0710d5b7a) ) |
| 261 | 261 | |
| 262 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 262 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 263 | 263 | ROM_LOAD32_BYTE( "770c09-a.f8", 0x000000, 0x010000, CRC(76690fb8) SHA1(afe267a37b65d63d3765dc3b88d8a8262446f786) ) |
| 264 | 264 | ROM_LOAD32_BYTE( "770c09-e.f9", 0x000001, 0x010000, CRC(17b482c9) SHA1(3535197956f5bf5b564fec1ddbb3e3ea3bf1f7bd) ) |
| 265 | 265 | ROM_LOAD32_BYTE( "770c08-a.f10", 0x000002, 0x010000, CRC(efd29a56) SHA1(2a9f138d1242a35162a3f092b0343dff899e3b83) ) |
| r31373 | r31374 | |
| 277 | 277 | ROM_LOAD32_BYTE( "770c08-d.c10", 0x0c0002, 0x010000, CRC(91591777) SHA1(53f416a51f7075f070168bced7b6f925f54c7b84) ) |
| 278 | 278 | ROM_LOAD32_BYTE( "770c08-h.c11", 0x0c0003, 0x010000, CRC(d97d4b15) SHA1(e3d7d7adeec8c8c808acb9f84641fd3a6bf249be) ) |
| 279 | 279 | |
| 280 | ROM_REGION( 0x080000, "k051316", 0 ) | |
| 280 | ROM_REGION( 0x080000, "k051316", 0 ) /* zoom/rotate */ | |
| 281 | 281 | ROM_LOAD( "770c06.f4", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) |
| 282 | 282 | ROM_LOAD( "770c07.h4", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) |
| 283 | 283 | |
| r31373 | r31374 | |
| 319 | 319 | ROM_LOAD32_WORD( "770c13.n22", 0x000000, 0x040000, CRC(b859ca4e) SHA1(f58678d503683f78cca0d5ed2d79f6f68ab3495a) ) |
| 320 | 320 | ROM_LOAD32_WORD( "770c12.k22", 0x000002, 0x040000, CRC(50d14b72) SHA1(e3ff4a5aeefa6c10b5f7fec18297948b7c5acfdf) ) |
| 321 | 321 | |
| 322 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 322 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 323 | 323 | ROM_LOAD32_WORD( "770c09.n4", 0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) ) |
| 324 | 324 | ROM_LOAD32_WORD( "770c08.k4", 0x000002, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) ) |
| 325 | 325 | |
| 326 | ROM_REGION( 0x080000, "k051316", 0 ) | |
| 326 | ROM_REGION( 0x080000, "k051316", 0 ) /* zoom/rotate */ | |
| 327 | 327 | ROM_LOAD( "770c06.f4", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) |
| 328 | 328 | ROM_LOAD( "770c07.h4", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) |
| 329 | 329 | |
| r31373 | r31374 | |
| 355 | 355 | ROM_LOAD32_WORD( "770c13.n22", 0x000000, 0x040000, CRC(b859ca4e) SHA1(f58678d503683f78cca0d5ed2d79f6f68ab3495a) ) |
| 356 | 356 | ROM_LOAD32_WORD( "770c12.k22", 0x000002, 0x040000, CRC(50d14b72) SHA1(e3ff4a5aeefa6c10b5f7fec18297948b7c5acfdf) ) |
| 357 | 357 | |
| 358 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 358 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 359 | 359 | ROM_LOAD32_WORD( "770c09.n4", 0x000000, 0x080000, CRC(1ab4a7ff) SHA1(fa007b41027f95d29d2a9f931a2fe235844db637) ) |
| 360 | 360 | ROM_LOAD32_WORD( "770c08.k4", 0x000002, 0x080000, CRC(a8e80586) SHA1(0401f59baa691905287cef94427f39e0c3f0adc6) ) |
| 361 | 361 | |
| 362 | ROM_REGION( 0x080000, "k051316", 0 ) | |
| 362 | ROM_REGION( 0x080000, "k051316", 0 ) /* zoom/rotate */ | |
| 363 | 363 | ROM_LOAD( "770c06.f4", 0x000000, 0x040000, CRC(d0c592ee) SHA1(c1be73dd259f2779d715659b177e47513776a0d4) ) |
| 364 | 364 | ROM_LOAD( "770c07.h4", 0x040000, 0x040000, CRC(0b399fb1) SHA1(fbe26f9aa9a655d08bebcdd79719d35134ca4dd5) ) |
| 365 | 365 |
| r31373 | r31374 | |
|---|---|---|
| 290 | 290 | { |
| 291 | 291 | m_ctc->trg2(0); |
| 292 | 292 | m_ctc->trg2(1); |
| 293 | } | |
| 293 | } | |
| 294 | 294 | |
| 295 | 295 | static const z80_daisy_config daisy_chain[] = |
| 296 | 296 | { |
| r31373 | r31374 | |
|---|---|---|
| 14 | 14 | public: |
| 15 | 15 | wpc_s_state(const machine_config &mconfig, device_type type, const char *tag) |
| 16 | 16 | : driver_device(mconfig, type, tag), |
| 17 | maincpu(*this, "maincpu"), | |
| 18 | dcs(*this, "dcs"), | |
| 19 | rombank(*this, "rombank"), | |
| 20 | mainram(*this, "mainram"), | |
| 21 | nvram(*this, "nvram"), | |
| 22 | pic(*this, "pic"), | |
| 23 | lamp(*this, "lamp"), | |
| 24 | out(*this, "out") | |
| 17 | maincpu(*this, "maincpu"), | |
| 18 | dcs(*this, "dcs"), | |
| 19 | rombank(*this, "rombank"), | |
| 20 | mainram(*this, "mainram"), | |
| 21 | nvram(*this, "nvram"), | |
| 22 | pic(*this, "pic"), | |
| 23 | lamp(*this, "lamp"), | |
| 24 | out(*this, "out") | |
| 25 | 25 | { } |
| 26 | 26 | |
| 27 | 27 | DECLARE_WRITE8_MEMBER(bank_w); |
| r31373 | r31374 | |
| 374 | 374 | }; |
| 375 | 375 | |
| 376 | 376 | const char *const wpc_s_state::outputs_corv[54] = { |
| 377 | "s:Trough eject", "s:ZR1 low rev gate", "s:Kickback", "s:Pit stop popper", "s:ZR1 up rev gate", NULL, "s:Knocker", "s:Route 66 kickout", | |
| 378 | "s:L slingshot", "s:R slingshot", "s:Left jet", "s:Bottom jet", "s:Right jet", NULL, "s:ZR1 lockup", "s:Loop gate", | |
| 379 | "s:Race direction", "s:L race enable", "s:R race enable", "f:Tenth corvette", "f:Jets", "f:R ramps", "f:U L flipper", "f:Catch me", | |
| 377 | "s:Trough eject", "s:ZR1 low rev gate", "s:Kickback", "s:Pit stop popper", "s:ZR1 up rev gate", NULL, "s:Knocker", "s:Route 66 kickout", | |
| 378 | "s:L slingshot", "s:R slingshot", "s:Left jet", "s:Bottom jet", "s:Right jet", NULL, "s:ZR1 lockup", "s:Loop gate", | |
| 379 | "s:Race direction", "s:L race enable", "s:R race enable", "f:Tenth corvette", "f:Jets", "f:R ramps", "f:U L flipper", "f:Catch me", | |
| 380 | 380 | "f:ZR1 ramp", "f:ZR1 underside", "f:R rear panel", "f:R standup", "s:R flip power", "s:R flip hold", "s:L flip power", "s:L flip hold", |
| 381 | "s:Diverter power", "s:Diverter hold", "s:UL flip power", "s:UL flip hold", NULL, NULL, NULL, NULL, | |
| 381 | "s:Diverter power", "s:Diverter hold", "s:UL flip power", "s:UL flip hold", NULL, NULL, NULL, NULL, | |
| 382 | 382 | NULL, |
| 383 | 383 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 384 | 384 | "g:Upper left", "g:Upper right", "g:Lower left", "g:Lower right", "g:Back box title" |
| r31373 | r31374 | |
| 386 | 386 | |
| 387 | 387 | static INPUT_PORTS_START( corv ) |
| 388 | 388 | PORT_START("SW.0") |
| 389 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left out lane") | |
| 390 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right out lane") | |
| 391 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 392 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 393 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plunger") | |
| 394 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L return lane") | |
| 395 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R return lane") | |
| 396 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Spinner") | |
| 389 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left out lane") | |
| 390 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right out lane") | |
| 391 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 392 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 393 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plunger") | |
| 394 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L return lane") | |
| 395 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R return lane") | |
| 396 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Spinner") | |
| 397 | 397 | |
| 398 | 398 | PORT_START("SW.1") |
| 399 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 400 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 401 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy in button") | |
| 402 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 403 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1st gear (opt)") | |
| 404 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2nd gear (opt)") | |
| 405 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3rd gear (opt)") | |
| 406 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4th gear (opt)") | |
| 399 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 400 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 401 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy in button") | |
| 402 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 403 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("1st gear (opt)") | |
| 404 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2nd gear (opt)") | |
| 405 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("3rd gear (opt)") | |
| 406 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("4th gear (opt)") | |
| 407 | 407 | |
| 408 | 408 | PORT_START("SW.2") |
| 409 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 410 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 411 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 412 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 413 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Route 66 entry") | |
| 414 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Pit stop popper") | |
| 415 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 416 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop entry") | |
| 409 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 410 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 411 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 412 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 413 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Route 66 entry") | |
| 414 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Pit stop popper") | |
| 415 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 416 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop entry") | |
| 417 | 417 | |
| 418 | 418 | PORT_START("SW.3") |
| 419 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 bottom entry") | |
| 420 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 top entry") | |
| 421 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Skid pad entry") | |
| 422 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skid pad exit") | |
| 423 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Route 66 exit") | |
| 424 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup 3") | |
| 425 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup 2") | |
| 426 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup 1") | |
| 419 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 bottom entry") | |
| 420 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 top entry") | |
| 421 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Skid pad entry") | |
| 422 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skid pad exit") | |
| 423 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Route 66 exit") | |
| 424 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup 3") | |
| 425 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup 2") | |
| 426 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup 1") | |
| 427 | 427 | |
| 428 | 428 | PORT_START("SW.4") |
| 429 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L race start") | |
| 430 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R race start") | |
| 431 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 432 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 433 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L race encoder") | |
| 434 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R race encoder") | |
| 435 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Route 66 kickout") | |
| 436 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skid rte66 exit") | |
| 429 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L race start") | |
| 430 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R race start") | |
| 431 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 432 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 433 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L race encoder") | |
| 434 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R race encoder") | |
| 435 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Route 66 kickout") | |
| 436 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skid rte66 exit") | |
| 437 | 437 | |
| 438 | 438 | PORT_START("SW.5") |
| 439 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 440 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 441 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 442 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 443 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 444 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L rollover") | |
| 445 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M rollover") | |
| 446 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R rollover") | |
| 439 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 440 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 441 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 442 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 443 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 444 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L rollover") | |
| 445 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M rollover") | |
| 446 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R rollover") | |
| 447 | 447 | |
| 448 | 448 | PORT_START("SW.6") |
| 449 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 full left") | |
| 450 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 full right") | |
| 451 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 452 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 453 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 exit") | |
| 454 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 lock ball 1") | |
| 455 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 lock ball 2") | |
| 456 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 lock ball 3") | |
| 449 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 full left") | |
| 450 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("ZR1 full right") | |
| 451 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 452 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 453 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 exit") | |
| 454 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 lock ball 1") | |
| 455 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 lock ball 2") | |
| 456 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ZR1 lock ball 3") | |
| 457 | 457 | |
| 458 | 458 | PORT_START("SW.7") |
| 459 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Million standup") | |
| 460 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skid pad standup") | |
| 461 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup") | |
| 462 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R rubber") | |
| 463 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 464 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet rubber") | |
| 465 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L outer loop") | |
| 466 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R outer loop") | |
| 459 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Million standup") | |
| 460 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skid pad standup") | |
| 461 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup") | |
| 462 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R rubber") | |
| 463 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 464 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet rubber") | |
| 465 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L outer loop") | |
| 466 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R outer loop") | |
| 467 | 467 | |
| 468 | 468 | PORT_START("DOOR") |
| 469 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 470 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 471 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 472 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 473 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 474 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 475 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 476 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 469 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 470 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 471 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 472 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 473 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 474 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 475 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 476 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 477 | 477 | |
| 478 | 478 | PORT_START("DSW") |
| 479 | 479 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 484 | 484 | PORT_DIPSETTING( 0xec, "Spain") |
| 485 | 485 | |
| 486 | 486 | PORT_START("FLIPPERS") |
| 487 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 488 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 489 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 490 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 491 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 492 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 493 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper EOS") | |
| 494 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 487 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 488 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 489 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 490 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 491 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 492 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 493 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper EOS") | |
| 494 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 495 | 495 | INPUT_PORTS_END |
| 496 | 496 | |
| 497 | 497 | const char *const wpc_s_state::lamps_dh[64] = { |
| r31373 | r31374 | |
| 506 | 506 | }; |
| 507 | 507 | |
| 508 | 508 | const char *const wpc_s_state::outputs_dh[54] = { |
| 509 | "s:Ball release", "s:Autoplunger", "s:Gun launch", "s:Top R popper", "s:Gun popper", "s:Drop target down", "s:Knocker", "s:Trap door hi", | |
| 510 | "s:Left sling", "s:Right sling", "s:Left jet", "s:Middle jet", "s:Right jet", "s:Left popper", "s:Right diverter", "s:Trap door hold", | |
| 511 | "f:Headquarters", "f:Top L popper", "f:Warehouse", "s:Gun motor", "f:Gun loaded", "f:Right ramp", "f:Right back", "f:Left back", | |
| 509 | "s:Ball release", "s:Autoplunger", "s:Gun launch", "s:Top R popper", "s:Gun popper", "s:Drop target down", "s:Knocker", "s:Trap door hi", | |
| 510 | "s:Left sling", "s:Right sling", "s:Left jet", "s:Middle jet", "s:Right jet", "s:Left popper", "s:Right diverter", "s:Trap door hold", | |
| 511 | "f:Headquarters", "f:Top L popper", "f:Warehouse", "s:Gun motor", "f:Gun loaded", "f:Right ramp", "f:Right back", "f:Left back", | |
| 512 | 512 | "s:Drop reset", "s:Top L popper", "s:Left diverter", "s:Right loop gate", "s:R flip power", "s:R flip hold", "s:L flip power", "s:L flip hold", |
| 513 | "s:UR flip power", "s:UR flip hold", "s:R loop magnet", "s:Left loop gate", NULL, NULL, NULL, NULL, | |
| 513 | "s:UR flip power", "s:UR flip hold", "s:R loop magnet", "s:Left loop gate", NULL, NULL, NULL, NULL, | |
| 514 | 514 | "s:Coin meter", |
| 515 | 515 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 516 | 516 | "g:Right string", "g:Left string", "g:Backbox title", "g:Backbox face", "g:Bottom string" |
| r31373 | r31374 | |
| 518 | 518 | |
| 519 | 519 | static INPUT_PORTS_START( dh ) |
| 520 | 520 | PORT_START("SW.0") |
| 521 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Gun handle trig") | |
| 522 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 523 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 524 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 525 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 526 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 527 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 528 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 8") | |
| 521 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Gun handle trig") | |
| 522 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 523 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 524 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 525 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 526 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 527 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 528 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 8") | |
| 529 | 529 | |
| 530 | 530 | PORT_START("SW.1") |
| 531 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 532 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 533 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ex ball button") | |
| 534 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 535 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 536 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 537 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 1") | |
| 538 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 2") | |
| 531 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 532 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 533 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ex ball button") | |
| 534 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 535 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 536 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 537 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 1") | |
| 538 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 2") | |
| 539 | 539 | |
| 540 | 540 | PORT_START("SW.2") |
| 541 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough jam") | |
| 542 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 543 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 544 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 545 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 546 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 547 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 548 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right ramp make") | |
| 541 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough jam") | |
| 542 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 543 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 544 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 545 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 546 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 547 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 548 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right ramp make") | |
| 549 | 549 | |
| 550 | 550 | PORT_START("SW.3") |
| 551 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 552 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 553 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp make") | |
| 554 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Gun chamber") | |
| 555 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Gun popper") | |
| 556 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Top R popper") | |
| 557 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 558 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 551 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 552 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 553 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp make") | |
| 554 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Gun chamber") | |
| 555 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Gun popper") | |
| 556 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Top R popper") | |
| 557 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 558 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 559 | 559 | |
| 560 | 560 | PORT_START("SW.4") |
| 561 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 562 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 563 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target down") | |
| 564 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 6") | |
| 565 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 7") | |
| 566 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 5") | |
| 567 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 4") | |
| 568 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 3") | |
| 561 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 562 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 563 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target down") | |
| 564 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 6") | |
| 565 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 7") | |
| 566 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 5") | |
| 567 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 4") | |
| 568 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 3") | |
| 569 | 569 | |
| 570 | 570 | PORT_START("SW.5") |
| 571 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 572 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 573 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 574 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 575 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 576 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left rollover") | |
| 577 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle rollover") | |
| 578 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right rollover") | |
| 571 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 572 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 573 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 574 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 575 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 576 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left rollover") | |
| 577 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle rollover") | |
| 578 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right rollover") | |
| 579 | 579 | |
| 580 | 580 | PORT_START("SW.6") |
| 581 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 582 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 583 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top L popper") | |
| 584 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 585 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 586 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Gun position") | |
| 587 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Gun lockup") | |
| 588 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 581 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 582 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 583 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top L popper") | |
| 584 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 585 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 586 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Gun position") | |
| 587 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Gun lockup") | |
| 588 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 589 | 589 | |
| 590 | 590 | PORT_START("SW.7") |
| 591 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 592 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 593 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 594 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 595 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 596 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 597 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 598 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Test switch") | |
| 591 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 592 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 593 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 594 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 595 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 596 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 597 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 598 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Test switch") | |
| 599 | 599 | |
| 600 | 600 | PORT_START("DOOR") |
| 601 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 602 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 603 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 604 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 605 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 606 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 607 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 608 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 601 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 602 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 603 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 604 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 605 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 606 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 607 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 608 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 609 | 609 | |
| 610 | 610 | PORT_START("DSW") |
| 611 | 611 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 616 | 616 | PORT_DIPSETTING( 0xec, "Spain") |
| 617 | 617 | |
| 618 | 618 | PORT_START("FLIPPERS") |
| 619 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 620 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 621 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 622 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 623 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 624 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 625 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 626 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 619 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 620 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 621 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 622 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 623 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 624 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 625 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 626 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 627 | 627 | INPUT_PORTS_END |
| 628 | 628 | |
| 629 | 629 | const char *const wpc_s_state::lamps_i500[64] = { |
| r31373 | r31374 | |
| 638 | 638 | }; |
| 639 | 639 | |
| 640 | 640 | const char *const wpc_s_state::outputs_i500[54] = { |
| 641 | "s:Auto plunger", "s:Upper popper", "s:Upper eject", "s:Lower eject", "s:Turbo popper", NULL, "s:Knocker", "s:Left jet", | |
| 642 | "s:Right jet", "s:Center jet", "s:Left sling", "s:Right sling", "s:Trough", NULL, "f:Upper popper fls", "f:Top left corner", | |
| 643 | "f:Top right corner", "s:Race track motor", "f:Orange car", "f:Yellow car", "f:Blue car", "f:Green car", "f:Lft jet flasher", "f:Rt jet flasher", | |
| 641 | "s:Auto plunger", "s:Upper popper", "s:Upper eject", "s:Lower eject", "s:Turbo popper", NULL, "s:Knocker", "s:Left jet", | |
| 642 | "s:Right jet", "s:Center jet", "s:Left sling", "s:Right sling", "s:Trough", NULL, "f:Upper popper fls", "f:Top left corner", | |
| 643 | "f:Top right corner", "s:Race track motor", "f:Orange car", "f:Yellow car", "f:Blue car", "f:Green car", "f:Lft jet flasher", "f:Rt jet flasher", | |
| 644 | 644 | "f:Cntr jet flasher", "f:Right side", "f:Left side (2)", "f:Rt ramp enter", "s:R flip power", "s:R flip hold", "s:L flip power", "s:L flip hold", |
| 645 | "s:UR flip power", "s:UR flip hold", "s:Diverter power", "s:Diverter hold", NULL, NULL, NULL, NULL, | |
| 645 | "s:UR flip power", "s:UR flip hold", "s:Diverter power", "s:Diverter hold", NULL, NULL, NULL, NULL, | |
| 646 | 646 | "s:Coin meter", |
| 647 | 647 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 648 | 648 | "g:Upper lft plyfld", "g:Upper rt plyfld", "g:Lower playfield", "g:Backbox", "g:Title-coindoor" |
| r31373 | r31374 | |
| 650 | 650 | |
| 651 | 651 | static INPUT_PORTS_START( i500 ) |
| 652 | 652 | PORT_START("SW.0") |
| 653 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 654 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 655 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 656 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 657 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 658 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left flip lane") | |
| 659 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right flip lane") | |
| 660 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right oulane") | |
| 653 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 654 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 655 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 656 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 657 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 658 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left flip lane") | |
| 659 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right flip lane") | |
| 660 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right oulane") | |
| 661 | 661 | |
| 662 | 662 | PORT_START("SW.1") |
| 663 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 664 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 665 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy-in button") | |
| 666 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 667 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 668 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 669 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 670 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank upper") | |
| 663 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 664 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 665 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy-in button") | |
| 666 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 667 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 668 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 669 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 670 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank upper") | |
| 671 | 671 | |
| 672 | 672 | PORT_START("SW.2") |
| 673 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank center") | |
| 674 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank lower") | |
| 675 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 676 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt flip wrench") | |
| 677 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 678 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 679 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 680 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 673 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank center") | |
| 674 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank lower") | |
| 675 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 676 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt flip wrench") | |
| 677 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 678 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 679 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 680 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 681 | 681 | |
| 682 | 682 | PORT_START("SW.3") |
| 683 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Top trough") | |
| 684 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 685 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 686 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 687 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 688 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lft ramp standup") | |
| 689 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Turbo wrench") | |
| 690 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet bumpr wrench") | |
| 683 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Top trough") | |
| 684 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 685 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 686 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 687 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 688 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lft ramp standup") | |
| 689 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Turbo wrench") | |
| 690 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet bumpr wrench") | |
| 691 | 691 | |
| 692 | 692 | PORT_START("SW.4") |
| 693 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left lane") | |
| 694 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center lane") | |
| 695 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right lane") | |
| 696 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ten point") | |
| 697 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lest ramp wrench") | |
| 698 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left light-up") | |
| 699 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center light-up") | |
| 700 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right light-up") | |
| 693 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left lane") | |
| 694 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center lane") | |
| 695 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right lane") | |
| 696 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ten point") | |
| 697 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lest ramp wrench") | |
| 698 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left light-up") | |
| 699 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center light-up") | |
| 700 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right light-up") | |
| 701 | 701 | |
| 702 | 702 | PORT_START("SW.5") |
| 703 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Upper popper") | |
| 704 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Turbo popper") | |
| 705 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Turbo ball sense") | |
| 706 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper eject") | |
| 707 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower kicker") | |
| 708 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Turbo index") | |
| 709 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 710 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 703 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Upper popper") | |
| 704 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Turbo popper") | |
| 705 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Turbo ball sense") | |
| 706 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper eject") | |
| 707 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower kicker") | |
| 708 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Turbo index") | |
| 709 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 710 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 711 | 711 | |
| 712 | 712 | PORT_START("SW.6") |
| 713 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 714 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 715 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 716 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center jet") | |
| 717 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 718 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 719 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 720 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 713 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 714 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 715 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 716 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center jet") | |
| 717 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 718 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 719 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 720 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 721 | 721 | |
| 722 | 722 | PORT_START("SW.7") |
| 723 | ||
| 723 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 724 | 724 | |
| 725 | 725 | PORT_START("DOOR") |
| 726 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 727 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 728 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 729 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 730 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 731 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 732 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 733 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 726 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 727 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 728 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 729 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 730 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 731 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 732 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 733 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 734 | 734 | |
| 735 | 735 | PORT_START("DSW") |
| 736 | 736 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 741 | 741 | PORT_DIPSETTING( 0xec, "Spain") |
| 742 | 742 | |
| 743 | 743 | PORT_START("FLIPPERS") |
| 744 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 745 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 746 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 747 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 748 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 749 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 750 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 751 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 744 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 745 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 746 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 747 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 748 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 749 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 750 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 751 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 752 | 752 | INPUT_PORTS_END |
| 753 | 753 | |
| 754 | 754 | const char *const wpc_s_state::lamps_jb[64] = { |
| r31373 | r31374 | |
| 763 | 763 | }; |
| 764 | 764 | |
| 765 | 765 | const char *const wpc_s_state::outputs_jb[54] = { |
| 766 | "s:Ball release", NULL, "s:Game saucer", "s:Drop targets", "s:Right eject hole", "s:Raise ramp", "s:Knocker", "s:Left eject hole", | |
| 767 | "s:Left slingshot", "s:Right slingshot", "s:Lower jet bumper", "s:Left jet bumber", "s:Upper jet bumper", "s:Drop ramp", "f:Right visor", "f:Left visor", | |
| 768 | "f:Center visor", "f:Pinbot face", "f:Jet bumpers", "f:Lower left", "f:Mid left", "f:Lower right", "f:Back panel 1 (L)", "f:Back panel 2", | |
| 766 | "s:Ball release", NULL, "s:Game saucer", "s:Drop targets", "s:Right eject hole", "s:Raise ramp", "s:Knocker", "s:Left eject hole", | |
| 767 | "s:Left slingshot", "s:Right slingshot", "s:Lower jet bumper", "s:Left jet bumber", "s:Upper jet bumper", "s:Drop ramp", "f:Right visor", "f:Left visor", | |
| 768 | "f:Center visor", "f:Pinbot face", "f:Jet bumpers", "f:Lower left", "f:Mid left", "f:Lower right", "f:Back panel 1 (L)", "f:Back panel 2", | |
| 769 | 769 | "f:Back panel 3", "f:Back panel 4", "f:Back panel 5 (R)", NULL, "s:R flip power", "s:R flip hold", "s:L flip power", "s:L flip hold", |
| 770 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
| 770 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, | |
| 771 | 771 | "s:Coin meter", |
| 772 | 772 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 773 | 773 | "g:Playfield lower", "g:Playfield left", "g:Playfield upper", "g:Playfield right", "g:Insert" |
| r31373 | r31374 | |
| 775 | 775 | |
| 776 | 776 | static INPUT_PORTS_START( jb ) |
| 777 | 777 | PORT_START("SW.0") |
| 778 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L left 10 point") | |
| 779 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U left 10 point") | |
| 780 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 781 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 782 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp is down") | |
| 783 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("High drop target") | |
| 784 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center drop target") | |
| 785 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Low drop target") | |
| 778 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L left 10 point") | |
| 779 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U left 10 point") | |
| 780 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 781 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 782 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp is down") | |
| 783 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("High drop target") | |
| 784 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center drop target") | |
| 785 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Low drop target") | |
| 786 | 786 | |
| 787 | 787 | PORT_START("SW.1") |
| 788 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 789 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 790 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy extra ball") | |
| 791 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 792 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 793 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L flipper lane") | |
| 794 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R flipper lane") | |
| 795 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 788 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 789 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 790 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy extra ball") | |
| 791 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 792 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 793 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L flipper lane") | |
| 794 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R flipper lane") | |
| 795 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 796 | 796 | |
| 797 | 797 | PORT_START("SW.2") |
| 798 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough jam") | |
| 799 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 800 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 801 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 802 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 803 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp exit") | |
| 804 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp entrance") | |
| 805 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Targ under ramp") | |
| 798 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough jam") | |
| 799 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 800 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 801 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 802 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 803 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp exit") | |
| 804 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp entrance") | |
| 805 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Targ under ramp") | |
| 806 | 806 | |
| 807 | 807 | PORT_START("SW.3") |
| 808 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 1 (left)") | |
| 809 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 2") | |
| 810 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 3") | |
| 811 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 4") | |
| 812 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 5 (right)") | |
| 813 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Game saucer") | |
| 814 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right eject hole") | |
| 815 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left eject hole") | |
| 808 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 1 (left)") | |
| 809 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 2") | |
| 810 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 3") | |
| 811 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 4") | |
| 812 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Visor 5 (right)") | |
| 813 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Game saucer") | |
| 814 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right eject hole") | |
| 815 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left eject hole") | |
| 816 | 816 | |
| 817 | 817 | PORT_START("SW.4") |
| 818 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank 1 (upper)") | |
| 819 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank target 2") | |
| 820 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank target 3") | |
| 821 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank target 4") | |
| 822 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank 5 (lower)") | |
| 823 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vortex upper") | |
| 824 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vortex center") | |
| 825 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vortex lower") | |
| 818 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank 1 (upper)") | |
| 819 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank target 2") | |
| 820 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank target 3") | |
| 821 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank target 4") | |
| 822 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("5-bank 5 (lower)") | |
| 823 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vortex upper") | |
| 824 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vortex center") | |
| 825 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vortex lower") | |
| 826 | 826 | |
| 827 | 827 | PORT_START("SW.5") |
| 828 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper jet bumper") | |
| 829 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet bumper") | |
| 830 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower jet bumper") | |
| 831 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 832 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 833 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right 10 point") | |
| 834 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Hit me target") | |
| 835 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ball shooter") | |
| 828 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper jet bumper") | |
| 829 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet bumper") | |
| 830 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower jet bumper") | |
| 831 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 832 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 833 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right 10 point") | |
| 834 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Hit me target") | |
| 835 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ball shooter") | |
| 836 | 836 | |
| 837 | 837 | PORT_START("SW.6") |
| 838 | ||
| 838 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 839 | 839 | |
| 840 | 840 | PORT_START("SW.7") |
| 841 | ||
| 841 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 842 | 842 | |
| 843 | 843 | PORT_START("DOOR") |
| 844 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 845 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 846 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 847 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 848 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 849 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 850 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 851 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 844 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 845 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 846 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 847 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 848 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 849 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 850 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 851 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 852 | 852 | |
| 853 | 853 | PORT_START("DSW") |
| 854 | 854 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 859 | 859 | PORT_DIPSETTING( 0xec, "Spain") |
| 860 | 860 | |
| 861 | 861 | PORT_START("FLIPPERS") |
| 862 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 863 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 864 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 865 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 866 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Visor is closed") | |
| 867 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 868 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Visor is open") | |
| 869 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 862 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 863 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 864 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 865 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 866 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Visor is closed") | |
| 867 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 868 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Visor is open") | |
| 869 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 870 | 870 | INPUT_PORTS_END |
| 871 | 871 | |
| 872 | 872 | const char *const wpc_s_state::lamps_jm[64] = { |
| r31373 | r31374 | |
| 881 | 881 | }; |
| 882 | 882 | |
| 883 | 883 | const char *const wpc_s_state::outputs_jm[54] = { |
| 884 | "s:Trough eject", "s:Autoplunger", "s:Popper", NULL, "s:Clear matrix", "s:Hand magnet", "s:Knocker", NULL, | |
| 885 | "s:Left sling", "s:Right sling", "s:Left jet", "s:Bottom jet", "s:Right jet", "s:Crazy Bob's", "s:Drop target up", "s:Drop target down", | |
| 886 | "f:Jets", "f:Crazy Bob's", "f:Left sling", "f:Right sling", "s:X mot direction", "s:X motor enable", "s:Y mot direction", "s:Y motor enable", | |
| 884 | "s:Trough eject", "s:Autoplunger", "s:Popper", NULL, "s:Clear matrix", "s:Hand magnet", "s:Knocker", NULL, | |
| 885 | "s:Left sling", "s:Right sling", "s:Left jet", "s:Bottom jet", "s:Right jet", "s:Crazy Bob's", "s:Drop target up", "s:Drop target down", | |
| 886 | "f:Jets", "f:Crazy Bob's", "f:Left sling", "f:Right sling", "s:X mot direction", "s:X motor enable", "s:Y mot direction", "s:Y motor enable", | |
| 887 | 887 | "f:Left ramp", "f:Right ramp", "f:Hand popper", "f:R backpanel", "s:R flip power", "s:R flip hold", "s:L flip power", "s:L flip hold", |
| 888 | "s:L diverter power", "s:L diverter hold", "s:R diverter power", "s:R diverter hold", NULL, NULL, NULL, NULL, | |
| 888 | "s:L diverter power", "s:L diverter hold", "s:R diverter power", "s:R diverter hold", NULL, NULL, NULL, NULL, | |
| 889 | 889 | "s:Coin meter", |
| 890 | 890 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 891 | 891 | "g:String 1", "g:String 2", "g:String 3", "g:String 4", "g:String 5" |
| r31373 | r31374 | |
| 893 | 893 | |
| 894 | 894 | static INPUT_PORTS_START( jm ) |
| 895 | 895 | PORT_START("SW.0") |
| 896 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 897 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("X hand home") | |
| 898 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 899 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 900 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 901 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left flip lane") | |
| 902 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right flip lane") | |
| 903 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 896 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 897 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("X hand home") | |
| 898 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 899 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 900 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 901 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left flip lane") | |
| 902 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right flip lane") | |
| 903 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 904 | 904 | |
| 905 | 905 | PORT_START("SW.1") |
| 906 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 907 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 908 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy in button") | |
| 909 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 910 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 911 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 912 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup") | |
| 913 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup") | |
| 906 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 907 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 908 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy in button") | |
| 909 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 910 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 911 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 912 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup") | |
| 913 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup") | |
| 914 | 914 | |
| 915 | 915 | PORT_START("SW.2") |
| 916 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough jam") | |
| 917 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 918 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 919 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 920 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 921 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Popper ball 1") | |
| 922 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Y hand home") | |
| 923 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R rubber") | |
| 916 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough jam") | |
| 917 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 918 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 919 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 920 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 921 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Popper ball 1") | |
| 922 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Y hand home") | |
| 923 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R rubber") | |
| 924 | 924 | |
| 925 | 925 | PORT_START("SW.3") |
| 926 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 927 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 928 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 929 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 930 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 931 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 932 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Crazy Bob's") | |
| 933 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Spinner") | |
| 926 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 927 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 928 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 929 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 930 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 931 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 932 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Crazy Bob's") | |
| 933 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Spinner") | |
| 934 | 934 | |
| 935 | 935 | PORT_START("SW.4") |
| 936 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 11") | |
| 937 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 21") | |
| 938 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 31") | |
| 939 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 940 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 941 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 942 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 943 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop entry") | |
| 936 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 11") | |
| 937 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 21") | |
| 938 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 31") | |
| 939 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 940 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 941 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 942 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 943 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop entry") | |
| 944 | 944 | |
| 945 | 945 | PORT_START("SW.5") |
| 946 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 12") | |
| 947 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 22") | |
| 948 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 32") | |
| 949 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet lane") | |
| 950 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet lane") | |
| 951 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet lane") | |
| 952 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R hand control") | |
| 953 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L hand control") | |
| 946 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 12") | |
| 947 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 22") | |
| 948 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 32") | |
| 949 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet lane") | |
| 950 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet lane") | |
| 951 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet lane") | |
| 952 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R hand control") | |
| 953 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L hand control") | |
| 954 | 954 | |
| 955 | 955 | PORT_START("SW.6") |
| 956 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 13") | |
| 957 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 23") | |
| 958 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 33") | |
| 959 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("X encoder A") | |
| 960 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("X encoder B") | |
| 961 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Y encoder B") | |
| 962 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Y encoder A") | |
| 963 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 956 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 13") | |
| 957 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 23") | |
| 958 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Cyber matrix 33") | |
| 959 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("X encoder A") | |
| 960 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("X encoder B") | |
| 961 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Y encoder B") | |
| 962 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Y encoder A") | |
| 963 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 964 | 964 | |
| 965 | 965 | PORT_START("SW.7") |
| 966 | ||
| 966 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 967 | 967 | |
| 968 | 968 | PORT_START("DOOR") |
| 969 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 970 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 971 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 972 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 973 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 974 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 975 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 976 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 969 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 970 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 971 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 972 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 973 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 974 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 975 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 976 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 977 | 977 | |
| 978 | 978 | PORT_START("DSW") |
| 979 | 979 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 984 | 984 | PORT_DIPSETTING( 0xec, "Spain") |
| 985 | 985 | |
| 986 | 986 | PORT_START("FLIPPERS") |
| 987 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 988 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 989 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 990 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 991 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Ball in hand") | |
| 992 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 993 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 994 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 987 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 988 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 989 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 990 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 991 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Ball in hand") | |
| 992 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 993 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 994 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 995 | 995 | INPUT_PORTS_END |
| 996 | 996 | |
| 997 | 997 | const char *const wpc_s_state::lamps_nf[64] = { |
| r31373 | r31374 | |
| 1006 | 1006 | }; |
| 1007 | 1007 | |
| 1008 | 1008 | const char *const wpc_s_state::outputs_nf[54] = { |
| 1009 | "s:Right popper", "s:Auto plunger", "s:Right magnet", "s:Kickback", "s:Center magnet", "s:Left magnet", "s:Knocker", "s:Drop target down", | |
| 1010 | NULL, "s:Right slingshot", "s:Left slingshot", "s:Drop target up", NULL, "s:Trough", "s:Eject", "s:Skull mouth", | |
| 1011 | "f:Fls(2) flip rtrn", "f:Fls spinner", "f:Fls no fear", "f:Fls(3) rt ramp", "f:Fls(2) skull", "f:Fls bkbox expl", "f:Fls(3) left ramp", "f:Fls top left", | |
| 1009 | "s:Right popper", "s:Auto plunger", "s:Right magnet", "s:Kickback", "s:Center magnet", "s:Left magnet", "s:Knocker", "s:Drop target down", | |
| 1010 | NULL, "s:Right slingshot", "s:Left slingshot", "s:Drop target up", NULL, "s:Trough", "s:Eject", "s:Skull mouth", | |
| 1011 | "f:Fls(2) flip rtrn", "f:Fls spinner", "f:Fls no fear", "f:Fls(3) rt ramp", "f:Fls(2) skull", "f:Fls bkbox expl", "f:Fls(3) left ramp", "f:Fls top left", | |
| 1012 | 1012 | "f:Fls(2) auto-fire", "f:Fls bkbox L top", "f:Fls bkbox R top", "f:Fls rt popper", "s:R flip power", "s:R flip hold", "s:L flip power", "s:L flip hold", |
| 1013 | "s:UR flip power", "s:UR flip hold", NULL, NULL, NULL, NULL, NULL, NULL, | |
| 1013 | "s:UR flip power", "s:UR flip hold", NULL, NULL, NULL, NULL, NULL, NULL, | |
| 1014 | 1014 | "s:Coin meter", |
| 1015 | 1015 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 1016 | 1016 | "g:Playfield top", "g:Playfield right", "g:Playfield left", "g:Insert title", "g:Insert bkground" |
| r31373 | r31374 | |
| 1018 | 1018 | |
| 1019 | 1019 | static INPUT_PORTS_START( nf ) |
| 1020 | 1020 | PORT_START("SW.0") |
| 1021 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 1022 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1023 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1024 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1025 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1026 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Spinner") | |
| 1027 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1028 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1021 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 1022 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1023 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1024 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1025 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1026 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Spinner") | |
| 1027 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1028 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1029 | 1029 | |
| 1030 | 1030 | PORT_START("SW.1") |
| 1031 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1032 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1033 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy extra ball") | |
| 1034 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1035 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Kickback") | |
| 1036 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1037 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1038 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1031 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1032 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1033 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Buy extra ball") | |
| 1034 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1035 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Kickback") | |
| 1036 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1037 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1038 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1039 | 1039 | |
| 1040 | 1040 | PORT_START("SW.2") |
| 1041 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough stack") | |
| 1042 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 1 (right)") | |
| 1043 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 2") | |
| 1044 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 3") | |
| 1045 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 4") | |
| 1041 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough stack") | |
| 1042 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 1 (right)") | |
| 1043 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 2") | |
| 1044 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 3") | |
| 1045 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough 4") | |
| 1046 | 1046 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_UNUSED) |
| 1047 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center tr entr") | |
| 1048 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left tr entr") | |
| 1047 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center tr entr") | |
| 1048 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left tr entr") | |
| 1049 | 1049 | |
| 1050 | 1050 | PORT_START("SW.3") |
| 1051 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper 1") | |
| 1052 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper 2") | |
| 1051 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper 1") | |
| 1052 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper 2") | |
| 1053 | 1053 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 1054 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1055 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1056 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left magnet") | |
| 1057 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center magnet") | |
| 1058 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right magnet") | |
| 1054 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1055 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1056 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left magnet") | |
| 1057 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center magnet") | |
| 1058 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right magnet") | |
| 1059 | 1059 | |
| 1060 | 1060 | PORT_START("SW.4") |
| 1061 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1062 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1063 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1064 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left wireform") | |
| 1065 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop") | |
| 1066 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Light kb bottom") | |
| 1067 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Light kb top") | |
| 1068 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 1061 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1062 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1063 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1064 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left wireform") | |
| 1065 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop") | |
| 1066 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Light kb bottom") | |
| 1067 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Light kb top") | |
| 1068 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 1069 | 1069 | |
| 1070 | 1070 | PORT_START("SW.5") |
| 1071 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Eject hole") | |
| 1072 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 1073 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 1074 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp middle") | |
| 1075 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1076 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 1077 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp exit") | |
| 1078 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1071 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Eject hole") | |
| 1072 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 1073 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 1074 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp middle") | |
| 1075 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1076 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 1077 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp exit") | |
| 1078 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1079 | 1079 | |
| 1080 | 1080 | PORT_START("SW.6") |
| 1081 | ||
| 1081 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1082 | 1082 | |
| 1083 | 1083 | PORT_START("SW.7") |
| 1084 | ||
| 1084 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1085 | 1085 | |
| 1086 | 1086 | PORT_START("DOOR") |
| 1087 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1088 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1089 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1090 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1091 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1092 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1093 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1094 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1087 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1088 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1089 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1090 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1091 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1092 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1093 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1094 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1095 | 1095 | |
| 1096 | 1096 | PORT_START("DSW") |
| 1097 | 1097 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1102 | 1102 | PORT_DIPSETTING( 0xec, "Spain") |
| 1103 | 1103 | |
| 1104 | 1104 | PORT_START("FLIPPERS") |
| 1105 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1106 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1107 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1108 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1109 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 1110 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1111 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1112 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1105 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1106 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1107 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1108 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1109 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 1110 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1111 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1112 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1113 | 1113 | INPUT_PORTS_END |
| 1114 | 1114 | |
| 1115 | 1115 | const char *const wpc_s_state::lamps_rs[64] = { |
| r31373 | r31374 | |
| 1124 | 1124 | }; |
| 1125 | 1125 | |
| 1126 | 1126 | const char *const wpc_s_state::outputs_rs[54] = { |
| 1127 | "s:Trough", "s:L left diverter", "s:Lock-up pin", "s:U left diverter", "s:U right diverter", "s:Start city", "s:Knocker", "s:Lock kickout", | |
| 1128 | "s:\"Ted\" eyes left", "s:\"Ted\" lids down", "s:\"Ted\" lids up", "s:\"Ted\" eyes right", "s:\"Red\" lids down", "s:\"Red\" eyes left", "s:\"Red\" lids up", "s:\"Red\" eyes right", | |
| 1129 | "s:", "s:", "s:", "s:", "s:Left sling", "s:Right sling", "s:Bulldozer motor", "s:\"Red\" eject", | |
| 1130 | "s:Top jet", "s:Left jet", "s:Right jet", "s:Shaker motor", "s:", "s:", "s:", "s:", | |
| 1131 | "s:", "s:", "s:", "s:", "f:Little flipper", "f:Left ramp", "f:Back white", "f:Back yellow", | |
| 1127 | "s:Trough", "s:L left diverter", "s:Lock-up pin", "s:U left diverter", "s:U right diverter", "s:Start city", "s:Knocker", "s:Lock kickout", | |
| 1128 | "s:\"Ted\" eyes left", "s:\"Ted\" lids down", "s:\"Ted\" lids up", "s:\"Ted\" eyes right", "s:\"Red\" lids down", "s:\"Red\" eyes left", "s:\"Red\" lids up", "s:\"Red\" eyes right", | |
| 1129 | "s:", "s:", "s:", "s:", "s:Left sling", "s:Right sling", "s:Bulldozer motor", "s:\"Red\" eject", | |
| 1130 | "s:Top jet", "s:Left jet", "s:Right jet", "s:Shaker motor", "s:", "s:", "s:", "s:", | |
| 1131 | "s:", "s:", "s:", "s:", "f:Little flipper", "f:Left ramp", "f:Back white", "f:Back yellow", | |
| 1132 | 1132 | "s:Coin meter", |
| 1133 | 1133 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 1134 | 1134 | "g:Playfld/insert 1", "g:Playfld/insert 2", "g:Playfld/insert 3", "g:Right playfield", "g:Left playfield" |
| r31373 | r31374 | |
| 1136 | 1136 | |
| 1137 | 1137 | static INPUT_PORTS_START( rs ) |
| 1138 | 1138 | PORT_START("SW.0") |
| 1139 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1140 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1141 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1142 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1143 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1144 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1145 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1146 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1139 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1140 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1141 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1142 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1143 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1144 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1145 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1146 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1147 | 1147 | |
| 1148 | 1148 | PORT_START("SW.1") |
| 1149 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1150 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1151 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1152 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1153 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1154 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1155 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1156 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1149 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1150 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1151 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1152 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1153 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1154 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1155 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1156 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1157 | 1157 | |
| 1158 | 1158 | PORT_START("SW.2") |
| 1159 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1160 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1161 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1162 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1163 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1164 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1165 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1166 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1159 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1160 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1161 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1162 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1163 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1164 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1165 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1166 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1167 | 1167 | |
| 1168 | 1168 | PORT_START("SW.3") |
| 1169 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1170 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1171 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1172 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1173 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1174 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1175 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1176 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1169 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1170 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1171 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1172 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1173 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1174 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1175 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1176 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1177 | 1177 | |
| 1178 | 1178 | PORT_START("SW.4") |
| 1179 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1180 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1181 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1182 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1183 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1184 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1185 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1186 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1179 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1180 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1181 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1182 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1183 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1184 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1185 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1186 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1187 | 1187 | |
| 1188 | 1188 | PORT_START("SW.5") |
| 1189 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1190 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1191 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1192 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1193 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1194 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1195 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1196 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1189 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1190 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1191 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1192 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1193 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1194 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1195 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1196 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1197 | 1197 | |
| 1198 | 1198 | PORT_START("SW.6") |
| 1199 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1200 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1201 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1202 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1203 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1204 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1205 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1206 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1199 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1200 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1201 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1202 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1203 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1204 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1205 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1206 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1207 | 1207 | |
| 1208 | 1208 | PORT_START("SW.7") |
| 1209 | ||
| 1209 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1210 | 1210 | |
| 1211 | 1211 | PORT_START("DOOR") |
| 1212 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1213 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1214 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1215 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1216 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1217 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1218 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1219 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1212 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1213 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1214 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1215 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1216 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1217 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1218 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1219 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1220 | 1220 | |
| 1221 | 1221 | PORT_START("DSW") |
| 1222 | 1222 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1227 | 1227 | PORT_DIPSETTING( 0xec, "Spain") |
| 1228 | 1228 | |
| 1229 | 1229 | PORT_START("FLIPPERS") |
| 1230 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1231 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1232 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1233 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1234 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1235 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1236 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1237 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1230 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1231 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1232 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1233 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1234 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1235 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1236 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1237 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1238 | 1238 | INPUT_PORTS_END |
| 1239 | 1239 | |
| 1240 | 1240 | const char *const wpc_s_state::lamps_fs[64] = { |
| r31373 | r31374 | |
| 1249 | 1249 | }; |
| 1250 | 1250 | |
| 1251 | 1251 | const char *const wpc_s_state::outputs_fs[54] = { |
| 1252 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1253 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1254 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1255 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1256 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1252 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1253 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1254 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1255 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1256 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1257 | 1257 | "s:Coin meter", |
| 1258 | 1258 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 1259 | 1259 | "g:", "g:", "g:", "g:", "g:" |
| r31373 | r31374 | |
| 1261 | 1261 | |
| 1262 | 1262 | static INPUT_PORTS_START( fs ) |
| 1263 | 1263 | PORT_START("SW.0") |
| 1264 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1265 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1266 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1267 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1268 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1269 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1270 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1271 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1264 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1265 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1266 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1267 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1268 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1269 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1270 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1271 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1272 | 1272 | |
| 1273 | 1273 | PORT_START("SW.1") |
| 1274 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1275 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1276 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1277 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1278 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1279 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1280 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1281 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1274 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1275 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1276 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1277 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1278 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1279 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1280 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1281 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1282 | 1282 | |
| 1283 | 1283 | PORT_START("SW.2") |
| 1284 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1285 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1286 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1287 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1288 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1289 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1290 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1291 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1284 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1285 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1286 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1287 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1288 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1289 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1290 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1291 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1292 | 1292 | |
| 1293 | 1293 | PORT_START("SW.3") |
| 1294 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1295 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1296 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1297 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1298 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1299 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1300 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1301 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1294 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1295 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1296 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1297 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1298 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1299 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1300 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1301 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1302 | 1302 | |
| 1303 | 1303 | PORT_START("SW.4") |
| 1304 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1305 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1306 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1307 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1308 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1309 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1310 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1311 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1304 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1305 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1306 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1307 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1308 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1309 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1310 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1311 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1312 | 1312 | |
| 1313 | 1313 | PORT_START("SW.5") |
| 1314 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1315 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1316 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1317 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1318 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1319 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1320 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1321 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1314 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1315 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1316 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1317 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1318 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1319 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1320 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1321 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1322 | 1322 | |
| 1323 | 1323 | PORT_START("SW.6") |
| 1324 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1325 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1326 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1327 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1328 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1329 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1330 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1331 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1324 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1325 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1326 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1327 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1328 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1329 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1330 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1331 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1332 | 1332 | |
| 1333 | 1333 | PORT_START("SW.7") |
| 1334 | ||
| 1334 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1335 | 1335 | |
| 1336 | 1336 | PORT_START("DOOR") |
| 1337 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1338 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1339 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1340 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1341 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1342 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1343 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1344 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1337 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1338 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1339 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1340 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1341 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1342 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1343 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1344 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1345 | 1345 | |
| 1346 | 1346 | PORT_START("DSW") |
| 1347 | 1347 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1352 | 1352 | PORT_DIPSETTING( 0xec, "Spain") |
| 1353 | 1353 | |
| 1354 | 1354 | PORT_START("FLIPPERS") |
| 1355 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1356 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1357 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1358 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1359 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1360 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1361 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1362 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1355 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1356 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1357 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1358 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1359 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1360 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1361 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1362 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1363 | 1363 | INPUT_PORTS_END |
| 1364 | 1364 | |
| 1365 | 1365 | const char *const wpc_s_state::lamps_ts[64] = { |
| r31373 | r31374 | |
| 1374 | 1374 | }; |
| 1375 | 1375 | |
| 1376 | 1376 | const char *const wpc_s_state::outputs_ts[54] = { |
| 1377 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1378 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1379 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1380 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1381 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1377 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1378 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1379 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1380 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1381 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1382 | 1382 | "s:Coin meter", |
| 1383 | 1383 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 1384 | 1384 | "g:", "g:", "g:", "g:", "g:" |
| r31373 | r31374 | |
| 1386 | 1386 | |
| 1387 | 1387 | static INPUT_PORTS_START( ts ) |
| 1388 | 1388 | PORT_START("SW.0") |
| 1389 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1390 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1391 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1392 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1393 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1394 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1395 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1396 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1389 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1390 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1391 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1392 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1393 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1394 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1395 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1396 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1397 | 1397 | |
| 1398 | 1398 | PORT_START("SW.1") |
| 1399 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1400 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1401 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1402 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1403 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1404 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1405 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1406 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1399 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1400 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1401 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1402 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1403 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1404 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1405 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1406 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1407 | 1407 | |
| 1408 | 1408 | PORT_START("SW.2") |
| 1409 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1410 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1411 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1412 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1413 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1414 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1415 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1416 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1409 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1410 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1411 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1412 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1413 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1414 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1415 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1416 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1417 | 1417 | |
| 1418 | 1418 | PORT_START("SW.3") |
| 1419 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1420 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1421 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1422 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1423 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1424 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1425 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1426 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1419 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1420 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1421 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1422 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1423 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1424 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1425 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1426 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1427 | 1427 | |
| 1428 | 1428 | PORT_START("SW.4") |
| 1429 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1430 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1431 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1432 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1433 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1434 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1435 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1436 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1429 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1430 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1431 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1432 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1433 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1434 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1435 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1436 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1437 | 1437 | |
| 1438 | 1438 | PORT_START("SW.5") |
| 1439 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1440 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1441 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1442 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1443 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1444 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1445 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1446 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1439 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1440 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1441 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1442 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1443 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1444 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1445 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1446 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1447 | 1447 | |
| 1448 | 1448 | PORT_START("SW.6") |
| 1449 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1450 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1451 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1452 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1453 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1454 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1455 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1456 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1449 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1450 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1451 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1452 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1453 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1454 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1455 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1456 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1457 | 1457 | |
| 1458 | 1458 | PORT_START("SW.7") |
| 1459 | ||
| 1459 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1460 | 1460 | |
| 1461 | 1461 | PORT_START("DOOR") |
| 1462 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1463 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1464 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1465 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1466 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1467 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1468 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1469 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1462 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1463 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1464 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1465 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1466 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1467 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1468 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1469 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1470 | 1470 | |
| 1471 | 1471 | PORT_START("DSW") |
| 1472 | 1472 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1477 | 1477 | PORT_DIPSETTING( 0xec, "Spain") |
| 1478 | 1478 | |
| 1479 | 1479 | PORT_START("FLIPPERS") |
| 1480 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1481 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1482 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1483 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1484 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1485 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1486 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1487 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1480 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1481 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1482 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1483 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1484 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1485 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1486 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1487 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1488 | 1488 | INPUT_PORTS_END |
| 1489 | 1489 | |
| 1490 | 1490 | const char *const wpc_s_state::lamps_tom[64] = { |
| r31373 | r31374 | |
| 1499 | 1499 | }; |
| 1500 | 1500 | |
| 1501 | 1501 | const char *const wpc_s_state::outputs_tom[54] = { |
| 1502 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1503 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1504 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1505 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1506 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1502 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1503 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1504 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1505 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1506 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1507 | 1507 | "s:Coin meter", |
| 1508 | 1508 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 1509 | 1509 | "g:", "g:", "g:", "g:", "g:" |
| r31373 | r31374 | |
| 1511 | 1511 | |
| 1512 | 1512 | static INPUT_PORTS_START( tom ) |
| 1513 | 1513 | PORT_START("SW.0") |
| 1514 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1515 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1516 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1517 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1518 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1519 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1520 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1521 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1514 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1515 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1516 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1517 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1518 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1519 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1520 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1521 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1522 | 1522 | |
| 1523 | 1523 | PORT_START("SW.1") |
| 1524 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1525 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1526 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1527 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1528 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1529 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1530 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1531 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1524 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1525 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1526 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1527 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1528 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1529 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1530 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1531 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1532 | 1532 | |
| 1533 | 1533 | PORT_START("SW.2") |
| 1534 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1535 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1536 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1537 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1538 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1539 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1540 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1541 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1534 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1535 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1536 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1537 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1538 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1539 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1540 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1541 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1542 | 1542 | |
| 1543 | 1543 | PORT_START("SW.3") |
| 1544 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1545 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1546 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1547 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1548 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1549 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1550 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1551 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1544 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1545 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1546 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1547 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1548 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1549 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1550 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1551 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1552 | 1552 | |
| 1553 | 1553 | PORT_START("SW.4") |
| 1554 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1555 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1556 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1557 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1558 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1559 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1560 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1561 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1554 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1555 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1556 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1557 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1558 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1559 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1560 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1561 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1562 | 1562 | |
| 1563 | 1563 | PORT_START("SW.5") |
| 1564 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1565 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1566 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1567 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1568 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1569 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1570 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1571 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1564 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1565 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1566 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1567 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1568 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1569 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1570 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1571 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1572 | 1572 | |
| 1573 | 1573 | PORT_START("SW.6") |
| 1574 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1575 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1576 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1577 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1578 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1579 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1580 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1581 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1574 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1575 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1576 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1577 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1578 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1579 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1580 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1581 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1582 | 1582 | |
| 1583 | 1583 | PORT_START("SW.7") |
| 1584 | ||
| 1584 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1585 | 1585 | |
| 1586 | 1586 | PORT_START("DOOR") |
| 1587 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1588 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1589 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1590 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1591 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1592 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1593 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1594 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1587 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1588 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1589 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1590 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1591 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1592 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1593 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1594 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1595 | 1595 | |
| 1596 | 1596 | PORT_START("DSW") |
| 1597 | 1597 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1602 | 1602 | PORT_DIPSETTING( 0xec, "Spain") |
| 1603 | 1603 | |
| 1604 | 1604 | PORT_START("FLIPPERS") |
| 1605 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1606 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1607 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1608 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1609 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1610 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1611 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1612 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1605 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1606 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1607 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1608 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1609 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1610 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1611 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1612 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1613 | 1613 | INPUT_PORTS_END |
| 1614 | 1614 | |
| 1615 | 1615 | const char *const wpc_s_state::lamps_wd[64] = { |
| r31373 | r31374 | |
| 1624 | 1624 | }; |
| 1625 | 1625 | |
| 1626 | 1626 | const char *const wpc_s_state::outputs_wd[54] = { |
| 1627 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1628 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1629 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1630 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1631 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1627 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1628 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1629 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1630 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1631 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1632 | 1632 | "s:Coin meter", |
| 1633 | 1633 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 1634 | 1634 | "g:", "g:", "g:", "g:", "g:" |
| r31373 | r31374 | |
| 1636 | 1636 | |
| 1637 | 1637 | static INPUT_PORTS_START( wd ) |
| 1638 | 1638 | PORT_START("SW.0") |
| 1639 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1640 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1641 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1642 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1643 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1644 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1645 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1646 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1639 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1640 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1641 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1642 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1643 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1644 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1645 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1646 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1647 | 1647 | |
| 1648 | 1648 | PORT_START("SW.1") |
| 1649 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1650 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1651 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1652 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1653 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1654 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1655 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1656 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1649 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1650 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1651 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1652 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1653 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1654 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1655 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1656 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1657 | 1657 | |
| 1658 | 1658 | PORT_START("SW.2") |
| 1659 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1660 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1661 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1662 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1663 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1664 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1665 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1666 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1659 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1660 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1661 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1662 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1663 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1664 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1665 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1666 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1667 | 1667 | |
| 1668 | 1668 | PORT_START("SW.3") |
| 1669 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1670 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1671 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1672 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1673 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1674 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1675 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1676 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1669 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1670 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1671 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1672 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1673 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1674 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1675 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1676 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1677 | 1677 | |
| 1678 | 1678 | PORT_START("SW.4") |
| 1679 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1680 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1681 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1682 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1683 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1684 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1685 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1686 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1679 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1680 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1681 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1682 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1683 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1684 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1685 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1686 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1687 | 1687 | |
| 1688 | 1688 | PORT_START("SW.5") |
| 1689 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1690 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1691 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1692 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1693 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1694 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1695 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1696 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1689 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1690 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1691 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1692 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1693 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1694 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1695 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1696 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1697 | 1697 | |
| 1698 | 1698 | PORT_START("SW.6") |
| 1699 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1700 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1701 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1702 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1703 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1704 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1705 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1706 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1699 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1700 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1701 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1702 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1703 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1704 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1705 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1706 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1707 | 1707 | |
| 1708 | 1708 | PORT_START("SW.7") |
| 1709 | ||
| 1709 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1710 | 1710 | |
| 1711 | 1711 | PORT_START("DOOR") |
| 1712 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1713 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1714 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1715 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1716 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1717 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1718 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1719 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1712 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1713 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1714 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1715 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1716 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1717 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1718 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1719 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1720 | 1720 | |
| 1721 | 1721 | PORT_START("DSW") |
| 1722 | 1722 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1727 | 1727 | PORT_DIPSETTING( 0xec, "Spain") |
| 1728 | 1728 | |
| 1729 | 1729 | PORT_START("FLIPPERS") |
| 1730 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1731 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1732 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1733 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1734 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1735 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1736 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1737 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1730 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1731 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1732 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1733 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1734 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1735 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1736 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1737 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1738 | 1738 | INPUT_PORTS_END |
| 1739 | 1739 | |
| 1740 | 1740 | const char *const wpc_s_state::lamps_wcs[64] = { |
| r31373 | r31374 | |
| 1749 | 1749 | }; |
| 1750 | 1750 | |
| 1751 | 1751 | const char *const wpc_s_state::outputs_wcs[54] = { |
| 1752 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1753 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1754 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1755 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1756 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1752 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1753 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1754 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1755 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1756 | "s:", "s:", "s:", "s:", "s:", "s:", "s:", "s:", | |
| 1757 | 1757 | "s:Coin meter", |
| 1758 | 1758 | NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, |
| 1759 | 1759 | "g:", "g:", "g:", "g:", "g:" |
| r31373 | r31374 | |
| 1761 | 1761 | |
| 1762 | 1762 | static INPUT_PORTS_START( wcs ) |
| 1763 | 1763 | PORT_START("SW.0") |
| 1764 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1765 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1766 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1767 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1768 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1769 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1770 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1771 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1764 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1765 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1766 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1767 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1768 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1769 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1770 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1771 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1772 | 1772 | |
| 1773 | 1773 | PORT_START("SW.1") |
| 1774 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1775 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1776 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1777 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1778 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1779 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1780 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1781 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1774 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1775 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1776 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1777 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1778 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1779 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1780 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1781 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1782 | 1782 | |
| 1783 | 1783 | PORT_START("SW.2") |
| 1784 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1785 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1786 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1787 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1788 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1789 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1790 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1791 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1784 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1785 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1786 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1787 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1788 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1789 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1790 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1791 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1792 | 1792 | |
| 1793 | 1793 | PORT_START("SW.3") |
| 1794 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1795 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1796 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1797 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1798 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1799 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1800 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1801 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1794 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1795 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1796 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1797 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1798 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1799 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1800 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1801 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1802 | 1802 | |
| 1803 | 1803 | PORT_START("SW.4") |
| 1804 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1805 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1806 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1807 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1808 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1809 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1810 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1811 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1804 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1805 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1806 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1807 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1808 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1809 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1810 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1811 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1812 | 1812 | |
| 1813 | 1813 | PORT_START("SW.5") |
| 1814 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1815 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1816 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1817 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1818 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1819 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1820 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1821 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1814 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1815 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1816 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1817 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1818 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1819 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1820 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1821 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1822 | 1822 | |
| 1823 | 1823 | PORT_START("SW.6") |
| 1824 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1825 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1826 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1827 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1828 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1829 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1830 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1831 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1824 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1825 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1826 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1827 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1828 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1829 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1830 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1831 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1832 | 1832 | |
| 1833 | 1833 | PORT_START("SW.7") |
| 1834 | ||
| 1834 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1835 | 1835 | |
| 1836 | 1836 | PORT_START("DOOR") |
| 1837 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1838 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1839 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1840 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1841 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1842 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1843 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1844 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1837 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1838 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1839 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1840 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1841 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1842 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1843 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1844 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1845 | 1845 | |
| 1846 | 1846 | PORT_START("DSW") |
| 1847 | 1847 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1852 | 1852 | PORT_DIPSETTING( 0xec, "Spain") |
| 1853 | 1853 | |
| 1854 | 1854 | PORT_START("FLIPPERS") |
| 1855 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1856 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1857 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1858 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1859 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1860 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1861 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1862 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1855 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1856 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1857 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1858 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1859 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1860 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1861 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1862 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1863 | 1863 | INPUT_PORTS_END |
| 1864 | 1864 | |
| 1865 | 1865 | static INPUT_PORTS_START( tfs ) |
| 1866 | 1866 | PORT_START("SW.0") |
| 1867 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1868 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1869 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1870 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1871 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1872 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1873 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1874 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1867 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1868 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1869 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1870 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1871 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1872 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1873 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1874 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1875 | 1875 | |
| 1876 | 1876 | PORT_START("SW.1") |
| 1877 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1878 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1879 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1880 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1881 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1882 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1883 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1884 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1877 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1878 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1879 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1880 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1881 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1882 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1883 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1884 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1885 | 1885 | |
| 1886 | 1886 | PORT_START("SW.2") |
| 1887 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1888 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1889 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1890 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1891 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1892 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1893 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1894 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1887 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1888 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1889 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1890 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1891 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1892 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1893 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1894 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1895 | 1895 | |
| 1896 | 1896 | PORT_START("SW.3") |
| 1897 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1898 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1899 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1900 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1901 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1902 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1903 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1904 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1897 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 1898 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 1899 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 1900 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 1901 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 1902 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 1903 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 1904 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1905 | 1905 | |
| 1906 | 1906 | PORT_START("SW.4") |
| 1907 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1908 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1909 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1910 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1911 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1912 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1913 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1914 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1907 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1908 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1909 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1910 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1911 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1912 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 1913 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 1914 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 1915 | 1915 | |
| 1916 | 1916 | PORT_START("SW.5") |
| 1917 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1918 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1919 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1920 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1921 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1922 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1923 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1924 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1917 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1918 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1919 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1920 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1921 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1922 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 1923 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 1924 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1925 | 1925 | |
| 1926 | 1926 | PORT_START("SW.6") |
| 1927 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1928 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1929 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1930 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1931 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1932 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1933 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1934 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1927 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1928 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1929 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1930 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1931 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 1932 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 1933 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 1934 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 1935 | 1935 | |
| 1936 | 1936 | PORT_START("SW.7") |
| 1937 | ||
| 1937 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1938 | 1938 | |
| 1939 | 1939 | PORT_START("DOOR") |
| 1940 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1941 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1942 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1943 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1944 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1945 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1946 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1947 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1940 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1941 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1942 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1943 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1944 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1945 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1946 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1947 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1948 | 1948 | |
| 1949 | 1949 | PORT_START("DSW") |
| 1950 | 1950 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1955 | 1955 | PORT_DIPSETTING( 0xec, "Spain") |
| 1956 | 1956 | |
| 1957 | 1957 | PORT_START("FLIPPERS") |
| 1958 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1959 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1960 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1961 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1962 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1963 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1964 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1965 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1958 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1959 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1960 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1961 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1962 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1963 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1964 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1965 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1966 | 1966 | INPUT_PORTS_END |
| 1967 | 1967 | |
| 1968 | 1968 | static MACHINE_CONFIG_START( wpc_s, wpc_s_state ) |
| r31373 | r31374 | |
| 2400 | 2400 | /*----------------- |
| 2401 | 2401 | / The Shadow |
| 2402 | 2402 | /------------------*/ |
| 2403 | ROM_START(ts_lh6) | |
| 2403 | ROM_START(ts_lh6) | |
| 2404 | 2404 | ROM_REGION(0x80000, "maincpu", 0) |
| 2405 | 2405 | ROM_LOAD("shad_h6.rom", 0x00000, 0x080000, CRC(0a72268d) SHA1(97836afc23c4160bca462f14c115b17e58fe5a48)) |
| 2406 | 2406 | ROM_REGION16_LE(0x1000000, "dcs", ROMREGION_ERASEFF) |
| r31373 | r31374 | |
|---|---|---|
| 1104 | 1104 | |
| 1105 | 1105 | /* sound hardware */ |
| 1106 | 1106 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) |
| 1107 | ||
| 1107 | ||
| 1108 | 1108 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| 1109 | MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_STANDARD) | |
| 1110 | MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(94) | |
| 1109 | MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_STANDARD) | |
| 1110 | MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(94) | |
| 1111 | 1111 | MACHINE_CONFIG_END |
| 1112 | 1112 | |
| 1113 | 1113 | static MACHINE_CONFIG_DERIVED( mk4, midzeus ) |
| r31373 | r31374 | |
| 1129 | 1129 | static MACHINE_CONFIG_DERIVED( invasn, midzeus ) |
| 1130 | 1130 | MCFG_CPU_ADD("pic", PIC16C57, 8000000) /* ? */ |
| 1131 | 1131 | MCFG_CPU_IO_MAP(pic_io_map) |
| 1132 | ||
| 1132 | ||
| 1133 | 1133 | MCFG_DEVICE_MODIFY("ioasic") |
| 1134 | 1134 | MCFG_MIDWAY_IOASIC_UPPER(468/* or 488 */) |
| 1135 | 1135 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
| 1157 | 1157 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) |
| 1158 | 1158 | |
| 1159 | 1159 | MCFG_M48T35_ADD( "m48t35" ) |
| 1160 | ||
| 1160 | ||
| 1161 | 1161 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| 1162 | 1162 | MCFG_MIDWAY_IOASIC_SHUFFLE(MIDWAY_IOASIC_STANDARD) |
| 1163 | 1163 | MCFG_MIDWAY_SERIAL_PIC2_YEAR_OFFS(99) |
| r31373 | r31374 | |
| 1527 | 1527 | * |
| 1528 | 1528 | *************************************/ |
| 1529 | 1529 | |
| 1530 | GAME( 1997, mk4, 0, mk4, mk4, midzeus_state, mk4, ROT0, "Midway", "Mortal Kombat 4 (version 3.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 1531 | GAME( 1997, mk4a, mk4, mk4, mk4, midzeus_state, mk4, ROT0, "Midway", "Mortal Kombat 4 (version 2.1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 1532 | GAME( 1997, mk4b, mk4, mk4, mk4, midzeus_state, mk4, ROT0, "Midway", "Mortal Kombat 4 (version 1.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 1530 | GAME( 1997, mk4, 0, mk4, mk4, midzeus_state, mk4, ROT0, "Midway", "Mortal Kombat 4 (version 3.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 1531 | GAME( 1997, mk4a, mk4, mk4, mk4, midzeus_state, mk4, ROT0, "Midway", "Mortal Kombat 4 (version 2.1)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 1532 | GAME( 1997, mk4b, mk4, mk4, mk4, midzeus_state, mk4, ROT0, "Midway", "Mortal Kombat 4 (version 1.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) | |
| 1533 | 1533 | GAME( 1999, invasnab, 0, invasn, invasn, midzeus_state, invasn, ROT0, "Midway", "Invasion - The Abductors (version 5.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 1534 | 1534 | GAME( 1999, invasnab4,invasnab, invasn, invasn, midzeus_state, invasn, ROT0, "Midway", "Invasion - The Abductors (version 4.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| 1535 | 1535 | GAME( 1999, invasnab3,invasnab, invasn, invasn, midzeus_state, invasn, ROT0, "Midway", "Invasion - The Abductors (version 3.0)", GAME_IMPERFECT_GRAPHICS | GAME_SUPPORTS_SAVE ) |
| r31373 | r31374 | |
|---|---|---|
| 1228 | 1228 | |
| 1229 | 1229 | //MCFG_DEVICE_ADD("ppi8255_2", I8255, 0) |
| 1230 | 1230 | /* (c0-c3) Group A Mode 2 (5-lines handshacked bidirectional port) |
| 1231 | Group B Mode 0, output; (see below for lines PC0-PC2) */ | |
| 1232 | //MCFG_I8255_IN_PORTA_CB(READ8(norautp_state, vram_data_r)) // VRAM data read | |
| 1233 | //MCFG_I8255_OUT_PORTA_CB(WRITE8(norautp_state, vram_data_w)) // VRAM data write | |
| 1234 | //MCFG_I8255_OUT_PORTB_CB(WRITE8(norautp_state, vram_addr_w)) // VRAM address write | |
| 1231 | Group B Mode 0, output; (see below for lines PC0-PC2) */ | |
| 1232 | //MCFG_I8255_IN_PORTA_CB(READ8(norautp_state, vram_data_r)) // VRAM data read | |
| 1233 | //MCFG_I8255_OUT_PORTA_CB(WRITE8(norautp_state, vram_data_w)) // VRAM data write | |
| 1234 | //MCFG_I8255_OUT_PORTB_CB(WRITE8(norautp_state, vram_addr_w)) // VRAM address write | |
| 1235 | 1235 | //MCFG_I8255_IN_PORTC_CB(READ8(norautp_state, ppi2_portc_r)) |
| 1236 | 1236 | //MCFG_I8255_OUT_PORTC_CB(WRITE8(norautp_state, ppi2_portc_w)) |
| 1237 | 1237 | /* PPI-2 is configured as mixed mode2 and mode0 output. |
| 1238 | It means that port A should be bidirectional and port B just as output. | |
| 1239 | Port C as hshk regs, and P0-P2 as input (norautp, norautjp) or output (other sets). */ | |
| 1238 | It means that port A should be bidirectional and port B just as output. | |
| 1239 | Port C as hshk regs, and P0-P2 as input (norautp, norautjp) or output (other sets). */ | |
| 1240 | 1240 | |
| 1241 | 1241 | /* video hardware */ |
| 1242 | 1242 | MCFG_SCREEN_ADD("screen", RASTER) |
| r31373 | r31374 | |
| 3438 | 3438 | |
| 3439 | 3439 | /* |
| 3440 | 3440 | ROM_START( pkii_dm ) |
| 3441 | ROM_REGION( 0x10000, "maincpu", 0 ) // no stack, call's RET go to PC=0 | |
| 3442 | ROM_LOAD( "12.u12", 0x0000, 0x1000, CRC(048e70d8) SHA1(f0eb16ba68455638de2ce68f51f305a13d0df287) ) | |
| 3443 | ROM_LOAD( "13.u18", 0x1000, 0x1000, CRC(06cf6789) SHA1(587d883c399348b518e3be4d1dc2581824055328) ) | |
| 3441 | ROM_REGION( 0x10000, "maincpu", 0 ) // no stack, call's RET go to PC=0 | |
| 3442 | ROM_LOAD( "12.u12", 0x0000, 0x1000, CRC(048e70d8) SHA1(f0eb16ba68455638de2ce68f51f305a13d0df287) ) | |
| 3443 | ROM_LOAD( "13.u18", 0x1000, 0x1000, CRC(06cf6789) SHA1(587d883c399348b518e3be4d1dc2581824055328) ) | |
| 3444 | 3444 | |
| 3445 | ROM_REGION( 0x1000, "gfx", 0 ) | |
| 3446 | ROM_FILL( 0x0000, 0x0800, 0xff ) | |
| 3447 | ROM_LOAD( "cgw-f506.u31", 0x0800, 0x0800, CRC(412fc492) SHA1(094ea0ffd0c22274cfe164f07c009ffe022331fd) ) | |
| 3445 | ROM_REGION( 0x1000, "gfx", 0 ) | |
| 3446 | ROM_FILL( 0x0000, 0x0800, 0xff ) | |
| 3447 | ROM_LOAD( "cgw-f506.u31", 0x0800, 0x0800, CRC(412fc492) SHA1(094ea0ffd0c22274cfe164f07c009ffe022331fd) ) | |
| 3448 | 3448 | |
| 3449 | ROM_REGION( 0x0200, "proms", 0 ) | |
| 3450 | ROM_LOAD( "63s141n.u51", 0x0000, 0x0100, CRC(88302127) SHA1(aed1273974917673405f1234ab64e6f8b3856c34) ) | |
| 3449 | ROM_REGION( 0x0200, "proms", 0 ) | |
| 3450 | ROM_LOAD( "63s141n.u51", 0x0000, 0x0100, CRC(88302127) SHA1(aed1273974917673405f1234ab64e6f8b3856c34) ) | |
| 3451 | 3451 | ROM_END |
| 3452 | 3452 | */ |
| 3453 | 3453 |
| r31373 | r31374 | |
|---|---|---|
| 380 | 380 | ROM_LOAD32_BYTE( "861a09.b", 0x040002, 0x10000, CRC(4917158d) SHA1(b53da3f29c9aeb59933dc3a8214cc1314e21000b) ) |
| 381 | 381 | ROM_LOAD32_BYTE( "861a09.d", 0x040003, 0x10000, CRC(2bb3282c) SHA1(6ca54948a02c91543b7e595641b0edc2564f83ff) ) |
| 382 | 382 | |
| 383 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 383 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 384 | 384 | ROM_LOAD32_BYTE( "861a05.a", 0x000000, 0x10000, CRC(cedc19d0) SHA1(6eb2a292d574dee06e214e61c0e08fa233ac68e8) ) |
| 385 | 385 | ROM_LOAD32_BYTE( "861a05.e", 0x000001, 0x10000, CRC(725af3fc) SHA1(98ac364db4b2c5682a299f4d2a288ebc8a303b1f) ) |
| 386 | 386 | ROM_LOAD32_BYTE( "861a06.a", 0x000002, 0x10000, CRC(85e2e30e) SHA1(11010727db8c71650c5b9df5340f9bc412435d11) ) |
| r31373 | r31374 | |
| 398 | 398 | ROM_LOAD32_BYTE( "861a06.d", 0x0c0002, 0x10000, CRC(bc70ab39) SHA1(a6fa0502ceb6862e7b1e4815326e268fd6511881) ) |
| 399 | 399 | ROM_LOAD32_BYTE( "861a06.h", 0x0c0003, 0x10000, CRC(d906b79b) SHA1(905814ce708d80fd4d1a398f60faa0bc680fccaf) ) |
| 400 | 400 | |
| 401 | ROM_REGION( 0x040000, "k051316", 0 ) | |
| 401 | ROM_REGION( 0x040000, "k051316", 0 ) /* zoom/rotate */ | |
| 402 | 402 | ROM_LOAD( "861a04.a", 0x000000, 0x10000, CRC(092a8b15) SHA1(d98a81bfa4bba73805f0236f8a80da130fcb378d) ) |
| 403 | 403 | ROM_LOAD( "861a04.b", 0x010000, 0x10000, CRC(75744b56) SHA1(5133d8f6622796ed6b9e6a0d0f1df28f00331fc7) ) |
| 404 | 404 | ROM_LOAD( "861a04.c", 0x020000, 0x10000, CRC(a00021c5) SHA1(f73f88af33387d73b4262e8652507e699926fabe) ) |
| r31373 | r31374 | |
| 434 | 434 | ROM_LOAD32_BYTE( "861a09.b", 0x040002, 0x10000, CRC(4917158d) SHA1(b53da3f29c9aeb59933dc3a8214cc1314e21000b) ) |
| 435 | 435 | ROM_LOAD32_BYTE( "861a09.d", 0x040003, 0x10000, CRC(2bb3282c) SHA1(6ca54948a02c91543b7e595641b0edc2564f83ff) ) |
| 436 | 436 | |
| 437 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 437 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 438 | 438 | ROM_LOAD32_BYTE( "861a05.a", 0x000000, 0x10000, CRC(cedc19d0) SHA1(6eb2a292d574dee06e214e61c0e08fa233ac68e8) ) |
| 439 | 439 | ROM_LOAD32_BYTE( "861a05.e", 0x000001, 0x10000, CRC(725af3fc) SHA1(98ac364db4b2c5682a299f4d2a288ebc8a303b1f) ) |
| 440 | 440 | ROM_LOAD32_BYTE( "861a06.a", 0x000002, 0x10000, CRC(85e2e30e) SHA1(11010727db8c71650c5b9df5340f9bc412435d11) ) |
| r31373 | r31374 | |
| 452 | 452 | ROM_LOAD32_BYTE( "861a06.d", 0x0c0002, 0x10000, CRC(bc70ab39) SHA1(a6fa0502ceb6862e7b1e4815326e268fd6511881) ) |
| 453 | 453 | ROM_LOAD32_BYTE( "861a06.h", 0x0c0003, 0x10000, CRC(d906b79b) SHA1(905814ce708d80fd4d1a398f60faa0bc680fccaf) ) |
| 454 | 454 | |
| 455 | ROM_REGION( 0x040000, "k051316", 0 ) | |
| 455 | ROM_REGION( 0x040000, "k051316", 0 ) /* zoom/rotate */ | |
| 456 | 456 | ROM_LOAD( "861a04.a", 0x000000, 0x10000, CRC(092a8b15) SHA1(d98a81bfa4bba73805f0236f8a80da130fcb378d) ) |
| 457 | 457 | ROM_LOAD( "861a04.b", 0x010000, 0x10000, CRC(75744b56) SHA1(5133d8f6622796ed6b9e6a0d0f1df28f00331fc7) ) |
| 458 | 458 | ROM_LOAD( "861a04.c", 0x020000, 0x10000, CRC(a00021c5) SHA1(f73f88af33387d73b4262e8652507e699926fabe) ) |
| r31373 | r31374 | |
| 488 | 488 | ROM_LOAD32_BYTE( "861a09.b", 0x040002, 0x10000, CRC(4917158d) SHA1(b53da3f29c9aeb59933dc3a8214cc1314e21000b) ) |
| 489 | 489 | ROM_LOAD32_BYTE( "861a09.d", 0x040003, 0x10000, CRC(2bb3282c) SHA1(6ca54948a02c91543b7e595641b0edc2564f83ff) ) |
| 490 | 490 | |
| 491 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 491 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 492 | 492 | ROM_LOAD32_BYTE( "861a05.a", 0x000000, 0x10000, CRC(cedc19d0) SHA1(6eb2a292d574dee06e214e61c0e08fa233ac68e8) ) |
| 493 | 493 | ROM_LOAD32_BYTE( "861a05.e", 0x000001, 0x10000, CRC(725af3fc) SHA1(98ac364db4b2c5682a299f4d2a288ebc8a303b1f) ) |
| 494 | 494 | ROM_LOAD32_BYTE( "861a06.a", 0x000002, 0x10000, CRC(85e2e30e) SHA1(11010727db8c71650c5b9df5340f9bc412435d11) ) |
| r31373 | r31374 | |
| 506 | 506 | ROM_LOAD32_BYTE( "861a06.d", 0x0c0002, 0x10000, CRC(bc70ab39) SHA1(a6fa0502ceb6862e7b1e4815326e268fd6511881) ) |
| 507 | 507 | ROM_LOAD32_BYTE( "861a06.h", 0x0c0003, 0x10000, CRC(d906b79b) SHA1(905814ce708d80fd4d1a398f60faa0bc680fccaf) ) |
| 508 | 508 | |
| 509 | ROM_REGION( 0x040000, "k051316", 0 ) | |
| 509 | ROM_REGION( 0x040000, "k051316", 0 ) /* zoom/rotate */ | |
| 510 | 510 | ROM_LOAD( "861a04.a", 0x000000, 0x10000, CRC(092a8b15) SHA1(d98a81bfa4bba73805f0236f8a80da130fcb378d) ) |
| 511 | 511 | ROM_LOAD( "861a04.b", 0x010000, 0x10000, CRC(75744b56) SHA1(5133d8f6622796ed6b9e6a0d0f1df28f00331fc7) ) |
| 512 | 512 | ROM_LOAD( "861a04.c", 0x020000, 0x10000, CRC(a00021c5) SHA1(f73f88af33387d73b4262e8652507e699926fabe) ) |
| r31373 | r31374 | |
|---|---|---|
| 805 | 805 | if (ACCESSING_BITS_0_7) |
| 806 | 806 | { |
| 807 | 807 | if (m_memcard->present() != -1) |
| 808 | | |
| 808 | m_memcard->write(space, offset, data); | |
| 809 | 809 | } |
| 810 | 810 | } |
| 811 | 811 | |
| r31373 | r31374 | |
| 851 | 851 | void neogeo_state::neogeo_main_cpu_banking_init() |
| 852 | 852 | { |
| 853 | 853 | /* create vector banks */ |
| 854 | // m_bank_vectors->configure_entry(1, m_region_maincpu->base()); | |
| 855 | // m_bank_vectors->configure_entry(0, memregion("mainbios")->base()); | |
| 856 | // m_bank_vectors->set_entry(0); | |
| 854 | // m_bank_vectors->configure_entry(1, m_region_maincpu->base()); | |
| 855 | // m_bank_vectors->configure_entry(0, memregion("mainbios")->base()); | |
| 856 | // m_bank_vectors->set_entry(0); | |
| 857 | 857 | m_use_cart_vectors = 0; |
| 858 | 858 | |
| 859 | 859 | if (m_type != NEOGEO_CD) |
| r31373 | r31374 | |
| 894 | 894 | m_bank_audio_main->configure_entry(0, memregion("audiobios")->base()); |
| 895 | 895 | else /* on hardware with no SM1 ROM, the cart ROM is always enabled */ |
| 896 | 896 | m_bank_audio_main->configure_entry(0, memregion("audiocpu")->base()); |
| 897 | ||
| 897 | ||
| 898 | 898 | m_bank_audio_main->set_entry(m_use_cart_audio); |
| 899 | 899 | |
| 900 | 900 | /* audio banking */ |
| r31373 | r31374 | |
| 904 | 904 | m_bank_audio_cart[3] = membank("audio_8000"); |
| 905 | 905 | |
| 906 | 906 | address_mask = (memregion("audiocpu")->bytes() - 0x10000 - 1) & 0x3ffff; |
| 907 | ||
| 908 | 907 | |
| 908 | ||
| 909 | 909 | for (region = 0; region < 4; region++) |
| 910 | 910 | { |
| 911 | 911 | for (bank = 0xff; bank >= 0; bank--) |
| r31373 | r31374 | |
| 1117 | 1117 | m_cartslots[3] = m_cartslot4; |
| 1118 | 1118 | m_cartslots[4] = m_cartslot5; |
| 1119 | 1119 | m_cartslots[5] = m_cartslot6; |
| 1120 | ||
| 1121 | 1120 | |
| 1121 | ||
| 1122 | 1122 | m_sprgen->set_screen(m_screen); |
| 1123 | 1123 | m_sprgen->set_sprite_region(m_region_sprites->base(), m_region_sprites->bytes()); |
| 1124 | 1124 | m_sprgen->set_fixed_regions(m_region_fixed->base(), m_region_fixed->bytes(), m_region_fixedbios); |
| 1125 | ||
| 1125 | ||
| 1126 | 1126 | } |
| 1127 | 1127 | |
| 1128 | 1128 | |
| r31373 | r31374 | |
| 1138 | 1138 | if (slot != m_currentslot) |
| 1139 | 1139 | { |
| 1140 | 1140 | m_currentslot = slot; |
| 1141 | ||
| 1141 | ||
| 1142 | 1142 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 1143 | 1143 | |
| 1144 | 1144 | // unmap old handlers, some carts will have installed overlays on them, we need them to be cleared |
| r31373 | r31374 | |
| 1163 | 1163 | ym->reset(); |
| 1164 | 1164 | |
| 1165 | 1165 | m_cartslots[m_currentslot]->setup_memory_banks(machine()); // setup basic pointers |
| 1166 | ||
| 1166 | ||
| 1167 | 1167 | ym->reset(); // reset it again to get the new pointers |
| 1168 | 1168 | |
| 1169 | 1169 | // these could have changed, ensure the pointers are valid |
| r31373 | r31374 | |
| 1175 | 1175 | |
| 1176 | 1176 | m_cartslots[m_currentslot]->activate_cart(machine(), m_maincpu, m_region_maincpu->base(), m_region_maincpu->bytes(), m_cartslots[m_currentslot]->get_fixed_base(), m_cartslots[m_currentslot]->get_fixed_size()); |
| 1177 | 1177 | //memcpy((UINT8*)m_cartslots[m_currentslot]->get_rom_base(),m_region_maincpu->base(), m_region_maincpu->bytes()); // hack- copy back any mods activate made (eh cthd2003)c |
| 1178 | ||
| 1178 | ||
| 1179 | 1179 | neogeo_audio_cpu_banking_init(0); // should probably be responsibility of the cart |
| 1180 | 1180 | m_audiocpu->reset(); // or some games like svc have no sounnd if in higher slots? |
| 1181 | 1181 | |
| r31373 | r31374 | |
| 1283 | 1283 | AM_RANGE(0x000000, 0x00007f) AM_READ(neogeo_slot_rom_low_bectors_r) |
| 1284 | 1284 | AM_RANGE(0x000080, 0x0fffff) AM_READ(neogeo_slot_rom_low_r) |
| 1285 | 1285 | AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK("cartridge") |
| 1286 | // | |
| 1286 | // AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) | |
| 1287 | 1287 | AM_IMPORT_FROM( neogeo_main_map ) |
| 1288 | 1288 | ADDRESS_MAP_END |
| 1289 | 1289 | |
| r31373 | r31374 | |
| 1401 | 1401 | |
| 1402 | 1402 | static INPUT_PORTS_START( neogeo_6slot ) |
| 1403 | 1403 | PORT_INCLUDE( neogeo ) |
| 1404 | ||
| 1404 | ||
| 1405 | 1405 | PORT_MODIFY("TEST") |
| 1406 | 1406 | PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_SPECIAL ) |
| 1407 | 1407 | INPUT_PORTS_END |
| r31373 | r31374 | |
| 1444 | 1444 | MCFG_PALETTE_ADD_INIT_BLACK("palette", 4096*2*2) |
| 1445 | 1445 | |
| 1446 | 1446 | MCFG_DEVICE_ADD("spritegen", NEOGEO_SPRITE_OPTIMZIED, 0) |
| 1447 | ||
| 1447 | ||
| 1448 | 1448 | /* audio hardware */ |
| 1449 | 1449 | MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker") |
| 1450 | 1450 | |
| r31373 | r31374 | |
| 1516 | 1516 | |
| 1517 | 1517 | /* YEAR NAME PARENT COMPAT MACHINE INPUT INIT */ |
| 1518 | 1518 | CONS( 1990, neogeo, 0, 0, mvs, neogeo_6slot, neogeo_state, mvs, "SNK", "Neo-Geo", GAME_IS_BIOS_ROOT | GAME_SUPPORTS_SAVE ) |
| 1519 |
| r31373 | r31374 | |
|---|---|---|
| 32 | 32 | |
| 33 | 33 | - Reset the game while pressing START1 to enter the "test mode" |
| 34 | 34 | |
| 35 | ||
| 35 | ||
| 36 | 36 | ***************************************************************************/ |
| 37 | 37 | |
| 38 | 38 | #include "emu.h" |
| r31373 | r31374 | |
|---|---|---|
| 435 | 435 | MCFG_VIDEO_START_OVERRIDE(supercrd_state, supercrd) |
| 436 | 436 | |
| 437 | 437 | // MCFG_MC6845_ADD("crtc", MC6845, "screen", MASTER_CLOCK/8) |
| 438 | // MCFG_MC6845_SHOW_BORDER_AREA(false) | |
| 439 | // MCFG_MC6845_CHAR_WIDTH(4) | |
| 438 | // MCFG_MC6845_SHOW_BORDER_AREA(false) | |
| 439 | // MCFG_MC6845_CHAR_WIDTH(4) | |
| 440 | 440 | |
| 441 | 441 | /* sound hardware */ |
| 442 | 442 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| r31373 | r31374 | |
|---|---|---|
| 560 | 560 | PORT_DIPNAME( 0x7000, 0x7000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW1:5,6,7") |
| 561 | 561 | PORT_DIPSETTING( 0x2000, "Level 1" ) |
| 562 | 562 | PORT_DIPSETTING( 0x1000, "Level 2" ) |
| 563 | ||
| 563 | PORT_DIPSETTING( 0x0000, "Level 3" ) | |
| 564 | 564 | PORT_DIPSETTING( 0x7000, "Level 4" ) |
| 565 | 565 | PORT_DIPSETTING( 0x6000, "Level 5" ) |
| 566 | 566 | PORT_DIPSETTING( 0x5000, "Level 6" ) |
| r31373 | r31374 | |
|---|---|---|
| 2145 | 2145 | |
| 2146 | 2146 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2) /* 8 MHz */ |
| 2147 | 2147 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler)) |
| 2148 | ||
| 2148 | ||
| 2149 | 2149 | MCFG_SOUND_ROUTE(0, "mono", 0.25) |
| 2150 | 2150 | MCFG_SOUND_ROUTE(1, "mono", 1.0) |
| 2151 | 2151 | MCFG_SOUND_ROUTE(2, "mono", 1.0) |
| r31373 | r31374 | |
| 2264 | 2264 | |
| 2265 | 2265 | MCFG_SOUND_ADD("ymsnd", YM2610, XTAL_16MHz/2) /* verified on pcb */ |
| 2266 | 2266 | MCFG_YM2610_IRQ_HANDLER(WRITELINE(taitob_state, irqhandler)) |
| 2267 | ||
| 2267 | ||
| 2268 | 2268 | MCFG_SOUND_ROUTE(0, "mono", 0.25) |
| 2269 | 2269 | MCFG_SOUND_ROUTE(1, "mono", 1.0) |
| 2270 | 2270 | MCFG_SOUND_ROUTE(2, "mono", 1.0) |
| r31373 | r31374 | |
|---|---|---|
| 850 | 850 | MCFG_I8255_OUT_PORTC_CB(WRITE8(turbo_state, turbo_ppi3c_w)) |
| 851 | 851 | |
| 852 | 852 | MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4) // unknown clock |
| 853 | MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w)) | |
| 853 | MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w)) // scan SL lines | |
| 854 | 854 | MCFG_I8279_OUT_DISP_CB(WRITE8(turbo_state, digit_w)) // display A&B |
| 855 | 855 | MCFG_I8279_IN_RL_CB(IOPORT("DSW1")) // kbd RL lines |
| 856 | ||
| 856 | ||
| 857 | 857 | /* video hardware */ |
| 858 | 858 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", turbo) |
| 859 | 859 | MCFG_PALETTE_ADD("palette", 256) |
| r31373 | r31374 | |
| 890 | 890 | MCFG_I8255_OUT_PORTC_CB(WRITE8(turbo_state, subroc3d_sound_c_w)) |
| 891 | 891 | |
| 892 | 892 | MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4) // unknown clock |
| 893 | MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w)) | |
| 893 | MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w)) // scan SL lines | |
| 894 | 894 | MCFG_I8279_OUT_DISP_CB(WRITE8(turbo_state, digit_w)) // display A&B |
| 895 | 895 | MCFG_I8279_IN_RL_CB(IOPORT("DSW1")) // kbd RL lines |
| 896 | 896 | |
| r31373 | r31374 | |
| 937 | 937 | MCFG_I8255_OUT_PORTC_CB(WRITE8(turbo_state, buckrog_ppi1c_w)) |
| 938 | 938 | |
| 939 | 939 | MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4) // unknown clock |
| 940 | MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w)) | |
| 940 | MCFG_I8279_OUT_SL_CB(WRITE8(turbo_state, scanlines_w)) // scan SL lines | |
| 941 | 941 | MCFG_I8279_OUT_DISP_CB(WRITE8(turbo_state, digit_w)) // display A&B |
| 942 | 942 | MCFG_I8279_IN_RL_CB(IOPORT("DSW1")) // kbd RL lines |
| 943 | 943 |
| r31373 | r31374 | |
|---|---|---|
| 773 | 773 | case 0x6000: return 0xf0 | 0xcc; |
| 774 | 774 | case 0x2000: return 0;//0xf0|0xcc; /* Perhaps 0xf0|0xcc|0xaa (Sprite under bottom layer) */ |
| 775 | 775 | } |
| 776 | ||
| 776 | ||
| 777 | 777 | return 0; |
| 778 | 778 | } |
| 779 | 779 | |
| r31373 | r31374 | |
| 787 | 787 | UINT16 colour = ((col >> 9) & 0xf) << 2; |
| 788 | 788 | if (col & 0x8000) |
| 789 | 789 | colour++; |
| 790 | ||
| 790 | ||
| 791 | 791 | return colour; |
| 792 | 792 | } |
| 793 | 793 | |
| r31373 | r31374 | |
| 1124 | 1124 | |
| 1125 | 1125 | MCFG_DEVICE_ADD("spritegen1", DECO_SPRITE, 0) |
| 1126 | 1126 | MCFG_DECO_SPRITE_PRIORITY_CB(rohga_state, rohga_pri_callback) |
| 1127 | MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, schmeisr_col_callback) | |
| 1127 | MCFG_DECO_SPRITE_COLOUR_CB(rohga_state, schmeisr_col_callback) // wire mods on pcb... | |
| 1128 | 1128 | MCFG_DECO_SPRITE_GFX_REGION(3) |
| 1129 | 1129 | MCFG_DECO_SPRITE_GFXDECODE("gfxdecode") |
| 1130 | 1130 | MCFG_DECO_SPRITE_PALETTE("palette") |
| r31373 | r31374 | |
|---|---|---|
| 141 | 141 | if ((rom[0] != 0x48e7) || (rom[1] != 0x3020) || (rom[2] != 0x322f) || (rom[3] != 0x0010) || (rom[4] != 0x227c)) |
| 142 | 142 | return false; |
| 143 | 143 | |
| 144 | ||
| 144 | if ((rom[7] != 0x4242) || (rom[8] != 0x2449) || (rom[9] != 0x3639)) | |
| 145 | 145 | return false; |
| 146 | 146 | |
| 147 | 147 | return true; |
| r31373 | r31374 | |
| 175 | 175 | |
| 176 | 176 | if (found==true) |
| 177 | 177 | { |
| 178 | ||
| 179 | 178 | startblock = (rom[i + 5] << 16) | rom[i + 6]; |
| 180 | 179 | endblock = (rom[i + 10] << 16) | rom[i + 11]; |
| 181 | 180 | sc45helperlog("------------ INPUTS -----------------\n"); |
| r31373 | r31374 | |
| 189 | 188 | UINT16 portpos = rom[j + 0]; |
| 190 | 189 | int port = (portpos & 0x1f); |
| 191 | 190 | int pos = (portpos >> 5); |
| 192 | ||
| 191 | ||
| 193 | 192 | UINT16 unk2 = rom[j + 1]; |
| 194 | 193 | UINT32 stringaddr = (rom[j + 2] << 16) | rom[j + 3]; |
| 195 | 194 | |
| r31373 | r31374 | |
| 208 | 207 | { |
| 209 | 208 | tempstring.cat(chr); |
| 210 | 209 | } |
| 211 | ||
| 210 | ||
| 212 | 211 | } |
| 213 | 212 | |
| 214 | 213 | tempstring.trimspace(); |
| r31373 | r31374 | |
| 232 | 231 | } |
| 233 | 232 | //else |
| 234 | 233 | //{ |
| 235 | // | |
| 234 | // printf("invalid port position?\n"); | |
| 236 | 235 | //} |
| 237 | ||
| 238 | 236 | |
| 239 | ||
| 237 | ||
| 238 | ||
| 240 | 239 | sc45helperlog("%s", tempstring.cstr()); |
| 241 | 240 | |
| 242 | 241 | sc45helperlog("\n"); |
| r31373 | r31374 | |
| 298 | 297 | int buttons_used = 1; |
| 299 | 298 | |
| 300 | 299 | printf("INPUT_PORTS_START( %s ) // this structure is generated\n", machine.system().name); |
| 301 | printf(" | |
| 300 | printf(" PORT_INCLUDE( sc4_base )\n"); | |
| 302 | 301 | |
| 303 | 302 | for (int i = 0; i < 32; i++) |
| 304 | 303 | { |
| r31373 | r31374 | |
| 310 | 309 | { |
| 311 | 310 | if (thisportused == 0) |
| 312 | 311 | { |
| 313 | printf(" | |
| 312 | printf(" PORT_MODIFY(\"IN-%d\")\n", i); | |
| 314 | 313 | thisportused = 1; |
| 315 | 314 | } |
| 316 | 315 | |
| 317 | 316 | if (ignoreports[i][j] > 0) |
| 318 | 317 | { |
| 319 | printf(" | |
| 318 | printf(" PORT_BIT( 0x%04x, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_%d_%d ) PORT_NAME(\"%s\")\n", 1 << j, i,j/*ignoreports[i][j]*/, sc4inputs[i][j].name.cstr()); | |
| 320 | 319 | buttons_used++; |
| 321 | 320 | } |
| 322 | 321 | else if (ignoreports[i][j] == -3) |
| 323 | 322 | { |
| 324 | printf(" | |
| 323 | printf(" // 0x%04x - \"%s\" // standard input (motherboard)\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 325 | 324 | } |
| 326 | 325 | else if (ignoreports[i][j] == -2) |
| 327 | 326 | { |
| 328 | printf(" | |
| 327 | printf(" // 0x%04x - \"%s\" // standard input (expected here)\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 329 | 328 | } |
| 330 | 329 | else if (ignoreports[i][j] == -1) |
| 331 | 330 | { |
| 332 | printf(" | |
| 331 | printf(" // 0x%04x - \"%s\" // unexpected here\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 333 | 332 | } |
| 334 | 333 | else if (ignoreports[i][j] == -4) |
| 335 | 334 | { |
| 336 | printf(" | |
| 335 | printf(" // 0x%04x - \"%s\" // known extended input, mapping not understood\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 337 | 336 | } |
| 338 | 337 | else if (ignoreports[i][j] == -5) |
| 339 | 338 | { |
| 340 | printf(" | |
| 339 | printf(" // 0x%04x - \"%s\" // known extended input, usually 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 341 | 340 | } |
| 342 | 341 | else if (ignoreports[i][j] == -6) |
| 343 | 342 | { |
| 344 | printf(" | |
| 343 | printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper low'\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 345 | 344 | } |
| 346 | 345 | else if (ignoreports[i][j] == -7) |
| 347 | 346 | { |
| 348 | printf(" | |
| 347 | printf(" // 0x%04x - \"%s\" // known extended input, usually 'hopper fit'\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 349 | 348 | } |
| 350 | 349 | else if (ignoreports[i][j] == -8) |
| 351 | 350 | { |
| 352 | printf(" | |
| 351 | printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'top up'\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 353 | 352 | } |
| 354 | 353 | else if (ignoreports[i][j] == -9) |
| 355 | 354 | { |
| 356 | printf(" | |
| 355 | printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop hi'\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 357 | 356 | } |
| 358 | 357 | else if (ignoreports[i][j] == -10) |
| 359 | 358 | { |
| 360 | printf(" | |
| 359 | printf(" // 0x%04x - \"%s\" // known extended(?) input, sometimes 'hop top'\n", 1 << j, sc4inputs[i][j].name.cstr()); | |
| 361 | 360 | } |
| 362 | 361 | buttons_used++; |
| 363 | 362 | } |
| r31373 | r31374 | |
| 404 | 403 | |
| 405 | 404 | int find_lamp_strings(running_machine &machine) |
| 406 | 405 | { |
| 407 | ||
| 408 | 406 | int startblock = -1; |
| 409 | 407 | int endblock = -1; |
| 410 | 408 | |
| r31373 | r31374 | |
| 428 | 426 | |
| 429 | 427 | if (startblock == -1) |
| 430 | 428 | return 0; |
| 431 | ||
| 432 | 429 | |
| 433 | 430 | |
| 431 | ||
| 434 | 432 | for (int y = 0; y < 16; y++) |
| 435 | 433 | { |
| 436 | 434 | for (int x = 0; x < 16; x++) |
| r31373 | r31374 | |
| 463 | 461 | UINT16 *rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base(); |
| 464 | 462 | UINT8 *rom8 = machine.root_device().memregion( "maincpu" )->base(); |
| 465 | 463 | |
| 466 | // | |
| 464 | // sc45helperlog("------------ LAMPS -----------------\n"); | |
| 467 | 465 | |
| 468 | 466 | if (endblock > startblock) |
| 469 | 467 | { |
| r31373 | r31374 | |
| 476 | 474 | UINT32 stringaddr = (rom[j + 1] << 16) | rom[j + 2]; |
| 477 | 475 | |
| 478 | 476 | //sc45helperlog("(row %02d, col %02d, unused %02x) addr %08x ", row,col, (portpos&0xff00)>>8, stringaddr); |
| 479 | ||
| 477 | ||
| 480 | 478 | astring tempstring; |
| 481 | 479 | |
| 482 | 480 | for (int k = stringaddr; k < stringaddr + 10; k++) |
| r31373 | r31374 | |
| 491 | 489 | { |
| 492 | 490 | tempstring.cat(chr); |
| 493 | 491 | } |
| 494 | ||
| 492 | ||
| 495 | 493 | } |
| 496 | 494 | |
| 497 | 495 | if (lamps[row][col].used == false) |
| r31373 | r31374 | |
| 538 | 536 | for (int x = 0; x < 6; x++) |
| 539 | 537 | { |
| 540 | 538 | sc45helperlog("<element name=\"inputlabel%d-%d\"><text string=\"%s\"><color red=\"1.0\" green=\"1.0\" blue=\"1.0\" /></text></element>\n", realy,x,sc4inputs[realy][x].name.cstr()); |
| 541 | ||
| 539 | ||
| 542 | 540 | } |
| 543 | 541 | } |
| 544 | 542 | sc45helperlog("\n"); |
| r31373 | r31374 | |
| 606 | 604 | |
| 607 | 605 | // try to find some specific named elements and move them around |
| 608 | 606 | d = 0; |
| 609 | ||
| 607 | ||
| 610 | 608 | for (int reel = 0; reel < 8; reel++) |
| 611 | 609 | { |
| 612 | 610 | char tempname[32]; |
| 613 | 611 | sprintf(tempname, "reel%d ", reel+1); |
| 614 | ||
| 615 | ||
| 612 | ||
| 613 | ||
| 616 | 614 | for (int pos = 0; pos < 3; pos++) |
| 617 | 615 | { |
| 618 | 616 | char tempname2[32]; |
| r31373 | r31374 | |
| 626 | 624 | { |
| 627 | 625 | for (int x = 0; x < 16; x++) |
| 628 | 626 | { |
| 629 | ||
| 630 | 627 | if (!strcmp(tempname2, lamps[y][x].lampname_alt.cstr())) |
| 631 | 628 | { |
| 632 | 629 | //sc45helperlog("%s found\n", tempname2); |
| r31373 | r31374 | |
| 637 | 634 | lamps[y][x].width = 50; |
| 638 | 635 | lamps[y][x].height = 17; |
| 639 | 636 | lamps[y][x].lamptypename = "reellamp"; |
| 640 | ||
| 641 | 637 | |
| 638 | ||
| 642 | 639 | } |
| 643 | 640 | else |
| 644 | 641 | { |
| r31373 | r31374 | |
| 669 | 666 | set_clickable_temp(machine, "cash bust", 8, 0x04); |
| 670 | 667 | |
| 671 | 668 | // no 'refill' lamp? |
| 672 | ||
| 673 | 669 | |
| 670 | ||
| 674 | 671 | } |
| 675 | 672 | |
| 676 | 673 | |
| r31373 | r31374 | |
| 692 | 689 | } |
| 693 | 690 | } |
| 694 | 691 | |
| 695 | // print out a simple matrix of some of the most common inputs, | |
| 692 | // print out a simple matrix of some of the most common inputs, | |
| 696 | 693 | d = 0; |
| 697 | 694 | for (int y = 0; y < 7; y++) |
| 698 | 695 | { |
| r31373 | r31374 | |
| 777 | 774 | |
| 778 | 775 | return 0; |
| 779 | 776 | } |
| 780 | ||
| 781 | 777 | |
| 778 | ||
| 782 | 779 | int find_reel_strings(running_machine &machine) |
| 783 | 780 | { |
| 784 | 781 | int startblock = -1; |
| r31373 | r31374 | |
| 787 | 784 | dynamic_array<int> reelsizes; |
| 788 | 785 | |
| 789 | 786 | // these are for sc4dnd ONLY, need to work out how the code calculates them |
| 790 | ||
| 787 | ||
| 791 | 788 | // this list is 4 * 16 symbols for the regular reels, 12 symbols for the number spin, and 2 groups of 16 depending on jackpot/stake keys used for the prize reel |
| 792 | 789 | // code that points at these is likely to be complex because it's conditional on the game code / mode.. |
| 793 | 790 | if (!strcmp(machine.system().name, "sc4dnd")) |
| r31373 | r31374 | |
| 841 | 838 | |
| 842 | 839 | if (startblock == -1) |
| 843 | 840 | return 0; |
| 844 | ||
| 845 | 841 | |
| 846 | 842 | |
| 847 | 843 | |
| 848 | 844 | |
| 845 | ||
| 849 | 846 | UINT16 *rom = (UINT16*)machine.root_device().memregion( "maincpu" )->base(); |
| 850 | 847 | UINT8 *rom8 = machine.root_device().memregion( "maincpu" )->base(); |
| 851 | 848 | |
| r31373 | r31374 | |
| 868 | 865 | if (current_symbols == 0) |
| 869 | 866 | { |
| 870 | 867 | int shifted = ((0x10000 / 16) * 11 ) + 692; |
| 871 | // | |
| 868 | // sc45helperlog("REEL %d\n", which_reel+1); | |
| 872 | 869 | sc45helperlog("<element name=\"SteppersReel%d\" defstate=\"0\">\n", which_reel+1); |
| 873 | 870 | sc45helperlog("<reel stateoffset=\"%d\" symbollist=\"", shifted); |
| 874 | 871 | } |
| 875 | ||
| 872 | ||
| 876 | 873 | UINT32 stringaddr = (rom[j + 0] << 16) | rom[j + 1]; |
| 877 | 874 | stringaddr &= 0xfffff; |
| 878 | 875 | |
| r31373 | r31374 | |
| 880 | 877 | continue; |
| 881 | 878 | |
| 882 | 879 | //sc45helperlog("addr %08x ", stringaddr); |
| 883 | ||
| 880 | ||
| 884 | 881 | astring tempstring; |
| 885 | 882 | |
| 886 | 883 | for (int k = stringaddr; k < stringaddr + 10; k++) |
| r31373 | r31374 | |
| 895 | 892 | { |
| 896 | 893 | tempstring.cat(chr); |
| 897 | 894 | } |
| 898 | ||
| 895 | ||
| 899 | 896 | } |
| 900 | 897 | |
| 901 | 898 | tempstring.trimspace(); |
| r31373 | r31374 | |
| 908 | 905 | } |
| 909 | 906 | |
| 910 | 907 | sc45helperlog("%s", tempstring.cstr()); |
| 911 | ||
| 912 | 908 | |
| 913 | 909 | |
| 910 | ||
| 914 | 911 | //sc45helperlog("\n"); |
| 915 | 912 | |
| 916 | 913 | current_symbols++; |
| r31373 | r31374 | |
|---|---|---|
| 122 | 122 | * Machine initialization |
| 123 | 123 | * |
| 124 | 124 | *************************************/ |
| 125 | ||
| 125 | ||
| 126 | 126 | void rpunch_state::machine_start() |
| 127 | 127 | { |
| 128 | 128 | save_item(NAME(m_sound_data)); |
| r31373 | r31374 | |
| 749 | 749 | ROM_LOAD( "sps_07.bin", 0x20000, 0x10000, CRC(904b7709) SHA1(9b66a565cd599928b666baad9f97c50f35ffcc37) ) |
| 750 | 750 | ROM_LOAD( "sps_08.bin", 0x30000, 0x10000, CRC(5430ffac) SHA1(163311d96f2f7e1ecb0901d0be73ac357b01bf6a) ) |
| 751 | 751 | ROM_LOAD( "sps_09.bin", 0x40000, 0x10000, CRC(414a6278) SHA1(baa9dc9ab0dd3c5f27c128de23053edcddf45ad0) ) |
| 752 | // | |
| 752 | // ROM_LOAD( "a09.bin", 0x50000, 0x08000, CRC(dd92dfe1) SHA1(08c956e11d567a215ec3cdaf6ef75fa9a886513a) ) // not on this set? | |
| 753 | 753 | |
| 754 | 754 | ROM_REGION( 0x80000, "sprites", ROMREGION_ERASEFF ) |
| 755 | 755 | ROM_LOAD16_BYTE( "sps_20.bin", 0x00000, 0x10000, CRC(c9e7206d) SHA1(af5b2f49387a3b46c6693f4782aa0e587f17ab25) ) |
| r31373 | r31374 | |
|---|---|---|
| 2718 | 2718 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 2719 | 2719 | |
| 2720 | 2720 | PORT_START("DSW") |
| 2721 | PORT_DIPNAME( 0x01, 0x01, "Test Mode" ) | |
| 2721 | PORT_DIPNAME( 0x01, 0x01, "Test Mode" ) PORT_DIPLOCATION("SW1:8") | |
| 2722 | 2722 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 2723 | 2723 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 2724 | PORT_DIPNAME( 0x02, 0x02, "Royal Flush" ) | |
| 2724 | PORT_DIPNAME( 0x02, 0x02, "Royal Flush" ) PORT_DIPLOCATION("SW1:7") | |
| 2725 | 2725 | PORT_DIPSETTING( 0x02, DEF_STR( Yes ) ) |
| 2726 | 2726 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 2727 | PORT_DIPNAME( 0x04, 0x04, "5 of a Kind" ) | |
| 2727 | PORT_DIPNAME( 0x04, 0x04, "5 of a Kind" ) PORT_DIPLOCATION("SW1:6") | |
| 2728 | 2728 | PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) |
| 2729 | 2729 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 2730 | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Coinage ) ) | |
| 2730 | PORT_DIPNAME( 0x18, 0x08, DEF_STR( Coinage ) ) PORT_DIPLOCATION("SW1:5,4") | |
| 2731 | 2731 | PORT_DIPSETTING( 0x08, "1C-10C" ) |
| 2732 | 2732 | PORT_DIPSETTING( 0x10, "1C-1C" ) |
| 2733 | 2733 | PORT_DIPSETTING( 0x18, "1C-2C" ) |
| 2734 | 2734 | PORT_DIPSETTING( 0x00, "1C-5C" ) |
| 2735 | PORT_DIPNAME( 0x60, 0x60, "Payment Type" ) | |
| 2735 | PORT_DIPNAME( 0x60, 0x60, "Payment Type" ) PORT_DIPLOCATION("SW1:3,2") | |
| 2736 | 2736 | PORT_DIPSETTING( 0x00, "Ticket + Hopper" ) |
| 2737 | 2737 | PORT_DIPSETTING( 0x20, "Ticket" ) |
| 2738 | 2738 | PORT_DIPSETTING( 0x40, "Hopper" ) |
| 2739 | 2739 | PORT_DIPSETTING( 0x60, "Ticket + Hopper" ) |
| 2740 | PORT_DIPNAME( 0x80, 0x80, "Pagamenti (Payment)" ) | |
| 2740 | PORT_DIPNAME( 0x80, 0x80, "Pagamenti (Payment)" ) PORT_DIPLOCATION("SW1:1") | |
| 2741 | 2741 | PORT_DIPSETTING( 0x80, "Pagamenti (Payment) A" ) |
| 2742 | 2742 | PORT_DIPSETTING( 0x00, "Pagamenti (Payment) B" ) |
| 2743 | 2743 | INPUT_PORTS_END |
| r31373 | r31374 | |
| 6218 | 6218 | |
| 6219 | 6219 | static UINT8 rcdino4_add[] = |
| 6220 | 6220 | { |
| 6221 | /* 0 1 2 3 4 5 6 7 8 9 a b c d e f*/ | |
| 6222 | /*0*/ 1, 9, 9, 9, 9, 2, 9, 9, 1, 2, 1, 9, 9, 3, 9, 9, | |
| 6223 | /*1*/ 2, 2, 9, 9, 9, 9, 9, 9, 1, 9, 1, 9, 9, 9, 9, 9, | |
| 6224 | /*2*/ 3, 9, 9, 9, 9, 2, 2, 9, 1, 2, 1, 9, 9, 3, 3, 9, | |
| 6225 | /*3*/ 2, 9, 9, 9, 9, 9, 9, 9, 1, 9, 1, 9, 9, 3, 9, 9, | |
| 6226 | /*4*/ 1, 9, 9, 9, 9, 2, 9, 9, 1, 2, 1, 9, 3, 3, 9, 9, | |
| 6227 | /*5*/ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 9, 9, 9, 9, 9, | |
| 6228 | /*6*/ 1, 9, 9, 9, 2, 2, 9, 9, 1, 2, 1, 9, 3, 3, 3, 9, | |
| 6229 | /*7*/ 9, 2, 9, 9, 9, 9, 9, 9, 9, 3, 1, 9, 9, 3, 9, 9, | |
| 6230 | /*8*/ 2, 9, 9, 9, 2, 2, 2, 9, 1, 9, 1, 9, 9, 3, 3, 9, | |
| 6231 | /*9*/ 2, 2, 9, 9, 9, 2, 9, 9, 1, 3, 9, 9, 3, 3, 3, 9, | |
| 6232 | /*a*/ 2, 9, 2, 9, 2, 2, 2, 9, 1, 2, 1, 9, 9, 3, 3, 2, | |
| 6233 | /*b*/ 2, 2, 9, 9, 9, 2, 9, 9, 9, 3, 9, 9, 9, 3, 9, 9, | |
| 6234 | /*c*/ 2, 9, 9, 9, 2, 2, 2, 9, 1, 2, 1, 9, 3, 3, 3, 9, | |
| 6235 | /*d*/ 2, 9, 9, 9, 9, 9, 9, 9, 1, 9, 1, 9, 9, 3, 9, 9, | |
| 6236 | /*e*/ 2, 9, 9, 9, 2, 9, 2, 9, 1, 2, 1, 9, 3, 9, 3, 9, | |
| 6237 | /*f*/ 2, 9, 9, 9, 9, 2, 9, 9, 1, 3, 1, 9, 9, 3, 9, 9 | |
| 6221 | /* 0 1 2 3 4 5 6 7 8 9 a b c d e f*/ | |
| 6222 | /*0*/ 1, 9, 9, 9, 9, 2, 9, 9, 1, 2, 1, 9, 9, 3, 9, 9, | |
| 6223 | /*1*/ 2, 2, 9, 9, 9, 9, 9, 9, 1, 9, 1, 9, 9, 9, 9, 9, | |
| 6224 | /*2*/ 3, 9, 9, 9, 9, 2, 2, 9, 1, 2, 1, 9, 9, 3, 3, 9, | |
| 6225 | /*3*/ 2, 9, 9, 9, 9, 9, 9, 9, 1, 9, 1, 9, 9, 3, 9, 9, | |
| 6226 | /*4*/ 1, 9, 9, 9, 9, 2, 9, 9, 1, 2, 1, 9, 3, 3, 9, 9, | |
| 6227 | /*5*/ 9, 9, 9, 9, 9, 9, 9, 9, 9, 9, 1, 9, 9, 9, 9, 9, | |
| 6228 | /*6*/ 1, 9, 9, 9, 2, 2, 9, 9, 1, 2, 1, 9, 3, 3, 3, 9, | |
| 6229 | /*7*/ 9, 2, 9, 9, 9, 9, 9, 9, 9, 3, 1, 9, 9, 3, 9, 9, | |
| 6230 | /*8*/ 2, 9, 9, 9, 2, 2, 2, 9, 1, 9, 1, 9, 9, 3, 3, 9, | |
| 6231 | /*9*/ 2, 2, 9, 9, 9, 2, 9, 9, 1, 3, 9, 9, 3, 3, 3, 9, | |
| 6232 | /*a*/ 2, 9, 2, 9, 2, 2, 2, 9, 1, 2, 1, 9, 9, 3, 3, 2, | |
| 6233 | /*b*/ 2, 2, 9, 9, 9, 2, 9, 9, 9, 3, 9, 9, 9, 3, 9, 9, | |
| 6234 | /*c*/ 2, 9, 9, 9, 2, 2, 2, 9, 1, 2, 1, 9, 3, 3, 3, 9, | |
| 6235 | /*d*/ 2, 9, 9, 9, 9, 9, 9, 9, 1, 9, 1, 9, 9, 3, 9, 9, | |
| 6236 | /*e*/ 2, 9, 9, 9, 2, 9, 2, 9, 1, 2, 1, 9, 3, 9, 3, 9, | |
| 6237 | /*f*/ 2, 9, 9, 9, 9, 2, 9, 9, 1, 3, 1, 9, 9, 3, 9, 9 | |
| 6238 | 6238 | }; |
| 6239 | 6239 | |
| 6240 | 6240 | static UINT8 rcdino4_keys40[] = |
| 6241 | 6241 | { |
| 6242 | /* | |
| 6242 | /* 40 41 42 43 44 45 46 47 48 49 4a 4b 4c 4d*/ | |
| 6243 | 6243 | 0x36, 0x54, 0x47, 0x6b, 0xce, 0x95, 0xa2, 0x66, 0x3a, 0x46, 0x53, 0xd7, 0xc4, 0xa4, |
| 6244 | /* | |
| 6244 | /* 4e 4f*/ | |
| 6245 | 6245 | 0x00, 0x00, |
| 6246 | /* | |
| 6246 | /* 50*/ | |
| 6247 | 6247 | 0x56 |
| 6248 | 6248 | }; |
| 6249 | 6249 | |
| 6250 | 6250 | static UINT8 rcdino4_keys80[] = |
| 6251 | 6251 | { |
| 6252 | /* 81 82 83 84 85 */ | |
| 6253 | 0xb8, 0x32, 0x1c, 0x23, 0xe2, | |
| 6254 | /* 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91*/ | |
| 6252 | /* 81 82 83 84 85 */ | |
| 6253 | 0xb8, 0x32, 0x1c, 0x23, 0xe2, | |
| 6254 | /* 86 87 88 89 8a 8b 8c 8d 8e 8f 90 91*/ | |
| 6255 | 6255 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6256 | /* | |
| 6256 | /* 92 93 94 95 96 97 */ | |
| 6257 | 6257 | 0x4c, 0x00, 0x3d, 0x00, 0xd9, 0x16, |
| 6258 | /* | |
| 6258 | /* 98 99 9a 9b 9c 9d 9e 9f a0 a1 a2 a3*/ | |
| 6259 | 6259 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6260 | /* | |
| 6260 | /* a4 a5 a6*/ | |
| 6261 | 6261 | 0x5e, 0x73, 0x69, |
| 6262 | /* | |
| 6262 | /* a7 a8 a9*/ | |
| 6263 | 6263 | 0x00, 0x00, 0x00, |
| 6264 | /* | |
| 6264 | /* aa*/ | |
| 6265 | 6265 | 0xa6, |
| 6266 | /* | |
| 6266 | /* ab ac ad ae af*/ | |
| 6267 | 6267 | 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6268 | /* | |
| 6268 | /* b0 b1*/ | |
| 6269 | 6269 | 0xc3, 0x40, |
| 6270 | /* | |
| 6270 | /* b2 b3 b4 b5 b6 b7 b8 b9 ba bb bc bd be bf c0 c1 c2*/ | |
| 6271 | 6271 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6272 | /* | |
| 6272 | /* c3 c4 c5*/ | |
| 6273 | 6273 | 0x92, 0xb7, 0x24, |
| 6274 | /* | |
| 6274 | /* c6 c7 c8 c9*/ | |
| 6275 | 6275 | 0x00, 0x00, 0x00, 0x00, |
| 6276 | /* | |
| 6276 | /* ca*/ | |
| 6277 | 6277 | 0x62, |
| 6278 | /* | |
| 6278 | /* cb cc cd ce cf*/ | |
| 6279 | 6279 | 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6280 | /* | |
| 6280 | /* d0*/ | |
| 6281 | 6281 | 0x84, |
| 6282 | /* | |
| 6282 | /* d1*/ | |
| 6283 | 6283 | 0x00, |
| 6284 | /* | |
| 6284 | /* d2*/ | |
| 6285 | 6285 | 0xaa, |
| 6286 | /* | |
| 6286 | /* d3 d4 d5*/ | |
| 6287 | 6287 | 0x00, 0x00, 0x00, |
| 6288 | /* | |
| 6288 | /* d6*/ | |
| 6289 | 6289 | 0xea, |
| 6290 | /* | |
| 6290 | /* d7 d8 d9 da db dc dd de df*/ | |
| 6291 | 6291 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6292 | /* | |
| 6292 | /* e0*/ | |
| 6293 | 6293 | 0x17, |
| 6294 | /* | |
| 6294 | /* e1 e2 e3*/ | |
| 6295 | 6295 | 0x00, 0x00, 0x00, |
| 6296 | /* | |
| 6296 | /* e4*/ | |
| 6297 | 6297 | 0xc0, |
| 6298 | /* | |
| 6298 | /* e5 e6 e7 e8 e9 ea eb ec ed ee ef f0 f1 f2 f3 f4 f5 f6 f7*/ | |
| 6299 | 6299 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, |
| 6300 | /* | |
| 6300 | /* f8 f9 fa fb fc fd fe*/ | |
| 6301 | 6301 | 0x06, 0x1e, 0x28, 0x5a, 0xcf, 0x79, 0x11 |
| 6302 | 6302 | }; |
| 6303 | 6303 | |
| r31373 | r31374 | |
| 6368 | 6368 | add = rcdino4_add[c]; |
| 6369 | 6369 | |
| 6370 | 6370 | if (((i == 0x81) |
| 6371 | && (j >= 0xa3) && (j <= 0xb1) /* text string */ | |
| 6372 | ) | |
| 6373 | || ((i == 0x82) | |
| 6374 | && (j >= 0x35) && (j <= 0x53) /* table of addresses */ | |
| 6375 | ) | |
| 6376 | || ((i == 0x85) | |
| 6377 | && (j >= 0x7e) && (j <= 0x8d) /* '0'-'9', 'A'-'F' */ | |
| 6378 | ) | |
| 6379 | || ((i == 0x94) | |
| 6380 | && (((j >= 0x4a) && (j <= 0x86)) /* zeroes */ | |
| 6381 | || ((j >= 0xbf) && (j <= 0xc1)) /* set of masks */ | |
| 6382 | ) | |
| 6383 | ) | |
| 6384 | || ((i == 0x96) | |
| 6385 | && (j >= 0x39) && (j <= 0x3e) /* set of masks */ | |
| 6386 | ) | |
| 6387 | || ((i == 0xa6) | |
| 6388 | && (j >= 0x30) && (j <= 0x32) /* set of masks */ | |
| 6389 | ) | |
| 6390 | || ((i == 0xaa) | |
| 6391 | && (j >= 0xf2) /* table of addresses */ | |
| 6392 | ) | |
| 6393 | || ((i == 0xc3) | |
| 6394 | && (j >= 0x70) && (j <= 0xaf) /* set of masks */ | |
| 6395 | ) | |
| 6396 | || ((i == 0xc4) | |
| 6397 | && (j >= 0xdc) /* zeroes and things */ | |
| 6398 | ) | |
| 6399 | || ((i == 0xd0) | |
| 6400 | && (j >= 0xd2) /* text and zeroes */ | |
| 6401 | ) | |
| 6402 | || ((i == 0xd2) | |
| 6403 | && ((j <= 0x2f) /* text and zeroes */ | |
| 6404 | || ((j >= 0x84) && (j <= 0xaf)) /* text and zeroes */ | |
| 6405 | ) | |
| 6406 | ) | |
| 6407 | || (add == 9) | |
| 6408 | ) | |
| 6371 | && (j >= 0xa3) && (j <= 0xb1) /* text string */ | |
| 6372 | ) | |
| 6373 | || ((i == 0x82) | |
| 6374 | && (j >= 0x35) && (j <= 0x53) /* table of addresses */ | |
| 6375 | ) | |
| 6376 | || ((i == 0x85) | |
| 6377 | && (j >= 0x7e) && (j <= 0x8d) /* '0'-'9', 'A'-'F' */ | |
| 6378 | ) | |
| 6379 | || ((i == 0x94) | |
| 6380 | && (((j >= 0x4a) && (j <= 0x86)) /* zeroes */ | |
| 6381 | || ((j >= 0xbf) && (j <= 0xc1)) /* set of masks */ | |
| 6382 | ) | |
| 6383 | ) | |
| 6384 | || ((i == 0x96) | |
| 6385 | && (j >= 0x39) && (j <= 0x3e) /* set of masks */ | |
| 6386 | ) | |
| 6387 | || ((i == 0xa6) | |
| 6388 | && (j >= 0x30) && (j <= 0x32) /* set of masks */ | |
| 6389 | ) | |
| 6390 | || ((i == 0xaa) | |
| 6391 | && (j >= 0xf2) /* table of addresses */ | |
| 6392 | ) | |
| 6393 | || ((i == 0xc3) | |
| 6394 | && (j >= 0x70) && (j <= 0xaf) /* set of masks */ | |
| 6395 | ) | |
| 6396 | || ((i == 0xc4) | |
| 6397 | && (j >= 0xdc) /* zeroes and things */ | |
| 6398 | ) | |
| 6399 | || ((i == 0xd0) | |
| 6400 | && (j >= 0xd2) /* text and zeroes */ | |
| 6401 | ) | |
| 6402 | || ((i == 0xd2) | |
| 6403 | && ((j <= 0x2f) /* text and zeroes */ | |
| 6404 | || ((j >= 0x84) && (j <= 0xaf)) /* text and zeroes */ | |
| 6405 | ) | |
| 6406 | ) | |
| 6407 | || (add == 9) | |
| 6408 | ) | |
| 6409 | 6409 | { |
| 6410 | 6410 | ++j; |
| 6411 | 6411 | } |
| r31373 | r31374 | |
| 6421 | 6421 | do {} while (!rcdino4_keys80[++i - 0x81]); |
| 6422 | 6422 | |
| 6423 | 6423 | if ((i == 0xa4) |
| 6424 | || (i == 0xb0) | |
| 6425 | || (i == 0xf8) | |
| 6426 | ) | |
| 6424 | || (i == 0xb0) | |
| 6425 | || (i == 0xf8) | |
| 6426 | ) | |
| 6427 | 6427 | { |
| 6428 | 6428 | j = 0; /* re-align offset after skipping some pages */ |
| 6429 | 6429 | } |
| r31373 | r31374 | |
|---|---|---|
| 429 | 429 | MCFG_TMS36XX_TYPE(TMS3615) |
| 430 | 430 | MCFG_TMS36XX_DECAY_TIMES(0.15, 0.20, 0, 0, 0, 0) |
| 431 | 431 | // NOTE: it's unknown if the TMS3615 mixes more than one voice internally. |
| 432 | // A wav taken from Pop Flamer sounds like there are at least no 'odd' | |
| 432 | // A wav taken from Pop Flamer sounds like there are at least no 'odd' | |
| 433 | 433 | // harmonics (5 1/3' and 2 2/3') |
| 434 | 434 | MCFG_SOUND_ROUTE(0, "mono", 0.60) |
| 435 | 435 | |
| r31373 | r31374 | |
| 466 | 466 | MCFG_TMS36XX_TYPE(TMS3615) |
| 467 | 467 | MCFG_TMS36XX_DECAY_TIMES(0.15, 0.20, 0, 0, 0, 0) |
| 468 | 468 | // NOTE: it's unknown if the TMS3615 mixes more than one voice internally. |
| 469 | // A wav taken from Pop Flamer sounds like there are at least no 'odd' | |
| 469 | // A wav taken from Pop Flamer sounds like there are at least no 'odd' | |
| 470 | 470 | // harmonics (5 1/3' and 2 2/3') |
| 471 | 471 | MCFG_SOUND_ROUTE(0, "mono", 0.60) |
| 472 | 472 |
| r31373 | r31374 | |
|---|---|---|
| 1330 | 1330 | LOG_IC8(("%s: IC8 PIA write CB2 (alpha clock) %02X\n", machine().describe_context(), state & 0xFF)); |
| 1331 | 1331 | |
| 1332 | 1332 | // DM Data pin B |
| 1333 | ||
| 1333 | ||
| 1334 | 1334 | m_vfd->sclk(!state); |
| 1335 | 1335 | } |
| 1336 | 1336 | |
| r31373 | r31374 | |
| 2600 | 2600 | MCFG_PTM6840_OUT1_CB(WRITE8(mpu4_state, ic2_o2_callback)) |
| 2601 | 2601 | MCFG_PTM6840_OUT2_CB(WRITE8(mpu4_state, ic2_o3_callback)) |
| 2602 | 2602 | MCFG_PTM6840_IRQ_CB(WRITELINE(mpu4_state, cpu0_irq)) |
| 2603 | ||
| 2603 | ||
| 2604 | 2604 | MCFG_DEVICE_ADD("pia_ic3", PIA6821, 0) |
| 2605 | 2605 | MCFG_PIA_WRITEPA_HANDLER(WRITE8(mpu4_state, pia_ic3_porta_w)) |
| 2606 | 2606 | MCFG_PIA_WRITEPB_HANDLER(WRITE8(mpu4_state, pia_ic3_portb_w)) |
| r31373 | r31374 | |
|---|---|---|
| 1126 | 1126 | GAME(1992, trek_110, trek_201, de_3_dmd1, de_3, de_3_state, de_3, ROT0, "Data East", "Star Trek 25th Anniversary (1.10)", GAME_IS_SKELETON_MECHANICAL) |
| 1127 | 1127 | GAME(1992, trek_11a, trek_201, de_3_dmd1, de_3, de_3_state, de_3, ROT0, "Data East", "Star Trek 25th Anniversary (1.10 Alpha Display)", GAME_IS_SKELETON_MECHANICAL) |
| 1128 | 1128 | GAME(1992, stwr_104, 0, de_3_dmd2, de_3, de_3_state, de_3, ROT0, "Data East", "Star Wars (1.04)", GAME_IS_SKELETON_MECHANICAL) |
| 1129 | GAME(1992, stwr_103, stwr_104, de_3_dmd2, de_3, de_3_state, de_3, ROT0, "Data East", "Star Wars (1.03)", | |
| 1129 | GAME(1992, stwr_103, stwr_104, de_3_dmd2, de_3, de_3_state, de_3, ROT0, "Data East", "Star Wars (1.03)", GAME_IS_SKELETON_MECHANICAL) | |
| 1130 | 1130 | GAME(1992, stwr_g11, stwr_104, de_3_dmd2, de_3, de_3_state, de_3, ROT0, "Data East", "Star Wars (1.01 Germany)", GAME_IS_SKELETON_MECHANICAL) |
| 1131 | 1131 | GAME(1992, stwr_a14, stwr_104, de_3_dmd2, de_3, de_3_state, de_3, ROT0, "Data East", "Star Wars (Display Rev.1.04)", GAME_IS_SKELETON_MECHANICAL) |
| 1132 | 1132 | GAME(1992, stwr_102, stwr_104, de_3_dmd2, de_3, de_3_state, de_3, ROT0, "Data East", "Star Wars (1.02)", GAME_IS_SKELETON_MECHANICAL) |
| r31373 | r31374 | |
|---|---|---|
| 994 | 994 | ROM_START( m4eaw__bz ) \ |
| 995 | 995 | ROM_REGION( 0x010000, "maincpu", 0 ) |
| 996 | 996 | ROM_LOAD( "everyones a winner v2-5p", 0x8000, 0x008000, CRC(eb8f2fc5) SHA1(0d3614bd5ff561d17bef0d1e620f2f812b8fed5b)) |
| 997 | M4EAW_EXTRA_ROMS | |
| 998 | ROM_END | |
| 997 | M4EAW_EXTRA_ROMS | |
| 998 | ROM_END | |
| 999 | 999 | |
| 1000 | 1000 | GAME(199?, m4eaw__bz, m4eaw ,mod4oki ,mpu4 , mpu4_state,m4_showstring ,ROT0,"Barcrest","Everyone's A Winner (Barcrest) (MPU4) (set 99)",GAME_FLAGS ) |
| 1001 | 1001 |
| r31373 | r31374 | |
|---|---|---|
| 1020 | 1020 | MCFG_DEVICE_ADD("k054338", K054338, 0) |
| 1021 | 1021 | MCFG_K054338_ALPHAINV(1) |
| 1022 | 1022 | MCFG_K054338_MIXER("k055555") |
| 1023 | ||
| 1023 | ||
| 1024 | 1024 | MCFG_VIDEO_START_OVERRIDE(mystwarr_state, mystwarr) |
| 1025 | 1025 | |
| 1026 | 1026 | /* sound hardware */ |
| r31373 | r31374 | |
|---|---|---|
| 621 | 621 | Peripheral String 0000000 |
| 622 | 622 | Product Number GDT-0004E |
| 623 | 623 | Version V5.002 |
| 624 | Release Date 20031203 | |
| 625 | ||
| 626 | PIC16C621A-20/P (317-0362-COM) | |
| 624 | Release Date 20031203 | |
| 625 | ||
| 626 | PIC16C621A-20/P (317-0362-COM) | |
| 627 | 627 | Sticker: 253-5508-0362 |
| 628 | 628 | */ |
| 629 | 629 | ROM_START( fzeroax ) |
| r31373 | r31374 | |
| 645 | 645 | Product Number GDT-0004C |
| 646 | 646 | Version V3.000 |
| 647 | 647 | Release Date 20030611 |
| 648 | ||
| 649 | PIC16C621A-20/P (317-0362-COM) | |
| 648 | ||
| 649 | PIC16C621A-20/P (317-0362-COM) | |
| 650 | 650 | Sticker: 253-5508-0362 |
| 651 | */ | |
| 651 | */ | |
| 652 | 652 | ROM_START( fzeroaxc ) |
| 653 | 653 | TRIFORCE_BIOS |
| 654 | 654 | |
| r31373 | r31374 | |
| 816 | 816 | Product Number GDT-0021 |
| 817 | 817 | Version V1.003 |
| 818 | 818 | Release Date 20060131 |
| 819 | Manufacturer ID | |
| 820 | Ring Code | |
| 819 | Manufacturer ID | |
| 820 | Ring Code | |
| 821 | 821 | BIN BLL.BIN |
| 822 | 822 | KEY ABFBD902FBD980E5 |
| 823 | 823 | GDI Structure 3 |
| r31373 | r31374 | |
| 825 | 825 | 2 450 0 2352 track02.raw 0 |
| 826 | 826 | 3 45000 4 2352 track03.bin 0 |
| 827 | 827 | |
| 828 | Files Infos : | |
| 828 | Files Infos : | |
| 829 | 829 | disc.gdi - size 87 - md5 b3ecdf113fd42344dd84142679e4cb36 - sha1 9d50b816d3f69ad192f5986ab487769965c2e082 |
| 830 | 830 | track01.bin - size 705600 - md5 0fa0aff28e75130cc9364e11755d0881 - sha1 647ff196eff7c220e1aa7829f87494d557c90be4 |
| 831 | 831 | track02.raw - size 3179904 - md5 32a6bba6f49385515c6649bb78f8e9c4 - sha1 27c8184e6d40c48fe6466bfb4171969eaf6baab3 |
| 832 | 832 | track03.bin - size 1185760800 - md5 8b67fe537a66fa849686df074531cb30 - sha1 153f638f5b67741687186835573ab485400f91bf |
| 833 | 833 | |
| 834 | 834 | ROM_START( vs42k6ex ) |
| 835 | ||
| 835 | TRIFORCE_BIOS | |
| 836 | 836 | |
| 837 | DISK_REGION( "gdrom" ) | |
| 838 | DISK_IMAGE_READONLY( "gdt-0021", 0, NO_DUMP ) disc.gdi is missing from available romset, it is impossible to create CHD with CHDMAN | |
| 837 | DISK_REGION( "gdrom" ) | |
| 838 | DISK_IMAGE_READONLY( "gdt-0021", 0, NO_DUMP ) disc.gdi is missing from available romset, it is impossible to create CHD with CHDMAN | |
| 839 | 839 | |
| 840 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 841 | ROM_LOAD("gdt-0021.data", 0x00, 0x50, NO_DUMP ) | |
| 840 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 841 | ROM_LOAD("gdt-0021.data", 0x00, 0x50, NO_DUMP ) | |
| 842 | 842 | ROM_END |
| 843 | 843 | */ |
| 844 | 844 | |
| r31373 | r31374 | |
| 848 | 848 | Hardware Tri-Force |
| 849 | 849 | Sec Key 253-5508-0567 |
| 850 | 850 | Pic 317-0567-COM |
| 851 | Ver 0001 | |
| 851 | Ver 0001 | |
| 852 | 852 | Boot File BRN.BIN |
| 853 | 853 | GD Unlock 70 1F 71 1F |
| 854 | 854 | DES Key D96446469BDCE9C1 |
| 855 | 855 | |
| 856 | 856 | ROM_START( tcfboxa ) |
| 857 | ||
| 857 | TRIFORCE_BIOS | |
| 858 | 858 | |
| 859 | DISK_REGION( "gdrom" ) | |
| 860 | DISK_IMAGE_READONLY( "gdt-0022", 0, NO_DUMP ) disc.gdi is missing from available romset, it is impossible to create CHD with CHDMAN | |
| 859 | DISK_REGION( "gdrom" ) | |
| 860 | DISK_IMAGE_READONLY( "gdt-0022", 0, NO_DUMP ) disc.gdi is missing from available romset, it is impossible to create CHD with CHDMAN | |
| 861 | 861 | |
| 862 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 863 | ROM_LOAD("317-0567-com.data", 0x00, 0x50, NO_DUMP ) | |
| 862 | ROM_REGION( 0x50, "picreturn", ROMREGION_ERASE) | |
| 863 | ROM_LOAD("317-0567-com.data", 0x00, 0x50, NO_DUMP ) | |
| 864 | 864 | ROM_END |
| 865 | 865 | */ |
| 866 | 866 | |
| r31373 | r31374 | |
| 879 | 879 | ROM_END |
| 880 | 880 | |
| 881 | 881 | /* |
| 882 | ||
| 882 | ||
| 883 | 883 | MK21 Ver.A |
| 884 | 884 | Number on ROM PCB 837-14343R4S0 |
| 885 | 885 | Number on Actel ProAsic 315-6419B |
| 886 | Number on Key Chip (PIC) 235-5509-5128 | |
| 887 | ||
| 888 | */ | |
| 886 | Number on Key Chip (PIC) 235-5509-5128 | |
| 889 | 887 | |
| 888 | */ | |
| 889 | ||
| 890 | 890 | ROM_START( mkartag2 ) |
| 891 | 891 | TRIFORCE_BIOS |
| 892 | 892 | |
| 893 | 893 | ROM_REGION(0x21200000, "rom_board", 0) |
| 894 | ROM_LOAD( "ic9_mx29lv400cttc.bin", 0x00000000, 0x0080000, CRC(2bb9f1fe) SHA1(935511d93a0ab06436b0674bef90c790c100e0b1) ) | |
| 895 | ROM_LOAD( "ic1_k9f1208u0b.bin", 0x01000000, 0x4200000, CRC(e52f17ef) SHA1(1e007d3136cacb89c396b8261e3978956cc21bdd) ) | |
| 896 | ROM_LOAD( "ic2_k9f1208u0b.bin", 0x04200000, 0x4200000, CRC(8a6a2649) SHA1(fd4318e7fb5020c499e06fdb1996b8d40161b674) ) | |
| 897 | ROM_LOAD( "ic3_k9f1208u0b.bin", 0x08400000, 0x4200000, CRC(8fd44a29) SHA1(9392bc4da6541960a83e9c7b3ab4f36bc5564fb7) ) | |
| 898 | ROM_LOAD( "ic4_k9f1208u0b.bin", 0x0c600000, 0x4200000, CRC(ae3fb198) SHA1(c9c0beb9f6875dbf7ce015454a59481524ef3ef6) ) | |
| 899 | ROM_LOAD( "ic5_k9f1208u0b.bin", 0x10800000, 0x4200000, CRC(e9208514) SHA1(ad0ed3e681cd78a61d7ad3af83db20e364bb47fd) ) | |
| 900 | ROM_LOAD( "ic6_k9f1208u0b.bin", 0x14c00000, 0x4200000, CRC(7363697c) SHA1(997c96d0b41774a24a2e0427a703bc295e784187) ) | |
| 901 | ROM_LOAD( "ic7_k9f1208u0b.bin", 0x18e00000, 0x4200000, CRC(407da1d2) SHA1(c185ebd2f3d8654d8fd394c56ac9bfff7e49f125) ) | |
| 902 | ROM_LOAD( "ic8_k9f1208u0b.bin", 0x1d000000, 0x4200000, CRC(9ab76062) SHA1(36a6317c646da5cf682d46ca438ce05e600bc354) ) | |
| 894 | ROM_LOAD( "ic9_mx29lv400cttc.bin", 0x00000000, 0x0080000, CRC(2bb9f1fe) SHA1(935511d93a0ab06436b0674bef90c790c100e0b1) ) | |
| 895 | ROM_LOAD( "ic1_k9f1208u0b.bin", 0x01000000, 0x4200000, CRC(e52f17ef) SHA1(1e007d3136cacb89c396b8261e3978956cc21bdd) ) | |
| 896 | ROM_LOAD( "ic2_k9f1208u0b.bin", 0x04200000, 0x4200000, CRC(8a6a2649) SHA1(fd4318e7fb5020c499e06fdb1996b8d40161b674) ) | |
| 897 | ROM_LOAD( "ic3_k9f1208u0b.bin", 0x08400000, 0x4200000, CRC(8fd44a29) SHA1(9392bc4da6541960a83e9c7b3ab4f36bc5564fb7) ) | |
| 898 | ROM_LOAD( "ic4_k9f1208u0b.bin", 0x0c600000, 0x4200000, CRC(ae3fb198) SHA1(c9c0beb9f6875dbf7ce015454a59481524ef3ef6) ) | |
| 899 | ROM_LOAD( "ic5_k9f1208u0b.bin", 0x10800000, 0x4200000, CRC(e9208514) SHA1(ad0ed3e681cd78a61d7ad3af83db20e364bb47fd) ) | |
| 900 | ROM_LOAD( "ic6_k9f1208u0b.bin", 0x14c00000, 0x4200000, CRC(7363697c) SHA1(997c96d0b41774a24a2e0427a703bc295e784187) ) | |
| 901 | ROM_LOAD( "ic7_k9f1208u0b.bin", 0x18e00000, 0x4200000, CRC(407da1d2) SHA1(c185ebd2f3d8654d8fd394c56ac9bfff7e49f125) ) | |
| 902 | ROM_LOAD( "ic8_k9f1208u0b.bin", 0x1d000000, 0x4200000, CRC(9ab76062) SHA1(36a6317c646da5cf682d46ca438ce05e600bc354) ) | |
| 903 | 903 | ROM_END |
| 904 | 904 | |
| 905 | 905 | ROM_START( mkartag2a ) |
| 906 | 906 | TRIFORCE_BIOS |
| 907 | 907 | |
| 908 | 908 | ROM_REGION(0x21200000, "rom_board", 0) |
| 909 | ROM_LOAD( "ic9_mx29lv400cttc(__alt).bin", 0x00000000, 0x0080000, CRC(ff854fd0) SHA1(0e42aff9a60aacd200b7a29d4d180abdab6a732e) ) | |
| 910 | ROM_LOAD( "ic1_k9f1208u0b(__alt).bin", 0x01000000, 0x4200000, CRC(c5624816) SHA1(d6f2a2ff9e9e14d857a0ec810521c378ba1fabd5) ) | |
| 911 | ROM_LOAD( "ic2_k9f1208u0b(__alt).bin", 0x04200000, 0x4200000, CRC(44e59a1f) SHA1(68a8c1178a33e23446980ec84486bc614f830dad) ) | |
| 912 | ROM_LOAD( "ic3_k9f1208u0b(__alt).bin", 0x08400000, 0x4200000, CRC(6688e7f9) SHA1(7d1e60806c02fd765dd0981e790a698a29050aae) ) | |
| 913 | ROM_LOAD( "ic4_k9f1208u0b(__alt).bin", 0x0c600000, 0x4200000, CRC(e043eac2) SHA1(0108d940a852ff03e919170957f2bca2c1a88a03) ) | |
| 914 | ROM_LOAD( "ic5_k9f1208u0b(__alt).bin", 0x10800000, 0x4200000, CRC(20882926) SHA1(c802de32ca24bf4e9fbabf47fed23a91b3d614ac) ) | |
| 915 | ROM_LOAD( "ic6_k9f1208u0b(__alt).bin", 0x14c00000, 0x4200000, CRC(14171ba4) SHA1(3ddace539cd8a4b53a1ef03238e8404db7dcd85e) ) | |
| 916 | ROM_LOAD( "ic7_k9f1208u0b(__alt).bin", 0x18e00000, 0x4200000, CRC(bd0199df) SHA1(aafb171e9f5a4c8dc2ef55ba344a0eb310c63467) ) | |
| 917 | ROM_LOAD( "ic8_k9f1208u0b(__alt).bin", 0x1d000000, 0x4200000, CRC(8ad6c7ae) SHA1(749b99a944f62aefb895a622c029656c69b3c736) ) | |
| 909 | ROM_LOAD( "ic9_mx29lv400cttc(__alt).bin", 0x00000000, 0x0080000, CRC(ff854fd0) SHA1(0e42aff9a60aacd200b7a29d4d180abdab6a732e) ) | |
| 910 | ROM_LOAD( "ic1_k9f1208u0b(__alt).bin", 0x01000000, 0x4200000, CRC(c5624816) SHA1(d6f2a2ff9e9e14d857a0ec810521c378ba1fabd5) ) | |
| 911 | ROM_LOAD( "ic2_k9f1208u0b(__alt).bin", 0x04200000, 0x4200000, CRC(44e59a1f) SHA1(68a8c1178a33e23446980ec84486bc614f830dad) ) | |
| 912 | ROM_LOAD( "ic3_k9f1208u0b(__alt).bin", 0x08400000, 0x4200000, CRC(6688e7f9) SHA1(7d1e60806c02fd765dd0981e790a698a29050aae) ) | |
| 913 | ROM_LOAD( "ic4_k9f1208u0b(__alt).bin", 0x0c600000, 0x4200000, CRC(e043eac2) SHA1(0108d940a852ff03e919170957f2bca2c1a88a03) ) | |
| 914 | ROM_LOAD( "ic5_k9f1208u0b(__alt).bin", 0x10800000, 0x4200000, CRC(20882926) SHA1(c802de32ca24bf4e9fbabf47fed23a91b3d614ac) ) | |
| 915 | ROM_LOAD( "ic6_k9f1208u0b(__alt).bin", 0x14c00000, 0x4200000, CRC(14171ba4) SHA1(3ddace539cd8a4b53a1ef03238e8404db7dcd85e) ) | |
| 916 | ROM_LOAD( "ic7_k9f1208u0b(__alt).bin", 0x18e00000, 0x4200000, CRC(bd0199df) SHA1(aafb171e9f5a4c8dc2ef55ba344a0eb310c63467) ) | |
| 917 | ROM_LOAD( "ic8_k9f1208u0b(__alt).bin", 0x1d000000, 0x4200000, CRC(8ad6c7ae) SHA1(749b99a944f62aefb895a622c029656c69b3c736) ) | |
| 918 | 918 | ROM_END |
| 919 | 919 | |
| 920 | 920 | /* Main board */ |
| r31373 | r31374 | |
|---|---|---|
| 815 | 815 | |
| 816 | 816 | MCFG_DEVICE_ADD("adc0838", ADC0838, 0) |
| 817 | 817 | MCFG_ADC083X_INPUT_CB(zr107_state, adc0838_callback) |
| 818 | ||
| 818 | ||
| 819 | 819 | MCFG_DEVICE_ADD("konppc", KONPPC, 0) |
| 820 | 820 | MCFG_KONPPC_CGBOARD_NUMBER(1) |
| 821 | 821 | MCFG_KONPPC_CGBOARD_TYPE(CGBOARD_TYPE_ZR107) |
| r31373 | r31374 | |
| 897 | 897 | |
| 898 | 898 | MCFG_DEVICE_ADD("adc0838", ADC0838, 0) |
| 899 | 899 | MCFG_ADC083X_INPUT_CB(zr107_state, adc0838_callback) |
| 900 | ||
| 900 | ||
| 901 | 901 | MCFG_DEVICE_ADD("konppc", KONPPC, 0) |
| 902 | 902 | MCFG_KONPPC_CGBOARD_NUMBER(1) |
| 903 | 903 | MCFG_KONPPC_CGBOARD_TYPE(CGBOARD_TYPE_GTICLUB) |
| r31373 | r31374 | |
|---|---|---|
| 221 | 221 | { |
| 222 | 222 | if (data & 0xf0) |
| 223 | 223 | logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), data); |
| 224 | ||
| 224 | ||
| 225 | 225 | membank("bank1")->set_entry((data & 0x0f) ^ 0x0f); |
| 226 | 226 | } |
| 227 | 227 | |
| r31373 | r31374 | |
| 234 | 234 | MCFG_KONAMICPU_LINE_CB(WRITE8(parodius_state, banking_callback)) |
| 235 | 235 | |
| 236 | 236 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 237 | MCFG_CPU_PROGRAM_MAP(parodius_sound_map) | |
| 237 | MCFG_CPU_PROGRAM_MAP(parodius_sound_map) /* NMIs are triggered by the 053260 */ | |
| 238 | 238 | |
| 239 | 239 | MCFG_DEVICE_ADD("bank0000", ADDRESS_MAP_BANK, 0) |
| 240 | 240 | MCFG_DEVICE_PROGRAM_MAP(bank0000_map) |
| r31373 | r31374 | |
|---|---|---|
| 379 | 379 | |
| 380 | 380 | /* video hardware */ |
| 381 | 381 | MCFG_DEVICE_ADD( "tms9128", TMS9128, XTAL_10_738635MHz / 2 ) /* TMS9128NL on the board */ |
| 382 | ||
| 382 | MCFG_TMS9928A_VRAM_SIZE(0x4000) | |
| 383 | 383 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(re900_state, vdp_interrupt)) |
| 384 | 384 | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 385 | 385 | MCFG_SCREEN_UPDATE_DEVICE( "tms9128", tms9128_device, screen_update ) |
| r31373 | r31374 | |
|---|---|---|
| 278 | 278 | MCFG_SCREEN_UPDATE_DEVICE("maincpu", tms34010_device, tms340x0_ind16) |
| 279 | 279 | MCFG_SCREEN_PALETTE("palette") |
| 280 | 280 | MCFG_VIDEO_START_OVERRIDE(midxunit_state,midxunit) |
| 281 | ||
| 281 | ||
| 282 | 282 | MCFG_DEVICE_ADD("serial_pic", MIDWAY_SERIAL_PIC, 0) |
| 283 | 283 | /* serial prefixes 419, 420 */ |
| 284 | 284 | MCFG_MIDWAY_SERIAL_PIC_UPPER(419); |
| r31373 | r31374 | |
|---|---|---|
| 449 | 449 | UINT32 gpdsp_sgblocks; |
| 450 | 450 | UINT32 gpdsp_address; |
| 451 | 451 | UINT32 epdsp_sgaddress; // encoder processor scatter-gather |
| 452 | UINT32 epdsp_sgblocks; | |
| 452 | UINT32 epdsp_sgblocks; | |
| 453 | 453 | UINT32 unknown_sgaddress; |
| 454 | 454 | UINT32 unknown_sgblocks; |
| 455 | 455 | int voice_number; |
| r31373 | r31374 | |
| 3345 | 3345 | // Vertex program (shader) |
| 3346 | 3346 | if (maddress == 0x1e94) { |
| 3347 | 3347 | /*if (data == 2) |
| 3348 | | |
| 3348 | logerror("Enabled vertex program\n"); | |
| 3349 | 3349 | else if (data == 4) |
| 3350 | | |
| 3350 | logerror("Enabled fixed function pipeline\n"); | |
| 3351 | 3351 | else if (data == 6) |
| 3352 | | |
| 3352 | logerror("Enabled both fixed function pipeline and vertex program ?\n"); | |
| 3353 | 3353 | else |
| 3354 | | |
| 3354 | logerror("Unknown value %d to method 0x1e94\n",data);*/ | |
| 3355 | 3355 | vertex_pipeline = data & 6; |
| 3356 | 3356 | countlen--; |
| 3357 | 3357 | } |
| r31373 | r31374 | |
| 5373 | 5373 | Product Number GDX-0001 |
| 5374 | 5374 | Version V1.004 |
| 5375 | 5375 | Release Date 20021029 |
| 5376 | Manufacturer ID | |
| 5377 | TOC DISC | |
| 5376 | Manufacturer ID | |
| 5377 | TOC DISC | |
| 5378 | 5378 | Track Start Sector End Sector Track Size |
| 5379 | 5379 | track01.bin 150 599 1058400 |
| 5380 | 5380 | track02.raw 750 2101 3179904 |
| r31373 | r31374 | |
| 5405 | 5405 | Product Number GDX-0002B |
| 5406 | 5406 | Version V3.000 |
| 5407 | 5407 | Release Date 20030224 |
| 5408 | Manufacturer ID | |
| 5409 | TOC DISC | |
| 5408 | Manufacturer ID | |
| 5409 | TOC DISC | |
| 5410 | 5410 | Track Start Sector End Sector Track Size |
| 5411 | 5411 | track01.bin 150 599 1058400 |
| 5412 | 5412 | track02.raw 750 2101 3179904 |
| r31373 | r31374 | |
| 5485 | 5485 | Product Number GDX-0006G |
| 5486 | 5486 | Version V8.000 |
| 5487 | 5487 | Release Date 20050202 |
| 5488 | Manufacturer ID | |
| 5489 | TOC DISC | |
| 5488 | Manufacturer ID | |
| 5489 | TOC DISC | |
| 5490 | 5490 | Track Start Sector End Sector Track Size |
| 5491 | 5491 | track01.bin 150 599 1058400 |
| 5492 | track02.raw 750 2101 3179904 | |
| 5493 | track03.bin 45150 549299 1185760800 | |
| 5492 | track02.raw 750 2101 3179904 | |
| 5493 | track03.bin 45150 549299 1185760800 | |
| 5494 | 5494 | */ |
| 5495 | 5495 | ROM_START( mj2 ) |
| 5496 | 5496 | CHIHIRO_BIOS |
| r31373 | r31374 | |
| 5627 | 5627 | Product Number GDX-0024A |
| 5628 | 5628 | Version V2.000 |
| 5629 | 5629 | Release Date 20090331 |
| 5630 | Manufacturer ID | |
| 5631 | TOC DISC | |
| 5630 | Manufacturer ID | |
| 5631 | TOC DISC | |
| 5632 | 5632 | Track Start Sector End Sector Track Size |
| 5633 | 5633 | track01.bin 150 8740 20206032 |
| 5634 | 5634 | track02.raw 8891 10242 3179904 |
| r31373 | r31374 | |
|---|---|---|
| 289 | 289 | ROM_REGION(0x20000, "cpu2", 0) |
| 290 | 290 | ROM_LOAD("u24_v11.bin", 0x0000, 0x2000, CRC(d46212f4) SHA1(50f1279d995b597c468805b323e0252800b28274)) |
| 291 | 291 | ROM_REGION(0x500000, "sound1", 0) |
| 292 | ||
| 292 | ROM_LOAD("u15_v10.bin", 0 , 0x80000, CRC(a77c884c) SHA1(10e7e242876fe197f582f1574ed47c4682b87db5)) | |
| 293 | 293 | ROM_LOAD("u19_v10.bin", 0x100000, 0x80000, CRC(550c1c52) SHA1(f97cceb552a6bffe55c85fc01120ad99d3b7f19b)) |
| 294 | 294 | ROM_LOAD("u30_v10.bin", 0x200000, 0x80000, CRC(44a2edb9) SHA1(c14b00e07cc873ef99ec629fbdeda72e9e69ac47)) |
| 295 | 295 | ROM_LOAD("u32_v10.bin", 0x300000, 0x80000, CRC(73ee0ecc) SHA1(48aed6f76c0b506bd39430c7f1ea8735db99b8e3)) |
| 296 | ROM_LOAD("u34_v10.bin", 0x400000, 0x80000, CRC(cd5ea236) SHA1(dded158bc2f8443d2e69834cde87e81661ca7c53)) | |
| 296 | ROM_LOAD("u34_v10.bin", 0x400000, 0x80000, CRC(cd5ea236) SHA1(dded158bc2f8443d2e69834cde87e81661ca7c53)) | |
| 297 | 297 | ROM_END |
| 298 | 298 | |
| 299 | 299 | GAME(1996, abv106, 0, capcom, capcom, capcom_state, capcom, ROT0, "Capcom", "Airborne", GAME_IS_SKELETON_MECHANICAL) |
| r31373 | r31374 | |
|---|---|---|
| 3889 | 3889 | |
| 3890 | 3890 | ROM_REGION( 0x2000, "maincpu:key", 0 ) // decryption key |
| 3891 | 3891 | // reconstructed key; some of the RNG-independent bits could be incorrect |
| 3892 | ||
| 3892 | ROM_LOAD( "317-0065.key", 0x0000, 0x2000, BAD_DUMP CRC(9e0f619d) SHA1(b0392e84d1c9af681dc9bb2ca3636e7cc41a605b) ) | |
| 3893 | 3893 | |
| 3894 | 3894 | ROM_REGION( 0x60000, "gfx1", 0 ) // tiles |
| 3895 | 3895 | ROM_LOAD( "opr-11674.a14", 0x00000, 0x20000, CRC(a57a66d5) SHA1(5103583d48997abad12a0c5fee26431c486ced52) ) |
| r31373 | r31374 | |
|---|---|---|
| 741 | 741 | MCFG_ISA_OUT_DRQ1_CB(DEVWRITELINE("dma8237_1", am9517a_device, dreq1_w)) |
| 742 | 742 | MCFG_ISA_OUT_DRQ2_CB(DEVWRITELINE("dma8237_1", am9517a_device, dreq2_w)) |
| 743 | 743 | MCFG_ISA_OUT_DRQ3_CB(DEVWRITELINE("dma8237_1", am9517a_device, dreq3_w)) |
| 744 | ||
| 744 | ||
| 745 | 745 | /*Sound Hardware*/ |
| 746 | 746 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 747 | 747 |
| r31373 | r31374 | |
|---|---|---|
| 1161 | 1161 | ROM_LOAD( "c.bin", 0xe400, 0x0400, CRC(0101ab24) SHA1(90e99001ef6890fbc76b4f58cc54df12dfa79e2e) ) |
| 1162 | 1162 | ROM_LOAD( "b(__acombat3).bin", 0xe800, 0x0400, CRC(4b847950) SHA1(49de63ac72dff22b962fc7b8d7b1c97939072b4a) ) // b.bin |
| 1163 | 1163 | ROM_LOAD( "a(__acombat3).bin", 0xec00, 0x0400, CRC(7eb7969b) SHA1(1aaf7af67b544d01a66a1f3d0eda8d42d2c5bb5d) ) // a.bin |
| 1164 | ||
| 1164 | ROM_LOAD( "j.bin", 0xf000, 0x0400, CRC(a7e2b47e) SHA1(97eda53dfc7f1914f7df36c13747d1d824b62734) ) | |
| 1165 | 1165 | ROM_LOAD( "h.bin", 0xf400, 0x0400, CRC(261ca943) SHA1(17136843f74d2236a5f81f2261b166c02dde138d) ) |
| 1166 | 1166 | ROM_LOAD( "f.bin", 0xf800, 0x0400, CRC(6ce39b64) SHA1(ba99ddc2d1208afd3f27a9749dac1faca645bbdc) ) |
| 1167 | 1167 | ROM_LOAD( "e.bin", 0xfc00, 0x0400, CRC(2acae469) SHA1(80019bc645a9919f9ec455452ea3e588d61a563f) ) |
| r31373 | r31374 | |
|---|---|---|
| 123 | 123 | AM_RANGE(0x5000, 0x50ff) AM_MIRROR(0x0700) AM_RAM AM_SHARE("objectram") |
| 124 | 124 | AM_RANGE(0x6800, 0x6807) AM_MIRROR(0x07f8) AM_WRITE(video_ctrl_w) |
| 125 | 125 | AM_RANGE(0x7000, 0x77ff) AM_READNOP //AFR - looks like a watchdog |
| 126 | AM_RANGE(0x8100, 0x8103) AM_MIRROR(0x7efc) AM_DEVREADWRITE("ppi", i8255_device, read, write) | |
| 126 | AM_RANGE(0x8100, 0x8103) AM_MIRROR(0x7efc) AM_DEVREADWRITE("ppi", i8255_device, read, write) | |
| 127 | 127 | ADDRESS_MAP_END |
| 128 | 128 | |
| 129 | 129 | static ADDRESS_MAP_START( audio1_map, AS_PROGRAM, 8, mrgame_state ) |
| r31373 | r31374 | |
| 373 | 373 | const UINT8 *color_prom = machine().root_device().memregion("proms")->base(); |
| 374 | 374 | |
| 375 | 375 | /* compute the color output resistor weights */ |
| 376 | compute_resistor_weights(0, | |
| 376 | compute_resistor_weights(0, 255, -1.0, | |
| 377 | 377 | 3, &resistances[0], rweights, 0, 0, |
| 378 | 378 | 3, &resistances[0], gweights, 0, 0, |
| 379 | 379 | 2, &resistances[1], bweights, 0, 0); |
| r31373 | r31374 | |
|---|---|---|
| 1327 | 1327 | MCFG_CPU_ADD("maincpu", V70, 20000000) // 20MHz |
| 1328 | 1328 | MCFG_CPU_PROGRAM_MAP(bnstars_map) |
| 1329 | 1329 | MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(ms32_state,irq_callback) |
| 1330 | ||
| 1331 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bnstars_state, ms32_interrupt, "lscreen", 0, 1) | |
| 1332 | 1330 | |
| 1331 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", bnstars_state, ms32_interrupt, "lscreen", 0, 1) | |
| 1332 | ||
| 1333 | 1333 | MCFG_CPU_ADD("audiocpu", Z80, 4000000) |
| 1334 | 1334 | MCFG_CPU_PROGRAM_MAP(bnstars_sound_map) |
| 1335 | 1335 |
| r31373 | r31374 | |
|---|---|---|
| 1735 | 1735 | /* basic machine hardware */ |
| 1736 | 1736 | MCFG_CPU_MODIFY("maincpu") |
| 1737 | 1737 | MCFG_CPU_PROGRAM_MAP(williams2_d000_rom_map) |
| 1738 | ||
| 1738 | ||
| 1739 | 1739 | MCFG_WILLIAMS_CVSD_SOUND_ADD("cvsd") |
| 1740 | 1740 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1741 | 1741 |
| r31373 | r31374 | |
|---|---|---|
| 241 | 241 | } |
| 242 | 242 | else |
| 243 | 243 | m_maincpu->space(AS_PROGRAM).install_readwrite_bank(0x0000, 0x03ff, "bank1"); /* RAM */ |
| 244 | ||
| 244 | ||
| 245 | 245 | /* bit 6 = enable char ROM reading through the video RAM */ |
| 246 | 246 | m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 247 | 247 | |
| r31373 | r31374 | |
| 314 | 314 | ROM_LOAD32_WORD( "821k06.k13", 0x000000, 0x040000, CRC(a1eadb24) SHA1(ca305b904b34e03918ad07281fda86ad63caa44f) ) |
| 315 | 315 | ROM_LOAD32_WORD( "821k07.k19", 0x000002, 0x040000, CRC(060019fa) SHA1(c3bca007aaa5f1c534d2a75fe4f96d01a740dd58) ) |
| 316 | 316 | |
| 317 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 317 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 318 | 318 | ROM_LOAD32_WORD( "821k04.k2", 0x000000, 0x080000, CRC(00e0291b) SHA1(39d5db6cf36826e47cdf5308eff9bfa8afc82050) ) |
| 319 | 319 | ROM_LOAD32_WORD( "821k05.k8", 0x000002, 0x080000, CRC(e09ea05d) SHA1(50ac9a2117ce63fe774c48d769ec445a83f1269e) ) |
| 320 | 320 | |
| r31373 | r31374 | |
| 337 | 337 | ROM_LOAD32_WORD( "821k06.k13", 0x000000, 0x040000, CRC(a1eadb24) SHA1(ca305b904b34e03918ad07281fda86ad63caa44f) ) |
| 338 | 338 | ROM_LOAD32_WORD( "821k07.k19", 0x000002, 0x040000, CRC(060019fa) SHA1(c3bca007aaa5f1c534d2a75fe4f96d01a740dd58) ) |
| 339 | 339 | |
| 340 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 340 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 341 | 341 | ROM_LOAD32_WORD( "821k04.k2", 0x000000, 0x080000, CRC(00e0291b) SHA1(39d5db6cf36826e47cdf5308eff9bfa8afc82050) ) /* sprites */ |
| 342 | 342 | ROM_LOAD32_WORD( "821k05.k8", 0x000002, 0x080000, CRC(e09ea05d) SHA1(50ac9a2117ce63fe774c48d769ec445a83f1269e) ) |
| 343 | 343 | |
| r31373 | r31374 | |
| 360 | 360 | ROM_LOAD32_WORD( "821k06.k13", 0x000000, 0x040000, CRC(a1eadb24) SHA1(ca305b904b34e03918ad07281fda86ad63caa44f) ) |
| 361 | 361 | ROM_LOAD32_WORD( "821k07.k19", 0x000002, 0x040000, CRC(060019fa) SHA1(c3bca007aaa5f1c534d2a75fe4f96d01a740dd58) ) |
| 362 | 362 | |
| 363 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 363 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 364 | 364 | ROM_LOAD32_WORD( "821k04.k2", 0x000000, 0x080000, CRC(00e0291b) SHA1(39d5db6cf36826e47cdf5308eff9bfa8afc82050) ) /* sprites */ |
| 365 | 365 | ROM_LOAD32_WORD( "821k05.k8", 0x000002, 0x080000, CRC(e09ea05d) SHA1(50ac9a2117ce63fe774c48d769ec445a83f1269e) ) |
| 366 | 366 |
| r31373 | r31374 | |
|---|---|---|
| 6 | 6 | |
| 7 | 7 | Typical Taito mid-80s hardware but with dual video outputs. |
| 8 | 8 | |
| 9 | Sound board: Z80, 2 x YM2149, OKI M5232 | |
| 10 | CPU board: Z80, ROM and RAM, 68705P5 MCU (protected) | |
| 11 | OBJ board: ROMs and RAM | |
| 12 | Video board: ROMs and RAM, 4 x Fujitsu MB112S146 (also used on arkanoid, lkage) | |
| 9 | Sound board: Z80, 2 x YM2149, OKI M5232 | |
| 10 | CPU board: Z80, ROM and RAM, 68705P5 MCU (protected) | |
| 11 | OBJ board: ROMs and RAM | |
| 12 | Video board: ROMs and RAM, 4 x Fujitsu MB112S146 (also used on arkanoid, lkage) | |
| 13 | 13 | |
| 14 | 14 | The rest is just common logic, there's no custom chips. |
| 15 | 15 | |
| r31373 | r31374 | |
| 99 | 99 | |
| 100 | 100 | Video |
| 101 | 101 | |
| 102 | ||
| 102 | Note: if MAME_DEBUG is defined, pressing Z with: | |
| 103 | 103 | |
| 104 | Q Shows the background tilemap | |
| 105 | W Shows the foreground tilemap | |
| 106 | A Shows the background sprites | |
| 107 | S Shows the foreground sprites | |
| 104 | Q Shows the background tilemap | |
| 105 | W Shows the foreground tilemap | |
| 106 | A Shows the background sprites | |
| 107 | S Shows the foreground sprites | |
| 108 | 108 | |
| 109 | ||
| 109 | Keys can be used together! | |
| 110 | 110 | |
| 111 | 111 | ***************************************************************************/ |
| 112 | 112 | |
| r31373 | r31374 | |
| 191 | 191 | int sx, sy, code, color; |
| 192 | 192 | |
| 193 | 193 | sx = sprram[offs + 3] - ((sprram[offs + 2] & 0x80) << 1); |
| 194 | sy = 256 - 8 - sprram[offs + 0] - 23; | |
| 194 | sy = 256 - 8 - sprram[offs + 0] - 23; // center player sprite: 256 - 8 - 0x71 + dy = 256/2-32/2 -> dy = -23 | |
| 195 | 195 | |
| 196 | int flipx = sprram[offs + 2] & 0x40; | |
| 196 | int flipx = sprram[offs + 2] & 0x40; // maybe | |
| 197 | 197 | int flipy = sprram[offs + 1] & 0x80; |
| 198 | 198 | |
| 199 | 199 | if (flip_screen_x()) |
| r31373 | r31374 | |
| 262 | 262 | bitmap.fill(0, cliprect); |
| 263 | 263 | |
| 264 | 264 | // background monitor |
| 265 | if (layers_ctrl & 1) m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); | |
| 266 | if (layers_ctrl & 4) draw_sprites(bitmap, cliprect, false); | |
| 265 | if (layers_ctrl & 1) m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0); | |
| 266 | if (layers_ctrl & 4) draw_sprites(bitmap, cliprect, false); | |
| 267 | 267 | |
| 268 | 268 | // foreground monitor |
| 269 | if (layers_ctrl & 8) draw_sprites(bitmap, cliprect, true); | |
| 270 | if (layers_ctrl & 2) m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); | |
| 269 | if (layers_ctrl & 8) draw_sprites(bitmap, cliprect, true); | |
| 270 | if (layers_ctrl & 2) m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0); | |
| 271 | 271 | |
| 272 | 272 | return 0; |
| 273 | 273 | } |
| r31373 | r31374 | |
| 283 | 283 | int result = 0; |
| 284 | 284 | |
| 285 | 285 | if ((m_mcu_val & 0x73) == 0x73) |
| 286 | result = 0x42; | |
| 286 | result = 0x42; // at boot | |
| 287 | 287 | |
| 288 | 288 | return result; |
| 289 | 289 | } |
| r31373 | r31374 | |
| 404 | 404 | |
| 405 | 405 | AM_RANGE(0xd800, 0xdbff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 406 | 406 | |
| 407 | AM_RANGE(0xdc00, 0xdc00) AM_WRITENOP | |
| 407 | AM_RANGE(0xdc00, 0xdc00) AM_WRITENOP // irq ack? | |
| 408 | 408 | ADDRESS_MAP_END |
| 409 | 409 | |
| 410 | 410 | static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, wyvernf0_state ) |
| r31373 | r31374 | |
| 431 | 431 | ***************************************************************************/ |
| 432 | 432 | |
| 433 | 433 | static INPUT_PORTS_START( wyvernf0 ) |
| 434 | PORT_START("DSW1") | |
| 434 | PORT_START("DSW1") // d600 -> 800c | |
| 435 | 435 | PORT_DIPNAME( 0x03, 0x03, DEF_STR( Bonus_Life ) ) |
| 436 | 436 | PORT_DIPSETTING( 0x00, "?? 0" ) |
| 437 | 437 | PORT_DIPSETTING( 0x01, "?? 1" ) |
| r31373 | r31374 | |
| 453 | 453 | PORT_DIPSETTING( 0x00, DEF_STR( Upright ) ) |
| 454 | 454 | PORT_DIPSETTING( 0x80, DEF_STR( Cocktail ) ) |
| 455 | 455 | |
| 456 | PORT_START("DSW2") | |
| 456 | PORT_START("DSW2") // d601 -> 800d | |
| 457 | 457 | PORT_DIPNAME( 0x0f, 0x00, DEF_STR( Coin_A ) ) |
| 458 | 458 | PORT_DIPSETTING( 0x0f, DEF_STR( 9C_1C ) ) |
| 459 | 459 | PORT_DIPSETTING( 0x0e, DEF_STR( 8C_1C ) ) |
| r31373 | r31374 | |
| 489 | 489 | PORT_DIPSETTING( 0x60, DEF_STR( 1C_7C ) ) |
| 490 | 490 | PORT_DIPSETTING( 0x70, DEF_STR( 1C_8C ) ) |
| 491 | 491 | |
| 492 | PORT_START("DSW3") | |
| 492 | PORT_START("DSW3") // d602 -> 800e | |
| 493 | 493 | PORT_DIPNAME( 0x03, 0x00, DEF_STR( Unknown ) ) |
| 494 | 494 | PORT_DIPSETTING( 0x00, "0" ) |
| 495 | 495 | PORT_DIPSETTING( 0x01, "1" ) |
| 496 | 496 | PORT_DIPSETTING( 0x02, "2" ) |
| 497 | 497 | PORT_DIPSETTING( 0x03, "3" ) |
| 498 | PORT_DIPUNKNOWN( 0x04, 0x04 ) | |
| 498 | PORT_DIPUNKNOWN( 0x04, 0x04 ) // * | |
| 499 | 499 | PORT_DIPNAME( 0x08, 0x00, DEF_STR( Demo_Sounds ) ) /* Music at every other title screen */ |
| 500 | 500 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 501 | 501 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| r31373 | r31374 | |
| 512 | 512 | PORT_DIPSETTING( 0x00, "1" ) |
| 513 | 513 | PORT_DIPSETTING( 0x80, "2" ) |
| 514 | 514 | |
| 515 | PORT_START("SYSTEM") | |
| 515 | PORT_START("SYSTEM") // d603 -> 800f / 8023 | |
| 516 | 516 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_START1 ) |
| 517 | 517 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_START2 ) |
| 518 | 518 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_SERVICE1 ) |
| r31373 | r31374 | |
| 522 | 522 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 523 | 523 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 524 | 524 | |
| 525 | PORT_START("JOY1") | |
| 525 | PORT_START("JOY1") // d604 -> 8010 / 8024 | |
| 526 | 526 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 527 | 527 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 528 | 528 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(1) |
| r31373 | r31374 | |
| 532 | 532 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 533 | 533 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 534 | 534 | |
| 535 | PORT_START("FIRE1") | |
| 535 | PORT_START("FIRE1") // d605 -> 8011 / 8025 | |
| 536 | 536 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 537 | 537 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 538 | 538 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| r31373 | r31374 | |
| 542 | 542 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 543 | 543 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 544 | 544 | |
| 545 | PORT_START("JOY2") | |
| 545 | PORT_START("JOY2") // d606 -> 8012 / 8026 | |
| 546 | 546 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 547 | 547 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 548 | 548 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_JOYSTICK_LEFT ) PORT_PLAYER(2) |
| r31373 | r31374 | |
| 552 | 552 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 553 | 553 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 554 | 554 | |
| 555 | PORT_START("FIRE2") | |
| 555 | PORT_START("FIRE2") // d607 -> 8013 / 8027 | |
| 556 | 556 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 557 | 557 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| 558 | 558 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_UNKNOWN ) |
| r31373 | r31374 | |
| 633 | 633 | MCFG_CPU_PROGRAM_MAP(sound_map) |
| 634 | 634 | MCFG_CPU_PERIODIC_INT_DRIVER(wyvernf0_state, irq0_line_hold, 60*2) // IRQ generated by ??? (drives music tempo), NMI by main cpu |
| 635 | 635 | |
| 636 | // MCFG_CPU_ADD("mcu", M68705, 4000000) // ? | |
| 637 | // MCFG_CPU_PROGRAM_MAP(mcu_map) | |
| 636 | // MCFG_CPU_ADD("mcu", M68705, 4000000) // ? | |
| 637 | // MCFG_CPU_PROGRAM_MAP(mcu_map) | |
| 638 | 638 | |
| 639 | // | |
| 639 | // MCFG_QUANTUM_TIME(attotime::from_hz(6000)) // 100 CPU slices per second to synchronize between the MCU and the main CPU | |
| 640 | 640 | |
| 641 | 641 | MCFG_MACHINE_START_OVERRIDE(wyvernf0_state,wyvernf0) |
| 642 | 642 | MCFG_MACHINE_RESET_OVERRIDE(wyvernf0_state,wyvernf0) |
| r31373 | r31374 | |
| 669 | 669 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.5) |
| 670 | 670 | |
| 671 | 671 | // music |
| 672 | MCFG_SOUND_ADD("msm", MSM5232, 2000000) | |
| 672 | MCFG_SOUND_ADD("msm", MSM5232, 2000000) // ? | |
| 673 | 673 | MCFG_MSM5232_SET_CAPACITORS(0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6, 0.39e-6) /* default 0.39 uF capacitors (not verified) */ |
| 674 | 674 | MCFG_SOUND_ROUTE(0, "mono", 1.0) // pin 28 2'-1 |
| 675 | 675 | MCFG_SOUND_ROUTE(1, "mono", 1.0) // pin 29 4'-1 |
| r31373 | r31374 | |
|---|---|---|
| 1465 | 1465 | |
| 1466 | 1466 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 1467 | 1467 | |
| 1468 | // Each 82C255 behaves like 2x 8255 (in mode 0). Since MAME doesn't support it yet, I replaced | |
| 1468 | // Each 82C255 behaves like 2x 8255 (in mode 0). Since MAME doesn't support it yet, I replaced | |
| 1469 | 1469 | // both 82C255 with 4x 8255... |
| 1470 | 1470 | MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) |
| 1471 | 1471 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) |
| r31373 | r31374 | |
|---|---|---|
| 600 | 600 | UINT8 *src = memregion("audiocpu")->base(); |
| 601 | 601 | int len = 0x8000; |
| 602 | 602 | dynamic_buffer buffer(len); |
| 603 | ||
| 603 | ||
| 604 | 604 | for (int i = 0; i < len; i++) |
| 605 | 605 | { |
| 606 | 606 | int addr; |
| 607 | ||
| 607 | ||
| 608 | 608 | addr = BITSWAP16(i, 15,14,13,12,11,10,9,8, 3,4,5,6, 7,2,1,0); |
| 609 | 609 | buffer[i] = src[addr]; |
| 610 | 610 |
| r31373 | r31374 | |
|---|---|---|
| 821 | 821 | INPUT_PORTS_END |
| 822 | 822 | |
| 823 | 823 | static INPUT_PORTS_START( supnudg2 ) /* need to find the button 'B' to be playable */ |
| 824 | ||
| 824 | PORT_INCLUDE ( trailblz ) | |
| 825 | 825 | |
| 826 | 826 | PORT_MODIFY("PIA0.A") |
| 827 | 827 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_NAME("1 Pound (5 credits)") // coin x 5 |
| r31373 | r31374 | |
|---|---|---|
| 512 | 512 | UINT8 vdisp; |
| 513 | 513 | vdisp = m_screen->vpos() < 256; |
| 514 | 514 | |
| 515 | ||
| 515 | return (m_pcab_vregs[offset] & 0xff7f) | vdisp<<7; //TODO | |
| 516 | 516 | } |
| 517 | 517 | } |
| 518 | 518 |
| r31373 | r31374 | |
|---|---|---|
| 148 | 148 | & ioport("KEY3")->read() & ioport("KEY4")->read()); |
| 149 | 149 | break; |
| 150 | 150 | } |
| 151 | ||
| 151 | ||
| 152 | 152 | return 0xff; |
| 153 | 153 | } |
| 154 | 154 | |
| r31373 | r31374 | |
| 2796 | 2796 | MCFG_TMPZ84C011_PORTB_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_dac1_w)) \ |
| 2797 | 2797 | MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_dac2_w)) \ |
| 2798 | 2798 | MCFG_TMPZ84C011_PORTD_READ_CB(READ8(nbmj9195_state, soundcpu_portd_r)) \ |
| 2799 | MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porte_w)) \ | |
| 2800 | ||
| 2799 | MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porte_w)) | |
| 2801 | 2800 | #define MSCOUTM_TMZ84C011_SOUND_PORTS \ |
| 2802 | 2801 | MCFG_TMPZ84C011_PORTA_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_porta_w)) \ |
| 2803 | 2802 | MCFG_TMPZ84C011_PORTB_WRITE_CB(WRITE8(nbmj9195_state, soundcpu_dac2_w)) \ |
| r31373 | r31374 | |
| 2812 | 2811 | MCFG_TMPZ84C011_PORTB_READ_CB(READ8(nbmj9195_state, mscoutm_cpu_portb_r)) \ |
| 2813 | 2812 | MCFG_TMPZ84C011_PORTC_READ_CB(READ8(nbmj9195_state, mscoutm_cpu_portc_r)) \ |
| 2814 | 2813 | MCFG_TMPZ84C011_PORTD_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_cpu_portd_w)) \ |
| 2815 | MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_cpu_porte_w)) | |
| 2814 | MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, mscoutm_cpu_porte_w)) | |
| 2816 | 2815 | |
| 2817 | ||
| 2818 | 2816 | #define OTHERS_TMZ84C011_MAIN_PORTS \ |
| 2819 | 2817 | MCFG_TMPZ84C011_PORTA_READ_CB(READ8(nbmj9195_state, others_cpu_porta_r)) \ |
| 2820 | 2818 | MCFG_TMPZ84C011_PORTB_READ_CB(READ8(nbmj9195_state, others_cpu_portb_r)) \ |
| 2821 | 2819 | MCFG_TMPZ84C011_PORTC_READ_CB(READ8(nbmj9195_state, others_cpu_portc_r)) \ |
| 2822 | 2820 | MCFG_TMPZ84C011_PORTC_WRITE_CB(WRITE8(nbmj9195_state, others_cpu_portc_w)) \ |
| 2823 | 2821 | MCFG_TMPZ84C011_PORTD_WRITE_CB(WRITE8(nbmj9195_state, others_cpu_portd_w)) \ |
| 2824 | MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, others_cpu_porte_w)) | |
| 2822 | MCFG_TMPZ84C011_PORTE_WRITE_CB(WRITE8(nbmj9195_state, others_cpu_porte_w)) | |
| 2825 | 2823 | |
| 2826 | ||
| 2827 | 2824 | static MACHINE_CONFIG_START( NBMJDRV1_base, nbmj9195_state ) |
| 2828 | 2825 | |
| 2829 | 2826 | /* basic machine hardware */ |
| r31373 | r31374 | |
|---|---|---|
| 491 | 491 | PORT_BIT( 0xff, 0x7f, IPT_AD_STICK_X ) PORT_SENSITIVITY(25) PORT_KEYDELTA(15) PORT_PLAYER(1) |
| 492 | 492 | |
| 493 | 493 | PORT_START("DSW") /* Verified by Manual & in Game service menu */ |
| 494 | PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Game_Time ) ) | |
| 494 | PORT_DIPNAME( 0x0003, 0x0000, DEF_STR( Game_Time ) ) PORT_DIPLOCATION("SW-1:1,2") | |
| 495 | 495 | PORT_DIPSETTING( 0x0003, "Shortest" ) |
| 496 | 496 | PORT_DIPSETTING( 0x0002, "Short" ) |
| 497 | 497 | PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) |
| 498 | 498 | PORT_DIPSETTING( 0x0001, "Long" ) |
| 499 | PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) | |
| 499 | PORT_DIPNAME( 0x000c, 0x0000, DEF_STR( Difficulty ) ) PORT_DIPLOCATION("SW-1:3,4") | |
| 500 | 500 | PORT_DIPSETTING( 0x0004, DEF_STR( Easy ) ) |
| 501 | 501 | PORT_DIPSETTING( 0x0000, DEF_STR( Medium ) ) |
| 502 | 502 | PORT_DIPSETTING( 0x0008, DEF_STR( Hard ) ) |
| 503 | 503 | PORT_DIPSETTING( 0x000c, DEF_STR( Hardest ) ) |
| 504 | PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) | |
| 504 | PORT_DIPNAME( 0x0010, 0x0000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("SW-1:5") | |
| 505 | 505 | PORT_DIPSETTING( 0x0010, DEF_STR( Off ) ) |
| 506 | 506 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 507 | PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Language ) ) | |
| 507 | PORT_DIPNAME( 0x0020, 0x0000, DEF_STR( Language ) ) PORT_DIPLOCATION("SW-1:6") | |
| 508 | 508 | PORT_DIPSETTING( 0x0020, DEF_STR( Japanese ) ) |
| 509 | 509 | PORT_DIPSETTING( 0x0000, DEF_STR( English ) ) |
| 510 | PORT_DIPNAME( 0x0040, 0x0000, "Stage 5 Continue" ) | |
| 510 | PORT_DIPNAME( 0x0040, 0x0000, "Stage 5 Continue" ) PORT_DIPLOCATION("SW-1:7") | |
| 511 | 511 | PORT_DIPSETTING( 0x0040, DEF_STR( Off ) ) |
| 512 | 512 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 513 | PORT_DIPNAME( 0x0080, 0x0000, "Output Mode" ) | |
| 513 | PORT_DIPNAME( 0x0080, 0x0000, "Output Mode" ) PORT_DIPLOCATION("SW-1:8") | |
| 514 | 514 | PORT_DIPSETTING( 0x0000, "A (Light)" ) |
| 515 | 515 | PORT_DIPSETTING( 0x0080, "B (Vibration)" ) |
| 516 | PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coin_A ) ) | |
| 516 | PORT_DIPNAME( 0x0700, 0x0000, DEF_STR( Coin_A ) ) PORT_DIPLOCATION("SW-2:1,2,3") | |
| 517 | 517 | PORT_DIPSETTING( 0x0600, DEF_STR( 6C_1C ) ) |
| 518 | 518 | PORT_DIPSETTING( 0x0500, DEF_STR( 5C_1C ) ) |
| 519 | 519 | PORT_DIPSETTING( 0x0400, DEF_STR( 4C_1C ) ) |
| r31373 | r31374 | |
| 522 | 522 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) |
| 523 | 523 | PORT_DIPSETTING( 0x0100, DEF_STR( 1C_2C ) ) |
| 524 | 524 | PORT_DIPSETTING( 0x0700, DEF_STR( Free_Play ) ) |
| 525 | PORT_DIPNAME( 0x3800, 0x0000, DEF_STR( Coin_B ) ) | |
| 525 | PORT_DIPNAME( 0x3800, 0x0000, DEF_STR( Coin_B ) ) PORT_DIPLOCATION("SW-2:4,5,6") | |
| 526 | 526 | PORT_DIPSETTING( 0x0000, DEF_STR( 1C_1C ) ) |
| 527 | 527 | PORT_DIPSETTING( 0x0800, DEF_STR( 1C_2C ) ) |
| 528 | 528 | PORT_DIPSETTING( 0x1000, DEF_STR( 1C_3C ) ) |
| r31373 | r31374 | |
| 531 | 531 | PORT_DIPSETTING( 0x2800, DEF_STR( 1C_6C ) ) |
| 532 | 532 | PORT_DIPSETTING( 0x3000, DEF_STR( 1C_7C ) ) |
| 533 | 533 | PORT_DIPSETTING( 0x3800, DEF_STR( Free_Play ) ) |
| 534 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) | |
| 534 | PORT_DIPNAME( 0x4000, 0x0000, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW-2:7") /* Manual only shows nothing for this one */ | |
| 535 | 535 | PORT_DIPSETTING( 0x4000, DEF_STR( Off ) ) |
| 536 | 536 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 537 | PORT_DIPNAME( 0x8000, 0x8000, "Hardware Test Mode" ) | |
| 537 | PORT_DIPNAME( 0x8000, 0x8000, "Hardware Test Mode" ) PORT_DIPLOCATION("SW-2:8") /* Manual only shows nothing for this one */ | |
| 538 | 538 | PORT_DIPSETTING( 0x8000, DEF_STR( Off ) ) |
| 539 | 539 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 540 | 540 | INPUT_PORTS_END |
| r31373 | r31374 | |
|---|---|---|
| 60 | 60 | DECLARE_READ16_MEMBER(test_r); |
| 61 | 61 | DECLARE_READ8_MEMBER(csplayh5_sound_r); |
| 62 | 62 | DECLARE_WRITE8_MEMBER(csplayh5_soundclr_w); |
| 63 | ||
| 63 | ||
| 64 | 64 | DECLARE_READ8_MEMBER(soundcpu_portd_r); |
| 65 | 65 | DECLARE_WRITE8_MEMBER(soundcpu_porta_w); |
| 66 | 66 | DECLARE_WRITE8_MEMBER(soundcpu_dac2_w); |
| r31373 | r31374 | |
| 460 | 460 | MCFG_CPU_ADD("maincpu",M68000,16000000) /* TMP68301-16 */ |
| 461 | 461 | MCFG_CPU_PROGRAM_MAP(csplayh5_map) |
| 462 | 462 | MCFG_CPU_IRQ_ACKNOWLEDGE_DEVICE("tmp68301",tmp68301_device,irq_callback) |
| 463 | ||
| 463 | ||
| 464 | 464 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", csplayh5_state, csplayh5_irq, "screen", 0, 1) |
| 465 | 465 | |
| 466 | 466 | MCFG_DEVICE_ADD("tmp68301", TMP68301, 0) |
| r31373 | r31374 | |
|---|---|---|
| 84 | 84 | |
| 85 | 85 | SOLVER(Solver, 48000) |
| 86 | 86 | ANALOG_INPUT(V5, 5) |
| 87 | PARAM(Solver.ACCURACY, 1e-6) | |
| 88 | PARAM(Solver.GS_LOOPS, 6) | |
| 89 | PARAM(Solver.SOR_FACTOR, 1.0) | |
| 90 | //PARAM(Solver.DYNAMIC_TS, 1) | |
| 91 | //PARAM(Solver.LTE, 5e-8) | |
| 87 | PARAM(Solver.ACCURACY, 1e-6) | |
| 88 | PARAM(Solver.GS_LOOPS, 6) | |
| 89 | PARAM(Solver.SOR_FACTOR, 1.0) | |
| 90 | //PARAM(Solver.DYNAMIC_TS, 1) | |
| 91 | //PARAM(Solver.LTE, 5e-8) | |
| 92 | 92 | |
| 93 | 93 | /* AY 8910 internal resistors */ |
| 94 | 94 | |
| r31373 | r31374 | |
| 143 | 143 | |
| 144 | 144 | NET_C(CC6.1, VR.2) |
| 145 | 145 | NET_C(CC6.2, R1.1) |
| 146 | CAP(CC3, 220e-6) | |
| 147 | NET_C(R1.2, CC3.1) | |
| 148 | NET_C(CC3.2, GND) | |
| 146 | CAP(CC3, 220e-6) | |
| 147 | NET_C(R1.2, CC3.1) | |
| 148 | NET_C(CC3.2, GND) | |
| 149 | 149 | |
| 150 | 150 | NETLIST_END() |
| 151 | 151 | |
| r31373 | r31374 | |
| 556 | 556 | |
| 557 | 557 | MCFG_SOUND_ADD("ay1", AY8910, AUDIO_CLOCK) /* 1.5 MHz */ |
| 558 | 558 | MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT) |
| 559 | MCFG_AY8910_RES_LOADS(10000.0, 10000.0, 10000.0) | |
| 560 | ||
| 559 | MCFG_AY8910_RES_LOADS(10000.0, 10000.0, 10000.0) | |
| 560 | ||
| 561 | 561 | MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0) |
| 562 | 562 | MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 1) |
| 563 | 563 | MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 2) |
| 564 | 564 | |
| 565 | 565 | MCFG_SOUND_ADD("ay2", AY8910, AUDIO_CLOCK) /* 1.5 MHz */ |
| 566 | 566 | MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT) |
| 567 | MCFG_AY8910_RES_LOADS(10000.0, 10000.0, 10000.0) | |
| 568 | ||
| 567 | MCFG_AY8910_RES_LOADS(10000.0, 10000.0, 10000.0) | |
| 568 | ||
| 569 | 569 | MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 3) |
| 570 | 570 | MCFG_SOUND_ROUTE_EX(1, "snd_nl", 1.0, 4) |
| 571 | 571 | MCFG_SOUND_ROUTE_EX(2, "snd_nl", 1.0, 5) |
| 572 | 572 | |
| 573 | 573 | /* NETLIST configuration using internal AY8910 resistor values */ |
| 574 | 574 | |
| 575 | ||
| 575 | /* Minimize resampling between ay8910 and netlist */ | |
| 576 | 576 | MCFG_SOUND_ADD("snd_nl", NETLIST_SOUND, AUDIO_CLOCK / 8 / 2) |
| 577 | 577 | MCFG_NETLIST_SETUP(nl_1942) |
| 578 | 578 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 5.0) |
| r31373 | r31374 | |
| 921 | 921 | GAME( 1984, 1942, 0, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "1942 (Revision B)", GAME_SUPPORTS_SAVE ) |
| 922 | 922 | GAME( 1984, 1942a, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "1942 (Revision A)", GAME_SUPPORTS_SAVE ) |
| 923 | 923 | GAME( 1984, 1942abl, 1942, 1942, 1942, _1942_state, 1942, ROT270, "bootleg", "1942 (Revision A, bootleg)", GAME_SUPPORTS_SAVE ) // data is the same as 1942a set, different rom format |
| 924 | GAME( 198?, 1942h, 1942, 1942, 1942, _1942_state, 1942, ROT270, "hack (Two Bit Score?)", "42", GAME_SUPPORTS_SAVE ) | |
| 924 | GAME( 198?, 1942h, 1942, 1942, 1942, _1942_state, 1942, ROT270, "hack (Two Bit Score?)", "42", GAME_SUPPORTS_SAVE ) | |
| 925 | 925 | GAME( 1984, 1942b, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom", "1942 (First Version)", GAME_SUPPORTS_SAVE ) |
| 926 | 926 | GAME( 1985, 1942w, 1942, 1942, 1942, _1942_state, 1942, ROT270, "Capcom (Williams Electronics license)", "1942 (Williams Electronics license)", GAME_SUPPORTS_SAVE ) /* Based on 1942 (Revision B) */ |
| 927 | 927 | GAME( 1984, 1942p, 1942, 1942p,1942p,_1942_state, 1942, ROT270, "Capcom", "1942 (prototype)", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| r31373 | r31374 | |
|---|---|---|
| 350 | 350 | |
| 351 | 351 | MCFG_DEVICE_ADD("k053246", K053246, 0) |
| 352 | 352 | MCFG_K053246_CB(dbz_state, sprite_callback) |
| 353 | MCFG_K053246_CONFIG("gfx2", 3, NORMAL_PLANE_ORDER, -87, 32) | |
| 353 | MCFG_K053246_CONFIG("gfx2", 3, NORMAL_PLANE_ORDER, -87, 32) // or -52, 16? | |
| 354 | 354 | MCFG_K053246_GFXDECODE("gfxdecode") |
| 355 | 355 | MCFG_K053246_PALETTE("palette") |
| 356 | 356 |
| r31373 | r31374 | |
|---|---|---|
| 472 | 472 | MCFG_TMS36XX_TYPE(TMS3615) |
| 473 | 473 | MCFG_TMS36XX_DECAY_TIMES(0.33, 0.33, 0, 0.33, 0, 0.33) |
| 474 | 474 | // NOTE: it's unknown if the TMS3615 mixes more than one voice internally. |
| 475 | // A wav taken from Pop Flamer sounds like there are at least no 'odd' | |
| 475 | // A wav taken from Pop Flamer sounds like there are at least no 'odd' | |
| 476 | 476 | // harmonics (5 1/3' and 2 2/3') |
| 477 | 477 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.75) |
| 478 | 478 | |
| r31373 | r31374 | |
| 1144 | 1144 | ROM_LOAD( "9 2716.bin", 0x0000, 0x0800, CRC(85866607) SHA1(cd240bd056f761b2f9e2142049434f02cae3e315) ) |
| 1145 | 1145 | ROM_LOAD( "10 2716.bin", 0x0800, 0x0800, CRC(a841d511) SHA1(8349008ab1d8ef08775b54170c37deb1d391fffc) ) |
| 1146 | 1146 | |
| 1147 | ROM_REGION( 0x0200, "proms", 0 ) // not present in dump, assuming to be the same, matches screenshots, note reverse order to most sets, same as pleiadsb2. | |
| 1147 | ROM_REGION( 0x0200, "proms", 0 ) // not present in dump, assuming to be the same, matches screenshots, note reverse order to most sets, same as pleiadsb2. | |
| 1148 | 1148 | ROM_LOAD( "7611-5.26", 0x0000, 0x0100, CRC(7a1bcb1e) SHA1(bdfab316ea26e2063879e7aa78b6ae2b55eb95c8) ) /* palette low bits */ |
| 1149 | 1149 | ROM_LOAD( "7611-5.33", 0x0100, 0x0100, CRC(e38eeb83) SHA1(252880d80425b2e697146e76efdc6cb9f3ba0378) ) /* palette high bits */ |
| 1150 | 1150 | ROM_END |
| r31373 | r31374 | |
|---|---|---|
| 216 | 216 | ROM_LOAD("fldrcpu2.rom", 0x2000, 0x2000, CRC(6ff2b276) SHA1(040b614f0b0587521ef5550b5587b94a7f3f178b)) |
| 217 | 217 | ROM_RELOAD(0x6000, 0x2000) |
| 218 | 218 | ROM_RELOAD(0xa000, 0x2000) |
| 219 | ROM_RELOAD(0xe000, 0x2000) | |
| 219 | ROM_RELOAD(0xe000, 0x2000) | |
| 220 | 220 | ROM_REGION(0x10000, "cpu2", 0) |
| 221 | 221 | ROM_LOAD("fdsndu3.rom", 0x0000, 0x2000, NO_DUMP) |
| 222 | 222 | ROM_RELOAD(0x4000, 0x2000) |
| r31373 | r31374 | |
| 244 | 244 | ROM_LOAD("skflcpu2.rom", 0x2000, 0x2000, CRC(ffc497aa) SHA1(3e88539ae1688322b9268f502d8ca41cffb28df3)) |
| 245 | 245 | ROM_RELOAD(0x6000, 0x2000) |
| 246 | 246 | ROM_RELOAD(0xa000, 0x2000) |
| 247 | ROM_RELOAD(0xe000, 0x2000) | |
| 247 | ROM_RELOAD(0xe000, 0x2000) | |
| 248 | 248 | ROM_REGION(0x10000, "cpu2", 0) |
| 249 | 249 | ROM_LOAD("sfsndu3.rom", 0x0000, 0x2000, NO_DUMP) |
| 250 | 250 | ROM_RELOAD(0x4000, 0x2000) |
| r31373 | r31374 | |
|---|---|---|
| 527 | 527 | MCFG_I8255_OUT_PORTC_CB(WRITE8(ecoinf2_state, ppi8255_ic24_write_c_inhibits)) |
| 528 | 528 | |
| 529 | 529 | MCFG_DEVICE_ADD("ic22_inpt", I8255, 0) |
| 530 | MCFG_I8255_IN_PORTA_CB(READ8(ecoinf2_state, ppi8255_ic22_read_a_levels)) | |
| 530 | MCFG_I8255_IN_PORTA_CB(READ8(ecoinf2_state, ppi8255_ic22_read_a_levels)) // manual says level switches | |
| 531 | 531 | MCFG_I8255_IN_PORTB_CB(READ8(ecoinf2_state, ppi8255_ic22_read_b_coins)) |
| 532 | MCFG_I8255_IN_PORTC_CB(READ8(ecoinf2_state, ppi8255_ic22_read_c_misc)) | |
| 532 | MCFG_I8255_IN_PORTC_CB(READ8(ecoinf2_state, ppi8255_ic22_read_c_misc)) // 0x20 appears to be meter power | |
| 533 | 533 | |
| 534 | 534 | MCFG_DEVICE_ADD("ic23_reel", I8255, 0) |
| 535 | 535 | MCFG_I8255_OUT_PORTA_CB(WRITE8(ecoinf2_state, ppi8255_ic23_write_a_reel01)) |
| 536 | 536 | MCFG_I8255_OUT_PORTB_CB(WRITE8(ecoinf2_state, ppi8255_ic23_write_b_reel23)) |
| 537 | MCFG_I8255_IN_PORTC_CB(READ8(ecoinf2_state, ppi8255_ic23_read_c_key)) | |
| 537 | MCFG_I8255_IN_PORTC_CB(READ8(ecoinf2_state, ppi8255_ic23_read_c_key)) // optos and keys | |
| 538 | 538 | |
| 539 | 539 | MCFG_DEVICE_ADD("ic13_leds", I8255, 0) |
| 540 | 540 | MCFG_I8255_OUT_PORTA_CB(WRITE8(ecoinf2_state, ppi8255_ic13_write_a_strobedat0)) |
| r31373 | r31374 | |
|---|---|---|
| 135 | 135 | ROM_SYSTEM_BIOS(1, "bios1", "exec rom intl 284001-1") |
| 136 | 136 | ROMX_LOAD("exec_rom_intl_284001-1.bin", 0xe000, 0x2000, CRC(6d2bd167) SHA1(77a220d5d98846b606dff608f7b5d00183ec3bab), ROM_BIOS(2) ) |
| 137 | 137 | |
| 138 | // The following fastboots are listed here for reference and documentation | |
| 139 | // ROM_SYSTEM_BIOS(2, "bios2", "us-fastboot hack") | |
| 140 | // ROMX_LOAD("us-fastboot.bin", 0xe000, 0x2000, CRa6e4dac4) SHA1(e0900be6d6858b985fd7f0999d864b2fceaf01a1), ROM_BIOS(3) ) | |
| 141 | // ROM_SYSTEM_BIOS(3, "bios3", "intl-fastboot hack") | |
| 142 | // ROMX_LOAD("intl-fastboot.bin", 0xe000, 0x2000, CRC(71dcf0f4) SHA1(2a257c5111f5cee841bd14acaa9df6496aaf3d8b), ROM_BIOS(4) ) | |
| 138 | // The following fastboots are listed here for reference and documentation | |
| 139 | // ROM_SYSTEM_BIOS(2, "bios2", "us-fastboot hack") | |
| 140 | // ROMX_LOAD("us-fastboot.bin", 0xe000, 0x2000, CRa6e4dac4) SHA1(e0900be6d6858b985fd7f0999d864b2fceaf01a1), ROM_BIOS(3) ) | |
| 141 | // ROM_SYSTEM_BIOS(3, "bios3", "intl-fastboot hack") | |
| 142 | // ROMX_LOAD("intl-fastboot.bin", 0xe000, 0x2000, CRC(71dcf0f4) SHA1(2a257c5111f5cee841bd14acaa9df6496aaf3d8b), ROM_BIOS(4) ) | |
| 143 | 143 | |
| 144 | 144 | ROM_END |
| 145 | 145 |
| r31373 | r31374 | |
|---|---|---|
| 246 | 246 | |
| 247 | 247 | MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) |
| 248 | 248 | MCFG_DECO16IC_SPLIT(0) |
| 249 | MCFG_DECO16IC_WIDTH12(3) | |
| 249 | MCFG_DECO16IC_WIDTH12(3) // both these tilemaps need to be twice the y size of usual! | |
| 250 | 250 | MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) |
| 251 | 251 | MCFG_DECO16IC_PF2_TRANS_MASK(0x0f) |
| 252 | 252 | MCFG_DECO16IC_PF1_COL_BANK(0x00) |
| r31373 | r31374 | |
|---|---|---|
| 352 | 352 | |
| 353 | 353 | MCFG_DEVICE_ADD("i8279", I8279, XTAL_6MHz/4) |
| 354 | 354 | MCFG_I8279_OUT_IRQ_CB(DEVWRITELINE("pia0", pia6821_device, cb1_w)) // irq |
| 355 | MCFG_I8279_OUT_SL_CB(WRITE8(icecold_state, scanlines_w)) | |
| 355 | MCFG_I8279_OUT_SL_CB(WRITE8(icecold_state, scanlines_w)) // scan SL lines | |
| 356 | 356 | MCFG_I8279_OUT_DISP_CB(WRITE8(icecold_state, digit_w)) // display A&B |
| 357 | MCFG_I8279_IN_RL_CB(READ8(icecold_state, kbd_r)) // kbd RL lines | |
| 358 | ||
| 357 | MCFG_I8279_IN_RL_CB(READ8(icecold_state, kbd_r)) // kbd RL lines | |
| 358 | ||
| 359 | 359 | // 30Hz signal from CH-C of ay0 |
| 360 | 360 | MCFG_TIMER_DRIVER_ADD_PERIODIC("sint_timer", icecold_state, icecold_sint_timer, attotime::from_hz(30)) |
| 361 | 361 |
| r31373 | r31374 | |
|---|---|---|
| 499 | 499 | MCFG_CPU_VBLANK_INT_DRIVER("screen", spy_state, spy_interrupt) |
| 500 | 500 | |
| 501 | 501 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 502 | MCFG_CPU_PROGRAM_MAP(spy_sound_map) | |
| 502 | MCFG_CPU_PROGRAM_MAP(spy_sound_map) /* nmi by the sound chip */ | |
| 503 | 503 | |
| 504 | 504 | /* video hardware */ |
| 505 | 505 | MCFG_SCREEN_ADD("screen", RASTER) |
| r31373 | r31374 | |
| 562 | 562 | ROM_LOAD32_WORD( "857b09.bin", 0x00000, 0x40000, CRC(b8780966) SHA1(6c255f1e4d1398fa9010a1ae0f5172dc524df109) ) |
| 563 | 563 | ROM_LOAD32_WORD( "857b08.bin", 0x00002, 0x40000, CRC(3e4d8d50) SHA1(70f45a725bf1e9d15285ffb6b280945f7ce7faf0) ) |
| 564 | 564 | |
| 565 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 565 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 566 | 566 | ROM_LOAD32_WORD( "857b06.bin", 0x00000, 0x80000, CRC(7b515fb1) SHA1(3830649d47964940023760b76e2bf94bb9163f23) ) |
| 567 | 567 | ROM_LOAD32_WORD( "857b05.bin", 0x00002, 0x80000, CRC(27b0f73b) SHA1(6b6a3da11c3005e3a62e6280818c18ae2ea31800) ) |
| 568 | 568 | |
| r31373 | r31374 | |
| 589 | 589 | ROM_LOAD32_WORD( "857b09.bin", 0x00000, 0x40000, CRC(b8780966) SHA1(6c255f1e4d1398fa9010a1ae0f5172dc524df109) ) |
| 590 | 590 | ROM_LOAD32_WORD( "857b08.bin", 0x00002, 0x40000, CRC(3e4d8d50) SHA1(70f45a725bf1e9d15285ffb6b280945f7ce7faf0) ) |
| 591 | 591 | |
| 592 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 593 | ROM_LOAD32_WORD( "857b06.bin", 0x00000, 0x80000, CRC(7b515fb1) SHA1(3830649d47964940023760b76e2bf94bb9163f23) ) | |
| 592 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 593 | ROM_LOAD32_WORD( "857b06.bin", 0x00000, 0x80000, CRC(7b515fb1) SHA1(3830649d47964940023760b76e2bf94bb9163f23) ) | |
| 594 | 594 | ROM_LOAD32_WORD( "857b05.bin", 0x00002, 0x80000, CRC(27b0f73b) SHA1(6b6a3da11c3005e3a62e6280818c18ae2ea31800) ) |
| 595 | 595 | |
| 596 | 596 | ROM_REGION( 0x0200, "proms", 0 ) |
| r31373 | r31374 | |
|---|---|---|
| 443 | 443 | MCFG_TMSPROM_STOP_BIT(7) /* bit # of stop */ |
| 444 | 444 | MCFG_TMSPROM_PDC_CB(DEVWRITELINE("tms", tms5110_device, pdc_w)) /* tms pdc func */ |
| 445 | 445 | MCFG_TMSPROM_CTL_CB(DEVWRITE8("tms", tms5110_device, ctl_w)) /* tms ctl func */ |
| 446 | ||
| 446 | ||
| 447 | 447 | /* sound hardware */ |
| 448 | 448 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 449 | 449 |
| r31373 | r31374 | |
|---|---|---|
| 1861 | 1861 | MCFG_CPU_ADD("maincpu", Z80, XTAL_13_33056MHz/2) /* verified freq on pin122 of TC0090LVC cpu */ |
| 1862 | 1862 | MCFG_CPU_PROGRAM_MAP(kurikint_map) |
| 1863 | 1863 | MCFG_CPU_IRQ_ACKNOWLEDGE_DRIVER(taitol_state,irq_callback) |
| 1864 | ||
| 1864 | ||
| 1865 | 1865 | MCFG_TIMER_DRIVER_ADD_SCANLINE("scantimer", taitol_state, vbl_interrupt, "screen", 0, 1) |
| 1866 | 1866 | |
| 1867 | 1867 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_12MHz/3) /* verified on pcb */ |
| r31373 | r31374 | |
|---|---|---|
| 409 | 409 | |
| 410 | 410 | MCFG_SOUND_ADD("ymsnd", YM2203, 12000000/8) |
| 411 | 411 | MCFG_YM2203_IRQ_HANDLER(WRITELINE(chanbara_state, sound_irq)) |
| 412 | ||
| 413 | ||
| 412 | ||
| 413 | ||
| 414 | 414 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(chanbara_state, chanbara_ay_out_0_w)) |
| 415 | 415 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(chanbara_state, chanbara_ay_out_1_w)) |
| 416 | 416 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| r31373 | r31374 | |
|---|---|---|
| 272 | 272 | |
| 273 | 273 | static ADDRESS_MAP_START( gstriker_map, AS_PROGRAM, 16, gstriker_state ) |
| 274 | 274 | AM_RANGE(0x000000, 0x0fffff) AM_ROM |
| 275 | AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, vram_r, vram_w ) | |
| 275 | AM_RANGE(0x100000, 0x103fff) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, vram_r, vram_w ) | |
| 276 | 276 | AM_RANGE(0x140000, 0x141fff) AM_RAM AM_SHARE("cg10103_m_vram") |
| 277 | AM_RANGE(0x180000, 0x180fff) AM_DEVREADWRITE("texttilemap", vs920a_text_tilemap_device, vram_r, vram_w ) | |
| 278 | AM_RANGE(0x181000, 0x181fff) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, line_r, line_w ) | |
| 277 | AM_RANGE(0x180000, 0x180fff) AM_DEVREADWRITE("texttilemap", vs920a_text_tilemap_device, vram_r, vram_w ) | |
| 278 | AM_RANGE(0x181000, 0x181fff) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, line_r, line_w ) | |
| 279 | 279 | AM_RANGE(0x1c0000, 0x1c0fff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") AM_MIRROR(0x00f000) |
| 280 | 280 | |
| 281 | AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, regs_r, regs_w ) | |
| 281 | AM_RANGE(0x200000, 0x20000f) AM_DEVREADWRITE("zoomtilemap", mb60553_zooming_tilemap_device, regs_r, regs_w ) | |
| 282 | 282 | AM_RANGE(0x200040, 0x20005f) AM_RAM AM_SHARE("mixerregs1") |
| 283 | 283 | AM_RANGE(0x200060, 0x20007f) AM_RAM AM_SHARE("mixerregs2") |
| 284 | 284 | AM_RANGE(0x200080, 0x200081) AM_READ_PORT("P1") |
| r31373 | r31374 | |
| 523 | 523 | MCFG_CPU_IO_MAP(sound_io_map) |
| 524 | 524 | |
| 525 | 525 | MCFG_SCREEN_ADD("screen", RASTER) |
| 526 | // | |
| 526 | // MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_AFTER_VBLANK) | |
| 527 | 527 | MCFG_SCREEN_REFRESH_RATE(60) |
| 528 | 528 | MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(5000) /* hand-tuned, it needs a bit */) |
| 529 | 529 | MCFG_SCREEN_SIZE(64*8, 64*8) |
| r31373 | r31374 | |
|---|---|---|
| 537 | 537 | { |
| 538 | 538 | UINT16 col = pal.clut[pal.addr >> 1]; |
| 539 | 539 | |
| 540 | /* if ((pal.addr & 1) == 0) | |
| 541 | return col & 0xff; | |
| 542 | else | |
| 543 | return col >> 8; | |
| 544 | */ | |
| 545 | ||
| 540 | /* if ((pal.addr & 1) == 0) | |
| 541 | return col & 0xff; | |
| 542 | else | |
| 543 | return col >> 8; | |
| 544 | */ | |
| 545 | ||
| 546 | 546 | return col; |
| 547 | 547 | } |
| 548 | 548 | else |
| r31373 | r31374 | |
| 604 | 604 | break; |
| 605 | 605 | } |
| 606 | 606 | |
| 607 | ||
| 607 | default: | |
| 608 | 608 | { |
| 609 | 609 | popmessage("Bt471: Unhandled write access (offset:%x, data:%x)", offset, data); |
| 610 | 610 | } |
| r31373 | r31374 | |
|---|---|---|
| 367 | 367 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */ |
| 368 | 368 | ROM_LOAD( "717e01", 0x000000, 0x008000, CRC(966b8ba8) SHA1(ab7448cb61fa5922b1d8ae5f0d0f42d734ed4f93) ) |
| 369 | 369 | |
| 370 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 370 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 371 | 371 | ROM_LOAD32_WORD( "717e04", 0x000000, 0x080000, CRC(1a50a1cc) SHA1(bc16fab84c637ed124e37b115ddc0149560b727d) ) |
| 372 | 372 | ROM_LOAD32_WORD( "717e05", 0x000002, 0x080000, CRC(46ccb506) SHA1(3ed1f54744fc5cdc0f48e42f250c366267a8199a) ) |
| 373 | 373 | |
| 374 | ROM_REGION( 0x020000, "k051316_1", 0 ) | |
| 374 | ROM_REGION( 0x020000, "k051316_1", 0 ) /* zoom/rotate */ | |
| 375 | 375 | ROM_LOAD( "717e06.n16", 0x000000, 0x020000, CRC(1ec26c7a) SHA1(05b5b522c5ebf5d0a71a7fc39ec9382008ef33c8) ) |
| 376 | 376 | |
| 377 | ROM_REGION( 0x100000, "k051316_2", 0 ) | |
| 377 | ROM_REGION( 0x100000, "k051316_2", 0 ) /* zoom/rotate */ | |
| 378 | 378 | ROM_LOAD( "717e07.l20", 0x000000, 0x040000, CRC(b9a565a8) SHA1(a11782f7336e5ad58a4c6ea81f2eeac35d5e7d0a) ) |
| 379 | 379 | ROM_LOAD( "717e08.l22", 0x040000, 0x040000, CRC(b68a212e) SHA1(b2bd121a43552c3ade528ac763a0df40c3e648e0) ) |
| 380 | 380 | ROM_LOAD( "717e11.n20", 0x080000, 0x040000, CRC(ebb171ec) SHA1(d65d4a6b169ce03e4427b2a397484634f938236b) ) |
| r31373 | r31374 | |
| 397 | 397 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */ |
| 398 | 398 | ROM_LOAD( "717e01", 0x000000, 0x008000, CRC(966b8ba8) SHA1(ab7448cb61fa5922b1d8ae5f0d0f42d734ed4f93) ) |
| 399 | 399 | |
| 400 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 400 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 401 | 401 | ROM_LOAD32_WORD( "717e04", 0x000000, 0x080000, CRC(1a50a1cc) SHA1(bc16fab84c637ed124e37b115ddc0149560b727d) ) |
| 402 | 402 | ROM_LOAD32_WORD( "717e05", 0x000002, 0x080000, CRC(46ccb506) SHA1(3ed1f54744fc5cdc0f48e42f250c366267a8199a) ) |
| 403 | 403 | |
| 404 | ROM_REGION( 0x020000, "k051316_1", 0 ) | |
| 404 | ROM_REGION( 0x020000, "k051316_1", 0 ) /* zoom/rotate */ | |
| 405 | 405 | ROM_LOAD( "717e06.n16", 0x000000, 0x020000, CRC(1ec26c7a) SHA1(05b5b522c5ebf5d0a71a7fc39ec9382008ef33c8) ) |
| 406 | 406 | |
| 407 | ROM_REGION( 0x100000, "k051316_2", 0 ) | |
| 407 | ROM_REGION( 0x100000, "k051316_2", 0 ) /* zoom/rotate */ | |
| 408 | 408 | ROM_LOAD( "717e07.l20", 0x000000, 0x040000, CRC(b9a565a8) SHA1(a11782f7336e5ad58a4c6ea81f2eeac35d5e7d0a) ) |
| 409 | 409 | ROM_LOAD( "717e08.l22", 0x040000, 0x040000, CRC(b68a212e) SHA1(b2bd121a43552c3ade528ac763a0df40c3e648e0) ) |
| 410 | 410 | ROM_LOAD( "717e11.n20", 0x080000, 0x040000, CRC(ebb171ec) SHA1(d65d4a6b169ce03e4427b2a397484634f938236b) ) |
| r31373 | r31374 | |
|---|---|---|
| 835 | 835 | MCFG_I8255_IN_PORTB_CB(IOPORT("SW1")) |
| 836 | 836 | MCFG_I8255_OUT_PORTC_CB(WRITE8(amaticmg_state, out_c_w)) |
| 837 | 837 | |
| 838 | // | |
| 838 | // MCFG_DEVICE_ADD("ppi8255_2", I8255A, 0) | |
| 839 | 839 | |
| 840 | 840 | /* video hardware */ |
| 841 | 841 | MCFG_SCREEN_ADD("screen", RASTER) |
| r31373 | r31374 | |
|---|---|---|
| 1573 | 1573 | /* sound hardware */ |
| 1574 | 1574 | MCFG_SOUND_MODIFY("8910.1") |
| 1575 | 1575 | MCFG_SOUND_CLOCK(18432000/12) // triple punch/knock out ay clock is 1.535MHz, derived from main cpu xtal; verified on hardware |
| 1576 | ||
| 1577 | ||
| 1576 | ||
| 1577 | ||
| 1578 | 1578 | MCFG_SOUND_ROUTES_RESET() |
| 1579 | 1579 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 1580 | 1580 |
| r31373 | r31374 | |
|---|---|---|
| 322 | 322 | |
| 323 | 323 | #if 0 |
| 324 | 324 | *------------------------------------------------------------------- |
| 325 | ||
| 325 | The Atarians (working bootleg) | |
| 326 | 326 | Game modified to work in emulation from original set (atarians) |
| 327 | 327 | -------------------------------------------------------------------*/ |
| 328 | 328 | ROM_START(atarianb) |
| 329 | 329 | ROM_REGION(0x10000, "maincpu", 0) |
| 330 | 330 | ROM_LOAD("atarianb.e00", 0x7000, 0x0800, CRC(74fc86e4) SHA1(135d75e5c03feae0929fa84caa3c802353cdd94e)) |
| 331 | ||
| 331 | ROM_LOAD("atarian.e0", 0x7800, 0x0800, CRC(45cb0427) SHA1(e286930ca36bdd0f79acefd142d2a5431fa8005b)) | |
| 332 | 332 | |
| 333 | 333 | ROM_REGION(0x1000, "sound1", 0) |
| 334 | 334 | ROM_LOAD("82s130.bin", 0x0000, 0x0200, CRC(da1f77b4) SHA1(b21fdc1c6f196c320ec5404013d672c35f95890b)) |
| r31373 | r31374 | |
|---|---|---|
| 107 | 107 | { |
| 108 | 108 | if (ACCESSING_BITS_0_7) |
| 109 | 109 | { |
| 110 | // | |
| 110 | // if (data & 0x80) logerror("PC$%06x Writing unknown bits %02x to the Coin/EEPROM port\n", space.device().safe_pcbase(), data); | |
| 111 | 111 | |
| 112 | 112 | if (data) { |
| 113 | 113 | if ((m_dispenser_latch & 0x80) == 0) m_dispenser_latch = 0; |
| r31373 | r31374 | |
| 122 | 122 | } |
| 123 | 123 | machine().device<ticket_dispenser_device>("ticket")->write(space, 0, (data & 0x08) ? 0x80 : 0); |
| 124 | 124 | |
| 125 | coin_counter_w(machine(), 0, data & 0x20); /* Coin In counter - transistor driven */ | |
| 126 | coin_counter_w(machine(), 1, data & 0x40); /* Token/Ticket Out counter - transistor driven */ | |
| 125 | coin_counter_w(machine(), 0, data & 0x20); /* Coin In counter - transistor driven */ | |
| 126 | coin_counter_w(machine(), 1, data & 0x40); /* Token/Ticket Out counter - transistor driven */ | |
| 127 | 127 | |
| 128 | 128 | m_eeprom->cs_write((data & 1) ? ASSERT_LINE : CLEAR_LINE); |
| 129 | 129 | m_eeprom->di_write((data & 4) >> 2); |
| r31373 | r31374 | |
| 135 | 135 | { |
| 136 | 136 | if (ACCESSING_BITS_0_7) |
| 137 | 137 | { |
| 138 | // | |
| 138 | // if (data & 0x87) logerror("PC$%06x Writing unknown bits %02x to the Coin/EEPROM port\n", space.device().safe_pcbase(), data); | |
| 139 | 139 | |
| 140 | 140 | if (data) { |
| 141 | 141 | if ((m_dispenser_latch & 0x80) == 0) m_dispenser_latch = 0; |
| r31373 | r31374 | |
| 150 | 150 | } |
| 151 | 151 | machine().device<ticket_dispenser_device>("ticket")->write(space, 0, (data & 0x08) ? 0x80 : 0); |
| 152 | 152 | |
| 153 | coin_counter_w(machine(), 0, data & 0x20); /* Coin In counter - transistor driven */ | |
| 154 | coin_counter_w(machine(), 1, data & 0x40); /* Token/Ticket Out counter - transistor driven */ | |
| 153 | coin_counter_w(machine(), 0, data & 0x20); /* Coin In counter - transistor driven */ | |
| 154 | coin_counter_w(machine(), 1, data & 0x40); /* Token/Ticket Out counter - transistor driven */ | |
| 155 | 155 | } |
| 156 | 156 | } |
| 157 | 157 | |
| r31373 | r31374 | |
| 165 | 165 | { |
| 166 | 166 | if (ACCESSING_BITS_0_7) |
| 167 | 167 | { |
| 168 | // | |
| 168 | // logerror("PC$%06x 68K Writing sound command %02x to OKI\n",space.device().safe_pcbase(), data); | |
| 169 | 169 | |
| 170 | 170 | m_snd_command = (data & 0xff); |
| 171 | 171 | m_snd_flag = 1; |
| r31373 | r31374 | |
| 180 | 180 | if ((m_oki_control & 0x38) == 0x30) |
| 181 | 181 | { |
| 182 | 182 | data = m_snd_command; |
| 183 | // | |
| 183 | // logerror("PC$%03x PortB reading %02x from the 68K\n", space.device().safe_pcbase(), data); | |
| 184 | 184 | } |
| 185 | 185 | else if ((m_oki_control & 0x38) == 0x28) |
| 186 | 186 | { |
| 187 | 187 | data = (m_oki->read(space, 0) & 0x0f); |
| 188 | // | |
| 188 | // logerror("PC$%03x PortB reading %02x from the OKI status port\n", space.device().safe_pcbase(), data); | |
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | return data; |
| r31373 | r31374 | |
| 241 | 241 | |
| 242 | 242 | if ((data & 0x38) == 0x18) |
| 243 | 243 | { |
| 244 | // | |
| 244 | // logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",space.device().safe_pcbase(),m_oki_command,m_oki_control,m_snd_command); | |
| 245 | 245 | m_oki->write(space, 0, m_oki_command); |
| 246 | 246 | } |
| 247 | 247 | } |
| r31373 | r31374 | |
| 252 | 252 | |
| 253 | 253 | if (m_old_oki_bank != (data & 3)) |
| 254 | 254 | { |
| 255 | // | |
| 255 | // logerror("PC$%03x Writing %02x to PortC (OKI bank select bits). Previous bank was %02x\n",space.device().safe_pcbase(),(data&3),m_old_oki_bank); | |
| 256 | 256 | |
| 257 | 257 | m_old_oki_bank = data & 3; |
| 258 | 258 | |
| r31373 | r31374 | |
| 266 | 266 | |
| 267 | 267 | if ((data & 0x38) == 0x18) |
| 268 | 268 | { |
| 269 | // | |
| 269 | // logerror("PC$%03x Writing %02x to OKI1, PortC=%02x, Code=%02x\n",space.device().safe_pcbase(),m_oki_command,m_oki_control,m_snd_command); | |
| 270 | 270 | m_oki->write(space, 0, m_oki_command); |
| 271 | 271 | } |
| 272 | 272 | } |
| r31373 | r31374 | |
| 338 | 338 | AM_RANGE(0x710018, 0x710019) AM_READ_PORT("P3") |
| 339 | 339 | AM_RANGE(0x71001a, 0x71001b) AM_READ_PORT("P4") |
| 340 | 340 | // AM_RANGE(0x71001c, 0x71001d) AM_READ(playmark_snd_status???) |
| 341 | // | |
| 341 | // AM_RANGE(0x71001e, 0x71001f) AM_WRITE(playmark_snd_command_w) | |
| 342 | 342 | AM_RANGE(0x780000, 0x780fff) AM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 343 | 343 | AM_RANGE(0xff0000, 0xffffff) AM_RAM |
| 344 | 344 | ADDRESS_MAP_END |
| r31373 | r31374 | |
| 384 | 384 | AM_RANGE(0x300016, 0x300017) AM_WRITE(hrdtimes_coin_w) |
| 385 | 385 | AM_RANGE(0x30001a, 0x30001b) AM_READ_PORT("DSW2") |
| 386 | 386 | AM_RANGE(0x30001c, 0x30001d) AM_READ_PORT("DSW1") |
| 387 | // | |
| 387 | // AM_RANGE(0x30001e, 0x30001f) AM_WRITE(playmark_snd_command_w) | |
| 388 | 388 | AM_RANGE(0x304000, 0x304001) AM_WRITENOP /* watchdog? irq ack? */ |
| 389 | 389 | ADDRESS_MAP_END |
| 390 | 390 | |
| r31373 | r31374 | |
| 438 | 438 | ADDRESS_MAP_END |
| 439 | 439 | |
| 440 | 440 | static ADDRESS_MAP_START( hrdtimes_sound_io_map, AS_IO, 8, playmark_state ) |
| 441 | AM_RANGE(0x00, 0x00) AM_NOP | |
| 441 | AM_RANGE(0x00, 0x00) AM_NOP /* AM_WRITE(playmark_oki_banking_w) Banking data output but not wired. Port 2 (Port C) is wired to the OKI banking instead */ | |
| 442 | 442 | AM_RANGE(0x01, 0x01) AM_READWRITE(playmark_snd_command_r, playmark_oki_w) |
| 443 | 443 | AM_RANGE(0x02, 0x02) AM_READWRITE(playmark_snd_flag_r, hrdtimes_snd_control_w) |
| 444 | 444 | AM_RANGE(PIC16C5x_T0, PIC16C5x_T0) AM_READ(PIC16C5X_T0_clk_r) |
| r31373 | r31374 | |
| 904 | 904 | |
| 905 | 905 | PORT_START("DISPENSER") |
| 906 | 906 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 907 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) | |
| 907 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) // Wired to Token dispenser connector, but doesn't seem to affect anything. | |
| 908 | 908 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Token Dispenser Empty") PORT_CODE(KEYCODE_N) |
| 909 | 909 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_SPECIAL ) PORT_READ_LINE_DEVICE_MEMBER("token", ticket_dispenser_device, line_r) |
| 910 | 910 | PORT_BIT( 0x10, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_NAME("Ticket Dispenser Empty") PORT_CODE(KEYCODE_T) |
| r31373 | r31374 | |
| 1922 | 1922 | ROM_COPY( "oki", 0x00000, 0x20000, 0x20000 ) |
| 1923 | 1923 | ROM_COPY( "oki", 0x00000, 0x40000, 0x20000 ) |
| 1924 | 1924 | |
| 1925 | ROM_REGION( 0x8000, "plds", 0 ) | |
| 1925 | ROM_REGION( 0x8000, "plds", 0 ) /* These were read protected */ | |
| 1926 | 1926 | ROM_LOAD( "palce16v8h-25-pc4_u58.jed", 0x0000, 0xb89, BAD_DUMP CRC(ba88c1da) SHA1(9b55e96eee44a467bdfbf760137ccb2fb3afedf0) ) |
| 1927 | 1927 | ROM_LOAD( "palce16v8h-25-pc4_u182.jed", 0x0000, 0xb89, BAD_DUMP CRC(ba88c1da) SHA1(9b55e96eee44a467bdfbf760137ccb2fb3afedf0) ) |
| 1928 | 1928 | ROM_LOAD( "palce16v8h-25-pc4_jamma.jed", 0x0000, 0xb89, BAD_DUMP CRC(ba88c1da) SHA1(9b55e96eee44a467bdfbf760137ccb2fb3afedf0) ) // On the Jamma Expansion board |
| r31373 | r31374 | |
| 1953 | 1953 | ROM_LOAD16_BYTE( "28.u40", 0x040001, 0x10000, CRC(40e65ed1) SHA1(bc75eb816c58eb0f983bb0eaee854c54e306e1da) ) |
| 1954 | 1954 | ROM_CONTINUE( 0x060001, 0x10000 ) |
| 1955 | 1955 | |
| 1956 | ROM_REGION( 0x80000, "gfx2", 0 ) | |
| 1956 | ROM_REGION( 0x80000, "gfx2", 0 ) /* Sprites */ | |
| 1957 | 1957 | ROM_LOAD16_BYTE( "26.u86", 0x00000, 0x20000, CRC(d3ee7d82) SHA1(b0b3df19d60430e7a9fa29fdfff2183a32986d2d) ) |
| 1958 | 1958 | ROM_LOAD16_BYTE( "30.u85", 0x00001, 0x20000, CRC(4b8a9558) SHA1(9f0f2d8f50f21cf188ad778c3a0a68ec23380b23) ) |
| 1959 | 1959 | ROM_LOAD16_BYTE( "25.u84", 0x40000, 0x20000, CRC(e1ab5cf5) SHA1(f76d00537cfd6f09439e44071875bf021622fd07) ) |
| r31373 | r31374 | |
|---|---|---|
| 3340 | 3340 | ROM_LOAD( "emag_si.e", 0x1800, 0x0400, CRC(c4e80586) SHA1(3d427d5a2eea3c911ec7bd055e06e6747ce5e84d) ) |
| 3341 | 3341 | ROM_LOAD( "emag_si.f", 0x1c00, 0x0400, CRC(077f5ef2) SHA1(625de6839073ac4c904f949efc1b2e0afea5d676) ) |
| 3342 | 3342 | ROM_END |
| 3343 | ||
| 3343 | ||
| 3344 | 3344 | ROM_START( tst_invd ) |
| 3345 | 3345 | ROM_REGION( 0x10000, "maincpu", 0 ) |
| 3346 | 3346 | ROM_LOAD( "test.h", 0x0000, 0x0800, CRC(f86a2eea) SHA1(4a72ff01f3e6d16bbe9bf7f123cd98895bfbed9a) ) /* The Test ROM */ |
| r31373 | r31374 | |
|---|---|---|
| 300 | 300 | m_avg(*this, "avg"), |
| 301 | 301 | m_rom(*this, "maincpu"), |
| 302 | 302 | m_knob_p1(*this, TEMPEST_KNOB_P1_TAG), |
| 303 | m_knob_p2(*this, TEMPEST_KNOB_P2_TAG), | |
| 304 | m_buttons_p1(*this, TEMPEST_BUTTONS_P1_TAG), | |
| 305 | m_buttons_p2(*this, TEMPEST_BUTTONS_P2_TAG), | |
| 306 | m_in1(*this, "IN1/DSW0"), | |
| 307 | m_in2(*this, "IN2") | |
| 308 | { } | |
| 303 | m_knob_p2(*this, TEMPEST_KNOB_P2_TAG), | |
| 304 | m_buttons_p1(*this, TEMPEST_BUTTONS_P1_TAG), | |
| 305 | m_buttons_p2(*this, TEMPEST_BUTTONS_P2_TAG), | |
| 306 | m_in1(*this, "IN1/DSW0"), | |
| 307 | m_in2(*this, "IN2") | |
| 308 | { } | |
| 309 | 309 | |
| 310 | 310 | required_device<cpu_device> m_maincpu; |
| 311 | 311 | required_device<mathbox_device> m_mathbox; |
| r31373 | r31374 | |
| 313 | 313 | required_memory_region m_rom; |
| 314 | 314 | |
| 315 | 315 | required_ioport m_knob_p1; |
| 316 | required_ioport m_knob_p2; | |
| 317 | required_ioport m_buttons_p1; | |
| 318 | required_ioport m_buttons_p2; | |
| 319 | required_ioport m_in1; | |
| 320 | required_ioport m_in2; | |
| 316 | required_ioport m_knob_p2; | |
| 317 | required_ioport m_buttons_p1; | |
| 318 | required_ioport m_buttons_p2; | |
| 319 | required_ioport m_in1; | |
| 320 | required_ioport m_in2; | |
| 321 | 321 | |
| 322 | ||
| 322 | UINT8 m_player_select; | |
| 323 | 323 | DECLARE_WRITE8_MEMBER(wdclr_w); |
| 324 | 324 | DECLARE_WRITE8_MEMBER(tempest_led_w); |
| 325 | 325 | DECLARE_WRITE8_MEMBER(tempest_coin_w); |
| r31373 | r31374 | |
| 329 | 329 | DECLARE_READ8_MEMBER(input_port_1_bit_r); |
| 330 | 330 | DECLARE_READ8_MEMBER(input_port_2_bit_r); |
| 331 | 331 | |
| 332 | ||
| 332 | DECLARE_READ8_MEMBER(rom_ae1f_r); | |
| 333 | 333 | |
| 334 | ||
| 334 | virtual void machine_start(); | |
| 335 | 335 | }; |
| 336 | 336 | |
| 337 | 337 | |
| r31373 | r31374 | |
| 365 | 365 | |
| 366 | 366 | CUSTOM_INPUT_MEMBER(tempest_state::tempest_buttons_r) |
| 367 | 367 | { |
| 368 | ||
| 368 | return (m_player_select == 0) ? m_buttons_p1->read() : m_buttons_p2->read(); | |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | 371 | |
| r31373 | r31374 | |
| 428 | 428 | machine().scheduler().boost_interleave(attotime::zero, attotime::from_usec(100)); |
| 429 | 429 | machine().scheduler().abort_timeslice(); |
| 430 | 430 | |
| 431 | const UINT8 *rom = m_rom->base(); | |
| 432 | return rom[0xae1f]; | |
| 431 | const UINT8 *rom = m_rom->base(); | |
| 432 | return rom[0xae1f]; | |
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | |
| r31373 | r31374 | |
| 454 | 454 | AM_RANGE(0x60c0, 0x60cf) AM_DEVREADWRITE("pokey1", pokey_device, read, write) |
| 455 | 455 | AM_RANGE(0x60d0, 0x60df) AM_DEVREADWRITE("pokey2", pokey_device, read, write) |
| 456 | 456 | AM_RANGE(0x60e0, 0x60e0) AM_WRITE(tempest_led_w) |
| 457 | AM_RANGE(0xae1f, 0xae1f) AM_READ(rom_ae1f_r) | |
| 458 | AM_RANGE(0x9000, 0xdfff) AM_ROM | |
| 457 | AM_RANGE(0xae1f, 0xae1f) AM_READ(rom_ae1f_r) | |
| 458 | AM_RANGE(0x9000, 0xdfff) AM_ROM | |
| 459 | 459 | AM_RANGE(0xf000, 0xffff) AM_ROM /* for the reset / interrupt vectors */ |
| 460 | 460 | ADDRESS_MAP_END |
| 461 | 461 |
| r31373 | r31374 | |
|---|---|---|
| 110 | 110 | |
| 111 | 111 | void quakeat_state::machine_start() |
| 112 | 112 | { |
| 113 | ||
| 114 | 113 | } |
| 115 | 114 | /*************************************************************/ |
| 116 | 115 |
| r31373 | r31374 | |
|---|---|---|
| 512 | 512 | WRITE8_MEMBER( maygayv1_state::lamp_data_w ) |
| 513 | 513 | { |
| 514 | 514 | //The two A/B ports are merged back into one, to make one row of 8 lamps. |
| 515 | ||
| 515 | ||
| 516 | 516 | if (m_old_lamp_strobe != m_lamp_strobe) |
| 517 | 517 | { |
| 518 | 518 | // Because of the nature of the lamping circuit, there is an element of persistance |
| r31373 | r31374 | |
| 525 | 525 | } |
| 526 | 526 | m_old_lamp_strobe = m_lamp_strobe; |
| 527 | 527 | } |
| 528 | ||
| 528 | ||
| 529 | 529 | } |
| 530 | 530 | |
| 531 | 531 | READ8_MEMBER( maygayv1_state::kbd_r ) |
| r31373 | r31374 | |
| 897 | 897 | MCFG_MC68681_A_TX_CALLBACK(WRITELINE(maygayv1_state, duart_txa)) |
| 898 | 898 | |
| 899 | 899 | MCFG_DEVICE_ADD("i8279", I8279, MASTER_CLOCK/4) // unknown clock |
| 900 | MCFG_I8279_OUT_SL_CB(WRITE8(maygayv1_state, strobe_w)) // scan SL lines | |
| 901 | MCFG_I8279_OUT_DISP_CB(WRITE8(maygayv1_state, lamp_data_w)) // display A&B | |
| 902 | MCFG_I8279_IN_RL_CB(READ8(maygayv1_state, kbd_r)) // kbd RL lines | |
| 903 | ||
| 900 | MCFG_I8279_OUT_SL_CB(WRITE8(maygayv1_state, strobe_w)) // scan SL lines | |
| 901 | MCFG_I8279_OUT_DISP_CB(WRITE8(maygayv1_state, lamp_data_w)) // display A&B | |
| 902 | MCFG_I8279_IN_RL_CB(READ8(maygayv1_state, kbd_r)) // kbd RL lines | |
| 903 | ||
| 904 | 904 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 905 | 905 | |
| 906 | 906 | MCFG_SOUND_ADD("ymsnd",YM2413, MASTER_CLOCK / 4) |
| r31373 | r31374 | |
|---|---|---|
| 156 | 156 | |
| 157 | 157 | WRITE8_MEMBER( surpratk_state::banking_callback ) |
| 158 | 158 | { |
| 159 | // | |
| 159 | // logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), data); | |
| 160 | 160 | membank("bank1")->set_entry(data & 0x1f); |
| 161 | 161 | } |
| 162 | 162 |
| r31373 | r31374 | |
|---|---|---|
| 1666 | 1666 | MCFG_SCREEN_ADD("screen", RASTER) |
| 1667 | 1667 | MCFG_SCREEN_VIDEO_ATTRIBUTES(VIDEO_UPDATE_BEFORE_VBLANK) |
| 1668 | 1668 | MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 508, 0, 384, 262, 0, 240) // most games configure the screen this way |
| 1669 | // | |
| 1669 | // MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 508, 0, 384, 286, 0, 256) // sftm, wcbowl and shufshot configure it this way | |
| 1670 | 1670 | MCFG_SCREEN_UPDATE_DRIVER(itech32_state, screen_update_itech32) |
| 1671 | 1671 | MCFG_SCREEN_PALETTE("palette") |
| 1672 | 1672 |
| r31373 | r31374 | |
|---|---|---|
| 163 | 163 | MCFG_DEVICE_ADD("ppi8255_ic21", I8255, 0) |
| 164 | 164 | |
| 165 | 165 | MCFG_DEVICE_ADD("ppi8255_ic22", I8255, 0) |
| 166 | MCFG_I8255_OUT_PORTB_CB(WRITE8(jpmmps_state, jpmmps_psg_buf_w)) // SN chip data | |
| 167 | MCFG_I8255_OUT_PORTC_CB(WRITE8(jpmmps_state, jpmmps_ic22_portc_w)) // C3 is last meter, C2 latches in data | |
| 166 | MCFG_I8255_OUT_PORTB_CB(WRITE8(jpmmps_state, jpmmps_psg_buf_w)) // SN chip data | |
| 167 | MCFG_I8255_OUT_PORTC_CB(WRITE8(jpmmps_state, jpmmps_ic22_portc_w)) // C3 is last meter, C2 latches in data | |
| 168 | 168 | |
| 169 | 169 | MCFG_DEVICE_ADD("ppi8255_ic25", I8255, 0) |
| 170 | 170 |
| r31373 | r31374 | |
|---|---|---|
| 1 | 1 | /*********************************************************************************** |
| 2 | ||
| 3 | fireball.c | |
| 4 | ||
| 5 | Mechanical game where you have a gun shooting rubber balls. | |
| 6 | 2 | |
| 7 | some pics here | |
| 8 | http://www.schausteller.de/anzeigenmarkt/euro-ball-66634.html | |
| 3 | fireball.c | |
| 9 | 4 | |
| 10 | TODO | |
| 11 | -NEVER sends store command to Eeprom so all change are lost | |
| 5 | Mechanical game where you have a gun shooting rubber balls. | |
| 12 | 6 | |
| 7 | some pics here | |
| 8 | http://www.schausteller.de/anzeigenmarkt/euro-ball-66634.html | |
| 9 | ||
| 10 | TODO | |
| 11 | -NEVER sends store command to Eeprom so all change are lost | |
| 12 | ||
| 13 | 13 | ************************************************************************************/ |
| 14 | 14 | |
| 15 | 15 | #include "emu.h" |
| r31373 | r31374 | |
| 20 | 20 | #include "machine/eepromser.h" |
| 21 | 21 | |
| 22 | 22 | /**************************** |
| 23 | * LOG defines | |
| 23 | * LOG defines * | |
| 24 | 24 | ****************************/ |
| 25 | 25 | |
| 26 | 26 | #define LOG_DISPLAY 0 |
| 27 | 27 | #define LOG_DISPLAY2 0 |
| 28 | 28 | #define LOG_INPUT 0 |
| 29 | #define LOG_AY8912 0 | |
| 29 | #define LOG_AY8912 0 | |
| 30 | 30 | #define LOG_P1 0 |
| 31 | 31 | #define LOG_P3 0 |
| 32 | 32 | #define LOG_OUTPUT 0 |
| 33 | 33 | |
| 34 | 34 | /**************************** |
| 35 | * Clock defines | |
| 35 | * Clock defines * | |
| 36 | 36 | ****************************/ |
| 37 | 37 | #define CPU_CLK XTAL_11_0592MHz |
| 38 | 38 | #define AY_CLK XTAL_11_0592MHz/8 |
| r31373 | r31374 | |
| 76 | 76 | required_device<cpu_device> m_maincpu; |
| 77 | 77 | required_device<ay8912_device> m_ay; |
| 78 | 78 | required_device<eeprom_serial_x24c44_device> m_eeprom; |
| 79 | ||
| 79 | ||
| 80 | 80 | // driver_device overrides |
| 81 | 81 | virtual void machine_reset(); |
| 82 | 82 | |
| r31373 | r31374 | |
| 101 | 101 | |
| 102 | 102 | WRITE8_MEMBER(fireball_state::io_00_w) |
| 103 | 103 | { |
| 104 | ||
| 105 | 104 | m_display_data= m_display_data&0x7f; |
| 106 | 105 | if (LOG_DISPLAY) |
| 107 | 106 | logerror("write to 0x00 IO %02X, m_display_data= %01X\n",data,m_display_data); |
| 108 | ||
| 107 | ||
| 109 | 108 | switch (data&0x0f) |
| 110 | 109 | { |
| 111 | case 1: | |
| 110 | case 1: output_set_digit_value(2, m_display_data); | |
| 112 | 111 | break; |
| 113 | case 2: | |
| 112 | case 2: output_set_digit_value(1, m_display_data); | |
| 114 | 113 | break; |
| 115 | case 4: | |
| 114 | case 4: output_set_digit_value(4, m_display_data); | |
| 116 | 115 | break; |
| 117 | case 8: | |
| 116 | case 8: output_set_digit_value(3, m_display_data); | |
| 118 | 117 | break; |
| 119 | 118 | } |
| 120 | 119 | |
| 121 | ||
| 120 | ||
| 122 | 121 | if (LOG_OUTPUT) |
| 123 | logerror("write to 0x00 IO (X11-X11A) %02X\n",data&0xf0); | |
| 124 | ||
| 122 | logerror("write to 0x00 IO (X11-X11A) %02X\n",data&0xf0); | |
| 123 | ||
| 125 | 124 | output_set_value("Hopper1", BIT(data, 4)); |
| 126 | 125 | output_set_value("Hopper2", BIT(data, 5)); |
| 127 | 126 | output_set_value("Hopper3", BIT(data, 6)); |
| r31373 | r31374 | |
| 141 | 140 | WRITE8_MEMBER(fireball_state::io_02_w) |
| 142 | 141 | { |
| 143 | 142 | if (LOG_OUTPUT) |
| 144 | logerror("write to 0x00 IO (X7-X9) %02X\n",data); | |
| 143 | logerror("write to 0x00 IO (X7-X9) %02X\n",data); | |
| 145 | 144 | |
| 146 | 145 | output_set_value("GameOver", BIT(data, 0)); |
| 147 | 146 | output_set_value("Title", BIT(data, 1)); |
| r31373 | r31374 | |
| 154 | 153 | } |
| 155 | 154 | |
| 156 | 155 | READ8_MEMBER(fireball_state::io_04_r) |
| 157 | { | |
| 156 | { //contraves per mod prog | |
| 158 | 157 | UINT8 tmp=0; |
| 159 | 158 | |
| 160 | 159 | tmp=ioport("X10-12")->read(); |
| 161 | 160 | |
| 162 | 161 | if (LOG_INPUT) |
| 163 | 162 | logerror("return %02X from 0x04\n",tmp); |
| 164 | return tmp; | |
| 163 | return tmp; | |
| 165 | 164 | } |
| 166 | 165 | |
| 167 | 166 | WRITE8_MEMBER(fireball_state::io_04_w) |
| r31373 | r31374 | |
| 189 | 188 | logerror("write to 0x06 data =%02X\n",data); |
| 190 | 189 | |
| 191 | 190 | to_ay_data= data; |
| 192 | ||
| 191 | ||
| 193 | 192 | if (LOG_DISPLAY2) |
| 194 | 193 | logerror("On board display write %02X\n",UINT8(~(data&0xff))); |
| 195 | ||
| 194 | ||
| 196 | 195 | output_set_digit_value(7, UINT8(~(data&0xff))); |
| 197 | 196 | } |
| 198 | 197 | |
| 199 | ||
| 200 | READ8_MEMBER(fireball_state::p1_r) | |
| 201 | { | |
| 198 | ||
| 199 | READ8_MEMBER(fireball_state::p1_r) | |
| 200 | { | |
| 202 | 201 | UINT8 tmp=0; |
| 203 | 202 | tmp=(m_p1_data&0xfe)|(m_eeprom->do_read()); |
| 204 | 203 | if (LOG_P1) |
| 205 | 204 | logerror("readP1 port data %02X\n",tmp&0x01); |
| 206 | 205 | return tmp; |
| 207 | } | |
| 208 | ||
| 209 | WRITE8_MEMBER(fireball_state::p1_w) | |
| 210 | { | |
| 206 | } | |
| 207 | ||
| 208 | WRITE8_MEMBER(fireball_state::p1_w) | |
| 209 | { | |
| 211 | 210 | //eeprom x24c44/ay8912/system stuff... |
| 212 | 211 | //bit0 goes to eeprom pin 3 and 4 (0x01) Data_in and Data_out |
| 213 | //bit1 goes to eeprom pin 1 (0x02) CE Hi active | |
| 214 | //bit2 goes to eeprom pin 2 (0x04) SK Clock | |
| 215 | //bit3 goes to dis/thr input of a ne555 that somehow reset the 8031... TODO | |
| 216 | //bit4 goes to ay8912 pin bc1 (0x10) | |
| 212 | //bit1 goes to eeprom pin 1 (0x02) CE Hi active | |
| 213 | //bit2 goes to eeprom pin 2 (0x04) SK Clock | |
| 214 | //bit3 goes to dis/thr input of a ne555 that somehow reset the 8031... TODO | |
| 215 | //bit4 goes to ay8912 pin bc1 (0x10) | |
| 217 | 216 | //bit5 goes to ay8912 pin bdir (0x20) |
| 218 | //bit6 goes to TODO | |
| 219 | //bit7 goes to TODO | |
| 217 | //bit6 goes to TODO | |
| 218 | //bit7 goes to TODO | |
| 220 | 219 | |
| 221 | 220 | if (LOG_AY8912){ |
| 222 | 221 | if(( data&0x30) != (m_p1_data&0x30)){ |
| 223 | 222 | logerror("write ay8910 controll bc1= %02X bdir= %02X\n",data&0x10, data&0x20); |
| 224 | 223 | } |
| 225 | 224 | } |
| 226 | ||
| 225 | ||
| 227 | 226 | m_eeprom->di_write(data & 0x01); |
| 228 | 227 | m_eeprom->clk_write((data & 0x04) ? ASSERT_LINE : CLEAR_LINE); |
| 229 | 228 | m_eeprom->cs_write((data & 0x02) ? ASSERT_LINE : CLEAR_LINE); |
| r31373 | r31374 | |
| 236 | 235 | |
| 237 | 236 | //AY 3-8912 data write/read |
| 238 | 237 | |
| 239 | if (data & 0x20){ | |
| 238 | if (data & 0x20){ //bdir | |
| 240 | 239 | //write to ay8912 |
| 241 | 240 | if (LOG_AY8912) |
| 242 | 241 | logerror("write to 0x06 bdir=1\n"); |
| r31373 | r31374 | |
| 248 | 247 | if (LOG_AY8912) |
| 249 | 248 | logerror("AY8912 address latch write=%02X\n",to_ay_data); |
| 250 | 249 | }else{ |
| 251 | //data_w | |
| 250 | //data_w | |
| 252 | 251 | if (LOG_AY8912) |
| 253 | 252 | logerror("write to 0x06 bc1=0\n"); |
| 254 | 253 | m_ay->data_w(space,0,to_ay_data ); |
| r31373 | r31374 | |
| 259 | 258 | if (LOG_AY8912) |
| 260 | 259 | logerror("write to 0x06 bdir=0\n"); |
| 261 | 260 | ay_data=m_ay->data_r(space,0); |
| 262 | } | |
| 263 | ||
| 261 | } | |
| 262 | ||
| 264 | 263 | m_p1_data=data; |
| 265 | 264 | } |
| 266 | 265 | |
| 267 | ||
| 268 | READ8_MEMBER(fireball_state::p3_r) | |
| 269 | { | |
| 266 | ||
| 267 | READ8_MEMBER(fireball_state::p3_r) | |
| 268 | { | |
| 270 | 269 | UINT8 ret = 0xfb | ((int_data&1)<<2); |
| 271 | 270 | if (LOG_P3) |
| 272 | 271 | logerror("read P3 port data = %02X\n",ret); |
| 273 | 272 | return ret; |
| 274 | } | |
| 275 | ||
| 273 | } | |
| 274 | ||
| 276 | 275 | WRITE8_MEMBER(fireball_state::p3_w) |
| 277 | ||
| 276 | { | |
| 278 | 277 | if (LOG_P3) |
| 279 | 278 | logerror("write to P3 port data=%02X\n",data); |
| 280 | ||
| 279 | ||
| 281 | 280 | m_p3_data=data; |
| 282 | 281 | } |
| 283 | ||
| 282 | ||
| 284 | 283 | /************************* |
| 285 | 284 | * Memory Map Information * |
| 286 | 285 | *************************/ |
| 287 | ||
| 286 | ||
| 288 | 287 | static ADDRESS_MAP_START( fireball_map, AS_PROGRAM, 8, fireball_state ) |
| 289 | 288 | AM_RANGE(0x0000, 0x1fff) AM_ROM |
| 290 | 289 | ADDRESS_MAP_END |
| 291 | 290 | |
| 292 | 291 | static ADDRESS_MAP_START( fireball_io_map, AS_IO, 8, fireball_state ) |
| 293 | ||
| 292 | ||
| 294 | 293 | AM_RANGE(0x00, 0x01)AM_READWRITE(io_00_r,io_00_w) |
| 295 | 294 | AM_RANGE(0x02, 0x03)AM_READWRITE(io_02_r,io_02_w) |
| 296 | 295 | AM_RANGE(0x04, 0x05)AM_READWRITE(io_04_r,io_04_w) |
| 297 | AM_RANGE(0x06, 0x07)AM_READWRITE(io_06_r,io_06_w) | |
| 298 | ||
| 296 | AM_RANGE(0x06, 0x07)AM_READWRITE(io_06_r,io_06_w) | |
| 297 | ||
| 299 | 298 | //internal port |
| 300 | 299 | AM_RANGE(MCS51_PORT_P1, MCS51_PORT_P1) AM_READWRITE(p1_r, p1_w) |
| 301 | 300 | AM_RANGE(MCS51_PORT_P3, MCS51_PORT_P3) AM_READWRITE(p3_r, p3_w) |
| r31373 | r31374 | |
| 321 | 320 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_I) PORT_NAME("800 Points") |
| 322 | 321 | |
| 323 | 322 | PORT_START("X6-8") |
| 324 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Empty Hopper A") | |
| 323 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_A) PORT_NAME("Empty Hopper A") //activeLow to fool the game code... | |
| 325 | 324 | PORT_BIT( 0x02, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_S) PORT_NAME("Empty Hopper B")//at least one hopper must be full |
| 326 | 325 | PORT_BIT( 0x04, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_D) PORT_NAME("Empty Hopper C") |
| 327 | 326 | PORT_BIT( 0x08, IP_ACTIVE_HIGH, IPT_BUTTON1 ) |
| r31373 | r31374 | |
| 330 | 329 | PORT_BIT( 0x40, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_X) PORT_NAME("Confirm Value") |
| 331 | 330 | PORT_BIT( 0x80, IP_ACTIVE_HIGH, IPT_OTHER ) PORT_CODE(KEYCODE_C) PORT_NAME("All Options Default value") |
| 332 | 331 | |
| 333 | PORT_START("X10-12") | |
| 332 | PORT_START("X10-12") | |
| 334 | 333 | PORT_DIPNAME( 0xff, 0x00, "Programming Value" ) |
| 335 | PORT_DIPSETTING( 0x00, "00" ) //0 | |
| 336 | PORT_DIPSETTING( 0x01, "01" ) | |
| 334 | PORT_DIPSETTING( 0x00, "00" ) //0 | |
| 335 | PORT_DIPSETTING( 0x01, "01" ) | |
| 337 | 336 | PORT_DIPSETTING( 0x02, "02" ) |
| 338 | 337 | PORT_DIPSETTING( 0x03, "03" ) |
| 339 | 338 | PORT_DIPSETTING( 0x04, "04" ) |
| r31373 | r31374 | |
| 342 | 341 | PORT_DIPSETTING( 0x07, "07" ) |
| 343 | 342 | PORT_DIPSETTING( 0x08, "08" ) |
| 344 | 343 | PORT_DIPSETTING( 0x09, "09" ) |
| 345 | PORT_DIPSETTING( 0x10, "10" ) | |
| 344 | PORT_DIPSETTING( 0x10, "10" ) //10 | |
| 346 | 345 | PORT_DIPSETTING( 0x11, "11" ) |
| 347 | 346 | PORT_DIPSETTING( 0x12, "12" ) |
| 348 | 347 | PORT_DIPSETTING( 0x13, "13" ) |
| r31373 | r31374 | |
| 352 | 351 | PORT_DIPSETTING( 0x17, "17" ) |
| 353 | 352 | PORT_DIPSETTING( 0x18, "18" ) |
| 354 | 353 | PORT_DIPSETTING( 0x19, "19" ) |
| 355 | PORT_DIPSETTING( 0x20, "20" ) | |
| 354 | PORT_DIPSETTING( 0x20, "20" ) //20 | |
| 356 | 355 | PORT_DIPSETTING( 0x21, "21" ) |
| 357 | 356 | PORT_DIPSETTING( 0x22, "22" ) |
| 358 | 357 | PORT_DIPSETTING( 0x23, "23" ) |
| r31373 | r31374 | |
| 362 | 361 | PORT_DIPSETTING( 0x27, "27" ) |
| 363 | 362 | PORT_DIPSETTING( 0x28, "28" ) |
| 364 | 363 | PORT_DIPSETTING( 0x29, "29" ) |
| 365 | PORT_DIPSETTING( 0x30, "30" ) | |
| 364 | PORT_DIPSETTING( 0x30, "30" ) //30 | |
| 366 | 365 | PORT_DIPSETTING( 0x31, "31" ) |
| 367 | 366 | PORT_DIPSETTING( 0x32, "32" ) |
| 368 | 367 | PORT_DIPSETTING( 0x33, "33" ) |
| r31373 | r31374 | |
| 372 | 371 | PORT_DIPSETTING( 0x37, "37" ) |
| 373 | 372 | PORT_DIPSETTING( 0x38, "38" ) |
| 374 | 373 | PORT_DIPSETTING( 0x39, "39" ) |
| 375 | PORT_DIPSETTING( 0x40, "40" ) | |
| 374 | PORT_DIPSETTING( 0x40, "40" ) //40 | |
| 376 | 375 | PORT_DIPSETTING( 0x41, "41" ) |
| 377 | 376 | PORT_DIPSETTING( 0x42, "42" ) |
| 378 | 377 | PORT_DIPSETTING( 0x43, "43" ) |
| r31373 | r31374 | |
| 382 | 381 | PORT_DIPSETTING( 0x47, "47" ) |
| 383 | 382 | PORT_DIPSETTING( 0x48, "48" ) |
| 384 | 383 | PORT_DIPSETTING( 0x49, "49" ) |
| 385 | PORT_DIPSETTING( 0x50, "50" ) | |
| 384 | PORT_DIPSETTING( 0x50, "50" ) //50 | |
| 386 | 385 | PORT_DIPSETTING( 0x51, "51" ) |
| 387 | 386 | PORT_DIPSETTING( 0x52, "52" ) |
| 388 | 387 | PORT_DIPSETTING( 0x53, "53" ) |
| r31373 | r31374 | |
| 392 | 391 | PORT_DIPSETTING( 0x57, "57" ) |
| 393 | 392 | PORT_DIPSETTING( 0x58, "58" ) |
| 394 | 393 | PORT_DIPSETTING( 0x59, "59" ) |
| 395 | PORT_DIPSETTING( 0x60, "60" ) | |
| 394 | PORT_DIPSETTING( 0x60, "60" ) //60 | |
| 396 | 395 | PORT_DIPSETTING( 0x61, "61" ) |
| 397 | 396 | PORT_DIPSETTING( 0x62, "62" ) |
| 398 | 397 | PORT_DIPSETTING( 0x63, "63" ) |
| r31373 | r31374 | |
| 402 | 401 | PORT_DIPSETTING( 0x67, "67" ) |
| 403 | 402 | PORT_DIPSETTING( 0x68, "68" ) |
| 404 | 403 | PORT_DIPSETTING( 0x69, "69" ) |
| 405 | PORT_DIPSETTING( 0x70, "70" ) | |
| 404 | PORT_DIPSETTING( 0x70, "70" ) //70 | |
| 406 | 405 | PORT_DIPSETTING( 0x71, "71" ) |
| 407 | 406 | PORT_DIPSETTING( 0x72, "72" ) |
| 408 | PORT_DIPSETTING( 0x73, "73" ) | |
| 407 | PORT_DIPSETTING( 0x73, "73" ) | |
| 409 | 408 | PORT_DIPSETTING( 0x74, "74" ) |
| 410 | 409 | PORT_DIPSETTING( 0x75, "75" ) |
| 411 | 410 | PORT_DIPSETTING( 0x76, "76" ) |
| 412 | 411 | PORT_DIPSETTING( 0x77, "77" ) |
| 413 | 412 | PORT_DIPSETTING( 0x78, "78" ) |
| 414 | 413 | PORT_DIPSETTING( 0x79, "79" ) |
| 415 | PORT_DIPSETTING( 0x80, "80" ) | |
| 414 | PORT_DIPSETTING( 0x80, "80" ) //80 | |
| 416 | 415 | PORT_DIPSETTING( 0x81, "81" ) |
| 417 | 416 | PORT_DIPSETTING( 0x82, "82" ) |
| 418 | 417 | PORT_DIPSETTING( 0x83, "83" ) |
| r31373 | r31374 | |
| 422 | 421 | PORT_DIPSETTING( 0x87, "87" ) |
| 423 | 422 | PORT_DIPSETTING( 0x88, "88" ) |
| 424 | 423 | PORT_DIPSETTING( 0x89, "89" ) |
| 425 | PORT_DIPSETTING( 0x90, "90" ) | |
| 424 | PORT_DIPSETTING( 0x90, "90" ) //90 | |
| 426 | 425 | PORT_DIPSETTING( 0x91, "91" ) |
| 427 | 426 | PORT_DIPSETTING( 0x92, "92" ) |
| 428 | PORT_DIPSETTING( 0x93, "93" ) | |
| 427 | PORT_DIPSETTING( 0x93, "93" ) | |
| 429 | 428 | PORT_DIPSETTING( 0x94, "94" ) |
| 430 | 429 | PORT_DIPSETTING( 0x95, "95" ) |
| 431 | 430 | PORT_DIPSETTING( 0x96, "96" ) |
| r31373 | r31374 | |
| 436 | 435 | INPUT_PORTS_END |
| 437 | 436 | |
| 438 | 437 | /****************************** |
| 439 | * machine reset | |
| 438 | * machine reset * | |
| 440 | 439 | ******************************/ |
| 441 | 440 | |
| 442 | 441 | void fireball_state::machine_reset() |
| r31373 | r31374 | |
| 444 | 443 | int_timing=1; |
| 445 | 444 | output_set_digit_value(5, 0x3f); |
| 446 | 445 | output_set_digit_value(6, 0x3f); |
| 447 | ||
| 446 | ||
| 448 | 447 | output_set_value("Hopper1", 0); |
| 449 | 448 | output_set_value("Hopper2", 0); |
| 450 | 449 | output_set_value("Hopper3", 0); |
| r31373 | r31374 | |
| 469 | 468 | if (int_timing==1){ |
| 470 | 469 | //logerror("INT set\n"); |
| 471 | 470 | m_maincpu->set_input_line(MCS51_INT0_LINE, ASSERT_LINE); |
| 472 | | |
| 471 | int_data=1; | |
| 473 | 472 | } |
| 474 | 473 | if (int_timing==2){ |
| 475 | 474 | //logerror("INT clear\n"); |
| 476 | 475 | m_maincpu->set_input_line(MCS51_INT0_LINE, CLEAR_LINE); |
| 477 | 476 | int_data=0; |
| 478 | } | |
| 477 | } | |
| 479 | 478 | if (int_timing==5){ |
| 480 | 479 | int_timing=0; |
| 481 | } | |
| 480 | } | |
| 482 | 481 | int_timing++; |
| 483 | 482 | } |
| 484 | 483 | |
| r31373 | r31374 | |
| 490 | 489 | |
| 491 | 490 | static MACHINE_CONFIG_START( fireball, fireball_state ) |
| 492 | 491 | /* basic machine hardware */ |
| 493 | MCFG_CPU_ADD("maincpu", I8031, CPU_CLK) | |
| 492 | MCFG_CPU_ADD("maincpu", I8031, CPU_CLK) // | |
| 494 | 493 | MCFG_CPU_PROGRAM_MAP(fireball_map) |
| 495 | 494 | MCFG_CPU_IO_MAP(fireball_io_map) |
| 496 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_0", fireball_state, int_0, attotime::from_hz(555)) | |
| 495 | MCFG_TIMER_DRIVER_ADD_PERIODIC("int_0", fireball_state, int_0, attotime::from_hz(555)) //9ms from scope reading 111Hz take care of this in the handler | |
| 497 | 496 | |
| 498 | 497 | MCFG_EEPROM_SERIAL_X24C44_ADD("eeprom") |
| 499 | ||
| 498 | ||
| 500 | 499 | /* sound hardware */ |
| 501 | 500 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 502 | 501 | MCFG_SOUND_ADD("aysnd", AY8912, AY_CLK) |
| 503 | 502 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) |
| 504 | ||
| 503 | ||
| 505 | 504 | /* Video */ |
| 506 | 505 | MCFG_DEFAULT_LAYOUT(layout_fireball) |
| 507 | 506 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
| 514 | 513 | ROM_START(fireball) |
| 515 | 514 | ROM_REGION(0x10000, "maincpu", 0) |
| 516 | 515 | ROM_LOAD("euroball-89-07-13-c026.bin", 0x0000, 0x2000, CRC(cab3fc1c) SHA1(bcf0d17e26f2d9f5e20bda258728c989ea138702)) |
| 517 | ||
| 516 | ||
| 518 | 517 | ROM_REGION( 0x20, "eeprom", 0 ) // default eeprom must have some specific value at 0x03 at least |
| 519 | ROM_LOAD( "fireball.nv", 0x0000, 0x020, CRC(1d0f5f0f) SHA1(8e68fcd8782f39ed3b1df6162db9be83cb3335e4) ) | |
| 518 | ROM_LOAD( "fireball.nv", 0x0000, 0x020, CRC(1d0f5f0f) SHA1(8e68fcd8782f39ed3b1df6162db9be83cb3335e4) ) //default setting | |
| 520 | 519 | ROM_END |
| 521 | 520 | |
| 522 | 521 | /************************* |
| 523 | 522 | * Game Drivers * |
| 524 | 523 | *************************/ |
| 525 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS*/ | |
| 526 | GAME( 1989, fireball, 0, fireball, fireball, driver_device, 0, ROT0, "Valco", "Fireball", GAME_MECHANICAL ) //1989 by rom name | |
| 527 | ||
| 528 | ||
| 524 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS*/ | |
| 525 | GAME( 1989, fireball, 0, fireball, fireball, driver_device, 0, ROT0, "Valco", "Fireball", GAME_MECHANICAL ) //1989 by rom name |
| r31373 | r31374 | |
|---|---|---|
| 260 | 260 | m_k001006_2(*this, "k001006_2"), |
| 261 | 261 | m_generic_paletteram_32(*this, "paletteram"), |
| 262 | 262 | m_konppc(*this, "konppc") { } |
| 263 | ||
| 263 | ||
| 264 | 264 | // TODO: Needs verification on real hardware |
| 265 | 265 | static const int m_sound_timer_usec = 2400; |
| 266 | 266 | |
| r31373 | r31374 | |
| 995 | 995 | MCFG_RF5C400_ADD("rfsnd", XTAL_33_8688MHz/2) |
| 996 | 996 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 997 | 997 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 998 | ||
| 998 | ||
| 999 | 999 | MCFG_DEVICE_ADD("konppc", KONPPC, 0) |
| 1000 | 1000 | MCFG_KONPPC_CGBOARD_NUMBER(1) |
| 1001 | 1001 | MCFG_KONPPC_CGBOARD_TYPE(CGBOARD_TYPE_GTICLUB) |
| r31373 | r31374 | |
| 1074 | 1074 | MCFG_VOODOO_SCREEN_TAG("lscreen") |
| 1075 | 1075 | MCFG_VOODOO_CPU_TAG("dsp") |
| 1076 | 1076 | MCFG_VOODOO_VBLANK_CB(WRITELINE(gticlub_state,voodoo_vblank_0)) |
| 1077 | ||
| 1077 | ||
| 1078 | 1078 | MCFG_DEVICE_ADD("voodoo1", VOODOO_1, STD_VOODOO_1_CLOCK) |
| 1079 | 1079 | MCFG_VOODOO_FBMEM(2) |
| 1080 | 1080 | MCFG_VOODOO_TMUMEM(2,2) |
| r31373 | r31374 | |
| 1133 | 1133 | MCFG_RF5C400_ADD("rfsnd", XTAL_33_8688MHz/2) |
| 1134 | 1134 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 1135 | 1135 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 1136 | ||
| 1136 | ||
| 1137 | 1137 | MCFG_DEVICE_ADD("konppc", KONPPC, 0) |
| 1138 | 1138 | MCFG_KONPPC_CGBOARD_NUMBER(2) |
| 1139 | 1139 | MCFG_KONPPC_CGBOARD_TYPE(CGBOARD_TYPE_HANGPLT) |
| r31373 | r31374 | |
|---|---|---|
| 174 | 174 | required_device<gfxdecode_device> m_gfxdecode; |
| 175 | 175 | required_device<palette_device> m_palette; |
| 176 | 176 | optional_shared_ptr<UINT8> m_generic_paletteram_8; |
| 177 | optional_shared_ptr<UINT8> m_generic_paletteram2_8; | |
| 177 | optional_shared_ptr<UINT8> m_generic_paletteram2_8; | |
| 178 | 178 | }; |
| 179 | 179 | |
| 180 | 180 | |
| r31373 | r31374 | |
| 205 | 205 | TILE_GET_INFO_MEMBER(skylncr_state::get_reel_1_tile_info) |
| 206 | 206 | { |
| 207 | 207 | UINT16 code = m_reeltiles_1_ram[ tile_index ] + (m_reeltileshigh_1_ram[ tile_index ] << 8); |
| 208 | int pal = (code & 0x8000) >> 15; | |
| 208 | int pal = (code & 0x8000) >> 15; | |
| 209 | 209 | SET_TILE_INFO_MEMBER(1, code&0x7fff, pal^1, TILE_FLIPYX( 0 )); |
| 210 | 210 | } |
| 211 | 211 | |
| r31373 | r31374 | |
| 611 | 611 | RGN_FRAC(1,2)+8*1, 8*1, |
| 612 | 612 | RGN_FRAC(1,2)+8*0, 8*0, |
| 613 | 613 | RGN_FRAC(1,2)+8*3, 8*3, |
| 614 | RGN_FRAC(1,2)+8*2, 8*2 | |
| 614 | RGN_FRAC(1,2)+8*2, 8*2 | |
| 615 | 615 | }, |
| 616 | 616 | { |
| 617 | 617 | STEP16(0,8*4), |
| r31373 | r31374 | |
| 634 | 634 | static GFXDECODE_START( neraidou ) |
| 635 | 635 | GFXDECODE_ENTRY( "gfx1", 0, layout8x8x8_alt, 0, 2 ) |
| 636 | 636 | GFXDECODE_ENTRY( "gfx2", 0, layout8x32x8_alt2, 0, 2 ) |
| 637 | // | |
| 637 | // GFXDECODE_ENTRY( "gfx2", 0, layout8x32x8_alt, 0x100, 1 ) | |
| 638 | 638 | GFXDECODE_END |
| 639 | 639 | |
| 640 | 640 | static GFXDECODE_START( sstar97 ) |
| r31373 | r31374 | |
| 834 | 834 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) |
| 835 | 835 | |
| 836 | 836 | PORT_START("DSW1") /* $02 (PPI0 port C) */ |
| 837 | PORT_DIPNAME( 0x11, 0x11, "Butterfly Max Mul" ) | |
| 837 | PORT_DIPNAME( 0x11, 0x11, "Butterfly Max Mul" ) PORT_DIPLOCATION("DSW-A:!4,!5") | |
| 838 | 838 | PORT_DIPSETTING( 0x11, "5" ) |
| 839 | 839 | PORT_DIPSETTING( 0x01, "7" ) |
| 840 | 840 | PORT_DIPSETTING( 0x10, "8" ) |
| 841 | 841 | PORT_DIPSETTING( 0x00, "12" ) |
| 842 | PORT_DIPNAME( 0x0e, 0x00, "Main Win Rate" ) | |
| 842 | PORT_DIPNAME( 0x0e, 0x00, "Main Win Rate" ) PORT_DIPLOCATION("DSW-A:!6,!7,!8") | |
| 843 | 843 | PORT_DIPSETTING( 0x0e, "55%" ) |
| 844 | 844 | PORT_DIPSETTING( 0x0c, "60%" ) |
| 845 | 845 | PORT_DIPSETTING( 0x0a, "65%" ) |
| r31373 | r31374 | |
| 848 | 848 | PORT_DIPSETTING( 0x04, "80%" ) |
| 849 | 849 | PORT_DIPSETTING( 0x02, "85%" ) |
| 850 | 850 | PORT_DIPSETTING( 0x00, "90%" ) |
| 851 | PORT_DIPNAME( 0x20, 0x00, "Reels Speed" ) | |
| 851 | PORT_DIPNAME( 0x20, 0x00, "Reels Speed" ) PORT_DIPLOCATION("DSW-A:!3") | |
| 852 | 852 | PORT_DIPSETTING( 0x20, "Slow" ) |
| 853 | 853 | PORT_DIPSETTING( 0x00, "Fast" ) |
| 854 | PORT_DIPNAME( 0x40, 0x00, "Bonus Score" ) | |
| 854 | PORT_DIPNAME( 0x40, 0x00, "Bonus Score" ) PORT_DIPLOCATION("DSW-A:!2") | |
| 855 | 855 | PORT_DIPSETTING( 0x40, "24" ) |
| 856 | 856 | PORT_DIPSETTING( 0x00, "32" ) |
| 857 | PORT_DIPNAME( 0x80, 0x00, "Key Out" ) | |
| 857 | PORT_DIPNAME( 0x80, 0x00, "Key Out" ) PORT_DIPLOCATION("DSW-A:!1") | |
| 858 | 858 | PORT_DIPSETTING( 0x00, "x1" ) |
| 859 | 859 | PORT_DIPSETTING( 0x80, "x100" ) |
| 860 | 860 | |
| 861 | 861 | PORT_START("DSW2") /* $10 (PPI1 port A) */ |
| 862 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) | |
| 862 | PORT_DIPNAME( 0x01, 0x01, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW-B:1") | |
| 863 | 863 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 864 | 864 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 865 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 865 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW-B:2") | |
| 866 | 866 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 867 | 867 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 868 | PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) | |
| 868 | PORT_DIPNAME( 0x04, 0x04, "Double-Up" ) PORT_DIPLOCATION("DSW-B:3") | |
| 869 | 869 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 870 | 870 | PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) |
| 871 | PORT_DIPNAME( 0x18, 0x18, "Refund Coin Limit" ) | |
| 871 | PORT_DIPNAME( 0x18, 0x18, "Refund Coin Limit" ) PORT_DIPLOCATION("DSW-B:4,5") | |
| 872 | 872 | PORT_DIPSETTING( 0x00, "0" ) |
| 873 | 873 | PORT_DIPSETTING( 0x18, "1000" ) |
| 874 | 874 | PORT_DIPSETTING( 0x10, "2000" ) |
| 875 | 875 | PORT_DIPSETTING( 0x08, "5000" ) |
| 876 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 876 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW-B:6") | |
| 877 | 877 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 878 | 878 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 879 | PORT_DIPNAME( 0xc0, 0xc0, "Butterfly Win Rate" ) | |
| 879 | PORT_DIPNAME( 0xc0, 0xc0, "Butterfly Win Rate" ) PORT_DIPLOCATION("DSW-B:7,8") | |
| 880 | 880 | PORT_DIPSETTING( 0xc0, "15%" ) |
| 881 | 881 | PORT_DIPSETTING( 0x80, "20%" ) |
| 882 | 882 | PORT_DIPSETTING( 0x40, "25%" ) |
| 883 | 883 | PORT_DIPSETTING( 0x00, "30%" ) |
| 884 | 884 | |
| 885 | 885 | PORT_START("DSW3") /* AY8910 port A */ |
| 886 | PORT_DIPNAME( 0x07, 0x07, "Coinage A, B & C" ) | |
| 886 | PORT_DIPNAME( 0x07, 0x07, "Coinage A, B & C" ) PORT_DIPLOCATION("DSW-D:1,2,3") | |
| 887 | 887 | PORT_DIPSETTING( 0x00, "1 Coin / 1 Credit" ) |
| 888 | 888 | PORT_DIPSETTING( 0x01, "1 Coin / 5 Credits" ) |
| 889 | 889 | PORT_DIPSETTING( 0x02, "1 Coin / 10 Credits" ) |
| r31373 | r31374 | |
| 892 | 892 | PORT_DIPSETTING( 0x05, "1 Coin / 40 Credits" ) |
| 893 | 893 | PORT_DIPSETTING( 0x06, "1 Coin / 50 Credits" ) |
| 894 | 894 | PORT_DIPSETTING( 0x07, "1 Coin / 100 Credit" ) |
| 895 | PORT_DIPNAME( 0x18, 0x00, "Credit Limit" ) | |
| 895 | PORT_DIPNAME( 0x18, 0x00, "Credit Limit" ) PORT_DIPLOCATION("DSW-D:4,5") | |
| 896 | 896 | PORT_DIPSETTING( 0x00, "120000" ) |
| 897 | 897 | PORT_DIPSETTING( 0x08, "100000" ) |
| 898 | 898 | PORT_DIPSETTING( 0x10, "80000" ) |
| 899 | 899 | PORT_DIPSETTING( 0x18, "50000" ) |
| 900 | PORT_DIPNAME( 0x20, 0x20, "Max Win Bonus" ) | |
| 900 | PORT_DIPNAME( 0x20, 0x20, "Max Win Bonus" ) PORT_DIPLOCATION("DSW-D:6") | |
| 901 | 901 | PORT_DIPSETTING( 0x20, "10000" ) |
| 902 | 902 | PORT_DIPSETTING( 0x00, "20000" ) |
| 903 | PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) | |
| 903 | PORT_DIPNAME( 0xc0, 0xc0, "Minimum Bet" ) PORT_DIPLOCATION("DSW-D:7,8") | |
| 904 | 904 | PORT_DIPSETTING( 0xc0, "8" ) |
| 905 | 905 | PORT_DIPSETTING( 0x80, "16" ) |
| 906 | 906 | PORT_DIPSETTING( 0x40, "32" ) |
| 907 | 907 | PORT_DIPSETTING( 0x00, "64" ) |
| 908 | 908 | |
| 909 | 909 | PORT_START("DSW4") /* AY8910 port B */ |
| 910 | PORT_DIPNAME( 0x07, 0x07, "Remote Credits" ) | |
| 910 | PORT_DIPNAME( 0x07, 0x07, "Remote Credits" ) PORT_DIPLOCATION("DSW-C:1,2,3") | |
| 911 | 911 | PORT_DIPSETTING( 0x00, "1 Pulse / 100 Credits" ) |
| 912 | 912 | PORT_DIPSETTING( 0x01, "1 Pulse / 110 Credits" ) |
| 913 | 913 | PORT_DIPSETTING( 0x02, "1 Pulse / 120 Credits" ) |
| r31373 | r31374 | |
| 916 | 916 | PORT_DIPSETTING( 0x05, "1 Pulse / 400 Credits" ) |
| 917 | 917 | PORT_DIPSETTING( 0x06, "1 Pulse / 500 Credits" ) |
| 918 | 918 | PORT_DIPSETTING( 0x07, "1 Pulse / 1000 Credits" ) |
| 919 | PORT_DIPNAME( 0x18, 0x18, "High Bet Limit" ) | |
| 919 | PORT_DIPNAME( 0x18, 0x18, "High Bet Limit" ) PORT_DIPLOCATION("DSW-C:4,5") | |
| 920 | 920 | PORT_DIPSETTING( 0x18, "32" ) |
| 921 | 921 | PORT_DIPSETTING( 0x10, "50" ) |
| 922 | 922 | PORT_DIPSETTING( 0x08, "72" ) |
| 923 | 923 | PORT_DIPSETTING( 0x00, "96" ) |
| 924 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 924 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW-C:6") | |
| 925 | 925 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 926 | 926 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 927 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 927 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("DSW-C:7") | |
| 928 | 928 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 929 | 929 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 930 | PORT_DIPNAME( 0x80, 0x00, "Coin Lock" ) | |
| 930 | PORT_DIPNAME( 0x80, 0x00, "Coin Lock" ) PORT_DIPLOCATION("DSW-C:8") | |
| 931 | 931 | PORT_DIPSETTING( 0x80, "Locked" ) |
| 932 | 932 | PORT_DIPSETTING( 0x00, "Normal" ) |
| 933 | 933 | INPUT_PORTS_END |
| r31373 | r31374 | |
| 976 | 976 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) |
| 977 | 977 | |
| 978 | 978 | PORT_START("DSW1") /* $02 (PPI0 port C) */ |
| 979 | PORT_DIPNAME( 0x01, 0x01, "Hardware Type (could be inverted)" ) | |
| 979 | PORT_DIPNAME( 0x01, 0x01, "Hardware Type (could be inverted)" ) // leave it off, otherwise the game works bad and resets | |
| 980 | 980 | PORT_DIPSETTING( 0x01, "Rolla" ) |
| 981 | 981 | PORT_DIPSETTING( 0x00, "Sky" ) |
| 982 | 982 | PORT_DIPNAME( 0x0e, 0x0e, "Main Game Percentage" ) |
| r31373 | r31374 | |
| 1120 | 1120 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_GAMBLE_KEYOUT ) |
| 1121 | 1121 | |
| 1122 | 1122 | PORT_START("DSW1") /* $02 (PPI0 port C) */ |
| 1123 | PORT_DIPNAME( 0x01, 0x01, "Hardware Type (could be inverted)" ) | |
| 1123 | PORT_DIPNAME( 0x01, 0x01, "Hardware Type (could be inverted)" ) // leave it off, otherwise the game works bad and resets | |
| 1124 | 1124 | PORT_DIPSETTING( 0x01, "Rolla" ) |
| 1125 | 1125 | PORT_DIPSETTING( 0x00, "Sky" ) |
| 1126 | 1126 | PORT_DIPNAME( 0x0e, 0x0e, "Main Game Percentage" ) |
| r31373 | r31374 | |
| 1161 | 1161 | PORT_DIPNAME( 0x10, 0x00, "Title" ) |
| 1162 | 1162 | PORT_DIPSETTING( 0x10, "Petalouda (Greek for Butterfly)" ) |
| 1163 | 1163 | PORT_DIPSETTING( 0x00, "Gallag" ) |
| 1164 | PORT_DIPNAME( 0x20, 0x20, "Alt GFX Decode (For different HW)" ) | |
| 1164 | PORT_DIPNAME( 0x20, 0x20, "Alt GFX Decode (For different HW)" ) // could be a mix with 08 'Rolla GFX' | |
| 1165 | 1165 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 1166 | 1166 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 1167 | 1167 | PORT_DIPNAME( 0xc0, 0xc0, "Butterfly Win Rate" ) |
| r31373 | r31374 | |
| 1502 | 1502 | ROM_LOAD16_BYTE( "mb.u35", 0x40001, 0x20000, CRC(fdaa2288) SHA1(199323c2bd2af0d9b1d254a330670e2845f21dd9) ) |
| 1503 | 1503 | |
| 1504 | 1504 | ROM_REGION( 0x80000, "gfx2", 0 ) |
| 1505 | ROM_LOAD16_BYTE( "mb.u52", 0x00000, 0x20000, CRC(15051537) SHA1(086c38c05c605f297a7bc470eb51763a7648e72c) ) // identical to butterfly. | |
| 1506 | ROM_LOAD16_BYTE( "mb.u54", 0x00001, 0x20000, CRC(8e34d029) SHA1(ae316f2f34768938a07d62db110ce59d2751abaa) ) // identical to butterfly. | |
| 1507 | ROM_LOAD16_BYTE( "mb.u56", 0x40000, 0x20000, CRC(21ca47f8) SHA1(b192be06a2eb817776309580dc64fd76772a8d50) ) // this one is straight fixed for reel tiles 6C-DF. | |
| 1508 | ROM_LOAD16_BYTE( "mb.u58", 0x40001, 0x20000, CRC(21ca47f8) SHA1(b192be06a2eb817776309580dc64fd76772a8d50) ) // identical to butterfly. | |
| 1505 | ROM_LOAD16_BYTE( "mb.u52", 0x00000, 0x20000, CRC(15051537) SHA1(086c38c05c605f297a7bc470eb51763a7648e72c) ) // identical to butterfly. | |
| 1506 | ROM_LOAD16_BYTE( "mb.u54", 0x00001, 0x20000, CRC(8e34d029) SHA1(ae316f2f34768938a07d62db110ce59d2751abaa) ) // identical to butterfly. | |
| 1507 | ROM_LOAD16_BYTE( "mb.u56", 0x40000, 0x20000, CRC(21ca47f8) SHA1(b192be06a2eb817776309580dc64fd76772a8d50) ) // this one is straight fixed for reel tiles 6C-DF. | |
| 1508 | ROM_LOAD16_BYTE( "mb.u58", 0x40001, 0x20000, CRC(21ca47f8) SHA1(b192be06a2eb817776309580dc64fd76772a8d50) ) // identical to butterfly. | |
| 1509 | 1509 | ROM_END |
| 1510 | 1510 | |
| 1511 | 1511 | ROM_START( gallag50 ) |
| r31373 | r31374 | |
|---|---|---|
| 23477 | 23477 | |
| 23478 | 23478 | |
| 23479 | 23479 | INPUT_PORTS_START( sc4pstat ) // this structure is generated |
| 23480 | PORT_INCLUDE( sc4_base ) | |
| 23481 | PORT_MODIFY("IN-1") | |
| 23482 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23483 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23484 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23485 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23486 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 23487 | PORT_MODIFY("IN-2") | |
| 23488 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23489 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23490 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23491 | PORT_MODIFY("IN-8") | |
| 23492 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("up") | |
| 23493 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("right") | |
| 23494 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("down") | |
| 23495 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("left") | |
| 23496 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cash") | |
| 23497 | PORT_MODIFY("IN-9") | |
| 23498 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nudge") | |
| 23499 | PORT_MODIFY("IN-16") | |
| 23500 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23501 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23502 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23503 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23504 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23505 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23506 | PORT_MODIFY("IN-17") | |
| 23507 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23508 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23509 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23510 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23511 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23512 | PORT_MODIFY("IN-18") | |
| 23513 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23514 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23515 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23516 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23517 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23518 | PORT_MODIFY("IN-19") | |
| 23519 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23520 | PORT_MODIFY("IN-20") | |
| 23521 | // 0x0001 - "test" // standard input (motherboard) | |
| 23522 | // 0x0002 - "lock" // standard input (expected here) | |
| 23523 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23524 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23525 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23480 | PORT_INCLUDE( sc4_base ) | |
| 23481 | PORT_MODIFY("IN-1") | |
| 23482 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23483 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23484 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23485 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23486 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 23487 | PORT_MODIFY("IN-2") | |
| 23488 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23489 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23490 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23491 | PORT_MODIFY("IN-8") | |
| 23492 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("up") | |
| 23493 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("right") | |
| 23494 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("down") | |
| 23495 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("left") | |
| 23496 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cash") | |
| 23497 | PORT_MODIFY("IN-9") | |
| 23498 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nudge") | |
| 23499 | PORT_MODIFY("IN-16") | |
| 23500 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23501 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23502 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23503 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23504 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23505 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23506 | PORT_MODIFY("IN-17") | |
| 23507 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23508 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23509 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23510 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23511 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23512 | PORT_MODIFY("IN-18") | |
| 23513 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23514 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23515 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23516 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23517 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23518 | PORT_MODIFY("IN-19") | |
| 23519 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23520 | PORT_MODIFY("IN-20") | |
| 23521 | // 0x0001 - "test" // standard input (motherboard) | |
| 23522 | // 0x0002 - "lock" // standard input (expected here) | |
| 23523 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23524 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23525 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23526 | 23526 | INPUT_PORTS_END |
| 23527 | 23527 | |
| 23528 | 23528 | // can't get past 'read meters' |
| r31373 | r31374 | |
| 23571 | 23571 | } |
| 23572 | 23572 | |
| 23573 | 23573 | INPUT_PORTS_START( sc4cvani ) // this structure is generated |
| 23574 | PORT_INCLUDE( sc4_base ) | |
| 23575 | PORT_MODIFY("IN-1") | |
| 23576 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23577 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("exchge") | |
| 23578 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 23579 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 23580 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 23581 | PORT_MODIFY("IN-2") | |
| 23582 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collet") | |
| 23583 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23584 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23585 | PORT_MODIFY("IN-8") | |
| 23586 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("low r") | |
| 23587 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low l") | |
| 23588 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("high l") | |
| 23589 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("high r") | |
| 23590 | PORT_MODIFY("IN-16") | |
| 23591 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23592 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23593 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23594 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23595 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23596 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23597 | PORT_MODIFY("IN-17") | |
| 23598 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23599 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23600 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23601 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23602 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23603 | PORT_MODIFY("IN-18") | |
| 23604 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23605 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23606 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23607 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23608 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23609 | PORT_MODIFY("IN-19") | |
| 23610 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23611 | PORT_MODIFY("IN-20") | |
| 23612 | // 0x0001 - "test" // standard input (motherboard) | |
| 23613 | // 0x0002 - "lock" // standard input (expected here) | |
| 23614 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23615 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23616 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23574 | PORT_INCLUDE( sc4_base ) | |
| 23575 | PORT_MODIFY("IN-1") | |
| 23576 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23577 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("exchge") | |
| 23578 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 23579 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 23580 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 23581 | PORT_MODIFY("IN-2") | |
| 23582 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collet") | |
| 23583 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23584 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23585 | PORT_MODIFY("IN-8") | |
| 23586 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("low r") | |
| 23587 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low l") | |
| 23588 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("high l") | |
| 23589 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("high r") | |
| 23590 | PORT_MODIFY("IN-16") | |
| 23591 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23592 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23593 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23594 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23595 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23596 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23597 | PORT_MODIFY("IN-17") | |
| 23598 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23599 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23600 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23601 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23602 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23603 | PORT_MODIFY("IN-18") | |
| 23604 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23605 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23606 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23607 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23608 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23609 | PORT_MODIFY("IN-19") | |
| 23610 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23611 | PORT_MODIFY("IN-20") | |
| 23612 | // 0x0001 - "test" // standard input (motherboard) | |
| 23613 | // 0x0002 - "lock" // standard input (expected here) | |
| 23614 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23615 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23616 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23617 | 23617 | INPUT_PORTS_END |
| 23618 | 23618 | |
| 23619 | 23619 | // PR2052 CASHLVANIA VANIASND CASH'!'VANIA |
| r31373 | r31374 | |
| 23651 | 23651 | } |
| 23652 | 23652 | |
| 23653 | 23653 | INPUT_PORTS_START( sc4cvclb ) // this structure is generated |
| 23654 | PORT_INCLUDE( sc4_base ) | |
| 23655 | PORT_MODIFY("IN-1") | |
| 23656 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23657 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23658 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23659 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23660 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 23661 | PORT_MODIFY("IN-2") | |
| 23662 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23663 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop") | |
| 23664 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23665 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23666 | PORT_MODIFY("IN-8") | |
| 23667 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("high l") | |
| 23668 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("high r") | |
| 23669 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudges") | |
| 23670 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("low r") | |
| 23671 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("low l") | |
| 23672 | PORT_MODIFY("IN-9") | |
| 23673 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("igor") | |
| 23674 | PORT_MODIFY("IN-16") | |
| 23675 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23676 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23677 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23678 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23679 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23680 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23681 | PORT_MODIFY("IN-17") | |
| 23682 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23683 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23684 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23685 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23686 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23687 | PORT_MODIFY("IN-18") | |
| 23688 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23689 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23690 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23691 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23692 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23693 | PORT_MODIFY("IN-19") | |
| 23694 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23695 | PORT_MODIFY("IN-20") | |
| 23696 | // 0x0001 - "test" // standard input (motherboard) | |
| 23697 | // 0x0002 - "lock" // standard input (expected here) | |
| 23698 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23699 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23700 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23654 | PORT_INCLUDE( sc4_base ) | |
| 23655 | PORT_MODIFY("IN-1") | |
| 23656 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23657 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23658 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23659 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23660 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 23661 | PORT_MODIFY("IN-2") | |
| 23662 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23663 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop") | |
| 23664 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23665 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23666 | PORT_MODIFY("IN-8") | |
| 23667 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("high l") | |
| 23668 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("high r") | |
| 23669 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudges") | |
| 23670 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("low r") | |
| 23671 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("low l") | |
| 23672 | PORT_MODIFY("IN-9") | |
| 23673 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("igor") | |
| 23674 | PORT_MODIFY("IN-16") | |
| 23675 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23676 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23677 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23678 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23679 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23680 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23681 | PORT_MODIFY("IN-17") | |
| 23682 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23683 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23684 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23685 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23686 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23687 | PORT_MODIFY("IN-18") | |
| 23688 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23689 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23690 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23691 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23692 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23693 | PORT_MODIFY("IN-19") | |
| 23694 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23695 | PORT_MODIFY("IN-20") | |
| 23696 | // 0x0001 - "test" // standard input (motherboard) | |
| 23697 | // 0x0002 - "lock" // standard input (expected here) | |
| 23698 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23699 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23700 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23701 | 23701 | INPUT_PORTS_END |
| 23702 | 23702 | |
| 23703 | 23703 | // PRXXXX CLUBCASHLVANIA V1.0 CLUBVANIASND CLUB CASH!VANIA |
| r31373 | r31374 | |
| 23737 | 23737 | |
| 23738 | 23738 | // inputs are from sc4gcclbl, the earlier(?) sets don't appear to have the structure filled in |
| 23739 | 23739 | INPUT_PORTS_START( sc4gcclbl ) // this structure is generated |
| 23740 | PORT_INCLUDE( sc4_base ) | |
| 23741 | PORT_MODIFY("IN-1") | |
| 23742 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 23743 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23744 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23745 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23746 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake1") | |
| 23747 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 23748 | PORT_MODIFY("IN-2") | |
| 23749 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake2") | |
| 23750 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stake3") | |
| 23751 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23752 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23753 | PORT_MODIFY("IN-3") | |
| 23754 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 23755 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 23756 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 23757 | PORT_MODIFY("IN-4") | |
| 23758 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 23759 | PORT_MODIFY("IN-5") | |
| 23760 | // 0x0001 - "priz4" // standard input (expected here) | |
| 23761 | // 0x0002 - "priz3" // standard input (expected here) | |
| 23762 | // 0x0004 - "priz2" // standard input (expected here) | |
| 23763 | // 0x0008 - "priz1" // standard input (expected here) | |
| 23764 | PORT_MODIFY("IN-16") | |
| 23765 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23766 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23767 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23768 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23769 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23770 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 23771 | PORT_MODIFY("IN-17") | |
| 23772 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23773 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23774 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23775 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23776 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 23777 | PORT_MODIFY("IN-18") | |
| 23778 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 23779 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 23780 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 23781 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 23782 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 23783 | PORT_MODIFY("IN-19") | |
| 23784 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 23785 | PORT_MODIFY("IN-20") | |
| 23786 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 23787 | // 0x0004 - "botdor" // standard input (expected here) | |
| 23788 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 23789 | // 0x0010 - "topdor" // standard input (expected here) | |
| 23740 | PORT_INCLUDE( sc4_base ) | |
| 23741 | PORT_MODIFY("IN-1") | |
| 23742 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 23743 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23744 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23745 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23746 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake1") | |
| 23747 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 23748 | PORT_MODIFY("IN-2") | |
| 23749 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake2") | |
| 23750 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stake3") | |
| 23751 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23752 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23753 | PORT_MODIFY("IN-3") | |
| 23754 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 23755 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 23756 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 23757 | PORT_MODIFY("IN-4") | |
| 23758 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 23759 | PORT_MODIFY("IN-5") | |
| 23760 | // 0x0001 - "priz4" // standard input (expected here) | |
| 23761 | // 0x0002 - "priz3" // standard input (expected here) | |
| 23762 | // 0x0004 - "priz2" // standard input (expected here) | |
| 23763 | // 0x0008 - "priz1" // standard input (expected here) | |
| 23764 | PORT_MODIFY("IN-16") | |
| 23765 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23766 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23767 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23768 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23769 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23770 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 23771 | PORT_MODIFY("IN-17") | |
| 23772 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23773 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23774 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23775 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23776 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 23777 | PORT_MODIFY("IN-18") | |
| 23778 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 23779 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 23780 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 23781 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 23782 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 23783 | PORT_MODIFY("IN-19") | |
| 23784 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 23785 | PORT_MODIFY("IN-20") | |
| 23786 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 23787 | // 0x0004 - "botdor" // standard input (expected here) | |
| 23788 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 23789 | // 0x0010 - "topdor" // standard input (expected here) | |
| 23790 | 23790 | INPUT_PORTS_END |
| 23791 | 23791 | |
| 23792 | 23792 | // this was marked (and has the header) GRAND CASINO, and was paired with some (bad dumps) of 'Grand Casino' sound roms, but it actually |
| r31373 | r31374 | |
| 23832 | 23832 | } |
| 23833 | 23833 | |
| 23834 | 23834 | INPUT_PORTS_START( sc4botn ) // this structure is generated |
| 23835 | PORT_INCLUDE( sc4_base ) | |
| 23836 | PORT_MODIFY("IN-1") | |
| 23837 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 23838 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23839 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23840 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23841 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchge") | |
| 23842 | PORT_MODIFY("IN-2") | |
| 23843 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 23844 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23845 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23846 | PORT_MODIFY("IN-8") | |
| 23847 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 23848 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 23849 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c pot") | |
| 23850 | PORT_MODIFY("IN-16") | |
| 23851 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23852 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23853 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23854 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23855 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23856 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23857 | PORT_MODIFY("IN-17") | |
| 23858 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23859 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23860 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23861 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23862 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23863 | PORT_MODIFY("IN-18") | |
| 23864 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23865 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23866 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23867 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23868 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23869 | PORT_MODIFY("IN-19") | |
| 23870 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23871 | PORT_MODIFY("IN-20") | |
| 23872 | // 0x0001 - "test" // standard input (motherboard) | |
| 23873 | // 0x0002 - "lock" // standard input (expected here) | |
| 23874 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23875 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23876 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23835 | PORT_INCLUDE( sc4_base ) | |
| 23836 | PORT_MODIFY("IN-1") | |
| 23837 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 23838 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23839 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23840 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23841 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchge") | |
| 23842 | PORT_MODIFY("IN-2") | |
| 23843 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 23844 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23845 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23846 | PORT_MODIFY("IN-8") | |
| 23847 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 23848 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 23849 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c pot") | |
| 23850 | PORT_MODIFY("IN-16") | |
| 23851 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23852 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23853 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23854 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23855 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23856 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23857 | PORT_MODIFY("IN-17") | |
| 23858 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23859 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23860 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23861 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23862 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23863 | PORT_MODIFY("IN-18") | |
| 23864 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23865 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23866 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23867 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23868 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23869 | PORT_MODIFY("IN-19") | |
| 23870 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23871 | PORT_MODIFY("IN-20") | |
| 23872 | // 0x0001 - "test" // standard input (motherboard) | |
| 23873 | // 0x0002 - "lock" // standard input (expected here) | |
| 23874 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23875 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23876 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23877 | 23877 | INPUT_PORTS_END |
| 23878 | 23878 | |
| 23879 | 23879 | // PR2538 BACK OF THE NET V011 BACKOFTHENETSND BACK OF THE NET |
| r31373 | r31374 | |
| 23904 | 23904 | } |
| 23905 | 23905 | |
| 23906 | 23906 | INPUT_PORTS_START( sc4bbclb ) // this structure is generated |
| 23907 | PORT_INCLUDE( sc4_base ) | |
| 23908 | PORT_MODIFY("IN-1") | |
| 23909 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23910 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23911 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23912 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23913 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 23914 | PORT_MODIFY("IN-2") | |
| 23915 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23916 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23917 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23918 | PORT_MODIFY("IN-8") | |
| 23919 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 23920 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("qps") | |
| 23921 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 23922 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 23923 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("nudges") | |
| 23924 | PORT_MODIFY("IN-16") | |
| 23925 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23926 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23927 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23928 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23929 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23930 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23931 | PORT_MODIFY("IN-17") | |
| 23932 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23933 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23934 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23935 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23936 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23937 | PORT_MODIFY("IN-18") | |
| 23938 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23939 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23940 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23941 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23942 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23943 | PORT_MODIFY("IN-19") | |
| 23944 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23945 | PORT_MODIFY("IN-20") | |
| 23946 | // 0x0001 - "test" // standard input (motherboard) | |
| 23947 | // 0x0002 - "lock" // standard input (expected here) | |
| 23948 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23949 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23950 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23907 | PORT_INCLUDE( sc4_base ) | |
| 23908 | PORT_MODIFY("IN-1") | |
| 23909 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23910 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23911 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23912 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23913 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 23914 | PORT_MODIFY("IN-2") | |
| 23915 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23916 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23917 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23918 | PORT_MODIFY("IN-8") | |
| 23919 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 23920 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("qps") | |
| 23921 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 23922 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 23923 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("nudges") | |
| 23924 | PORT_MODIFY("IN-16") | |
| 23925 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 23926 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 23927 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 23928 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 23929 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 23930 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 23931 | PORT_MODIFY("IN-17") | |
| 23932 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 23933 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 23934 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 23935 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 23936 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 23937 | PORT_MODIFY("IN-18") | |
| 23938 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 23939 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 23940 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 23941 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 23942 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 23943 | PORT_MODIFY("IN-19") | |
| 23944 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 23945 | PORT_MODIFY("IN-20") | |
| 23946 | // 0x0001 - "test" // standard input (motherboard) | |
| 23947 | // 0x0002 - "lock" // standard input (expected here) | |
| 23948 | // 0x0004 - "topdor" // standard input (expected here) | |
| 23949 | // 0x0008 - "botdor" // standard input (expected here) | |
| 23950 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23951 | 23951 | INPUT_PORTS_END |
| 23952 | 23952 | |
| 23953 | 23953 | // doesn't play |
| r31373 | r31374 | |
| 23979 | 23979 | } |
| 23980 | 23980 | |
| 23981 | 23981 | INPUT_PORTS_START( sc4captn ) // this structure is generated |
| 23982 | PORT_INCLUDE( sc4_base ) | |
| 23983 | PORT_MODIFY("IN-1") | |
| 23984 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23985 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23986 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23987 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23988 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 23989 | PORT_MODIFY("IN-2") | |
| 23990 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23991 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23992 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23993 | PORT_MODIFY("IN-4") | |
| 23994 | // 0x0010 - "topup" // known extended(?) input, sometimes 'top up' | |
| 23995 | PORT_MODIFY("IN-8") | |
| 23996 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkndge") | |
| 23997 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk ko") | |
| 23998 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featre OR tkfeat") | |
| 23999 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("cash OR tkcash") | |
| 24000 | PORT_MODIFY("IN-16") | |
| 24001 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24002 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24003 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24004 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24005 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24006 | PORT_MODIFY("IN-17") | |
| 24007 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24008 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24009 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24010 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24011 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24012 | PORT_MODIFY("IN-18") | |
| 24013 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24014 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24015 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24016 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24017 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24018 | PORT_MODIFY("IN-19") | |
| 24019 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24020 | PORT_MODIFY("IN-20") | |
| 24021 | // 0x0001 - "test" // standard input (motherboard) | |
| 24022 | // 0x0002 - "lock" // standard input (expected here) | |
| 24023 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24024 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24025 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 23982 | PORT_INCLUDE( sc4_base ) | |
| 23983 | PORT_MODIFY("IN-1") | |
| 23984 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 23985 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 23986 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 23987 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 23988 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 23989 | PORT_MODIFY("IN-2") | |
| 23990 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 23991 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 23992 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 23993 | PORT_MODIFY("IN-4") | |
| 23994 | // 0x0010 - "topup" // known extended(?) input, sometimes 'top up' | |
| 23995 | PORT_MODIFY("IN-8") | |
| 23996 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkndge") | |
| 23997 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk ko") | |
| 23998 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featre OR tkfeat") | |
| 23999 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("cash OR tkcash") | |
| 24000 | PORT_MODIFY("IN-16") | |
| 24001 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24002 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24003 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24004 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24005 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24006 | PORT_MODIFY("IN-17") | |
| 24007 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24008 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24009 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24010 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24011 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24012 | PORT_MODIFY("IN-18") | |
| 24013 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24014 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24015 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24016 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24017 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24018 | PORT_MODIFY("IN-19") | |
| 24019 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24020 | PORT_MODIFY("IN-20") | |
| 24021 | // 0x0001 - "test" // standard input (motherboard) | |
| 24022 | // 0x0002 - "lock" // standard input (expected here) | |
| 24023 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24024 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24025 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24026 | 24026 | INPUT_PORTS_END |
| 24027 | 24027 | |
| 24028 | 24028 | // PR2013 CAPTAIN CASH CCASH SOUNDS CAPTAIN CASH |
| r31373 | r31374 | |
| 24052 | 24052 | } |
| 24053 | 24053 | |
| 24054 | 24054 | INPUT_PORTS_START( sc4cmous ) // this structure is generated |
| 24055 | PORT_INCLUDE( sc4_base ) | |
| 24056 | PORT_MODIFY("IN-1") | |
| 24057 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 24058 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24059 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24060 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24061 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 24062 | PORT_MODIFY("IN-2") | |
| 24063 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24064 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24065 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24066 | PORT_MODIFY("IN-8") | |
| 24067 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24068 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 24069 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 24070 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 24071 | PORT_MODIFY("IN-16") | |
| 24072 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24073 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24074 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24075 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24076 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24077 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24078 | PORT_MODIFY("IN-17") | |
| 24079 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24080 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24081 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24082 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24083 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24084 | PORT_MODIFY("IN-18") | |
| 24085 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24086 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24087 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24088 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24089 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24090 | PORT_MODIFY("IN-19") | |
| 24091 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24092 | PORT_MODIFY("IN-20") | |
| 24093 | // 0x0001 - "test" // standard input (motherboard) | |
| 24094 | // 0x0002 - "lock" // standard input (expected here) | |
| 24095 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24096 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24097 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24055 | PORT_INCLUDE( sc4_base ) | |
| 24056 | PORT_MODIFY("IN-1") | |
| 24057 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 24058 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24059 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24060 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24061 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 24062 | PORT_MODIFY("IN-2") | |
| 24063 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24064 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24065 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24066 | PORT_MODIFY("IN-8") | |
| 24067 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24068 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 24069 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 24070 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 24071 | PORT_MODIFY("IN-16") | |
| 24072 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24073 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24074 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24075 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24076 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24077 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24078 | PORT_MODIFY("IN-17") | |
| 24079 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24080 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24081 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24082 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24083 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24084 | PORT_MODIFY("IN-18") | |
| 24085 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24086 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24087 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24088 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24089 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24090 | PORT_MODIFY("IN-19") | |
| 24091 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24092 | PORT_MODIFY("IN-20") | |
| 24093 | // 0x0001 - "test" // standard input (motherboard) | |
| 24094 | // 0x0002 - "lock" // standard input (expected here) | |
| 24095 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24096 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24097 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24098 | 24098 | INPUT_PORTS_END |
| 24099 | 24099 | |
| 24100 | 24100 | // PR2534 CASH AND MOUSE V041 CASHANDMOUSESND CASH AND MOUSE |
| r31373 | r31374 | |
| 24128 | 24128 | } |
| 24129 | 24129 | |
| 24130 | 24130 | INPUT_PORTS_START( sc4cad ) // this structure is generated |
| 24131 | PORT_INCLUDE( sc4_base ) | |
| 24132 | PORT_MODIFY("IN-1") | |
| 24133 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24134 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24135 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24136 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24137 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 24138 | PORT_MODIFY("IN-2") | |
| 24139 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24140 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24141 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24142 | PORT_MODIFY("IN-8") | |
| 24143 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24144 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 24145 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("dice") | |
| 24146 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 24147 | PORT_MODIFY("IN-16") | |
| 24148 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24149 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24150 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24151 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24152 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24153 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24154 | PORT_MODIFY("IN-17") | |
| 24155 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24156 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24157 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24158 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24159 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24160 | PORT_MODIFY("IN-18") | |
| 24161 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24162 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24163 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24164 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24165 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24166 | PORT_MODIFY("IN-19") | |
| 24167 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24168 | PORT_MODIFY("IN-20") | |
| 24169 | // 0x0001 - "test" // standard input (motherboard) | |
| 24170 | // 0x0002 - "lock" // standard input (expected here) | |
| 24171 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24172 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24173 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24131 | PORT_INCLUDE( sc4_base ) | |
| 24132 | PORT_MODIFY("IN-1") | |
| 24133 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24134 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24135 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24136 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24137 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 24138 | PORT_MODIFY("IN-2") | |
| 24139 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24140 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24141 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24142 | PORT_MODIFY("IN-8") | |
| 24143 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24144 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 24145 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("dice") | |
| 24146 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 24147 | PORT_MODIFY("IN-16") | |
| 24148 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24149 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24150 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24151 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24152 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24153 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24154 | PORT_MODIFY("IN-17") | |
| 24155 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24156 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24157 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24158 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24159 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24160 | PORT_MODIFY("IN-18") | |
| 24161 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24162 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24163 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24164 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24165 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24166 | PORT_MODIFY("IN-19") | |
| 24167 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24168 | PORT_MODIFY("IN-20") | |
| 24169 | // 0x0001 - "test" // standard input (motherboard) | |
| 24170 | // 0x0002 - "lock" // standard input (expected here) | |
| 24171 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24172 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24173 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24174 | 24174 | INPUT_PORTS_END |
| 24175 | 24175 | |
| 24176 | 24176 | // PR2528 CASH ADDER V1.0 CASHADDERSND CASH ADDER |
| r31373 | r31374 | |
| 24217 | 24217 | } |
| 24218 | 24218 | |
| 24219 | 24219 | INPUT_PORTS_START( sc4cadcl ) // this structure is generated |
| 24220 | PORT_INCLUDE( sc4_base ) | |
| 24221 | PORT_MODIFY("IN-1") | |
| 24222 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24223 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24224 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24225 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24226 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 24227 | PORT_MODIFY("IN-2") | |
| 24228 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24229 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 24230 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24231 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24232 | PORT_MODIFY("IN-8") | |
| 24233 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 24234 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("qps") | |
| 24235 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 24236 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("cash") | |
| 24237 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cpot") | |
| 24238 | PORT_MODIFY("IN-16") | |
| 24239 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24240 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24241 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24242 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24243 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24244 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24245 | PORT_MODIFY("IN-17") | |
| 24246 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24247 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24248 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24249 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24250 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24251 | PORT_MODIFY("IN-18") | |
| 24252 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24253 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24254 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24255 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24256 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24257 | PORT_MODIFY("IN-19") | |
| 24258 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24259 | PORT_MODIFY("IN-20") | |
| 24260 | // 0x0001 - "test" // standard input (motherboard) | |
| 24261 | // 0x0002 - "lock" // standard input (expected here) | |
| 24262 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24263 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24264 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24220 | PORT_INCLUDE( sc4_base ) | |
| 24221 | PORT_MODIFY("IN-1") | |
| 24222 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24223 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24224 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24225 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24226 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 24227 | PORT_MODIFY("IN-2") | |
| 24228 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24229 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 24230 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24231 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24232 | PORT_MODIFY("IN-8") | |
| 24233 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 24234 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("qps") | |
| 24235 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 24236 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("cash") | |
| 24237 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cpot") | |
| 24238 | PORT_MODIFY("IN-16") | |
| 24239 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24240 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24241 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24242 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24243 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24244 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24245 | PORT_MODIFY("IN-17") | |
| 24246 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24247 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24248 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24249 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24250 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24251 | PORT_MODIFY("IN-18") | |
| 24252 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24253 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24254 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24255 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24256 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24257 | PORT_MODIFY("IN-19") | |
| 24258 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24259 | PORT_MODIFY("IN-20") | |
| 24260 | // 0x0001 - "test" // standard input (motherboard) | |
| 24261 | // 0x0002 - "lock" // standard input (expected here) | |
| 24262 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24263 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24264 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24265 | 24265 | INPUT_PORTS_END |
| 24266 | 24266 | |
| 24267 | 24267 | // PRXXXX QPS155 CLUB CASH ADDER Version 411 CLUBCASHADDERSND CLUB CASH ADDER |
| r31373 | r31374 | |
| 24285 | 24285 | } |
| 24286 | 24286 | |
| 24287 | 24287 | INPUT_PORTS_START( sc4cr ) // this structure is generated |
| 24288 | PORT_INCLUDE( sc4_base ) | |
| 24289 | PORT_MODIFY("IN-1") | |
| 24290 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24291 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24292 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24293 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24294 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 24295 | PORT_MODIFY("IN-2") | |
| 24296 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24297 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24298 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24299 | PORT_MODIFY("IN-8") | |
| 24300 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("up") | |
| 24301 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("right") | |
| 24302 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("down") | |
| 24303 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("left") | |
| 24304 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cash") | |
| 24305 | PORT_MODIFY("IN-9") | |
| 24306 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nudge") | |
| 24307 | PORT_MODIFY("IN-16") | |
| 24308 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24309 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24310 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24311 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24312 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24313 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24314 | PORT_MODIFY("IN-17") | |
| 24315 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24316 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24317 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24318 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24319 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24320 | PORT_MODIFY("IN-18") | |
| 24321 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24322 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24323 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24324 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24325 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24326 | PORT_MODIFY("IN-19") | |
| 24327 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24328 | PORT_MODIFY("IN-20") | |
| 24329 | // 0x0001 - "test" // standard input (motherboard) | |
| 24330 | // 0x0002 - "lock" // standard input (expected here) | |
| 24331 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24332 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24333 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24288 | PORT_INCLUDE( sc4_base ) | |
| 24289 | PORT_MODIFY("IN-1") | |
| 24290 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24291 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24292 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24293 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24294 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 24295 | PORT_MODIFY("IN-2") | |
| 24296 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24297 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24298 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24299 | PORT_MODIFY("IN-8") | |
| 24300 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("up") | |
| 24301 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("right") | |
| 24302 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("down") | |
| 24303 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("left") | |
| 24304 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cash") | |
| 24305 | PORT_MODIFY("IN-9") | |
| 24306 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nudge") | |
| 24307 | PORT_MODIFY("IN-16") | |
| 24308 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24309 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24310 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24311 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24312 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24313 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24314 | PORT_MODIFY("IN-17") | |
| 24315 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24316 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24317 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24318 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24319 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24320 | PORT_MODIFY("IN-18") | |
| 24321 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24322 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24323 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24324 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24325 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24326 | PORT_MODIFY("IN-19") | |
| 24327 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24328 | PORT_MODIFY("IN-20") | |
| 24329 | // 0x0001 - "test" // standard input (motherboard) | |
| 24330 | // 0x0002 - "lock" // standard input (expected here) | |
| 24331 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24332 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24333 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24334 | 24334 | INPUT_PORTS_END |
| 24335 | 24335 | |
| 24336 | 24336 | |
| r31373 | r31374 | |
| 24369 | 24369 | } |
| 24370 | 24370 | |
| 24371 | 24371 | INPUT_PORTS_START( sc4crcl ) // this structure is generated |
| 24372 | PORT_INCLUDE( sc4_base ) | |
| 24373 | PORT_MODIFY("IN-1") | |
| 24374 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24375 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24376 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24377 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24378 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 24379 | PORT_MODIFY("IN-2") | |
| 24380 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24381 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop") | |
| 24382 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24383 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24384 | PORT_MODIFY("IN-8") | |
| 24385 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("up") | |
| 24386 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("right") | |
| 24387 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("down") | |
| 24388 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("left") | |
| 24389 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("igor") | |
| 24390 | PORT_MODIFY("IN-16") | |
| 24391 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24392 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24393 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24394 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24395 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24396 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24397 | PORT_MODIFY("IN-17") | |
| 24398 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24399 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24400 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24401 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24402 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24403 | PORT_MODIFY("IN-18") | |
| 24404 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24405 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24406 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24407 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24408 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24409 | PORT_MODIFY("IN-19") | |
| 24410 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24411 | PORT_MODIFY("IN-20") | |
| 24412 | // 0x0001 - "test" // standard input (motherboard) | |
| 24413 | // 0x0002 - "lock" // standard input (expected here) | |
| 24414 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24415 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24416 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24372 | PORT_INCLUDE( sc4_base ) | |
| 24373 | PORT_MODIFY("IN-1") | |
| 24374 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24375 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24376 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24377 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24378 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 24379 | PORT_MODIFY("IN-2") | |
| 24380 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24381 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop") | |
| 24382 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24383 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24384 | PORT_MODIFY("IN-8") | |
| 24385 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("up") | |
| 24386 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("right") | |
| 24387 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("down") | |
| 24388 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("left") | |
| 24389 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("igor") | |
| 24390 | PORT_MODIFY("IN-16") | |
| 24391 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24392 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24393 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24394 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24395 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24396 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24397 | PORT_MODIFY("IN-17") | |
| 24398 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24399 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24400 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24401 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24402 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24403 | PORT_MODIFY("IN-18") | |
| 24404 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24405 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24406 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24407 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24408 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24409 | PORT_MODIFY("IN-19") | |
| 24410 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24411 | PORT_MODIFY("IN-20") | |
| 24412 | // 0x0001 - "test" // standard input (motherboard) | |
| 24413 | // 0x0002 - "lock" // standard input (expected here) | |
| 24414 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24415 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24416 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24417 | 24417 | INPUT_PORTS_END |
| 24418 | 24418 | |
| 24419 | 24419 | // PR???? CLUB CASHRAKER V1.0 CLUBRAKERSND CLUB CASHRAKER |
| r31373 | r31374 | |
| 24445 | 24445 | } |
| 24446 | 24446 | |
| 24447 | 24447 | INPUT_PORTS_START( sc4cashm ) // this structure is generated |
| 24448 | PORT_INCLUDE( sc4_base ) | |
| 24449 | PORT_MODIFY("IN-1") | |
| 24450 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24451 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24452 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24453 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24454 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("take") | |
| 24455 | PORT_MODIFY("IN-2") | |
| 24456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24457 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24458 | PORT_MODIFY("IN-8") | |
| 24459 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24460 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blast") | |
| 24461 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("feat") | |
| 24462 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("topbrd") | |
| 24463 | PORT_MODIFY("IN-16") | |
| 24464 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24465 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24466 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24467 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24468 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24469 | PORT_MODIFY("IN-17") | |
| 24470 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24471 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24472 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24473 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24474 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24475 | PORT_MODIFY("IN-18") | |
| 24476 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24477 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24478 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24479 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24480 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24481 | PORT_MODIFY("IN-19") | |
| 24482 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24483 | PORT_MODIFY("IN-20") | |
| 24484 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 24448 | PORT_INCLUDE( sc4_base ) | |
| 24449 | PORT_MODIFY("IN-1") | |
| 24450 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24451 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24452 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24453 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24454 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("take") | |
| 24455 | PORT_MODIFY("IN-2") | |
| 24456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24457 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24458 | PORT_MODIFY("IN-8") | |
| 24459 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24460 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blast") | |
| 24461 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("feat") | |
| 24462 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("topbrd") | |
| 24463 | PORT_MODIFY("IN-16") | |
| 24464 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24465 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24466 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24467 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24468 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24469 | PORT_MODIFY("IN-17") | |
| 24470 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24471 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24472 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24473 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24474 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24475 | PORT_MODIFY("IN-18") | |
| 24476 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24477 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24478 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24479 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24480 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24481 | PORT_MODIFY("IN-19") | |
| 24482 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24483 | PORT_MODIFY("IN-20") | |
| 24484 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 24485 | 24485 | INPUT_PORTS_END |
| 24486 | 24486 | |
| 24487 | 24487 | // PR2008 CASHANOVA CASH SOUNDS |
| r31373 | r31374 | |
| 24529 | 24529 | |
| 24530 | 24530 | // the topbox sets contain no input defs |
| 24531 | 24531 | INPUT_PORTS_START( sc4ckxg ) // this structure is generated |
| 24532 | PORT_INCLUDE( sc4_base ) | |
| 24533 | PORT_MODIFY("IN-1") | |
| 24534 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24535 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 24536 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 24537 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 24538 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("trnsfr") | |
| 24539 | PORT_MODIFY("IN-2") | |
| 24540 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autply") | |
| 24541 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24542 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24543 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24544 | PORT_MODIFY("IN-3") | |
| 24545 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 24546 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 24547 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 24548 | PORT_MODIFY("IN-4") | |
| 24549 | // 0x0008 - "top up" // unexpected here | |
| 24550 | PORT_MODIFY("IN-5") | |
| 24551 | // 0x0001 - "priz4" // standard input (expected here) | |
| 24552 | // 0x0002 - "priz3" // standard input (expected here) | |
| 24553 | // 0x0004 - "priz2" // standard input (expected here) | |
| 24554 | // 0x0008 - "priz1" // standard input (expected here) | |
| 24555 | PORT_MODIFY("IN-6") | |
| 24556 | // 0x0001 - "perc1" // standard input (expected here) | |
| 24557 | // 0x0002 - "perc2" // standard input (expected here) | |
| 24558 | // 0x0004 - "perc3" // standard input (expected here) | |
| 24559 | // 0x0008 - "perc4" // standard input (expected here) | |
| 24560 | PORT_MODIFY("IN-16") | |
| 24561 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24562 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24563 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24564 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24565 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24566 | PORT_MODIFY("IN-17") | |
| 24567 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24568 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24569 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24570 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24571 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 24572 | PORT_MODIFY("IN-18") | |
| 24573 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 24574 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 24575 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 24576 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 24577 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 24578 | PORT_MODIFY("IN-19") | |
| 24579 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 24580 | PORT_MODIFY("IN-20") | |
| 24581 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 24582 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 24583 | // 0x0004 - "serdor" // standard input (expected here) | |
| 24584 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 24585 | // 0x0010 - "serdor" // standard input (expected here) | |
| 24532 | PORT_INCLUDE( sc4_base ) | |
| 24533 | PORT_MODIFY("IN-1") | |
| 24534 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24535 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 24536 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 24537 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 24538 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("trnsfr") | |
| 24539 | PORT_MODIFY("IN-2") | |
| 24540 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autply") | |
| 24541 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24542 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24543 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24544 | PORT_MODIFY("IN-3") | |
| 24545 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 24546 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 24547 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 24548 | PORT_MODIFY("IN-4") | |
| 24549 | // 0x0008 - "top up" // unexpected here | |
| 24550 | PORT_MODIFY("IN-5") | |
| 24551 | // 0x0001 - "priz4" // standard input (expected here) | |
| 24552 | // 0x0002 - "priz3" // standard input (expected here) | |
| 24553 | // 0x0004 - "priz2" // standard input (expected here) | |
| 24554 | // 0x0008 - "priz1" // standard input (expected here) | |
| 24555 | PORT_MODIFY("IN-6") | |
| 24556 | // 0x0001 - "perc1" // standard input (expected here) | |
| 24557 | // 0x0002 - "perc2" // standard input (expected here) | |
| 24558 | // 0x0004 - "perc3" // standard input (expected here) | |
| 24559 | // 0x0008 - "perc4" // standard input (expected here) | |
| 24560 | PORT_MODIFY("IN-16") | |
| 24561 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24562 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24563 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24564 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24565 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24566 | PORT_MODIFY("IN-17") | |
| 24567 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24568 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24569 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24570 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24571 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 24572 | PORT_MODIFY("IN-18") | |
| 24573 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 24574 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 24575 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 24576 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 24577 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 24578 | PORT_MODIFY("IN-19") | |
| 24579 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 24580 | PORT_MODIFY("IN-20") | |
| 24581 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 24582 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 24583 | // 0x0004 - "serdor" // standard input (expected here) | |
| 24584 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 24585 | // 0x0010 - "serdor" // standard input (expected here) | |
| 24586 | 24586 | INPUT_PORTS_END |
| 24587 | 24587 | |
| 24588 | 24588 | // this seems to need all the units connected to function |
| r31373 | r31374 | |
| 24615 | 24615 | } |
| 24616 | 24616 | |
| 24617 | 24617 | INPUT_PORTS_START( sc4chick ) // this structure is generated |
| 24618 | PORT_INCLUDE( sc4_base ) | |
| 24619 | PORT_MODIFY("IN-1") | |
| 24620 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold 1") | |
| 24621 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 2") | |
| 24622 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 3") | |
| 24623 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("cancel") | |
| 24624 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 24625 | PORT_MODIFY("IN-2") | |
| 24626 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24627 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24628 | PORT_MODIFY("IN-4") | |
| 24629 | // 0x0008 - "refloa" // unexpected here | |
| 24630 | PORT_MODIFY("IN-16") | |
| 24631 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24632 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24633 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24634 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24635 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24636 | PORT_MODIFY("IN-17") | |
| 24637 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24638 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24639 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24640 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24641 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24642 | PORT_MODIFY("IN-18") | |
| 24643 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24644 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24645 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24646 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24647 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24648 | PORT_MODIFY("IN-19") | |
| 24649 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24650 | PORT_MODIFY("IN-20") | |
| 24651 | // 0x0001 - "green" // standard input (motherboard) | |
| 24652 | // 0x0002 - "cash d" // standard input (expected here) | |
| 24653 | // 0x0004 - "top do" // standard input (expected here) | |
| 24654 | // 0x0008 - "dump" // standard input (expected here) | |
| 24618 | PORT_INCLUDE( sc4_base ) | |
| 24619 | PORT_MODIFY("IN-1") | |
| 24620 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold 1") | |
| 24621 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 2") | |
| 24622 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 3") | |
| 24623 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("cancel") | |
| 24624 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 24625 | PORT_MODIFY("IN-2") | |
| 24626 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24627 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24628 | PORT_MODIFY("IN-4") | |
| 24629 | // 0x0008 - "refloa" // unexpected here | |
| 24630 | PORT_MODIFY("IN-16") | |
| 24631 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24632 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24633 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24634 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24635 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24636 | PORT_MODIFY("IN-17") | |
| 24637 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24638 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24639 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24640 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24641 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24642 | PORT_MODIFY("IN-18") | |
| 24643 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24644 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24645 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24646 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24647 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24648 | PORT_MODIFY("IN-19") | |
| 24649 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24650 | PORT_MODIFY("IN-20") | |
| 24651 | // 0x0001 - "green" // standard input (motherboard) | |
| 24652 | // 0x0002 - "cash d" // standard input (expected here) | |
| 24653 | // 0x0004 - "top do" // standard input (expected here) | |
| 24654 | // 0x0008 - "dump" // standard input (expected here) | |
| 24655 | 24655 | INPUT_PORTS_END |
| 24656 | 24656 | |
| 24657 | 24657 | // PR7060CASINO CHICKEN DALES TTTWO SOUNDS CHICKEN DALES |
| r31373 | r31374 | |
| 24675 | 24675 | } |
| 24676 | 24676 | |
| 24677 | 24677 | INPUT_PORTS_START( sc4ccogs ) // this structure is generated |
| 24678 | PORT_INCLUDE( sc4_base ) | |
| 24679 | PORT_MODIFY("IN-1") | |
| 24680 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24681 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24682 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24683 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24684 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 24685 | PORT_MODIFY("IN-2") | |
| 24686 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24687 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24688 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24689 | PORT_MODIFY("IN-8") | |
| 24690 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24691 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("green") | |
| 24692 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blue") | |
| 24693 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("red") | |
| 24694 | PORT_MODIFY("IN-16") | |
| 24695 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24696 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24697 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24698 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24699 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24700 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24701 | PORT_MODIFY("IN-17") | |
| 24702 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24703 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24704 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24705 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24706 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24707 | PORT_MODIFY("IN-18") | |
| 24708 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24709 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24710 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24711 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24712 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24713 | PORT_MODIFY("IN-19") | |
| 24714 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24715 | PORT_MODIFY("IN-20") | |
| 24716 | // 0x0001 - "test" // standard input (motherboard) | |
| 24717 | // 0x0002 - "lock" // standard input (expected here) | |
| 24718 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24719 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24720 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24678 | PORT_INCLUDE( sc4_base ) | |
| 24679 | PORT_MODIFY("IN-1") | |
| 24680 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24681 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24682 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24683 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24684 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 24685 | PORT_MODIFY("IN-2") | |
| 24686 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 24687 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24688 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24689 | PORT_MODIFY("IN-8") | |
| 24690 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 24691 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("green") | |
| 24692 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blue") | |
| 24693 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("red") | |
| 24694 | PORT_MODIFY("IN-16") | |
| 24695 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 24696 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 24697 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 24698 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 24699 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 24700 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24701 | PORT_MODIFY("IN-17") | |
| 24702 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 24703 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 24704 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 24705 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 24706 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 24707 | PORT_MODIFY("IN-18") | |
| 24708 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 24709 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 24710 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 24711 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 24712 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 24713 | PORT_MODIFY("IN-19") | |
| 24714 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 24715 | PORT_MODIFY("IN-20") | |
| 24716 | // 0x0001 - "test" // standard input (motherboard) | |
| 24717 | // 0x0002 - "lock" // standard input (expected here) | |
| 24718 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24719 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24720 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24721 | 24721 | INPUT_PORTS_END |
| 24722 | 24722 | |
| 24723 | 24723 | // PR2522 CLEVERCOGS V1.0 CLEVERCOGSSND CLEVER COGS |
| r31373 | r31374 | |
| 24751 | 24751 | } |
| 24752 | 24752 | |
| 24753 | 24753 | INPUT_PORTS_START( sc4cclime ) // this structure is generated |
| 24754 | PORT_INCLUDE( sc4_base ) | |
| 24755 | PORT_MODIFY("IN-1") | |
| 24756 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24757 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 24758 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 24759 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 24760 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 24761 | PORT_MODIFY("IN-2") | |
| 24762 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 24763 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24764 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24765 | PORT_MODIFY("IN-3") | |
| 24766 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 24767 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 24768 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 24769 | PORT_MODIFY("IN-4") | |
| 24770 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 24771 | // 0x0008 - "hoptop" // known extended(?) input, sometimes 'hop top' | |
| 24772 | // 0x0100 - "hop lo" // known extended input, usually 'hopper low' | |
| 24773 | PORT_MODIFY("IN-5") | |
| 24774 | // 0x0001 - "priz4" // standard input (expected here) | |
| 24775 | // 0x0002 - "priz3" // standard input (expected here) | |
| 24776 | // 0x0004 - "priz2" // standard input (expected here) | |
| 24777 | // 0x0008 - "priz1" // standard input (expected here) | |
| 24778 | PORT_MODIFY("IN-6") | |
| 24779 | // 0x0001 - "perc1" // standard input (expected here) | |
| 24780 | // 0x0002 - "perc2" // standard input (expected here) | |
| 24781 | // 0x0004 - "perc3" // standard input (expected here) | |
| 24782 | // 0x0008 - "perc4" // standard input (expected here) | |
| 24783 | PORT_MODIFY("IN-16") | |
| 24784 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24785 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24786 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24787 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24788 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24789 | PORT_MODIFY("IN-17") | |
| 24790 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24791 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24792 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24793 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24794 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24795 | PORT_MODIFY("IN-18") | |
| 24796 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24797 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24798 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24799 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24800 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24801 | PORT_MODIFY("IN-19") | |
| 24802 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24803 | PORT_MODIFY("IN-20") | |
| 24804 | // 0x0001 - "grn bu" // standard input (motherboard) | |
| 24805 | // 0x0002 - "botdor" // standard input (expected here) | |
| 24806 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24807 | // 0x0008 - "hopdum" // standard input (expected here) | |
| 24754 | PORT_INCLUDE( sc4_base ) | |
| 24755 | PORT_MODIFY("IN-1") | |
| 24756 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24757 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 24758 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 24759 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 24760 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 24761 | PORT_MODIFY("IN-2") | |
| 24762 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 24763 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24764 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24765 | PORT_MODIFY("IN-3") | |
| 24766 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 24767 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 24768 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 24769 | PORT_MODIFY("IN-4") | |
| 24770 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 24771 | // 0x0008 - "hoptop" // known extended(?) input, sometimes 'hop top' | |
| 24772 | // 0x0100 - "hop lo" // known extended input, usually 'hopper low' | |
| 24773 | PORT_MODIFY("IN-5") | |
| 24774 | // 0x0001 - "priz4" // standard input (expected here) | |
| 24775 | // 0x0002 - "priz3" // standard input (expected here) | |
| 24776 | // 0x0004 - "priz2" // standard input (expected here) | |
| 24777 | // 0x0008 - "priz1" // standard input (expected here) | |
| 24778 | PORT_MODIFY("IN-6") | |
| 24779 | // 0x0001 - "perc1" // standard input (expected here) | |
| 24780 | // 0x0002 - "perc2" // standard input (expected here) | |
| 24781 | // 0x0004 - "perc3" // standard input (expected here) | |
| 24782 | // 0x0008 - "perc4" // standard input (expected here) | |
| 24783 | PORT_MODIFY("IN-16") | |
| 24784 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24785 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24786 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24787 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24788 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24789 | PORT_MODIFY("IN-17") | |
| 24790 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24791 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24792 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24793 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24794 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24795 | PORT_MODIFY("IN-18") | |
| 24796 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24797 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24798 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24799 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24800 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24801 | PORT_MODIFY("IN-19") | |
| 24802 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24803 | PORT_MODIFY("IN-20") | |
| 24804 | // 0x0001 - "grn bu" // standard input (motherboard) | |
| 24805 | // 0x0002 - "botdor" // standard input (expected here) | |
| 24806 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24807 | // 0x0008 - "hopdum" // standard input (expected here) | |
| 24808 | 24808 | INPUT_PORTS_END |
| 24809 | 24809 | |
| 24810 | 24810 | // PR1129 CASINO CRAZY CLIMBER PR1129 CRAZY CLIMBER SOUNDS11 |
| r31373 | r31374 | |
| 24869 | 24869 | // Crazy Fruits sets are a bit strange compared to others.. |
| 24870 | 24870 | // sc4cfqpsc, sc4cfqpse, sc4cfqpsf, sc4cfqpsg, sc4cfqpsh, sc4cfqpsi are the only sets to specify inputs, and they use port 7 which is VERY unusual |
| 24871 | 24871 | INPUT_PORTS_START( sc4cfqpsf ) // this structure is generated |
| 24872 | PORT_INCLUDE( sc4_base ) | |
| 24873 | PORT_MODIFY("IN-1") | |
| 24874 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24875 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24876 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24877 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24878 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 24879 | PORT_MODIFY("IN-2") | |
| 24880 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchan") | |
| 24881 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24882 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24883 | PORT_MODIFY("IN-7") | |
| 24884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("take s") | |
| 24885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_1 ) PORT_NAME("take n") | |
| 24886 | PORT_MODIFY("IN-8") | |
| 24887 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("banana") | |
| 24888 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("qps bu") | |
| 24889 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take c") | |
| 24890 | PORT_MODIFY("IN-16") | |
| 24891 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24892 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24893 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24894 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24895 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24896 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24897 | PORT_MODIFY("IN-17") | |
| 24898 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24899 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24900 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24901 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24902 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24903 | PORT_MODIFY("IN-18") | |
| 24904 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24905 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24906 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24907 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24908 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24909 | PORT_MODIFY("IN-19") | |
| 24910 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24911 | PORT_MODIFY("IN-20") | |
| 24912 | // 0x0001 - "test" // standard input (motherboard) | |
| 24913 | // 0x0002 - "lock" // standard input (expected here) | |
| 24914 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24915 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24916 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24872 | PORT_INCLUDE( sc4_base ) | |
| 24873 | PORT_MODIFY("IN-1") | |
| 24874 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24875 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 24876 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 24877 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 24878 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 24879 | PORT_MODIFY("IN-2") | |
| 24880 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchan") | |
| 24881 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 24882 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24883 | PORT_MODIFY("IN-7") | |
| 24884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("take s") | |
| 24885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_1 ) PORT_NAME("take n") | |
| 24886 | PORT_MODIFY("IN-8") | |
| 24887 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("banana") | |
| 24888 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("qps bu") | |
| 24889 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take c") | |
| 24890 | PORT_MODIFY("IN-16") | |
| 24891 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24892 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24893 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24894 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24895 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24896 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 24897 | PORT_MODIFY("IN-17") | |
| 24898 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24899 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24900 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24901 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24902 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24903 | PORT_MODIFY("IN-18") | |
| 24904 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24905 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 24906 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 24907 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 24908 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 24909 | PORT_MODIFY("IN-19") | |
| 24910 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 24911 | PORT_MODIFY("IN-20") | |
| 24912 | // 0x0001 - "test" // standard input (motherboard) | |
| 24913 | // 0x0002 - "lock" // standard input (expected here) | |
| 24914 | // 0x0004 - "topdor" // standard input (expected here) | |
| 24915 | // 0x0008 - "botdor" // standard input (expected here) | |
| 24916 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 24917 | 24917 | INPUT_PORTS_END |
| 24918 | 24918 | |
| 24919 | 24919 | // PR6813 CRAZY FRUITS PR6813 CRAZY FRUITS SOUNDS11 |
| r31373 | r31374 | |
| 24976 | 24976 | } |
| 24977 | 24977 | |
| 24978 | 24978 | INPUT_PORTS_START( sc4crzkyi ) // this structure is generated |
| 24979 | PORT_INCLUDE( sc4_base ) | |
| 24980 | PORT_MODIFY("IN-1") | |
| 24981 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24982 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 24983 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 24984 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 24985 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 24986 | PORT_MODIFY("IN-2") | |
| 24987 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 24988 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24989 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24990 | PORT_MODIFY("IN-3") | |
| 24991 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 24992 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 24993 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 24994 | PORT_MODIFY("IN-4") | |
| 24995 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 24996 | // 0x0008 - "hop to" // known extended(?) input, sometimes 'hop top' | |
| 24997 | // 0x0100 - "hop lo" // known extended input, usually 'hopper low' | |
| 24998 | PORT_MODIFY("IN-5") | |
| 24999 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25000 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25001 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25002 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25003 | PORT_MODIFY("IN-6") | |
| 25004 | // 0x0001 - "perc1" // standard input (expected here) | |
| 25005 | // 0x0002 - "perc2" // standard input (expected here) | |
| 25006 | // 0x0004 - "perc3" // standard input (expected here) | |
| 25007 | // 0x0008 - "perc4" // standard input (expected here) | |
| 25008 | PORT_MODIFY("IN-16") | |
| 25009 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25010 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25011 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25012 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25013 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25014 | PORT_MODIFY("IN-17") | |
| 25015 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25016 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25017 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25018 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25019 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25020 | PORT_MODIFY("IN-18") | |
| 25021 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25022 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25023 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25024 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25025 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25026 | PORT_MODIFY("IN-19") | |
| 25027 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25028 | PORT_MODIFY("IN-20") | |
| 25029 | // 0x0001 - "green" // standard input (motherboard) | |
| 25030 | // 0x0002 - "botdor" // standard input (expected here) | |
| 25031 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25032 | // 0x0008 - "hopper" // standard input (expected here) | |
| 24979 | PORT_INCLUDE( sc4_base ) | |
| 24980 | PORT_MODIFY("IN-1") | |
| 24981 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 24982 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 24983 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 24984 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 24985 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 24986 | PORT_MODIFY("IN-2") | |
| 24987 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 24988 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 24989 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 24990 | PORT_MODIFY("IN-3") | |
| 24991 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 24992 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 24993 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 24994 | PORT_MODIFY("IN-4") | |
| 24995 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 24996 | // 0x0008 - "hop to" // known extended(?) input, sometimes 'hop top' | |
| 24997 | // 0x0100 - "hop lo" // known extended input, usually 'hopper low' | |
| 24998 | PORT_MODIFY("IN-5") | |
| 24999 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25000 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25001 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25002 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25003 | PORT_MODIFY("IN-6") | |
| 25004 | // 0x0001 - "perc1" // standard input (expected here) | |
| 25005 | // 0x0002 - "perc2" // standard input (expected here) | |
| 25006 | // 0x0004 - "perc3" // standard input (expected here) | |
| 25007 | // 0x0008 - "perc4" // standard input (expected here) | |
| 25008 | PORT_MODIFY("IN-16") | |
| 25009 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25010 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25011 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25012 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25013 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25014 | PORT_MODIFY("IN-17") | |
| 25015 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25016 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25017 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25018 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25019 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25020 | PORT_MODIFY("IN-18") | |
| 25021 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25022 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25023 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25024 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25025 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25026 | PORT_MODIFY("IN-19") | |
| 25027 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25028 | PORT_MODIFY("IN-20") | |
| 25029 | // 0x0001 - "green" // standard input (motherboard) | |
| 25030 | // 0x0002 - "botdor" // standard input (expected here) | |
| 25031 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25032 | // 0x0008 - "hopper" // standard input (expected here) | |
| 25033 | 25033 | INPUT_PORTS_END |
| 25034 | 25034 | |
| 25035 | 25035 | // PR1128 CASINO CRAZY KEYS PR1128 CRAZY KEYS SOUNDS11 |
| r31373 | r31374 | |
| 25078 | 25078 | } |
| 25079 | 25079 | |
| 25080 | 25080 | INPUT_PORTS_START( sc4deepi ) // this structure is generated |
| 25081 | PORT_INCLUDE( sc4_base ) | |
| 25082 | PORT_MODIFY("IN-1") | |
| 25083 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25084 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 25085 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 25086 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 25087 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 25088 | PORT_MODIFY("IN-2") | |
| 25089 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25090 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25091 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25092 | PORT_MODIFY("IN-8") | |
| 25093 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("use") | |
| 25094 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tke my") | |
| 25095 | PORT_MODIFY("IN-16") | |
| 25096 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25097 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25098 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25099 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25100 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25101 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25102 | PORT_MODIFY("IN-17") | |
| 25103 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25104 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25105 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25106 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25107 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25108 | PORT_MODIFY("IN-18") | |
| 25109 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25110 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25111 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25112 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25113 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25114 | PORT_MODIFY("IN-19") | |
| 25115 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25116 | PORT_MODIFY("IN-20") | |
| 25117 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 25118 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 25119 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 25120 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 25121 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25081 | PORT_INCLUDE( sc4_base ) | |
| 25082 | PORT_MODIFY("IN-1") | |
| 25083 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25084 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 25085 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 25086 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 25087 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 25088 | PORT_MODIFY("IN-2") | |
| 25089 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25090 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25091 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25092 | PORT_MODIFY("IN-8") | |
| 25093 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("use") | |
| 25094 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tke my") | |
| 25095 | PORT_MODIFY("IN-16") | |
| 25096 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25097 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25098 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25099 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25100 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25101 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25102 | PORT_MODIFY("IN-17") | |
| 25103 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25104 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25105 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25106 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25107 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25108 | PORT_MODIFY("IN-18") | |
| 25109 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25110 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25111 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25112 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25113 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25114 | PORT_MODIFY("IN-19") | |
| 25115 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25116 | PORT_MODIFY("IN-20") | |
| 25117 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 25118 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 25119 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 25120 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 25121 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25122 | 25122 | INPUT_PORTS_END |
| 25123 | 25123 | |
| 25124 | 25124 | // PR2099 DEEP IMPACT DIMP SOUNDS DEEP IMPACT |
| r31373 | r31374 | |
| 25146 | 25146 | } |
| 25147 | 25147 | |
| 25148 | 25148 | INPUT_PORTS_START( sc4dblfr ) // this structure is generated |
| 25149 | PORT_INCLUDE( sc4_base ) | |
| 25150 | PORT_MODIFY("IN-1") | |
| 25151 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("collec OR cancel") | |
| 25152 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 25153 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 25154 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 25155 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("streak") | |
| 25156 | PORT_MODIFY("IN-2") | |
| 25157 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 25158 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 25159 | PORT_MODIFY("IN-16") | |
| 25160 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25161 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 25162 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 25163 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 25164 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 25165 | PORT_MODIFY("IN-17") | |
| 25166 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25167 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 25168 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 25169 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 25170 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 25171 | PORT_MODIFY("IN-18") | |
| 25172 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25173 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 25174 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 25175 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 25176 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 25177 | PORT_MODIFY("IN-19") | |
| 25178 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25179 | PORT_MODIFY("IN-20") | |
| 25180 | // 0x0001 - "green" // standard input (motherboard) | |
| 25149 | PORT_INCLUDE( sc4_base ) | |
| 25150 | PORT_MODIFY("IN-1") | |
| 25151 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("collec OR cancel") | |
| 25152 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 25153 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 25154 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 25155 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("streak") | |
| 25156 | PORT_MODIFY("IN-2") | |
| 25157 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 25158 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 25159 | PORT_MODIFY("IN-16") | |
| 25160 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25161 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 25162 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 25163 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 25164 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 25165 | PORT_MODIFY("IN-17") | |
| 25166 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25167 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 25168 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 25169 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 25170 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 25171 | PORT_MODIFY("IN-18") | |
| 25172 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25173 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 25174 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 25175 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 25176 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 25177 | PORT_MODIFY("IN-19") | |
| 25178 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 25179 | PORT_MODIFY("IN-20") | |
| 25180 | // 0x0001 - "green" // standard input (motherboard) | |
| 25181 | 25181 | INPUT_PORTS_END |
| 25182 | 25182 | |
| 25183 | 25183 | // PR7060 DOUBLE FRENZY DFRZYSND |
| r31373 | r31374 | |
| 25206 | 25206 | } |
| 25207 | 25207 | |
| 25208 | 25208 | INPUT_PORTS_START( sc4darw ) // this structure is generated |
| 25209 | PORT_INCLUDE( sc4_base ) | |
| 25210 | PORT_MODIFY("IN-1") | |
| 25211 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25212 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25213 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25214 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25215 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 25216 | PORT_MODIFY("IN-2") | |
| 25217 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("mixed") | |
| 25218 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25219 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25220 | PORT_MODIFY("IN-8") | |
| 25221 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 25222 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("rshoot") | |
| 25223 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bshoot") | |
| 25224 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 25225 | PORT_MODIFY("IN-16") | |
| 25226 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25227 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25228 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25229 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25230 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25231 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25232 | PORT_MODIFY("IN-17") | |
| 25233 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25234 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25235 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25236 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25237 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25238 | PORT_MODIFY("IN-18") | |
| 25239 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25240 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25241 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25242 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25243 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25244 | PORT_MODIFY("IN-19") | |
| 25245 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25246 | PORT_MODIFY("IN-20") | |
| 25247 | // 0x0001 - "test" // standard input (motherboard) | |
| 25248 | // 0x0002 - "lock" // standard input (expected here) | |
| 25249 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25250 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25251 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25209 | PORT_INCLUDE( sc4_base ) | |
| 25210 | PORT_MODIFY("IN-1") | |
| 25211 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25212 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25213 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25214 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25215 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 25216 | PORT_MODIFY("IN-2") | |
| 25217 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("mixed") | |
| 25218 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25219 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25220 | PORT_MODIFY("IN-8") | |
| 25221 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 25222 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("rshoot") | |
| 25223 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bshoot") | |
| 25224 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 25225 | PORT_MODIFY("IN-16") | |
| 25226 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25227 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25228 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25229 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25230 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25231 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25232 | PORT_MODIFY("IN-17") | |
| 25233 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25234 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25235 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25236 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25237 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25238 | PORT_MODIFY("IN-18") | |
| 25239 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25240 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25241 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25242 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25243 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25244 | PORT_MODIFY("IN-19") | |
| 25245 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25246 | PORT_MODIFY("IN-20") | |
| 25247 | // 0x0001 - "test" // standard input (motherboard) | |
| 25248 | // 0x0002 - "lock" // standard input (expected here) | |
| 25249 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25250 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25251 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25252 | 25252 | INPUT_PORTS_END |
| 25253 | 25253 | |
| 25254 | 25254 | // PR2026 DOUGH AND ARROW DOUGHSND DOUGH AND ARROW |
| r31373 | r31374 | |
| 25274 | 25274 | } |
| 25275 | 25275 | |
| 25276 | 25276 | INPUT_PORTS_START( sc4duckq ) // this structure is generated |
| 25277 | PORT_INCLUDE( sc4_base ) | |
| 25278 | PORT_MODIFY("IN-1") | |
| 25279 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25280 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collet") | |
| 25281 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 25282 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 25283 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 25284 | PORT_MODIFY("IN-2") | |
| 25285 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 25286 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25287 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25288 | PORT_MODIFY("IN-8") | |
| 25289 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("autnud") | |
| 25290 | PORT_MODIFY("IN-16") | |
| 25291 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25292 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25293 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25294 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25295 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25296 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25297 | PORT_MODIFY("IN-17") | |
| 25298 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25299 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25300 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25301 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25302 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25303 | PORT_MODIFY("IN-18") | |
| 25304 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25305 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25306 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25307 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25308 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25309 | PORT_MODIFY("IN-19") | |
| 25310 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25311 | PORT_MODIFY("IN-20") | |
| 25312 | // 0x0001 - "test" // standard input (motherboard) | |
| 25313 | // 0x0002 - "lock" // standard input (expected here) | |
| 25314 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25315 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25316 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25277 | PORT_INCLUDE( sc4_base ) | |
| 25278 | PORT_MODIFY("IN-1") | |
| 25279 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25280 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collet") | |
| 25281 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 25282 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 25283 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 25284 | PORT_MODIFY("IN-2") | |
| 25285 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 25286 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25287 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25288 | PORT_MODIFY("IN-8") | |
| 25289 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("autnud") | |
| 25290 | PORT_MODIFY("IN-16") | |
| 25291 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25292 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25293 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25294 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25295 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25296 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25297 | PORT_MODIFY("IN-17") | |
| 25298 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25299 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25300 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25301 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25302 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25303 | PORT_MODIFY("IN-18") | |
| 25304 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25305 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25306 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25307 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25308 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25309 | PORT_MODIFY("IN-19") | |
| 25310 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25311 | PORT_MODIFY("IN-20") | |
| 25312 | // 0x0001 - "test" // standard input (motherboard) | |
| 25313 | // 0x0002 - "lock" // standard input (expected here) | |
| 25314 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25315 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25316 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25317 | 25317 | INPUT_PORTS_END |
| 25318 | 25318 | |
| 25319 | 25319 | // PR2519 THEDUCKSOFHAZZARD V1.0 DUCKSOFHAZZARDSND DUCKS OF HAZZARD |
| r31373 | r31374 | |
| 25337 | 25337 | } |
| 25338 | 25338 | |
| 25339 | 25339 | INPUT_PORTS_START( sc4eascs ) // this structure is generated |
| 25340 | PORT_INCLUDE( sc4_base ) | |
| 25341 | PORT_MODIFY("IN-1") | |
| 25342 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold 1") | |
| 25343 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 2") | |
| 25344 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 3") | |
| 25345 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("cancel") | |
| 25346 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 25347 | PORT_MODIFY("IN-2") | |
| 25348 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 25349 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25350 | PORT_MODIFY("IN-3") | |
| 25351 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 25352 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 25353 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 25354 | PORT_MODIFY("IN-4") | |
| 25355 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 25356 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 25357 | // 0x0100 - "hop lo" // known extended input, usually 'hopper low' | |
| 25358 | PORT_MODIFY("IN-5") | |
| 25359 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25360 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25361 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25362 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25363 | PORT_MODIFY("IN-6") | |
| 25364 | // 0x0001 - "perc1" // standard input (expected here) | |
| 25365 | // 0x0002 - "perc2" // standard input (expected here) | |
| 25366 | // 0x0004 - "perc3" // standard input (expected here) | |
| 25367 | // 0x0008 - "perc4" // standard input (expected here) | |
| 25368 | PORT_MODIFY("IN-16") | |
| 25369 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25370 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25371 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25372 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25373 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25374 | PORT_MODIFY("IN-17") | |
| 25375 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25376 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25377 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25378 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25379 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25380 | PORT_MODIFY("IN-18") | |
| 25381 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25382 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25383 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25384 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 25385 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 25386 | PORT_MODIFY("IN-19") | |
| 25387 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 25388 | PORT_MODIFY("IN-20") | |
| 25389 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 25390 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 25391 | // 0x0004 - "frt do" // standard input (expected here) | |
| 25392 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 25393 | // 0x0010 - "serdor" // standard input (expected here) | |
| 25340 | PORT_INCLUDE( sc4_base ) | |
| 25341 | PORT_MODIFY("IN-1") | |
| 25342 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold 1") | |
| 25343 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 2") | |
| 25344 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 3") | |
| 25345 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("cancel") | |
| 25346 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 25347 | PORT_MODIFY("IN-2") | |
| 25348 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 25349 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25350 | PORT_MODIFY("IN-3") | |
| 25351 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 25352 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 25353 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 25354 | PORT_MODIFY("IN-4") | |
| 25355 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 25356 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 25357 | // 0x0100 - "hop lo" // known extended input, usually 'hopper low' | |
| 25358 | PORT_MODIFY("IN-5") | |
| 25359 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25360 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25361 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25362 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25363 | PORT_MODIFY("IN-6") | |
| 25364 | // 0x0001 - "perc1" // standard input (expected here) | |
| 25365 | // 0x0002 - "perc2" // standard input (expected here) | |
| 25366 | // 0x0004 - "perc3" // standard input (expected here) | |
| 25367 | // 0x0008 - "perc4" // standard input (expected here) | |
| 25368 | PORT_MODIFY("IN-16") | |
| 25369 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25370 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25371 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25372 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25373 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25374 | PORT_MODIFY("IN-17") | |
| 25375 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25376 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25377 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25378 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25379 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25380 | PORT_MODIFY("IN-18") | |
| 25381 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25382 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25383 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25384 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 25385 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 25386 | PORT_MODIFY("IN-19") | |
| 25387 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 25388 | PORT_MODIFY("IN-20") | |
| 25389 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 25390 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 25391 | // 0x0004 - "frt do" // standard input (expected here) | |
| 25392 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 25393 | // 0x0010 - "serdor" // standard input (expected here) | |
| 25394 | 25394 | INPUT_PORTS_END |
| 25395 | 25395 | |
| 25396 | 25396 | // PR1326 CASINO EASY STREAK PR1326 EASY STREAK SOUNDS11 (actually expects PR1326_CAS_EASY_STREAK_SOUNDS11 ? ) |
| r31373 | r31374 | |
| 25424 | 25424 | } |
| 25425 | 25425 | |
| 25426 | 25426 | INPUT_PORTS_START( sc4fastf ) // this structure is generated |
| 25427 | PORT_INCLUDE( sc4_base ) | |
| 25428 | PORT_MODIFY("IN-1") | |
| 25429 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25430 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 25431 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 25432 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 25433 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 25434 | PORT_MODIFY("IN-2") | |
| 25435 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collct") | |
| 25436 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ft exc") | |
| 25437 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25438 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25439 | PORT_MODIFY("IN-8") | |
| 25440 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("kos lo") | |
| 25441 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("ndg lo") | |
| 25442 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spn lo") | |
| 25443 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("kos hi") | |
| 25444 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ndg hi") | |
| 25445 | PORT_MODIFY("IN-9") | |
| 25446 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("spn hi") | |
| 25447 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("stop") | |
| 25448 | PORT_MODIFY("IN-16") | |
| 25449 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25450 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25451 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25452 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25453 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25454 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25455 | PORT_MODIFY("IN-17") | |
| 25456 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25457 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25458 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25459 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25460 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25461 | PORT_MODIFY("IN-18") | |
| 25462 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25463 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25464 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25465 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25466 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25467 | PORT_MODIFY("IN-19") | |
| 25468 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25469 | PORT_MODIFY("IN-20") | |
| 25470 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 25471 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 25472 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 25473 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 25474 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25427 | PORT_INCLUDE( sc4_base ) | |
| 25428 | PORT_MODIFY("IN-1") | |
| 25429 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25430 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 25431 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 25432 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 25433 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 25434 | PORT_MODIFY("IN-2") | |
| 25435 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collct") | |
| 25436 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ft exc") | |
| 25437 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25438 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25439 | PORT_MODIFY("IN-8") | |
| 25440 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("kos lo") | |
| 25441 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("ndg lo") | |
| 25442 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spn lo") | |
| 25443 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("kos hi") | |
| 25444 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ndg hi") | |
| 25445 | PORT_MODIFY("IN-9") | |
| 25446 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("spn hi") | |
| 25447 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("stop") | |
| 25448 | PORT_MODIFY("IN-16") | |
| 25449 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25450 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25451 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25452 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25453 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25454 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25455 | PORT_MODIFY("IN-17") | |
| 25456 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25457 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25458 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25459 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25460 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25461 | PORT_MODIFY("IN-18") | |
| 25462 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25463 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25464 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25465 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25466 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25467 | PORT_MODIFY("IN-19") | |
| 25468 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25469 | PORT_MODIFY("IN-20") | |
| 25470 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 25471 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 25472 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 25473 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 25474 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25475 | 25475 | INPUT_PORTS_END |
| 25476 | 25476 | |
| 25477 | 25477 | // PR2071 FAST 'N' FURIOUS FNF SOUNDS FAST 'N' FURIOUS |
| r31373 | r31374 | |
| 25497 | 25497 | } |
| 25498 | 25498 | |
| 25499 | 25499 | INPUT_PORTS_START( sc4ffru ) // this structure is generated |
| 25500 | PORT_INCLUDE( sc4_base ) | |
| 25501 | PORT_MODIFY("IN-1") | |
| 25502 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25503 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25504 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25505 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25506 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 25507 | PORT_MODIFY("IN-2") | |
| 25508 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25509 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25510 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25511 | PORT_MODIFY("IN-4") | |
| 25512 | // 0x0010 - "topup" // known extended(?) input, sometimes 'top up' | |
| 25513 | PORT_MODIFY("IN-8") | |
| 25514 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh ko") | |
| 25515 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("bonus") | |
| 25516 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 25517 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("featre") | |
| 25518 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet ko") | |
| 25519 | PORT_MODIFY("IN-16") | |
| 25520 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25521 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25522 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25523 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25524 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25525 | PORT_MODIFY("IN-17") | |
| 25526 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25527 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25528 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25529 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25530 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25531 | PORT_MODIFY("IN-18") | |
| 25532 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25533 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25534 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25535 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25536 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25537 | PORT_MODIFY("IN-19") | |
| 25538 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25539 | PORT_MODIFY("IN-20") | |
| 25540 | // 0x0001 - "test" // standard input (motherboard) | |
| 25541 | // 0x0002 - "lock" // standard input (expected here) | |
| 25542 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25543 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25544 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25500 | PORT_INCLUDE( sc4_base ) | |
| 25501 | PORT_MODIFY("IN-1") | |
| 25502 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25503 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25504 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25505 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25506 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 25507 | PORT_MODIFY("IN-2") | |
| 25508 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25509 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25510 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25511 | PORT_MODIFY("IN-4") | |
| 25512 | // 0x0010 - "topup" // known extended(?) input, sometimes 'top up' | |
| 25513 | PORT_MODIFY("IN-8") | |
| 25514 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh ko") | |
| 25515 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("bonus") | |
| 25516 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 25517 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("featre") | |
| 25518 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet ko") | |
| 25519 | PORT_MODIFY("IN-16") | |
| 25520 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25521 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25522 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25523 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25524 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25525 | PORT_MODIFY("IN-17") | |
| 25526 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25527 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25528 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25529 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25530 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25531 | PORT_MODIFY("IN-18") | |
| 25532 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25533 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25534 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25535 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25536 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25537 | PORT_MODIFY("IN-19") | |
| 25538 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25539 | PORT_MODIFY("IN-20") | |
| 25540 | // 0x0001 - "test" // standard input (motherboard) | |
| 25541 | // 0x0002 - "lock" // standard input (expected here) | |
| 25542 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25543 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25544 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25545 | 25545 | INPUT_PORTS_END |
| 25546 | 25546 | |
| 25547 | 25547 | // PR7070 FAST FRUIT FFRUIT SOUNDS FAST FRUIT |
| r31373 | r31374 | |
| 25570 | 25570 | } |
| 25571 | 25571 | |
| 25572 | 25572 | INPUT_PORTS_START( sc4fire ) // this structure is generated |
| 25573 | PORT_INCLUDE( sc4_base ) | |
| 25574 | PORT_MODIFY("IN-1") | |
| 25575 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25576 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 25577 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 25578 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 25579 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 25580 | PORT_MODIFY("IN-2") | |
| 25581 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25582 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25583 | PORT_MODIFY("IN-8") | |
| 25584 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 25585 | PORT_MODIFY("IN-16") | |
| 25586 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25587 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25588 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25589 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25590 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25591 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25592 | PORT_MODIFY("IN-17") | |
| 25593 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25594 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25595 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25596 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25597 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25598 | PORT_MODIFY("IN-18") | |
| 25599 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25600 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25601 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25602 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25603 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25604 | PORT_MODIFY("IN-19") | |
| 25605 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25606 | PORT_MODIFY("IN-20") | |
| 25607 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 25608 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 25609 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 25610 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 25611 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25573 | PORT_INCLUDE( sc4_base ) | |
| 25574 | PORT_MODIFY("IN-1") | |
| 25575 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25576 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 25577 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 25578 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 25579 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 25580 | PORT_MODIFY("IN-2") | |
| 25581 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25582 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25583 | PORT_MODIFY("IN-8") | |
| 25584 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 25585 | PORT_MODIFY("IN-16") | |
| 25586 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25587 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25588 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25589 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25590 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25591 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25592 | PORT_MODIFY("IN-17") | |
| 25593 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25594 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25595 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25596 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25597 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25598 | PORT_MODIFY("IN-18") | |
| 25599 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25600 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25601 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25602 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25603 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25604 | PORT_MODIFY("IN-19") | |
| 25605 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25606 | PORT_MODIFY("IN-20") | |
| 25607 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 25608 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 25609 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 25610 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 25611 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25612 | 25612 | INPUT_PORTS_END |
| 25613 | 25613 | |
| 25614 | 25614 | // PR2082 FIRE POWER FPOW SOUNDS FIRE POWER |
| r31373 | r31374 | |
| 25633 | 25633 | } |
| 25634 | 25634 | |
| 25635 | 25635 | INPUT_PORTS_START( sc4frenz ) // this structure is generated |
| 25636 | PORT_INCLUDE( sc4_base ) | |
| 25637 | PORT_MODIFY("IN-1") | |
| 25638 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25639 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25640 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25641 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25642 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 25643 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 25644 | PORT_MODIFY("IN-2") | |
| 25645 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 25646 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25647 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25648 | PORT_MODIFY("IN-3") | |
| 25649 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 25650 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 25651 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 25652 | PORT_MODIFY("IN-5") | |
| 25653 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25654 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25655 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25656 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25657 | PORT_MODIFY("IN-6") | |
| 25658 | // 0x0001 - "perc1" // standard input (expected here) | |
| 25659 | // 0x0002 - "perc2" // standard input (expected here) | |
| 25660 | // 0x0004 - "perc3" // standard input (expected here) | |
| 25661 | // 0x0008 - "perc4" // standard input (expected here) | |
| 25662 | PORT_MODIFY("IN-8") | |
| 25663 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("boost") | |
| 25664 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("no lse") | |
| 25665 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ch num") | |
| 25666 | PORT_MODIFY("IN-16") | |
| 25667 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25668 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25669 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25670 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25671 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25672 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25673 | PORT_MODIFY("IN-17") | |
| 25674 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25675 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25676 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25677 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25678 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25679 | PORT_MODIFY("IN-18") | |
| 25680 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25681 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25682 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25683 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 25684 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 25685 | PORT_MODIFY("IN-19") | |
| 25686 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 25687 | PORT_MODIFY("IN-20") | |
| 25688 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 25689 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 25690 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25691 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25692 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25636 | PORT_INCLUDE( sc4_base ) | |
| 25637 | PORT_MODIFY("IN-1") | |
| 25638 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25639 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25640 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25641 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25642 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 25643 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 25644 | PORT_MODIFY("IN-2") | |
| 25645 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 25646 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25647 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25648 | PORT_MODIFY("IN-3") | |
| 25649 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 25650 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 25651 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 25652 | PORT_MODIFY("IN-5") | |
| 25653 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25654 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25655 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25656 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25657 | PORT_MODIFY("IN-6") | |
| 25658 | // 0x0001 - "perc1" // standard input (expected here) | |
| 25659 | // 0x0002 - "perc2" // standard input (expected here) | |
| 25660 | // 0x0004 - "perc3" // standard input (expected here) | |
| 25661 | // 0x0008 - "perc4" // standard input (expected here) | |
| 25662 | PORT_MODIFY("IN-8") | |
| 25663 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("boost") | |
| 25664 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("no lse") | |
| 25665 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ch num") | |
| 25666 | PORT_MODIFY("IN-16") | |
| 25667 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25668 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25669 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25670 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25671 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25672 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25673 | PORT_MODIFY("IN-17") | |
| 25674 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25675 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25676 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25677 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25678 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25679 | PORT_MODIFY("IN-18") | |
| 25680 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25681 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25682 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25683 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 25684 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 25685 | PORT_MODIFY("IN-19") | |
| 25686 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 25687 | PORT_MODIFY("IN-20") | |
| 25688 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 25689 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 25690 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25691 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25692 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25693 | 25693 | INPUT_PORTS_END |
| 25694 | 25694 | |
| 25695 | 25695 | // PR1101 FRUIT FRENZY PR1101 FRUIT FRENZY SOUNDS11 |
| r31373 | r31374 | |
| 25717 | 25717 | } |
| 25718 | 25718 | |
| 25719 | 25719 | INPUT_PORTS_START( sc4ftopi ) // this structure is generated |
| 25720 | PORT_INCLUDE( sc4_base ) | |
| 25721 | PORT_MODIFY("IN-1") | |
| 25722 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25723 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25724 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25725 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25726 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 25727 | PORT_MODIFY("IN-2") | |
| 25728 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25729 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25730 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25731 | PORT_MODIFY("IN-8") | |
| 25732 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 25733 | PORT_MODIFY("IN-9") | |
| 25734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nudge") | |
| 25735 | PORT_MODIFY("IN-16") | |
| 25736 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25737 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25738 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25739 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25740 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25741 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25742 | PORT_MODIFY("IN-17") | |
| 25743 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25744 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25745 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25746 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25747 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25748 | PORT_MODIFY("IN-18") | |
| 25749 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25750 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25751 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25752 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25753 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25754 | PORT_MODIFY("IN-19") | |
| 25755 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25756 | PORT_MODIFY("IN-20") | |
| 25757 | // 0x0001 - "test" // standard input (motherboard) | |
| 25758 | // 0x0002 - "lock" // standard input (expected here) | |
| 25759 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25760 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25761 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25720 | PORT_INCLUDE( sc4_base ) | |
| 25721 | PORT_MODIFY("IN-1") | |
| 25722 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 25723 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25724 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25725 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25726 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 25727 | PORT_MODIFY("IN-2") | |
| 25728 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25729 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25730 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25731 | PORT_MODIFY("IN-8") | |
| 25732 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 25733 | PORT_MODIFY("IN-9") | |
| 25734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nudge") | |
| 25735 | PORT_MODIFY("IN-16") | |
| 25736 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25737 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25738 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25739 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25740 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25741 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25742 | PORT_MODIFY("IN-17") | |
| 25743 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25744 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25745 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25746 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25747 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25748 | PORT_MODIFY("IN-18") | |
| 25749 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25750 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25751 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25752 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25753 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25754 | PORT_MODIFY("IN-19") | |
| 25755 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25756 | PORT_MODIFY("IN-20") | |
| 25757 | // 0x0001 - "test" // standard input (motherboard) | |
| 25758 | // 0x0002 - "lock" // standard input (expected here) | |
| 25759 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25760 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25761 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25762 | 25762 | INPUT_PORTS_END |
| 25763 | 25763 | |
| 25764 | 25764 | // PR2027 FRUITOPIA FRUITOPIASND FRUITOPIA |
| r31373 | r31374 | |
| 25793 | 25793 | } |
| 25794 | 25794 | |
| 25795 | 25795 | INPUT_PORTS_START( sc4fullt ) // this structure is generated |
| 25796 | PORT_INCLUDE( sc4_base ) | |
| 25797 | PORT_MODIFY("IN-1") | |
| 25798 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 25799 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25800 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25801 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25802 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 25803 | PORT_MODIFY("IN-2") | |
| 25804 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25805 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25806 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25807 | PORT_MODIFY("IN-8") | |
| 25808 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 25809 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 25810 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("wserie") | |
| 25811 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 25812 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("nudge") | |
| 25813 | PORT_MODIFY("IN-16") | |
| 25814 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25815 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25816 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25817 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25818 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25819 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25820 | PORT_MODIFY("IN-17") | |
| 25821 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25822 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25823 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25824 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25825 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25826 | PORT_MODIFY("IN-18") | |
| 25827 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25828 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25829 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25830 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25831 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25832 | PORT_MODIFY("IN-19") | |
| 25833 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25834 | PORT_MODIFY("IN-20") | |
| 25835 | // 0x0001 - "test" // standard input (motherboard) | |
| 25836 | // 0x0002 - "lock" // standard input (expected here) | |
| 25837 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25838 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25839 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25796 | PORT_INCLUDE( sc4_base ) | |
| 25797 | PORT_MODIFY("IN-1") | |
| 25798 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 25799 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25800 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25801 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25802 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 25803 | PORT_MODIFY("IN-2") | |
| 25804 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 25805 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25806 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25807 | PORT_MODIFY("IN-8") | |
| 25808 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 25809 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 25810 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("wserie") | |
| 25811 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 25812 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("nudge") | |
| 25813 | PORT_MODIFY("IN-16") | |
| 25814 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25815 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25816 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25817 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25818 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25819 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25820 | PORT_MODIFY("IN-17") | |
| 25821 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25822 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25823 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25824 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25825 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 25826 | PORT_MODIFY("IN-18") | |
| 25827 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 25828 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 25829 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 25830 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 25831 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 25832 | PORT_MODIFY("IN-19") | |
| 25833 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 25834 | PORT_MODIFY("IN-20") | |
| 25835 | // 0x0001 - "test" // standard input (motherboard) | |
| 25836 | // 0x0002 - "lock" // standard input (expected here) | |
| 25837 | // 0x0004 - "topdor" // standard input (expected here) | |
| 25838 | // 0x0008 - "botdor" // standard input (expected here) | |
| 25839 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25840 | 25840 | INPUT_PORTS_END |
| 25841 | 25841 | |
| 25842 | 25842 | // PR2537 FULL THROTTLE 011 FULLTHROTTLESND FULL THROTTLE |
| r31373 | r31374 | |
| 25873 | 25873 | } |
| 25874 | 25874 | |
| 25875 | 25875 | INPUT_PORTS_START( sc4ziggy ) // this structure is generated |
| 25876 | PORT_INCLUDE( sc4_base ) | |
| 25877 | PORT_MODIFY("IN-1") | |
| 25878 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 25879 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 25880 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 25881 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 25882 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 25883 | PORT_MODIFY("IN-2") | |
| 25884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 25885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 25886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 25888 | PORT_MODIFY("IN-8") | |
| 25889 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 25890 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 25891 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 25892 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 25893 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 25894 | PORT_MODIFY("IN-9") | |
| 25895 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 25896 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 25897 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 25898 | PORT_MODIFY("IN-16") | |
| 25899 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25900 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25901 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25902 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25903 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25904 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25905 | PORT_MODIFY("IN-17") | |
| 25906 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25907 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25908 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25909 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25910 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25911 | PORT_MODIFY("IN-18") | |
| 25912 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25913 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25914 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25915 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 25916 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 25917 | PORT_MODIFY("IN-19") | |
| 25918 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 25919 | PORT_MODIFY("IN-20") | |
| 25920 | // 0x0001 - "test" // standard input (motherboard) | |
| 25921 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 25922 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 25923 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 25924 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25876 | PORT_INCLUDE( sc4_base ) | |
| 25877 | PORT_MODIFY("IN-1") | |
| 25878 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 25879 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 25880 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 25881 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 25882 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 25883 | PORT_MODIFY("IN-2") | |
| 25884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 25885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 25886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 25887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 25888 | PORT_MODIFY("IN-8") | |
| 25889 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 25890 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 25891 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 25892 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 25893 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 25894 | PORT_MODIFY("IN-9") | |
| 25895 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 25896 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 25897 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 25898 | PORT_MODIFY("IN-16") | |
| 25899 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25900 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25901 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25902 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25903 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25904 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 25905 | PORT_MODIFY("IN-17") | |
| 25906 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25907 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25908 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25909 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25910 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25911 | PORT_MODIFY("IN-18") | |
| 25912 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25913 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25914 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25915 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 25916 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 25917 | PORT_MODIFY("IN-19") | |
| 25918 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 25919 | PORT_MODIFY("IN-20") | |
| 25920 | // 0x0001 - "test" // standard input (motherboard) | |
| 25921 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 25922 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 25923 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 25924 | // 0x0010 - "deflt" // standard input (expected here) | |
| 25925 | 25925 | INPUT_PORTS_END |
| 25926 | 25926 | |
| 25927 | 25927 | // PR2162 GETTIN' ZIGGY ZIGY SOUNDS GETTIN' ZIGGY |
| r31373 | r31374 | |
| 25951 | 25951 | } |
| 25952 | 25952 | |
| 25953 | 25953 | INPUT_PORTS_START( sc4gldcl ) // this structure is generated |
| 25954 | PORT_INCLUDE( sc4_base ) | |
| 25955 | PORT_MODIFY("IN-1") | |
| 25956 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 25957 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25958 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25959 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25960 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 25961 | PORT_MODIFY("IN-2") | |
| 25962 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 25963 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 25964 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25965 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 25966 | PORT_MODIFY("IN-3") | |
| 25967 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 25968 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 25969 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 25970 | PORT_MODIFY("IN-4") | |
| 25971 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 25972 | PORT_MODIFY("IN-5") | |
| 25973 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25974 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25975 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25976 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25977 | PORT_MODIFY("IN-8") | |
| 25978 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 25979 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk spi") | |
| 25980 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 25981 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk cpo") | |
| 25982 | PORT_MODIFY("IN-16") | |
| 25983 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25984 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25985 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25986 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25987 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25988 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25989 | PORT_MODIFY("IN-17") | |
| 25990 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25991 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25992 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25993 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25994 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25995 | PORT_MODIFY("IN-18") | |
| 25996 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25997 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25998 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25999 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26000 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26001 | PORT_MODIFY("IN-19") | |
| 26002 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26003 | PORT_MODIFY("IN-20") | |
| 26004 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26005 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26006 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26007 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26008 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 25954 | PORT_INCLUDE( sc4_base ) | |
| 25955 | PORT_MODIFY("IN-1") | |
| 25956 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 25957 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 25958 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 25959 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 25960 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 25961 | PORT_MODIFY("IN-2") | |
| 25962 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 25963 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 25964 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 25965 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 25966 | PORT_MODIFY("IN-3") | |
| 25967 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 25968 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 25969 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 25970 | PORT_MODIFY("IN-4") | |
| 25971 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 25972 | PORT_MODIFY("IN-5") | |
| 25973 | // 0x0001 - "priz4" // standard input (expected here) | |
| 25974 | // 0x0002 - "priz3" // standard input (expected here) | |
| 25975 | // 0x0004 - "priz2" // standard input (expected here) | |
| 25976 | // 0x0008 - "priz1" // standard input (expected here) | |
| 25977 | PORT_MODIFY("IN-8") | |
| 25978 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 25979 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk spi") | |
| 25980 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 25981 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk cpo") | |
| 25982 | PORT_MODIFY("IN-16") | |
| 25983 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 25984 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 25985 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 25986 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 25987 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 25988 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 25989 | PORT_MODIFY("IN-17") | |
| 25990 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 25991 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 25992 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 25993 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 25994 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 25995 | PORT_MODIFY("IN-18") | |
| 25996 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 25997 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 25998 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 25999 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26000 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26001 | PORT_MODIFY("IN-19") | |
| 26002 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26003 | PORT_MODIFY("IN-20") | |
| 26004 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26005 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26006 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26007 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26008 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26009 | 26009 | INPUT_PORTS_END |
| 26010 | 26010 | |
| 26011 | 26011 | // PR2292 CLUB GLADIATOR CLUB GLADIATOR CLUB CLUB GLAD SOUNDS CLUB GLADIATOR |
| r31373 | r31374 | |
| 26050 | 26050 | } |
| 26051 | 26051 | |
| 26052 | 26052 | INPUT_PORTS_START( sc4ghost ) // this structure is generated |
| 26053 | PORT_INCLUDE( sc4_base ) | |
| 26054 | PORT_MODIFY("IN-1") | |
| 26055 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold 1") | |
| 26056 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 2") | |
| 26057 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 3") | |
| 26058 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("cancel") | |
| 26059 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autply") | |
| 26060 | PORT_MODIFY("IN-2") | |
| 26061 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 26062 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26063 | PORT_MODIFY("IN-3") | |
| 26064 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26065 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26066 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26067 | PORT_MODIFY("IN-5") | |
| 26068 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26069 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26070 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26071 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26072 | PORT_MODIFY("IN-6") | |
| 26073 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26074 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26075 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26076 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26077 | PORT_MODIFY("IN-16") | |
| 26078 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26079 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26080 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26081 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26082 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26083 | PORT_MODIFY("IN-17") | |
| 26084 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26085 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26086 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26087 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26088 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 26089 | PORT_MODIFY("IN-18") | |
| 26090 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 26091 | // 0x0002 - "dil12 OR doorlk" // standard input (motherboard) | |
| 26092 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 26093 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26094 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26095 | PORT_MODIFY("IN-19") | |
| 26096 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26097 | PORT_MODIFY("IN-20") | |
| 26098 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26099 | // 0x0004 - "cshdor" // standard input (expected here) | |
| 26100 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 26101 | // 0x0010 - "serdor" // standard input (expected here) | |
| 26053 | PORT_INCLUDE( sc4_base ) | |
| 26054 | PORT_MODIFY("IN-1") | |
| 26055 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold 1") | |
| 26056 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 2") | |
| 26057 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 3") | |
| 26058 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("cancel") | |
| 26059 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autply") | |
| 26060 | PORT_MODIFY("IN-2") | |
| 26061 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 26062 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26063 | PORT_MODIFY("IN-3") | |
| 26064 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26065 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26066 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26067 | PORT_MODIFY("IN-5") | |
| 26068 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26069 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26070 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26071 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26072 | PORT_MODIFY("IN-6") | |
| 26073 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26074 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26075 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26076 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26077 | PORT_MODIFY("IN-16") | |
| 26078 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26079 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26080 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26081 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26082 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26083 | PORT_MODIFY("IN-17") | |
| 26084 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26085 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26086 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26087 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26088 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 26089 | PORT_MODIFY("IN-18") | |
| 26090 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 26091 | // 0x0002 - "dil12 OR doorlk" // standard input (motherboard) | |
| 26092 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 26093 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26094 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26095 | PORT_MODIFY("IN-19") | |
| 26096 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26097 | PORT_MODIFY("IN-20") | |
| 26098 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26099 | // 0x0004 - "cshdor" // standard input (expected here) | |
| 26100 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 26101 | // 0x0010 - "serdor" // standard input (expected here) | |
| 26102 | 26102 | INPUT_PORTS_END |
| 26103 | 26103 | |
| 26104 | 26104 | // PR7090 GOLDEN GHOST GOLDEN GHOST MAZ GHOST SOUNDS GOLDEN GHOST |
| r31373 | r31374 | |
| 26137 | 26137 | } |
| 26138 | 26138 | |
| 26139 | 26139 | INPUT_PORTS_START( sc4ggrid ) // this structure is generated |
| 26140 | PORT_INCLUDE( sc4_base ) | |
| 26141 | PORT_MODIFY("IN-1") | |
| 26142 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26143 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26144 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26145 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26146 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 26147 | PORT_MODIFY("IN-2") | |
| 26148 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 26149 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26150 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26151 | PORT_MODIFY("IN-8") | |
| 26152 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("right") | |
| 26153 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up") | |
| 26154 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 26155 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 26156 | PORT_MODIFY("IN-16") | |
| 26157 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26158 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26159 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26160 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26161 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26162 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 26163 | PORT_MODIFY("IN-17") | |
| 26164 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26165 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26166 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26167 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26168 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26169 | PORT_MODIFY("IN-18") | |
| 26170 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26171 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26172 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26173 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26174 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26175 | PORT_MODIFY("IN-19") | |
| 26176 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26177 | PORT_MODIFY("IN-20") | |
| 26178 | // 0x0001 - "test" // standard input (motherboard) | |
| 26179 | // 0x0002 - "lock" // standard input (expected here) | |
| 26180 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26181 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26182 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26140 | PORT_INCLUDE( sc4_base ) | |
| 26141 | PORT_MODIFY("IN-1") | |
| 26142 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26143 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26144 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26145 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26146 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 26147 | PORT_MODIFY("IN-2") | |
| 26148 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 26149 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26150 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26151 | PORT_MODIFY("IN-8") | |
| 26152 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("right") | |
| 26153 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up") | |
| 26154 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 26155 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 26156 | PORT_MODIFY("IN-16") | |
| 26157 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26158 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26159 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26160 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26161 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26162 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 26163 | PORT_MODIFY("IN-17") | |
| 26164 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26165 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26166 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26167 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26168 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26169 | PORT_MODIFY("IN-18") | |
| 26170 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26171 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26172 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26173 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26174 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26175 | PORT_MODIFY("IN-19") | |
| 26176 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26177 | PORT_MODIFY("IN-20") | |
| 26178 | // 0x0001 - "test" // standard input (motherboard) | |
| 26179 | // 0x0002 - "lock" // standard input (expected here) | |
| 26180 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26181 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26182 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26183 | 26183 | INPUT_PORTS_END |
| 26184 | 26184 | |
| 26185 | 26185 | // PR2518 GOLDEN GRID V1.0 GOLDENGRIDSND GOLDEN GRID |
| r31373 | r31374 | |
| 26227 | 26227 | } |
| 26228 | 26228 | |
| 26229 | 26229 | INPUT_PORTS_START( sc4ggcl ) // this structure is generated |
| 26230 | PORT_INCLUDE( sc4_base ) | |
| 26231 | PORT_MODIFY("IN-1") | |
| 26232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26236 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 26237 | PORT_MODIFY("IN-2") | |
| 26238 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 26239 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26240 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26241 | PORT_MODIFY("IN-8") | |
| 26242 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 26243 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("qps") | |
| 26244 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("right") | |
| 26245 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("up") | |
| 26246 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cash") | |
| 26247 | PORT_MODIFY("IN-16") | |
| 26248 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26249 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26250 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26251 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26252 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26253 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 26254 | PORT_MODIFY("IN-17") | |
| 26255 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26256 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26257 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26258 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26259 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26260 | PORT_MODIFY("IN-18") | |
| 26261 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26262 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26263 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26264 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26265 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26266 | PORT_MODIFY("IN-19") | |
| 26267 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26268 | PORT_MODIFY("IN-20") | |
| 26269 | // 0x0001 - "test" // standard input (motherboard) | |
| 26270 | // 0x0002 - "lock" // standard input (expected here) | |
| 26271 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26272 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26273 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26230 | PORT_INCLUDE( sc4_base ) | |
| 26231 | PORT_MODIFY("IN-1") | |
| 26232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26236 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 26237 | PORT_MODIFY("IN-2") | |
| 26238 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 26239 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26240 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26241 | PORT_MODIFY("IN-8") | |
| 26242 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 26243 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("qps") | |
| 26244 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("right") | |
| 26245 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("up") | |
| 26246 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cash") | |
| 26247 | PORT_MODIFY("IN-16") | |
| 26248 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26249 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26250 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26251 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26252 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26253 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 26254 | PORT_MODIFY("IN-17") | |
| 26255 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26256 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26257 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26258 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26259 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26260 | PORT_MODIFY("IN-18") | |
| 26261 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26262 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26263 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26264 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26265 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26266 | PORT_MODIFY("IN-19") | |
| 26267 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26268 | PORT_MODIFY("IN-20") | |
| 26269 | // 0x0001 - "test" // standard input (motherboard) | |
| 26270 | // 0x0002 - "lock" // standard input (expected here) | |
| 26271 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26272 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26273 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26274 | 26274 | INPUT_PORTS_END |
| 26275 | 26275 | |
| 26276 | 26276 | // PR???? CLUB GOLDEN GRID V1.0 CLUBGOLDENGRIDSND CLUB GOLDEN GRID |
| r31373 | r31374 | |
| 26301 | 26301 | } |
| 26302 | 26302 | |
| 26303 | 26303 | INPUT_PORTS_START( sc4goldw ) // this structure is generated |
| 26304 | PORT_INCLUDE( sc4_base ) | |
| 26305 | PORT_MODIFY("IN-1") | |
| 26306 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26307 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26308 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26309 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26310 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("bell") | |
| 26311 | // 0x0100 - "pndlow" // known extended input, usually 'hopper fit' | |
| 26312 | PORT_MODIFY("IN-2") | |
| 26313 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26314 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26315 | // 0x0100 - "10plow" // unexpected here | |
| 26316 | PORT_MODIFY("IN-3") | |
| 26317 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26318 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26319 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26320 | PORT_MODIFY("IN-5") | |
| 26321 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26322 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26323 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26324 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26325 | PORT_MODIFY("IN-6") | |
| 26326 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26327 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26328 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26329 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26330 | PORT_MODIFY("IN-16") | |
| 26331 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26332 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26333 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26334 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26335 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26336 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 26337 | PORT_MODIFY("IN-17") | |
| 26338 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26339 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26340 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26341 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26342 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26343 | PORT_MODIFY("IN-18") | |
| 26344 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26345 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26346 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26347 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26348 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26349 | PORT_MODIFY("IN-19") | |
| 26350 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26351 | PORT_MODIFY("IN-20") | |
| 26352 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26353 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26354 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26355 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26356 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26304 | PORT_INCLUDE( sc4_base ) | |
| 26305 | PORT_MODIFY("IN-1") | |
| 26306 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26307 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26308 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26309 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26310 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("bell") | |
| 26311 | // 0x0100 - "pndlow" // known extended input, usually 'hopper fit' | |
| 26312 | PORT_MODIFY("IN-2") | |
| 26313 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26314 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26315 | // 0x0100 - "10plow" // unexpected here | |
| 26316 | PORT_MODIFY("IN-3") | |
| 26317 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26318 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26319 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26320 | PORT_MODIFY("IN-5") | |
| 26321 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26322 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26323 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26324 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26325 | PORT_MODIFY("IN-6") | |
| 26326 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26327 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26328 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26329 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26330 | PORT_MODIFY("IN-16") | |
| 26331 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26332 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26333 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26334 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26335 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26336 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 26337 | PORT_MODIFY("IN-17") | |
| 26338 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26339 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26340 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26341 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26342 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26343 | PORT_MODIFY("IN-18") | |
| 26344 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26345 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26346 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26347 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26348 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26349 | PORT_MODIFY("IN-19") | |
| 26350 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26351 | PORT_MODIFY("IN-20") | |
| 26352 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26353 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26354 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26355 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26356 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26357 | 26357 | INPUT_PORTS_END |
| 26358 | 26358 | |
| 26359 | 26359 | INPUT_PORTS_START( sc4goldwd ) // this structure is generated |
| 26360 | PORT_INCLUDE( sc4_base ) | |
| 26361 | PORT_MODIFY("IN-1") | |
| 26362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26363 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26364 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26365 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26366 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("bell") | |
| 26367 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("pndlow OR 10plow") | |
| 26368 | PORT_MODIFY("IN-2") | |
| 26369 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 26370 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 26371 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26372 | PORT_MODIFY("IN-3") | |
| 26373 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26374 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26375 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26376 | PORT_MODIFY("IN-4") | |
| 26377 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 26378 | PORT_MODIFY("IN-5") | |
| 26379 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26380 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26381 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26382 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26383 | PORT_MODIFY("IN-6") | |
| 26384 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26385 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26386 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26387 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26388 | PORT_MODIFY("IN-16") | |
| 26389 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26390 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26391 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26392 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26393 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26394 | PORT_MODIFY("IN-17") | |
| 26395 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26396 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26397 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26398 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26399 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26400 | PORT_MODIFY("IN-18") | |
| 26401 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26402 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26403 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26404 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26405 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26406 | PORT_MODIFY("IN-19") | |
| 26407 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26408 | PORT_MODIFY("IN-20") | |
| 26409 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26410 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 26411 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26412 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 26360 | PORT_INCLUDE( sc4_base ) | |
| 26361 | PORT_MODIFY("IN-1") | |
| 26362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26363 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26364 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26365 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26366 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("bell") | |
| 26367 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("pndlow OR 10plow") | |
| 26368 | PORT_MODIFY("IN-2") | |
| 26369 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 26370 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 26371 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26372 | PORT_MODIFY("IN-3") | |
| 26373 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26374 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26375 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26376 | PORT_MODIFY("IN-4") | |
| 26377 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 26378 | PORT_MODIFY("IN-5") | |
| 26379 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26380 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26381 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26382 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26383 | PORT_MODIFY("IN-6") | |
| 26384 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26385 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26386 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26387 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26388 | PORT_MODIFY("IN-16") | |
| 26389 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26390 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26391 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26392 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26393 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26394 | PORT_MODIFY("IN-17") | |
| 26395 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26396 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26397 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26398 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26399 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26400 | PORT_MODIFY("IN-18") | |
| 26401 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26402 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26403 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26404 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26405 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26406 | PORT_MODIFY("IN-19") | |
| 26407 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26408 | PORT_MODIFY("IN-20") | |
| 26409 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26410 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 26411 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26412 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 26413 | 26413 | INPUT_PORTS_END |
| 26414 | 26414 | |
| 26415 | 26415 | |
| r31373 | r31374 | |
| 26426 | 26426 | GAMEL( 200?, sc4goldwg ,sc4goldw, sc4, sc4goldwd, sc4_state, sc4, ROT0, "BFM","Golden Winner (Bellfruit) (Scorpion 4) (set 8)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 26427 | 26427 | |
| 26428 | 26428 | INPUT_PORTS_START( sc4ggdlx ) // this structure is generated |
| 26429 | PORT_INCLUDE( sc4_base ) | |
| 26430 | PORT_MODIFY("IN-1") | |
| 26431 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 26432 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 26433 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 26434 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 26435 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 26436 | PORT_MODIFY("IN-2") | |
| 26437 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 26438 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26439 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26440 | PORT_MODIFY("IN-16") | |
| 26441 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26442 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 26443 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 26444 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 26445 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 26446 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 26447 | PORT_MODIFY("IN-17") | |
| 26448 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26449 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 26450 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 26451 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 26452 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 26453 | PORT_MODIFY("IN-18") | |
| 26454 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26455 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 26456 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 26457 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 26458 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 26459 | PORT_MODIFY("IN-19") | |
| 26460 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26461 | PORT_MODIFY("IN-20") | |
| 26462 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 26463 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 26464 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 26465 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 26466 | // 0x0010 - "deflt" // standard input (expected here) | |
| 26429 | PORT_INCLUDE( sc4_base ) | |
| 26430 | PORT_MODIFY("IN-1") | |
| 26431 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 26432 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 26433 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 26434 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 26435 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 26436 | PORT_MODIFY("IN-2") | |
| 26437 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 26438 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26439 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26440 | PORT_MODIFY("IN-16") | |
| 26441 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26442 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 26443 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 26444 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 26445 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 26446 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 26447 | PORT_MODIFY("IN-17") | |
| 26448 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26449 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 26450 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 26451 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 26452 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 26453 | PORT_MODIFY("IN-18") | |
| 26454 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26455 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 26456 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 26457 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 26458 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 26459 | PORT_MODIFY("IN-19") | |
| 26460 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 26461 | PORT_MODIFY("IN-20") | |
| 26462 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 26463 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 26464 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 26465 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 26466 | // 0x0010 - "deflt" // standard input (expected here) | |
| 26467 | 26467 | INPUT_PORTS_END |
| 26468 | 26468 | |
| 26469 | 26469 | |
| r31373 | r31374 | |
| 26501 | 26501 | } |
| 26502 | 26502 | |
| 26503 | 26503 | INPUT_PORTS_START( sc4greed ) // this structure is generated |
| 26504 | PORT_INCLUDE( sc4_base ) | |
| 26505 | PORT_MODIFY("IN-1") | |
| 26506 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26507 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26508 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26509 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26510 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 26511 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 26512 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 26513 | PORT_MODIFY("IN-2") | |
| 26514 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 26515 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26516 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26517 | PORT_MODIFY("IN-3") | |
| 26518 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26519 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26520 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26521 | PORT_MODIFY("IN-5") | |
| 26522 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26523 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26524 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26525 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26526 | PORT_MODIFY("IN-6") | |
| 26527 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26528 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26529 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26530 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26531 | PORT_MODIFY("IN-8") | |
| 26532 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk not") | |
| 26533 | PORT_MODIFY("IN-16") | |
| 26534 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26535 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26536 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26537 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26538 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26539 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26540 | PORT_MODIFY("IN-17") | |
| 26541 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26542 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26543 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26544 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26545 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26546 | PORT_MODIFY("IN-18") | |
| 26547 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26548 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26549 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26550 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26551 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26552 | PORT_MODIFY("IN-19") | |
| 26553 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26554 | PORT_MODIFY("IN-20") | |
| 26555 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26556 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26557 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26558 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26559 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26504 | PORT_INCLUDE( sc4_base ) | |
| 26505 | PORT_MODIFY("IN-1") | |
| 26506 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26507 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26508 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26509 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26510 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 26511 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 26512 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 26513 | PORT_MODIFY("IN-2") | |
| 26514 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 26515 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26516 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26517 | PORT_MODIFY("IN-3") | |
| 26518 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26519 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26520 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26521 | PORT_MODIFY("IN-5") | |
| 26522 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26523 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26524 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26525 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26526 | PORT_MODIFY("IN-6") | |
| 26527 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26528 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26529 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26530 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26531 | PORT_MODIFY("IN-8") | |
| 26532 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk not") | |
| 26533 | PORT_MODIFY("IN-16") | |
| 26534 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26535 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26536 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26537 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26538 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26539 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26540 | PORT_MODIFY("IN-17") | |
| 26541 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26542 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26543 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26544 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26545 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26546 | PORT_MODIFY("IN-18") | |
| 26547 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26548 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26549 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26550 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26551 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26552 | PORT_MODIFY("IN-19") | |
| 26553 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26554 | PORT_MODIFY("IN-20") | |
| 26555 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26556 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26557 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26558 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26559 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26560 | 26560 | INPUT_PORTS_END |
| 26561 | 26561 | |
| 26562 | 26562 | // PR1401 AWP GREEDY GONZALEZ PR1401 GREEDY GONZ SOUNDS11 |
| r31373 | r31374 | |
| 26580 | 26580 | } |
| 26581 | 26581 | |
| 26582 | 26582 | INPUT_PORTS_START( sc4hf ) // this structure is generated |
| 26583 | PORT_INCLUDE( sc4_base ) | |
| 26584 | PORT_MODIFY("IN-1") | |
| 26585 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26586 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26587 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26588 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26589 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 26590 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 26591 | PORT_MODIFY("IN-2") | |
| 26592 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 26593 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26594 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26595 | PORT_MODIFY("IN-3") | |
| 26596 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26597 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26598 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26599 | PORT_MODIFY("IN-5") | |
| 26600 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26601 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26602 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26603 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26604 | PORT_MODIFY("IN-6") | |
| 26605 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26606 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26607 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26608 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26609 | PORT_MODIFY("IN-16") | |
| 26610 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26611 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26612 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26613 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26614 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26615 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26616 | PORT_MODIFY("IN-17") | |
| 26617 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26618 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26619 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26620 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26621 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 26622 | PORT_MODIFY("IN-18") | |
| 26623 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 26624 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 26625 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 26626 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26627 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26628 | PORT_MODIFY("IN-19") | |
| 26629 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26630 | PORT_MODIFY("IN-20") | |
| 26631 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26632 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26633 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26634 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26635 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26583 | PORT_INCLUDE( sc4_base ) | |
| 26584 | PORT_MODIFY("IN-1") | |
| 26585 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26586 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26587 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26588 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26589 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 26590 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 26591 | PORT_MODIFY("IN-2") | |
| 26592 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 26593 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26594 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26595 | PORT_MODIFY("IN-3") | |
| 26596 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26597 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26598 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26599 | PORT_MODIFY("IN-5") | |
| 26600 | // 0x0001 - "priz4" // standard input (expected here) | |
| 26601 | // 0x0002 - "priz3" // standard input (expected here) | |
| 26602 | // 0x0004 - "priz2" // standard input (expected here) | |
| 26603 | // 0x0008 - "priz1" // standard input (expected here) | |
| 26604 | PORT_MODIFY("IN-6") | |
| 26605 | // 0x0001 - "perc1" // standard input (expected here) | |
| 26606 | // 0x0002 - "perc2" // standard input (expected here) | |
| 26607 | // 0x0004 - "perc3" // standard input (expected here) | |
| 26608 | // 0x0008 - "perc4" // standard input (expected here) | |
| 26609 | PORT_MODIFY("IN-16") | |
| 26610 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26611 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26612 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26613 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26614 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26615 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26616 | PORT_MODIFY("IN-17") | |
| 26617 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26618 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26619 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26620 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26621 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 26622 | PORT_MODIFY("IN-18") | |
| 26623 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 26624 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 26625 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 26626 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26627 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26628 | PORT_MODIFY("IN-19") | |
| 26629 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26630 | PORT_MODIFY("IN-20") | |
| 26631 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 26632 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26633 | // 0x0004 - "topdor" // standard input (expected here) | |
| 26634 | // 0x0008 - "botdor" // standard input (expected here) | |
| 26635 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26636 | 26636 | INPUT_PORTS_END |
| 26637 | 26637 | |
| 26638 | 26638 | //PR1011 HAPPY FRUITS PR1011 HAPPY FRUITS SOUNDS11 |
| r31373 | r31374 | |
| 26663 | 26663 | } |
| 26664 | 26664 | |
| 26665 | 26665 | INPUT_PORTS_START( sc4himi ) // this structure is generated |
| 26666 | PORT_INCLUDE( sc4_base ) | |
| 26667 | PORT_MODIFY("IN-1") | |
| 26668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26669 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 26670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 26671 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 26672 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 26673 | PORT_MODIFY("IN-2") | |
| 26674 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 26675 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26676 | PORT_MODIFY("IN-8") | |
| 26677 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 26678 | PORT_MODIFY("IN-16") | |
| 26679 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26680 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26681 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26682 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26683 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26684 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26685 | PORT_MODIFY("IN-17") | |
| 26686 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26687 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26688 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26689 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26690 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26691 | PORT_MODIFY("IN-18") | |
| 26692 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26693 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26694 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26695 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26696 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26697 | PORT_MODIFY("IN-19") | |
| 26698 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26699 | PORT_MODIFY("IN-20") | |
| 26700 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 26701 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 26702 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 26703 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 26704 | // 0x0010 - "deflt" // standard input (expected here) | |
| 26666 | PORT_INCLUDE( sc4_base ) | |
| 26667 | PORT_MODIFY("IN-1") | |
| 26668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26669 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 26670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 26671 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 26672 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 26673 | PORT_MODIFY("IN-2") | |
| 26674 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 26675 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26676 | PORT_MODIFY("IN-8") | |
| 26677 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 26678 | PORT_MODIFY("IN-16") | |
| 26679 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26680 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26681 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26682 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26683 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26684 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26685 | PORT_MODIFY("IN-17") | |
| 26686 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26687 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26688 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26689 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26690 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26691 | PORT_MODIFY("IN-18") | |
| 26692 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26693 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26694 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26695 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26696 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26697 | PORT_MODIFY("IN-19") | |
| 26698 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26699 | PORT_MODIFY("IN-20") | |
| 26700 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 26701 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 26702 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 26703 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 26704 | // 0x0010 - "deflt" // standard input (expected here) | |
| 26705 | 26705 | INPUT_PORTS_END |
| 26706 | 26706 | |
| 26707 | 26707 | // PR2999 HIGH 'N' MIGHTY MITY SOUNDS HIGH 'N' MIGHTY |
| r31373 | r31374 | |
| 26736 | 26736 | } |
| 26737 | 26737 | |
| 26738 | 26738 | INPUT_PORTS_START( sc4hi5 ) // this structure is generated |
| 26739 | PORT_INCLUDE( sc4_base ) | |
| 26740 | PORT_MODIFY("IN-1") | |
| 26741 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26742 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26743 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26744 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26745 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 26746 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 26747 | PORT_MODIFY("IN-2") | |
| 26748 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("coll") | |
| 26749 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26750 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26751 | PORT_MODIFY("IN-4") | |
| 26752 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 26753 | PORT_MODIFY("IN-5") | |
| 26754 | // 0x0001 - "pzkey1" // standard input (expected here) | |
| 26755 | // 0x0002 - "pzkey2" // standard input (expected here) | |
| 26756 | // 0x0004 - "pzkey3" // standard input (expected here) | |
| 26757 | // 0x0008 - "pzkey4" // standard input (expected here) | |
| 26758 | PORT_MODIFY("IN-6") | |
| 26759 | // 0x0001 - "pckey1" // standard input (expected here) | |
| 26760 | // 0x0002 - "pckey2" // standard input (expected here) | |
| 26761 | // 0x0004 - "pckey3" // standard input (expected here) | |
| 26762 | // 0x0008 - "pckey4" // standard input (expected here) | |
| 26763 | PORT_MODIFY("IN-8") | |
| 26764 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 26765 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 26766 | PORT_MODIFY("IN-16") | |
| 26767 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26768 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26769 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26770 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26771 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26772 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 26773 | PORT_MODIFY("IN-17") | |
| 26774 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26775 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26776 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26777 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26778 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26779 | PORT_MODIFY("IN-18") | |
| 26780 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26781 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26782 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26783 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26784 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26785 | PORT_MODIFY("IN-19") | |
| 26786 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26787 | PORT_MODIFY("IN-20") | |
| 26788 | // 0x0001 - "green" // standard input (motherboard) | |
| 26789 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26790 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26791 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26792 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26739 | PORT_INCLUDE( sc4_base ) | |
| 26740 | PORT_MODIFY("IN-1") | |
| 26741 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26742 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 26743 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 26744 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 26745 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 26746 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 26747 | PORT_MODIFY("IN-2") | |
| 26748 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("coll") | |
| 26749 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26750 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26751 | PORT_MODIFY("IN-4") | |
| 26752 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 26753 | PORT_MODIFY("IN-5") | |
| 26754 | // 0x0001 - "pzkey1" // standard input (expected here) | |
| 26755 | // 0x0002 - "pzkey2" // standard input (expected here) | |
| 26756 | // 0x0004 - "pzkey3" // standard input (expected here) | |
| 26757 | // 0x0008 - "pzkey4" // standard input (expected here) | |
| 26758 | PORT_MODIFY("IN-6") | |
| 26759 | // 0x0001 - "pckey1" // standard input (expected here) | |
| 26760 | // 0x0002 - "pckey2" // standard input (expected here) | |
| 26761 | // 0x0004 - "pckey3" // standard input (expected here) | |
| 26762 | // 0x0008 - "pckey4" // standard input (expected here) | |
| 26763 | PORT_MODIFY("IN-8") | |
| 26764 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 26765 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 26766 | PORT_MODIFY("IN-16") | |
| 26767 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26768 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26769 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26770 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26771 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26772 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 26773 | PORT_MODIFY("IN-17") | |
| 26774 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26775 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26776 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26777 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26778 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26779 | PORT_MODIFY("IN-18") | |
| 26780 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26781 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26782 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26783 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26784 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26785 | PORT_MODIFY("IN-19") | |
| 26786 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26787 | PORT_MODIFY("IN-20") | |
| 26788 | // 0x0001 - "green" // standard input (motherboard) | |
| 26789 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26790 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26791 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26792 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26793 | 26793 | INPUT_PORTS_END |
| 26794 | 26794 | |
| 26795 | 26795 | // PR1003 HIGH FIVE PR1003 HIGH FIVE SOUNDS11 |
| r31373 | r31374 | |
| 26819 | 26819 | } |
| 26820 | 26820 | |
| 26821 | 26821 | INPUT_PORTS_START( sc4sprng ) // this structure is generated |
| 26822 | PORT_INCLUDE( sc4_base ) | |
| 26823 | PORT_MODIFY("IN-1") | |
| 26824 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26825 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold") | |
| 26826 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("holdhi") | |
| 26827 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("holdlo") | |
| 26828 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 26829 | PORT_MODIFY("IN-2") | |
| 26830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 26831 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26832 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26833 | PORT_MODIFY("IN-8") | |
| 26834 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 26835 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blasts") | |
| 26836 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 26837 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("prize") | |
| 26838 | PORT_MODIFY("IN-16") | |
| 26839 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26840 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26841 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26842 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26843 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26844 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26845 | PORT_MODIFY("IN-17") | |
| 26846 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26847 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26848 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26849 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26850 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26851 | PORT_MODIFY("IN-18") | |
| 26852 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26853 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26854 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26855 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26856 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26857 | PORT_MODIFY("IN-19") | |
| 26858 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26859 | PORT_MODIFY("IN-20") | |
| 26860 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 26861 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 26862 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 26863 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 26864 | // 0x0010 - "deflt" // standard input (expected here) | |
| 26822 | PORT_INCLUDE( sc4_base ) | |
| 26823 | PORT_MODIFY("IN-1") | |
| 26824 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26825 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold") | |
| 26826 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("holdhi") | |
| 26827 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("holdlo") | |
| 26828 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 26829 | PORT_MODIFY("IN-2") | |
| 26830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 26831 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26832 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26833 | PORT_MODIFY("IN-8") | |
| 26834 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 26835 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blasts") | |
| 26836 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 26837 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("prize") | |
| 26838 | PORT_MODIFY("IN-16") | |
| 26839 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26840 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26841 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26842 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26843 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26844 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 26845 | PORT_MODIFY("IN-17") | |
| 26846 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26847 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26848 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26849 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26850 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 26851 | PORT_MODIFY("IN-18") | |
| 26852 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 26853 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 26854 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 26855 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 26856 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 26857 | PORT_MODIFY("IN-19") | |
| 26858 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 26859 | PORT_MODIFY("IN-20") | |
| 26860 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 26861 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 26862 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 26863 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 26864 | // 0x0010 - "deflt" // standard input (expected here) | |
| 26865 | 26865 | INPUT_PORTS_END |
| 26866 | 26866 | |
| 26867 | 26867 | // PR2066 HIGHLY SPRUNG HIGH SOUNDS HIGHLY SPRUNG |
| r31373 | r31374 | |
| 26885 | 26885 | } |
| 26886 | 26886 | |
| 26887 | 26887 | INPUT_PORTS_START( sc4hilo ) // this structure is generated |
| 26888 | PORT_INCLUDE( sc4_base ) | |
| 26889 | PORT_MODIFY("IN-1") | |
| 26890 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26891 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 26892 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 26893 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 26894 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 26895 | PORT_MODIFY("IN-2") | |
| 26896 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 26897 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26898 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26899 | PORT_MODIFY("IN-3") | |
| 26900 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26901 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26902 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26903 | PORT_MODIFY("IN-4") | |
| 26904 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 26905 | // 0x0004 - "hpunit" // unexpected here | |
| 26906 | // 0x0010 - "htopup" // known extended(?) input, sometimes 'top up' | |
| 26907 | PORT_MODIFY("IN-5") | |
| 26908 | // 0x0001 - "pzkey4" // standard input (expected here) | |
| 26909 | // 0x0002 - "pzkey3" // standard input (expected here) | |
| 26910 | // 0x0004 - "pzkey2" // standard input (expected here) | |
| 26911 | // 0x0008 - "pzkey1" // standard input (expected here) | |
| 26912 | PORT_MODIFY("IN-6") | |
| 26913 | // 0x0001 - "pckey1" // standard input (expected here) | |
| 26914 | // 0x0002 - "pckey2" // standard input (expected here) | |
| 26915 | // 0x0004 - "pckey3" // standard input (expected here) | |
| 26916 | // 0x0008 - "pckey4" // standard input (expected here) | |
| 26917 | PORT_MODIFY("IN-8") | |
| 26918 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 26919 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 26920 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 26921 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi nud") | |
| 26922 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi csh") | |
| 26923 | PORT_MODIFY("IN-9") | |
| 26924 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fet") | |
| 26925 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo nud") | |
| 26926 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("lo csh") | |
| 26927 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("lo fet") | |
| 26928 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk brc") | |
| 26929 | PORT_MODIFY("IN-16") | |
| 26930 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26931 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26932 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26933 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26934 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26935 | PORT_MODIFY("IN-17") | |
| 26936 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26937 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26938 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26939 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26940 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 26941 | PORT_MODIFY("IN-18") | |
| 26942 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 26943 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 26944 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 26945 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26946 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26947 | PORT_MODIFY("IN-19") | |
| 26948 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26949 | PORT_MODIFY("IN-20") | |
| 26950 | // 0x0001 - "green" // standard input (motherboard) | |
| 26951 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26952 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26953 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26954 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26888 | PORT_INCLUDE( sc4_base ) | |
| 26889 | PORT_MODIFY("IN-1") | |
| 26890 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26891 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 26892 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 26893 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 26894 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 26895 | PORT_MODIFY("IN-2") | |
| 26896 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 26897 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 26898 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 26899 | PORT_MODIFY("IN-3") | |
| 26900 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 26901 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 26902 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 26903 | PORT_MODIFY("IN-4") | |
| 26904 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 26905 | // 0x0004 - "hpunit" // unexpected here | |
| 26906 | // 0x0010 - "htopup" // known extended(?) input, sometimes 'top up' | |
| 26907 | PORT_MODIFY("IN-5") | |
| 26908 | // 0x0001 - "pzkey4" // standard input (expected here) | |
| 26909 | // 0x0002 - "pzkey3" // standard input (expected here) | |
| 26910 | // 0x0004 - "pzkey2" // standard input (expected here) | |
| 26911 | // 0x0008 - "pzkey1" // standard input (expected here) | |
| 26912 | PORT_MODIFY("IN-6") | |
| 26913 | // 0x0001 - "pckey1" // standard input (expected here) | |
| 26914 | // 0x0002 - "pckey2" // standard input (expected here) | |
| 26915 | // 0x0004 - "pckey3" // standard input (expected here) | |
| 26916 | // 0x0008 - "pckey4" // standard input (expected here) | |
| 26917 | PORT_MODIFY("IN-8") | |
| 26918 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 26919 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 26920 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 26921 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi nud") | |
| 26922 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi csh") | |
| 26923 | PORT_MODIFY("IN-9") | |
| 26924 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fet") | |
| 26925 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo nud") | |
| 26926 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("lo csh") | |
| 26927 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("lo fet") | |
| 26928 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk brc") | |
| 26929 | PORT_MODIFY("IN-16") | |
| 26930 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 26931 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 26932 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 26933 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 26934 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 26935 | PORT_MODIFY("IN-17") | |
| 26936 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 26937 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 26938 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 26939 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 26940 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 26941 | PORT_MODIFY("IN-18") | |
| 26942 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 26943 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 26944 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 26945 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 26946 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 26947 | PORT_MODIFY("IN-19") | |
| 26948 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 26949 | PORT_MODIFY("IN-20") | |
| 26950 | // 0x0001 - "green" // standard input (motherboard) | |
| 26951 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 26952 | // 0x0004 - "serdor" // standard input (expected here) | |
| 26953 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 26954 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 26955 | 26955 | INPUT_PORTS_END |
| 26956 | 26956 | |
| 26957 | 26957 | // PR1013 HILOWATHA PR1013 HILOWATHA SOUNDS11 |
| r31373 | r31374 | |
| 26986 | 26986 | } |
| 26987 | 26987 | |
| 26988 | 26988 | INPUT_PORTS_START( sc4hitsh ) // this structure is generated |
| 26989 | PORT_INCLUDE( sc4_base ) | |
| 26990 | PORT_MODIFY("IN-1") | |
| 26991 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26992 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26993 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26994 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26995 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 26996 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 26997 | PORT_MODIFY("IN-2") | |
| 26998 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 26999 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27000 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27001 | PORT_MODIFY("IN-3") | |
| 27002 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27003 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27004 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27005 | PORT_MODIFY("IN-5") | |
| 27006 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27007 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27008 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27009 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27010 | PORT_MODIFY("IN-6") | |
| 27011 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27012 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27013 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27014 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27015 | PORT_MODIFY("IN-8") | |
| 27016 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk sht") | |
| 27017 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("col rd") | |
| 27018 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 27019 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("blu lo") | |
| 27020 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("red lo") | |
| 27021 | PORT_MODIFY("IN-9") | |
| 27022 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("gre lo") | |
| 27023 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk stp") | |
| 27024 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("col bl") | |
| 27025 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("blu hi") | |
| 27026 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("red hi") | |
| 27027 | PORT_MODIFY("IN-10") | |
| 27028 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("gre hi") | |
| 27029 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("col gr") | |
| 27030 | PORT_MODIFY("IN-16") | |
| 27031 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27032 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27033 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27034 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27035 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27036 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27037 | PORT_MODIFY("IN-17") | |
| 27038 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27039 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27040 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27041 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27042 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27043 | PORT_MODIFY("IN-18") | |
| 27044 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27045 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27046 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27047 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27048 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27049 | PORT_MODIFY("IN-19") | |
| 27050 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27051 | PORT_MODIFY("IN-20") | |
| 27052 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27053 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27054 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27055 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27056 | // 0x0010 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 26989 | PORT_INCLUDE( sc4_base ) | |
| 26990 | PORT_MODIFY("IN-1") | |
| 26991 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 26992 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 26993 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 26994 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 26995 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 26996 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 26997 | PORT_MODIFY("IN-2") | |
| 26998 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 26999 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27000 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27001 | PORT_MODIFY("IN-3") | |
| 27002 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27003 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27004 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27005 | PORT_MODIFY("IN-5") | |
| 27006 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27007 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27008 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27009 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27010 | PORT_MODIFY("IN-6") | |
| 27011 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27012 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27013 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27014 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27015 | PORT_MODIFY("IN-8") | |
| 27016 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk sht") | |
| 27017 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("col rd") | |
| 27018 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 27019 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("blu lo") | |
| 27020 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("red lo") | |
| 27021 | PORT_MODIFY("IN-9") | |
| 27022 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("gre lo") | |
| 27023 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk stp") | |
| 27024 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("col bl") | |
| 27025 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("blu hi") | |
| 27026 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("red hi") | |
| 27027 | PORT_MODIFY("IN-10") | |
| 27028 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("gre hi") | |
| 27029 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("col gr") | |
| 27030 | PORT_MODIFY("IN-16") | |
| 27031 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27032 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27033 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27034 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27035 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27036 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27037 | PORT_MODIFY("IN-17") | |
| 27038 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27039 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27040 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27041 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27042 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27043 | PORT_MODIFY("IN-18") | |
| 27044 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27045 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27046 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27047 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27048 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27049 | PORT_MODIFY("IN-19") | |
| 27050 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27051 | PORT_MODIFY("IN-20") | |
| 27052 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27053 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27054 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27055 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27056 | // 0x0010 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 27057 | 27057 | INPUT_PORTS_END |
| 27058 | 27058 | |
| 27059 | 27059 | // PR1112 HIT SHOT PR1112 HIT SHOT SOUNDS11 |
| r31373 | r31374 | |
| 27081 | 27081 | } |
| 27082 | 27082 | |
| 27083 | 27083 | INPUT_PORTS_START( sc4h6cl ) // this structure is generated |
| 27084 | PORT_INCLUDE( sc4_base ) | |
| 27085 | PORT_MODIFY("IN-1") | |
| 27086 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27087 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27088 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27089 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27090 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake1") | |
| 27091 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 27092 | PORT_MODIFY("IN-2") | |
| 27093 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake2") | |
| 27094 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stake3") | |
| 27095 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 27096 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27097 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 27098 | PORT_MODIFY("IN-3") | |
| 27099 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27100 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27101 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27102 | PORT_MODIFY("IN-4") | |
| 27103 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27104 | PORT_MODIFY("IN-5") | |
| 27105 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27106 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27107 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27108 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27109 | PORT_MODIFY("IN-6") | |
| 27110 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27111 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27112 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27113 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27114 | PORT_MODIFY("IN-16") | |
| 27115 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27116 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27117 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27118 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27119 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27120 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27121 | PORT_MODIFY("IN-17") | |
| 27122 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27123 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27124 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27125 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27126 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27127 | PORT_MODIFY("IN-18") | |
| 27128 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27129 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27130 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27131 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27132 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27133 | PORT_MODIFY("IN-19") | |
| 27134 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27135 | PORT_MODIFY("IN-20") | |
| 27136 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27137 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27138 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27139 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27140 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27084 | PORT_INCLUDE( sc4_base ) | |
| 27085 | PORT_MODIFY("IN-1") | |
| 27086 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27087 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27088 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27089 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27090 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake1") | |
| 27091 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 27092 | PORT_MODIFY("IN-2") | |
| 27093 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake2") | |
| 27094 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stake3") | |
| 27095 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 27096 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27097 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 27098 | PORT_MODIFY("IN-3") | |
| 27099 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27100 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27101 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27102 | PORT_MODIFY("IN-4") | |
| 27103 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27104 | PORT_MODIFY("IN-5") | |
| 27105 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27106 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27107 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27108 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27109 | PORT_MODIFY("IN-6") | |
| 27110 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27111 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27112 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27113 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27114 | PORT_MODIFY("IN-16") | |
| 27115 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27116 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27117 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27118 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27119 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27120 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27121 | PORT_MODIFY("IN-17") | |
| 27122 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27123 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27124 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27125 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27126 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27127 | PORT_MODIFY("IN-18") | |
| 27128 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27129 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27130 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27131 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27132 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27133 | PORT_MODIFY("IN-19") | |
| 27134 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27135 | PORT_MODIFY("IN-20") | |
| 27136 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27137 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27138 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27139 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27140 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27141 | 27141 | INPUT_PORTS_END |
| 27142 | 27142 | |
| 27143 | 27143 | // PR1759 CLUB HOT SIX HOT SIX CLUB PR1759 HOSX SOUNDS11 |
| r31373 | r31374 | |
| 27164 | 27164 | } |
| 27165 | 27165 | |
| 27166 | 27166 | INPUT_PORTS_START( sc4ijclb ) // this structure is generated |
| 27167 | PORT_INCLUDE( sc4_base ) | |
| 27168 | PORT_MODIFY("IN-1") | |
| 27169 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27170 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27171 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27172 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27173 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27174 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 27175 | PORT_MODIFY("IN-2") | |
| 27176 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 27177 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27178 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27179 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27180 | PORT_MODIFY("IN-3") | |
| 27181 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27182 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27183 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27184 | PORT_MODIFY("IN-5") | |
| 27185 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27186 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27187 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27188 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27189 | PORT_MODIFY("IN-8") | |
| 27190 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 27191 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk spi") | |
| 27192 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk cpo") | |
| 27193 | PORT_MODIFY("IN-16") | |
| 27194 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27195 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27196 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27197 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27198 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27199 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27200 | PORT_MODIFY("IN-17") | |
| 27201 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27202 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27203 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27204 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27205 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27206 | PORT_MODIFY("IN-18") | |
| 27207 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27208 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27209 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27210 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27211 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27212 | PORT_MODIFY("IN-19") | |
| 27213 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27214 | PORT_MODIFY("IN-20") | |
| 27215 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27216 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27217 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27218 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27219 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27167 | PORT_INCLUDE( sc4_base ) | |
| 27168 | PORT_MODIFY("IN-1") | |
| 27169 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27170 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27171 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27172 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27173 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27174 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 27175 | PORT_MODIFY("IN-2") | |
| 27176 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 27177 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27178 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27179 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27180 | PORT_MODIFY("IN-3") | |
| 27181 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27182 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27183 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27184 | PORT_MODIFY("IN-5") | |
| 27185 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27186 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27187 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27188 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27189 | PORT_MODIFY("IN-8") | |
| 27190 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 27191 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk spi") | |
| 27192 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk cpo") | |
| 27193 | PORT_MODIFY("IN-16") | |
| 27194 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27195 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27196 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27197 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27198 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27199 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27200 | PORT_MODIFY("IN-17") | |
| 27201 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27202 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27203 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27204 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27205 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27206 | PORT_MODIFY("IN-18") | |
| 27207 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27208 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27209 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27210 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27211 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27212 | PORT_MODIFY("IN-19") | |
| 27213 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27214 | PORT_MODIFY("IN-20") | |
| 27215 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27216 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27217 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27218 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27219 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27220 | 27220 | INPUT_PORTS_END |
| 27221 | 27221 | |
| 27222 | 27222 | // PR2403 CLUB ITALIAN JOB CLUB ITALIAN JOB CLUB CLUB ITJB SOUNDS |
| r31373 | r31374 | |
| 27239 | 27239 | } |
| 27240 | 27240 | |
| 27241 | 27241 | INPUT_PORTS_START( sc4jack ) // this structure is generated |
| 27242 | PORT_INCLUDE( sc4_base ) | |
| 27243 | PORT_MODIFY("IN-1") | |
| 27244 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27245 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 27246 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 27247 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 27248 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 27249 | PORT_MODIFY("IN-2") | |
| 27250 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 27251 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27252 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27253 | PORT_MODIFY("IN-8") | |
| 27254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tke ft") | |
| 27255 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tke ng") | |
| 27256 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 27257 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("csh pt") | |
| 27258 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("colect") | |
| 27259 | PORT_MODIFY("IN-16") | |
| 27260 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27261 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27262 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27263 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27264 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27265 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27266 | PORT_MODIFY("IN-17") | |
| 27267 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27268 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27269 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27270 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27271 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27272 | PORT_MODIFY("IN-18") | |
| 27273 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27274 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27275 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27276 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27277 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27278 | PORT_MODIFY("IN-19") | |
| 27279 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27280 | PORT_MODIFY("IN-20") | |
| 27281 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 27282 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 27283 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 27284 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 27285 | // 0x0010 - "deflt" // standard input (expected here) | |
| 27242 | PORT_INCLUDE( sc4_base ) | |
| 27243 | PORT_MODIFY("IN-1") | |
| 27244 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27245 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 27246 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 27247 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 27248 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 27249 | PORT_MODIFY("IN-2") | |
| 27250 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 27251 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27252 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27253 | PORT_MODIFY("IN-8") | |
| 27254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tke ft") | |
| 27255 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tke ng") | |
| 27256 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 27257 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("csh pt") | |
| 27258 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("colect") | |
| 27259 | PORT_MODIFY("IN-16") | |
| 27260 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27261 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27262 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27263 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27264 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27265 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27266 | PORT_MODIFY("IN-17") | |
| 27267 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27268 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27269 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27270 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27271 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27272 | PORT_MODIFY("IN-18") | |
| 27273 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27274 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27275 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27276 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27277 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27278 | PORT_MODIFY("IN-19") | |
| 27279 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27280 | PORT_MODIFY("IN-20") | |
| 27281 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 27282 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 27283 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 27284 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 27285 | // 0x0010 - "deflt" // standard input (expected here) | |
| 27286 | 27286 | INPUT_PORTS_END |
| 27287 | 27287 | |
| 27288 | 27288 | // PR2078 JACK THE KIPPER JKIP SOUNDS JACK THE KIPPER |
| r31373 | r31374 | |
| 27313 | 27313 | } |
| 27314 | 27314 | |
| 27315 | 27315 | INPUT_PORTS_START( sc4jjunc ) // this structure is generated |
| 27316 | PORT_INCLUDE( sc4_base ) | |
| 27317 | PORT_MODIFY("IN-1") | |
| 27318 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27319 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27320 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 27321 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 27322 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 27323 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 27324 | PORT_MODIFY("IN-2") | |
| 27325 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 27326 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27327 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27328 | PORT_MODIFY("IN-3") | |
| 27329 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27330 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27331 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27332 | PORT_MODIFY("IN-5") | |
| 27333 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27334 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27335 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27336 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27337 | PORT_MODIFY("IN-6") | |
| 27338 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27339 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27340 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27341 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27342 | PORT_MODIFY("IN-8") | |
| 27343 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 27344 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 27345 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk haz") | |
| 27346 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 27347 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk ss") | |
| 27348 | PORT_MODIFY("IN-16") | |
| 27349 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27350 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27351 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27352 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27353 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27354 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27355 | PORT_MODIFY("IN-17") | |
| 27356 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27357 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27358 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27359 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27360 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27361 | PORT_MODIFY("IN-18") | |
| 27362 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27363 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27364 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27365 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27366 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27367 | PORT_MODIFY("IN-19") | |
| 27368 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27369 | PORT_MODIFY("IN-20") | |
| 27370 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27371 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27372 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27373 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27374 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27316 | PORT_INCLUDE( sc4_base ) | |
| 27317 | PORT_MODIFY("IN-1") | |
| 27318 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27319 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27320 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 27321 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 27322 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 27323 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 27324 | PORT_MODIFY("IN-2") | |
| 27325 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 27326 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27327 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27328 | PORT_MODIFY("IN-3") | |
| 27329 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27330 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27331 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27332 | PORT_MODIFY("IN-5") | |
| 27333 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27334 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27335 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27336 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27337 | PORT_MODIFY("IN-6") | |
| 27338 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27339 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27340 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27341 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27342 | PORT_MODIFY("IN-8") | |
| 27343 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 27344 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 27345 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk haz") | |
| 27346 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 27347 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk ss") | |
| 27348 | PORT_MODIFY("IN-16") | |
| 27349 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27350 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27351 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27352 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27353 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27354 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27355 | PORT_MODIFY("IN-17") | |
| 27356 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27357 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27358 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27359 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27360 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27361 | PORT_MODIFY("IN-18") | |
| 27362 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27363 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27364 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27365 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27366 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27367 | PORT_MODIFY("IN-19") | |
| 27368 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27369 | PORT_MODIFY("IN-20") | |
| 27370 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27371 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27372 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27373 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27374 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27375 | 27375 | INPUT_PORTS_END |
| 27376 | 27376 | |
| 27377 | 27377 | // PR1304 JACKPOT JUNCTION PR1304 JACKPOT JUNCTION SOUNDS11 |
| r31373 | r31374 | |
| 27411 | 27411 | } |
| 27412 | 27412 | |
| 27413 | 27413 | INPUT_PORTS_START( sc4jjucl ) // this structure is generated |
| 27414 | PORT_INCLUDE( sc4_base ) | |
| 27415 | PORT_MODIFY("IN-1") | |
| 27416 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27417 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27418 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27419 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27420 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27421 | PORT_MODIFY("IN-2") | |
| 27422 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27423 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 27424 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 27425 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27426 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 27427 | PORT_MODIFY("IN-3") | |
| 27428 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27429 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27430 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27431 | PORT_MODIFY("IN-4") | |
| 27432 | // 0x0001 - "hop2lo" // unexpected here | |
| 27433 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 27434 | PORT_MODIFY("IN-5") | |
| 27435 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27436 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27437 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27438 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27439 | PORT_MODIFY("IN-8") | |
| 27440 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 27441 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudges") | |
| 27442 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blasts") | |
| 27443 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shots") | |
| 27444 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk haz") | |
| 27445 | PORT_MODIFY("IN-16") | |
| 27446 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27447 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27448 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27449 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27450 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27451 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27452 | PORT_MODIFY("IN-17") | |
| 27453 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27454 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27455 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27456 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27457 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27458 | PORT_MODIFY("IN-18") | |
| 27459 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27460 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27461 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27462 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 27463 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 27464 | PORT_MODIFY("IN-19") | |
| 27465 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 27466 | PORT_MODIFY("IN-20") | |
| 27467 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27468 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27469 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27470 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27471 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27414 | PORT_INCLUDE( sc4_base ) | |
| 27415 | PORT_MODIFY("IN-1") | |
| 27416 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27417 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27418 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27419 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27420 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27421 | PORT_MODIFY("IN-2") | |
| 27422 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27423 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 27424 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 27425 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27426 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 27427 | PORT_MODIFY("IN-3") | |
| 27428 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27429 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27430 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27431 | PORT_MODIFY("IN-4") | |
| 27432 | // 0x0001 - "hop2lo" // unexpected here | |
| 27433 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 27434 | PORT_MODIFY("IN-5") | |
| 27435 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27436 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27437 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27438 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27439 | PORT_MODIFY("IN-8") | |
| 27440 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 27441 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudges") | |
| 27442 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blasts") | |
| 27443 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shots") | |
| 27444 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk haz") | |
| 27445 | PORT_MODIFY("IN-16") | |
| 27446 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27447 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27448 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27449 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27450 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27451 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27452 | PORT_MODIFY("IN-17") | |
| 27453 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27454 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27455 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27456 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27457 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27458 | PORT_MODIFY("IN-18") | |
| 27459 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27460 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27461 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27462 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 27463 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 27464 | PORT_MODIFY("IN-19") | |
| 27465 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 27466 | PORT_MODIFY("IN-20") | |
| 27467 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27468 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27469 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27470 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27471 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27472 | 27472 | INPUT_PORTS_END |
| 27473 | 27473 | |
| 27474 | 27474 | // REEL7 ERR 27 (where does reel 7 connect?!) |
| r31373 | r31374 | |
| 27501 | 27501 | |
| 27502 | 27502 | |
| 27503 | 27503 | INPUT_PORTS_START( sc4jolly ) // this structure is generated |
| 27504 | PORT_INCLUDE( sc4_base ) | |
| 27505 | PORT_MODIFY("IN-1") | |
| 27506 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27507 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27508 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27509 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27510 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchge") | |
| 27511 | PORT_MODIFY("IN-2") | |
| 27512 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("nudge") | |
| 27513 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27514 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27515 | PORT_MODIFY("IN-8") | |
| 27516 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("hi 1") | |
| 27517 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi 2") | |
| 27518 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi 3") | |
| 27519 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo 3") | |
| 27520 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo 2") | |
| 27521 | PORT_MODIFY("IN-9") | |
| 27522 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("lo 1") | |
| 27523 | PORT_MODIFY("IN-16") | |
| 27524 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27525 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27526 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27527 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27528 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27529 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 27530 | PORT_MODIFY("IN-17") | |
| 27531 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27532 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27533 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27534 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27535 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27536 | PORT_MODIFY("IN-18") | |
| 27537 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27538 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27539 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27540 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27541 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27542 | PORT_MODIFY("IN-19") | |
| 27543 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27544 | PORT_MODIFY("IN-20") | |
| 27545 | // 0x0001 - "test" // standard input (motherboard) | |
| 27546 | // 0x0002 - "lock" // standard input (expected here) | |
| 27547 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27548 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27549 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27504 | PORT_INCLUDE( sc4_base ) | |
| 27505 | PORT_MODIFY("IN-1") | |
| 27506 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27507 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27508 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27509 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27510 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchge") | |
| 27511 | PORT_MODIFY("IN-2") | |
| 27512 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("nudge") | |
| 27513 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27514 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27515 | PORT_MODIFY("IN-8") | |
| 27516 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("hi 1") | |
| 27517 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi 2") | |
| 27518 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi 3") | |
| 27519 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo 3") | |
| 27520 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo 2") | |
| 27521 | PORT_MODIFY("IN-9") | |
| 27522 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("lo 1") | |
| 27523 | PORT_MODIFY("IN-16") | |
| 27524 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27525 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27526 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27527 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27528 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27529 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 27530 | PORT_MODIFY("IN-17") | |
| 27531 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27532 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27533 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27534 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27535 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27536 | PORT_MODIFY("IN-18") | |
| 27537 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27538 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27539 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27540 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27541 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27542 | PORT_MODIFY("IN-19") | |
| 27543 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27544 | PORT_MODIFY("IN-20") | |
| 27545 | // 0x0001 - "test" // standard input (motherboard) | |
| 27546 | // 0x0002 - "lock" // standard input (expected here) | |
| 27547 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27548 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27549 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27550 | 27550 | INPUT_PORTS_END |
| 27551 | 27551 | |
| 27552 | 27552 | // PR2054 JOLLY JOUSTINGV2.0 JJOLLSND JOLLY JOUSTING |
| r31373 | r31374 | |
| 27578 | 27578 | |
| 27579 | 27579 | |
| 27580 | 27580 | INPUT_PORTS_START( sc4juicy ) // this structure is generated |
| 27581 | PORT_INCLUDE( sc4_base ) | |
| 27582 | PORT_MODIFY("IN-1") | |
| 27583 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27584 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27585 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 27586 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 27587 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27588 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 27589 | PORT_MODIFY("IN-2") | |
| 27590 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27591 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27592 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27593 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27594 | PORT_MODIFY("IN-4") | |
| 27595 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27596 | PORT_MODIFY("IN-16") | |
| 27597 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27598 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27599 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27600 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27601 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27602 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27603 | PORT_MODIFY("IN-17") | |
| 27604 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27605 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27606 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27607 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27608 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27609 | PORT_MODIFY("IN-18") | |
| 27610 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27611 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27612 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27613 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27614 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27615 | PORT_MODIFY("IN-19") | |
| 27616 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27617 | PORT_MODIFY("IN-20") | |
| 27618 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27619 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27620 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27621 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27622 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27581 | PORT_INCLUDE( sc4_base ) | |
| 27582 | PORT_MODIFY("IN-1") | |
| 27583 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27584 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27585 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 27586 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 27587 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27588 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 27589 | PORT_MODIFY("IN-2") | |
| 27590 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27591 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27592 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27593 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27594 | PORT_MODIFY("IN-4") | |
| 27595 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27596 | PORT_MODIFY("IN-16") | |
| 27597 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27598 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27599 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27600 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27601 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27602 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27603 | PORT_MODIFY("IN-17") | |
| 27604 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27605 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27606 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27607 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27608 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27609 | PORT_MODIFY("IN-18") | |
| 27610 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27611 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27612 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27613 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 27614 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 27615 | PORT_MODIFY("IN-19") | |
| 27616 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 27617 | PORT_MODIFY("IN-20") | |
| 27618 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27619 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27620 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27621 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27622 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27623 | 27623 | INPUT_PORTS_END |
| 27624 | 27624 | |
| 27625 | 27625 | // PR1136 JUICY JACKPOTS 65% FERRY PR1136 JUICY JACKPOTS SOUNDS11 |
| r31373 | r31374 | |
| 27656 | 27656 | } |
| 27657 | 27657 | |
| 27658 | 27658 | INPUT_PORTS_START( sc4kalei ) // this structure is generated |
| 27659 | PORT_INCLUDE( sc4_base ) | |
| 27660 | PORT_MODIFY("IN-1") | |
| 27661 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 27662 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 27663 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 27664 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 27665 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 27666 | PORT_MODIFY("IN-2") | |
| 27667 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 27668 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27669 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27670 | PORT_MODIFY("IN-8") | |
| 27671 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 27672 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 27673 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c pot") | |
| 27674 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shot") | |
| 27675 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("streak") | |
| 27676 | PORT_MODIFY("IN-16") | |
| 27677 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27678 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27679 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27680 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27681 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27682 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 27683 | PORT_MODIFY("IN-17") | |
| 27684 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27685 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27686 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27687 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27688 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27689 | PORT_MODIFY("IN-18") | |
| 27690 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27691 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27692 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27693 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27694 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27695 | PORT_MODIFY("IN-19") | |
| 27696 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27697 | PORT_MODIFY("IN-20") | |
| 27698 | // 0x0001 - "test" // standard input (motherboard) | |
| 27699 | // 0x0002 - "lock" // standard input (expected here) | |
| 27700 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27701 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27702 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27659 | PORT_INCLUDE( sc4_base ) | |
| 27660 | PORT_MODIFY("IN-1") | |
| 27661 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 27662 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 27663 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 27664 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 27665 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 27666 | PORT_MODIFY("IN-2") | |
| 27667 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 27668 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27669 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27670 | PORT_MODIFY("IN-8") | |
| 27671 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 27672 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 27673 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c pot") | |
| 27674 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shot") | |
| 27675 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("streak") | |
| 27676 | PORT_MODIFY("IN-16") | |
| 27677 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27678 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27679 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27680 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27681 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27682 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 27683 | PORT_MODIFY("IN-17") | |
| 27684 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27685 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27686 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27687 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27688 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27689 | PORT_MODIFY("IN-18") | |
| 27690 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27691 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27692 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27693 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27694 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27695 | PORT_MODIFY("IN-19") | |
| 27696 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27697 | PORT_MODIFY("IN-20") | |
| 27698 | // 0x0001 - "test" // standard input (motherboard) | |
| 27699 | // 0x0002 - "lock" // standard input (expected here) | |
| 27700 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27701 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27702 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27703 | 27703 | INPUT_PORTS_END |
| 27704 | 27704 | |
| 27705 | 27705 | // PR2538 KALEIDOSCOPE 011 KALEIDOSCOPESND KALEIDOSCOPE |
| r31373 | r31374 | |
| 27729 | 27729 | } |
| 27730 | 27730 | |
| 27731 | 27731 | INPUT_PORTS_START( sc4lir ) // this structure is generated |
| 27732 | PORT_INCLUDE( sc4_base ) | |
| 27733 | PORT_MODIFY("IN-1") | |
| 27734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 27736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 27737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 27738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 27739 | PORT_MODIFY("IN-2") | |
| 27740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 27741 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27742 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27743 | PORT_MODIFY("IN-8") | |
| 27744 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk dic") | |
| 27745 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk thr") | |
| 27746 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 27747 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk csh") | |
| 27748 | PORT_MODIFY("IN-16") | |
| 27749 | // 0x0001 - "dils 1" // standard input (motherboard) | |
| 27750 | // 0x0002 - "dils 2" // standard input (motherboard) | |
| 27751 | // 0x0004 - "dils 3" // standard input (motherboard) | |
| 27752 | // 0x0008 - "dils 4" // standard input (motherboard) | |
| 27753 | // 0x0010 - "dils 5" // standard input (motherboard) | |
| 27754 | PORT_MODIFY("IN-17") | |
| 27755 | // 0x0001 - "dils 6" // standard input (motherboard) | |
| 27756 | // 0x0002 - "dils 7" // standard input (motherboard) | |
| 27757 | // 0x0004 - "dils 8" // standard input (motherboard) | |
| 27758 | // 0x0008 - "dils 9" // standard input (motherboard) | |
| 27759 | // 0x0010 - "dils10" // standard input (motherboard) | |
| 27760 | PORT_MODIFY("IN-18") | |
| 27761 | // 0x0001 - "dils11" // standard input (motherboard) | |
| 27762 | // 0x0002 - "dils12" // standard input (motherboard) | |
| 27763 | // 0x0004 - "dils13" // standard input (motherboard) | |
| 27764 | // 0x0008 - "dils14" // standard input (motherboard) | |
| 27765 | // 0x0010 - "dils15" // standard input (motherboard) | |
| 27766 | PORT_MODIFY("IN-19") | |
| 27767 | // 0x0001 - "dils16" // standard input (motherboard) | |
| 27768 | PORT_MODIFY("IN-20") | |
| 27769 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27770 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27771 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27772 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27732 | PORT_INCLUDE( sc4_base ) | |
| 27733 | PORT_MODIFY("IN-1") | |
| 27734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 27736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 27737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 27738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 27739 | PORT_MODIFY("IN-2") | |
| 27740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 27741 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27742 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27743 | PORT_MODIFY("IN-8") | |
| 27744 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk dic") | |
| 27745 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk thr") | |
| 27746 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 27747 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk csh") | |
| 27748 | PORT_MODIFY("IN-16") | |
| 27749 | // 0x0001 - "dils 1" // standard input (motherboard) | |
| 27750 | // 0x0002 - "dils 2" // standard input (motherboard) | |
| 27751 | // 0x0004 - "dils 3" // standard input (motherboard) | |
| 27752 | // 0x0008 - "dils 4" // standard input (motherboard) | |
| 27753 | // 0x0010 - "dils 5" // standard input (motherboard) | |
| 27754 | PORT_MODIFY("IN-17") | |
| 27755 | // 0x0001 - "dils 6" // standard input (motherboard) | |
| 27756 | // 0x0002 - "dils 7" // standard input (motherboard) | |
| 27757 | // 0x0004 - "dils 8" // standard input (motherboard) | |
| 27758 | // 0x0008 - "dils 9" // standard input (motherboard) | |
| 27759 | // 0x0010 - "dils10" // standard input (motherboard) | |
| 27760 | PORT_MODIFY("IN-18") | |
| 27761 | // 0x0001 - "dils11" // standard input (motherboard) | |
| 27762 | // 0x0002 - "dils12" // standard input (motherboard) | |
| 27763 | // 0x0004 - "dils13" // standard input (motherboard) | |
| 27764 | // 0x0008 - "dils14" // standard input (motherboard) | |
| 27765 | // 0x0010 - "dils15" // standard input (motherboard) | |
| 27766 | PORT_MODIFY("IN-19") | |
| 27767 | // 0x0001 - "dils16" // standard input (motherboard) | |
| 27768 | PORT_MODIFY("IN-20") | |
| 27769 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27770 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27771 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27772 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27773 | 27773 | INPUT_PORTS_END |
| 27774 | 27774 | |
| 27775 | 27775 | // PR1001 LET IT ROLL PR1001 LETITROLL SOUNDS11 |
| r31373 | r31374 | |
| 27802 | 27802 | } |
| 27803 | 27803 | |
| 27804 | 27804 | INPUT_PORTS_START( sc4ldvcl ) // this structure is generated |
| 27805 | PORT_INCLUDE( sc4_base ) | |
| 27806 | PORT_MODIFY("IN-1") | |
| 27807 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27808 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27809 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27810 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27811 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27812 | PORT_MODIFY("IN-2") | |
| 27813 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27814 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27815 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("xfer") | |
| 27816 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27817 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 27818 | PORT_MODIFY("IN-3") | |
| 27819 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27820 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27821 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27822 | PORT_MODIFY("IN-4") | |
| 27823 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27824 | PORT_MODIFY("IN-5") | |
| 27825 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27826 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27827 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27828 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27829 | PORT_MODIFY("IN-8") | |
| 27830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 27831 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("mov up") | |
| 27832 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("pick") | |
| 27833 | PORT_MODIFY("IN-16") | |
| 27834 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27835 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27836 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27837 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27838 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27839 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27840 | PORT_MODIFY("IN-17") | |
| 27841 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27842 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27843 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27844 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27845 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27846 | PORT_MODIFY("IN-18") | |
| 27847 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27848 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27849 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27850 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 27851 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 27852 | PORT_MODIFY("IN-19") | |
| 27853 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 27854 | PORT_MODIFY("IN-20") | |
| 27855 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27856 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27857 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27858 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27859 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27805 | PORT_INCLUDE( sc4_base ) | |
| 27806 | PORT_MODIFY("IN-1") | |
| 27807 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27808 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27809 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 27810 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 27811 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27812 | PORT_MODIFY("IN-2") | |
| 27813 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27814 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27815 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("xfer") | |
| 27816 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27817 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 27818 | PORT_MODIFY("IN-3") | |
| 27819 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27820 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27821 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27822 | PORT_MODIFY("IN-4") | |
| 27823 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27824 | PORT_MODIFY("IN-5") | |
| 27825 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27826 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27827 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27828 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27829 | PORT_MODIFY("IN-8") | |
| 27830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 27831 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("mov up") | |
| 27832 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("pick") | |
| 27833 | PORT_MODIFY("IN-16") | |
| 27834 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27835 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27836 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27837 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27838 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27839 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 27840 | PORT_MODIFY("IN-17") | |
| 27841 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27842 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27843 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27844 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27845 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 27846 | PORT_MODIFY("IN-18") | |
| 27847 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 27848 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 27849 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 27850 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 27851 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 27852 | PORT_MODIFY("IN-19") | |
| 27853 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 27854 | PORT_MODIFY("IN-20") | |
| 27855 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27856 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27857 | // 0x0004 - "topdor" // standard input (expected here) | |
| 27858 | // 0x0008 - "botdor" // standard input (expected here) | |
| 27859 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27860 | 27860 | INPUT_PORTS_END |
| 27861 | 27861 | |
| 27862 | 27862 | // PR2421 LITTLEDEVIL CLUB LITTLEDEVIL CLUB CLILDEV SOUNDS CLUB LITTLEDEVIL |
| r31373 | r31374 | |
| 27879 | 27879 | } |
| 27880 | 27880 | |
| 27881 | 27881 | INPUT_PORTS_START( sc4lockb ) // this structure is generated |
| 27882 | PORT_INCLUDE( sc4_base ) | |
| 27883 | PORT_MODIFY("IN-1") | |
| 27884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 27886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 27887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 27888 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 27889 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 27890 | PORT_MODIFY("IN-2") | |
| 27891 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 27892 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27893 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27894 | PORT_MODIFY("IN-3") | |
| 27895 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27896 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27897 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27898 | PORT_MODIFY("IN-4") | |
| 27899 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 27900 | PORT_MODIFY("IN-5") | |
| 27901 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27902 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27903 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27904 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27905 | PORT_MODIFY("IN-6") | |
| 27906 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27907 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27908 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27909 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27910 | PORT_MODIFY("IN-8") | |
| 27911 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 27912 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 27913 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 27914 | PORT_MODIFY("IN-16") | |
| 27915 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27916 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27917 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27918 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27919 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27920 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 27921 | PORT_MODIFY("IN-17") | |
| 27922 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27923 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27924 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27925 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27926 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27927 | PORT_MODIFY("IN-18") | |
| 27928 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27929 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27930 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27931 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27932 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27933 | PORT_MODIFY("IN-19") | |
| 27934 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27935 | PORT_MODIFY("IN-20") | |
| 27936 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27937 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27938 | // 0x0004 - "serdor" // standard input (expected here) | |
| 27939 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 27940 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27882 | PORT_INCLUDE( sc4_base ) | |
| 27883 | PORT_MODIFY("IN-1") | |
| 27884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 27885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 27886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 27887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 27888 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 27889 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 27890 | PORT_MODIFY("IN-2") | |
| 27891 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 27892 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27893 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27894 | PORT_MODIFY("IN-3") | |
| 27895 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27896 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27897 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27898 | PORT_MODIFY("IN-4") | |
| 27899 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 27900 | PORT_MODIFY("IN-5") | |
| 27901 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27902 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27903 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27904 | // 0x0008 - "priz1" // standard input (expected here) | |
| 27905 | PORT_MODIFY("IN-6") | |
| 27906 | // 0x0001 - "perc1" // standard input (expected here) | |
| 27907 | // 0x0002 - "perc2" // standard input (expected here) | |
| 27908 | // 0x0004 - "perc3" // standard input (expected here) | |
| 27909 | // 0x0008 - "perc4" // standard input (expected here) | |
| 27910 | PORT_MODIFY("IN-8") | |
| 27911 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 27912 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 27913 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 27914 | PORT_MODIFY("IN-16") | |
| 27915 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 27916 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 27917 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 27918 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 27919 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 27920 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 27921 | PORT_MODIFY("IN-17") | |
| 27922 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 27923 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 27924 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 27925 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 27926 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 27927 | PORT_MODIFY("IN-18") | |
| 27928 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 27929 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 27930 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 27931 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 27932 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 27933 | PORT_MODIFY("IN-19") | |
| 27934 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 27935 | PORT_MODIFY("IN-20") | |
| 27936 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 27937 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 27938 | // 0x0004 - "serdor" // standard input (expected here) | |
| 27939 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 27940 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27941 | 27941 | INPUT_PORTS_END |
| 27942 | 27942 | |
| 27943 | 27943 | // PR1108 LOCKBUSTER PR1108 LOCKBUSTER SOUNDS11 |
| r31373 | r31374 | |
| 27973 | 27973 | } |
| 27974 | 27974 | |
| 27975 | 27975 | INPUT_PORTS_START( sc4lkbcl ) // this structure is generated |
| 27976 | PORT_INCLUDE( sc4_base ) | |
| 27977 | PORT_MODIFY("IN-1") | |
| 27978 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27979 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27980 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 27981 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 27982 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27983 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 27984 | PORT_MODIFY("IN-2") | |
| 27985 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27986 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27987 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27988 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27989 | PORT_MODIFY("IN-3") | |
| 27990 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27991 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27992 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27993 | PORT_MODIFY("IN-4") | |
| 27994 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27995 | PORT_MODIFY("IN-5") | |
| 27996 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27997 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27998 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27999 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28000 | PORT_MODIFY("IN-8") | |
| 28001 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t.cash") | |
| 28002 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 28003 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 28004 | PORT_MODIFY("IN-16") | |
| 28005 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28006 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28007 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28008 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28009 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28010 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28011 | PORT_MODIFY("IN-17") | |
| 28012 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28013 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28014 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28015 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28016 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28017 | PORT_MODIFY("IN-18") | |
| 28018 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28019 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28020 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28021 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 28022 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 28023 | PORT_MODIFY("IN-19") | |
| 28024 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 28025 | PORT_MODIFY("IN-20") | |
| 28026 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28027 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28028 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28029 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28030 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 27976 | PORT_INCLUDE( sc4_base ) | |
| 27977 | PORT_MODIFY("IN-1") | |
| 27978 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 27979 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 27980 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 27981 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 27982 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 27983 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 27984 | PORT_MODIFY("IN-2") | |
| 27985 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 27986 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 27987 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 27988 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 27989 | PORT_MODIFY("IN-3") | |
| 27990 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 27991 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 27992 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 27993 | PORT_MODIFY("IN-4") | |
| 27994 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 27995 | PORT_MODIFY("IN-5") | |
| 27996 | // 0x0001 - "priz4" // standard input (expected here) | |
| 27997 | // 0x0002 - "priz3" // standard input (expected here) | |
| 27998 | // 0x0004 - "priz2" // standard input (expected here) | |
| 27999 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28000 | PORT_MODIFY("IN-8") | |
| 28001 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t.cash") | |
| 28002 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 28003 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 28004 | PORT_MODIFY("IN-16") | |
| 28005 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28006 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28007 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28008 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28009 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28010 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28011 | PORT_MODIFY("IN-17") | |
| 28012 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28013 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28014 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28015 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28016 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28017 | PORT_MODIFY("IN-18") | |
| 28018 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28019 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28020 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28021 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 28022 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 28023 | PORT_MODIFY("IN-19") | |
| 28024 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 28025 | PORT_MODIFY("IN-20") | |
| 28026 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28027 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28028 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28029 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28030 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28031 | 28031 | INPUT_PORTS_END |
| 28032 | 28032 | |
| 28033 | 28033 | // PR1321 CLUB LOCKBUSTER PR1321 CLUB LOCKBUSTER SOUNDS11 |
| r31373 | r31374 | |
| 28063 | 28063 | } |
| 28064 | 28064 | |
| 28065 | 28065 | INPUT_PORTS_START( sc4lotrf ) // this structure is generated |
| 28066 | PORT_INCLUDE( sc4_base ) | |
| 28067 | PORT_MODIFY("IN-1") | |
| 28068 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28069 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28070 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28071 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28072 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 28073 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 28074 | PORT_MODIFY("IN-2") | |
| 28075 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 28076 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28077 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28078 | PORT_MODIFY("IN-3") | |
| 28079 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28080 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28081 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28082 | PORT_MODIFY("IN-4") | |
| 28083 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 28084 | PORT_MODIFY("IN-5") | |
| 28085 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28086 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28087 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28088 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28089 | PORT_MODIFY("IN-6") | |
| 28090 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28091 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28092 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28093 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28094 | PORT_MODIFY("IN-8") | |
| 28095 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auto n") | |
| 28096 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 28097 | PORT_MODIFY("IN-16") | |
| 28098 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28099 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28100 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28101 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28102 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28103 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 28104 | PORT_MODIFY("IN-17") | |
| 28105 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28106 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28107 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28108 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28109 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28110 | PORT_MODIFY("IN-18") | |
| 28111 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28112 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28113 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28114 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28115 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28116 | PORT_MODIFY("IN-19") | |
| 28117 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28118 | PORT_MODIFY("IN-20") | |
| 28119 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28120 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28121 | // 0x0004 - "serdor" // standard input (expected here) | |
| 28122 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 28123 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28066 | PORT_INCLUDE( sc4_base ) | |
| 28067 | PORT_MODIFY("IN-1") | |
| 28068 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28069 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28070 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28071 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28072 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 28073 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 28074 | PORT_MODIFY("IN-2") | |
| 28075 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 28076 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28077 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28078 | PORT_MODIFY("IN-3") | |
| 28079 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28080 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28081 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28082 | PORT_MODIFY("IN-4") | |
| 28083 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 28084 | PORT_MODIFY("IN-5") | |
| 28085 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28086 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28087 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28088 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28089 | PORT_MODIFY("IN-6") | |
| 28090 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28091 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28092 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28093 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28094 | PORT_MODIFY("IN-8") | |
| 28095 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auto n") | |
| 28096 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 28097 | PORT_MODIFY("IN-16") | |
| 28098 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28099 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28100 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28101 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28102 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28103 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 28104 | PORT_MODIFY("IN-17") | |
| 28105 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28106 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28107 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28108 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28109 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28110 | PORT_MODIFY("IN-18") | |
| 28111 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28112 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28113 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28114 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28115 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28116 | PORT_MODIFY("IN-19") | |
| 28117 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28118 | PORT_MODIFY("IN-20") | |
| 28119 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28120 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28121 | // 0x0004 - "serdor" // standard input (expected here) | |
| 28122 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 28123 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28124 | 28124 | INPUT_PORTS_END |
| 28125 | 28125 | |
| 28126 | 28126 | // PR1115 LORD OF THE RINGS PR1115 L O T RINGS SOUNDS11 |
| r31373 | r31374 | |
| 28160 | 28160 | } |
| 28161 | 28161 | |
| 28162 | 28162 | INPUT_PORTS_START( sc4lotr2 ) // this structure is generated |
| 28163 | PORT_INCLUDE( sc4_base ) | |
| 28164 | PORT_MODIFY("IN-1") | |
| 28165 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28166 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28167 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28168 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28169 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 28170 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 28171 | PORT_MODIFY("IN-2") | |
| 28172 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 28173 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28174 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28175 | PORT_MODIFY("IN-3") | |
| 28176 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28177 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28178 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28179 | PORT_MODIFY("IN-4") | |
| 28180 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 28181 | PORT_MODIFY("IN-5") | |
| 28182 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28183 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28184 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28185 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28186 | PORT_MODIFY("IN-6") | |
| 28187 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28188 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28189 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28190 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28191 | PORT_MODIFY("IN-8") | |
| 28192 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 28193 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 28194 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 28195 | PORT_MODIFY("IN-16") | |
| 28196 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 28197 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 28198 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 28199 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 28200 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 28201 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 28202 | PORT_MODIFY("IN-17") | |
| 28203 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 28204 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 28205 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 28206 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 28207 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28208 | PORT_MODIFY("IN-18") | |
| 28209 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28210 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28211 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28212 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 28213 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 28214 | PORT_MODIFY("IN-19") | |
| 28215 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 28216 | PORT_MODIFY("IN-20") | |
| 28217 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28218 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28219 | // 0x0004 - "serdor" // standard input (expected here) | |
| 28220 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 28221 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28163 | PORT_INCLUDE( sc4_base ) | |
| 28164 | PORT_MODIFY("IN-1") | |
| 28165 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28166 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28167 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28168 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28169 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 28170 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 28171 | PORT_MODIFY("IN-2") | |
| 28172 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 28173 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28174 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28175 | PORT_MODIFY("IN-3") | |
| 28176 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28177 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28178 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28179 | PORT_MODIFY("IN-4") | |
| 28180 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 28181 | PORT_MODIFY("IN-5") | |
| 28182 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28183 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28184 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28185 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28186 | PORT_MODIFY("IN-6") | |
| 28187 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28188 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28189 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28190 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28191 | PORT_MODIFY("IN-8") | |
| 28192 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 28193 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 28194 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 28195 | PORT_MODIFY("IN-16") | |
| 28196 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 28197 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 28198 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 28199 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 28200 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 28201 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 28202 | PORT_MODIFY("IN-17") | |
| 28203 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 28204 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 28205 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 28206 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 28207 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28208 | PORT_MODIFY("IN-18") | |
| 28209 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28210 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28211 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28212 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 28213 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 28214 | PORT_MODIFY("IN-19") | |
| 28215 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 28216 | PORT_MODIFY("IN-20") | |
| 28217 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28218 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28219 | // 0x0004 - "serdor" // standard input (expected here) | |
| 28220 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 28221 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28222 | 28222 | INPUT_PORTS_END |
| 28223 | 28223 | |
| 28224 | 28224 | |
| r31373 | r31374 | |
| 28262 | 28262 | } |
| 28263 | 28263 | |
| 28264 | 28264 | INPUT_PORTS_START( sc4ltr2c ) // this structure is generated |
| 28265 | PORT_INCLUDE( sc4_base ) | |
| 28266 | PORT_MODIFY("IN-1") | |
| 28267 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 28268 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28269 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28270 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28271 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 28272 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 28273 | PORT_MODIFY("IN-2") | |
| 28274 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 28275 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 28276 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28277 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28278 | PORT_MODIFY("IN-3") | |
| 28279 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28280 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28281 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28282 | PORT_MODIFY("IN-4") | |
| 28283 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 28284 | PORT_MODIFY("IN-5") | |
| 28285 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28286 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28287 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28288 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28289 | PORT_MODIFY("IN-8") | |
| 28290 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 28291 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 28292 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("sspins") | |
| 28293 | PORT_MODIFY("IN-16") | |
| 28294 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28295 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28296 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28297 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28298 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28299 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28300 | PORT_MODIFY("IN-17") | |
| 28301 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28302 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28303 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28304 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28305 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28306 | PORT_MODIFY("IN-18") | |
| 28307 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28308 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28309 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28310 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 28311 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 28312 | PORT_MODIFY("IN-19") | |
| 28313 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 28314 | PORT_MODIFY("IN-20") | |
| 28315 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28316 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28317 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28318 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28319 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28265 | PORT_INCLUDE( sc4_base ) | |
| 28266 | PORT_MODIFY("IN-1") | |
| 28267 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 28268 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28269 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28270 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28271 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 28272 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 28273 | PORT_MODIFY("IN-2") | |
| 28274 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 28275 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 28276 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28277 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28278 | PORT_MODIFY("IN-3") | |
| 28279 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28280 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28281 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28282 | PORT_MODIFY("IN-4") | |
| 28283 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 28284 | PORT_MODIFY("IN-5") | |
| 28285 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28286 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28287 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28288 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28289 | PORT_MODIFY("IN-8") | |
| 28290 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 28291 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 28292 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("sspins") | |
| 28293 | PORT_MODIFY("IN-16") | |
| 28294 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28295 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28296 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28297 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28298 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28299 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28300 | PORT_MODIFY("IN-17") | |
| 28301 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28302 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28303 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28304 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28305 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28306 | PORT_MODIFY("IN-18") | |
| 28307 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28308 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28309 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28310 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 28311 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 28312 | PORT_MODIFY("IN-19") | |
| 28313 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 28314 | PORT_MODIFY("IN-20") | |
| 28315 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28316 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28317 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28318 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28319 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28320 | 28320 | INPUT_PORTS_END |
| 28321 | 28321 | |
| 28322 | 28322 | // PR1420 CLUB LOTR TWO TOWERS PR1420 CLUB TWOTOWERS SOUNDS11 |
| r31373 | r31374 | |
| 28351 | 28351 | } |
| 28352 | 28352 | |
| 28353 | 28353 | INPUT_PORTS_START( sc4magic ) // this structure is generated |
| 28354 | PORT_INCLUDE( sc4_base ) | |
| 28355 | PORT_MODIFY("IN-1") | |
| 28356 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28357 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28358 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28359 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28360 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 28361 | PORT_MODIFY("IN-2") | |
| 28362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 28363 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28364 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28365 | PORT_MODIFY("IN-8") | |
| 28366 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 28367 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudges") | |
| 28368 | PORT_MODIFY("IN-16") | |
| 28369 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28370 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28371 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28372 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28373 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28374 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28375 | PORT_MODIFY("IN-17") | |
| 28376 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28377 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28378 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28379 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28380 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28381 | PORT_MODIFY("IN-18") | |
| 28382 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28383 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28384 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28385 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28386 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28387 | PORT_MODIFY("IN-19") | |
| 28388 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28389 | PORT_MODIFY("IN-20") | |
| 28390 | // 0x0001 - "test" // standard input (motherboard) | |
| 28391 | // 0x0002 - "lock" // standard input (expected here) | |
| 28392 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28393 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28394 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28354 | PORT_INCLUDE( sc4_base ) | |
| 28355 | PORT_MODIFY("IN-1") | |
| 28356 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28357 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28358 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28359 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28360 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 28361 | PORT_MODIFY("IN-2") | |
| 28362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 28363 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28364 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28365 | PORT_MODIFY("IN-8") | |
| 28366 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 28367 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudges") | |
| 28368 | PORT_MODIFY("IN-16") | |
| 28369 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28370 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28371 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28372 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28373 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28374 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28375 | PORT_MODIFY("IN-17") | |
| 28376 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28377 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28378 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28379 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28380 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28381 | PORT_MODIFY("IN-18") | |
| 28382 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28383 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28384 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28385 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28386 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28387 | PORT_MODIFY("IN-19") | |
| 28388 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28389 | PORT_MODIFY("IN-20") | |
| 28390 | // 0x0001 - "test" // standard input (motherboard) | |
| 28391 | // 0x0002 - "lock" // standard input (expected here) | |
| 28392 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28393 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28394 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28395 | 28395 | INPUT_PORTS_END |
| 28396 | 28396 | |
| 28397 | 28397 | // PR2520 MAGIC POUND ABOUT V1.0 MAGICPOUNDABOUTSND MAGIC POUNDABOUT |
| r31373 | r31374 | |
| 28417 | 28417 | } |
| 28418 | 28418 | |
| 28419 | 28419 | INPUT_PORTS_START( sc4maxim ) // this structure is generated |
| 28420 | PORT_INCLUDE( sc4_base ) | |
| 28421 | PORT_MODIFY("IN-1") | |
| 28422 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28423 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28424 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28425 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28426 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 28427 | PORT_MODIFY("IN-2") | |
| 28428 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excnge") | |
| 28429 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28430 | PORT_MODIFY("IN-4") | |
| 28431 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 28432 | PORT_MODIFY("IN-8") | |
| 28433 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bon") | |
| 28434 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 28435 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 28436 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk spk") | |
| 28437 | PORT_MODIFY("IN-16") | |
| 28438 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28439 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28440 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28441 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28442 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28443 | PORT_MODIFY("IN-17") | |
| 28444 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28445 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28446 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28447 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28448 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28449 | PORT_MODIFY("IN-18") | |
| 28450 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28451 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28452 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28453 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28454 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28455 | PORT_MODIFY("IN-19") | |
| 28456 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28457 | PORT_MODIFY("IN-20") | |
| 28458 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 28459 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 28460 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 28461 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 28462 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28420 | PORT_INCLUDE( sc4_base ) | |
| 28421 | PORT_MODIFY("IN-1") | |
| 28422 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28423 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28424 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28425 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28426 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 28427 | PORT_MODIFY("IN-2") | |
| 28428 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excnge") | |
| 28429 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28430 | PORT_MODIFY("IN-4") | |
| 28431 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 28432 | PORT_MODIFY("IN-8") | |
| 28433 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bon") | |
| 28434 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 28435 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 28436 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk spk") | |
| 28437 | PORT_MODIFY("IN-16") | |
| 28438 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28439 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28440 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28441 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28442 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28443 | PORT_MODIFY("IN-17") | |
| 28444 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28445 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28446 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28447 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28448 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28449 | PORT_MODIFY("IN-18") | |
| 28450 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28451 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28452 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28453 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28454 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28455 | PORT_MODIFY("IN-19") | |
| 28456 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28457 | PORT_MODIFY("IN-20") | |
| 28458 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 28459 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 28460 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 28461 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 28462 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28463 | 28463 | INPUT_PORTS_END |
| 28464 | 28464 | |
| 28465 | 28465 | // PR2019 MAXIMUS CASH MAX SOUNDS MAXIMUS CASH |
| r31373 | r31374 | |
| 28490 | 28490 | } |
| 28491 | 28491 | |
| 28492 | 28492 | INPUT_PORTS_START( sc4monob ) // this structure is generated |
| 28493 | PORT_INCLUDE( sc4_base ) | |
| 28494 | PORT_MODIFY("IN-1") | |
| 28495 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28496 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 28497 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 28498 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 28499 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 28500 | PORT_MODIFY("IN-2") | |
| 28501 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 28502 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28503 | PORT_MODIFY("IN-8") | |
| 28504 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 28505 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cas") | |
| 28506 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 28507 | PORT_MODIFY("IN-16") | |
| 28508 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28509 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28510 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28511 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28512 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28513 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28514 | PORT_MODIFY("IN-17") | |
| 28515 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28516 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28517 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28518 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28519 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28520 | PORT_MODIFY("IN-18") | |
| 28521 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28522 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28523 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28524 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28525 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28526 | PORT_MODIFY("IN-19") | |
| 28527 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28528 | PORT_MODIFY("IN-20") | |
| 28529 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 28530 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 28531 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 28532 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 28533 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28493 | PORT_INCLUDE( sc4_base ) | |
| 28494 | PORT_MODIFY("IN-1") | |
| 28495 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28496 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 28497 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 28498 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 28499 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 28500 | PORT_MODIFY("IN-2") | |
| 28501 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 28502 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28503 | PORT_MODIFY("IN-8") | |
| 28504 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 28505 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cas") | |
| 28506 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 28507 | PORT_MODIFY("IN-16") | |
| 28508 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28509 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28510 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28511 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28512 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28513 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28514 | PORT_MODIFY("IN-17") | |
| 28515 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28516 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28517 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28518 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28519 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28520 | PORT_MODIFY("IN-18") | |
| 28521 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28522 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28523 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28524 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28525 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28526 | PORT_MODIFY("IN-19") | |
| 28527 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28528 | PORT_MODIFY("IN-20") | |
| 28529 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 28530 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 28531 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 28532 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 28533 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28534 | 28534 | INPUT_PORTS_END |
| 28535 | 28535 | |
| 28536 | 28536 | // PR2121 MONOPOLY MPLY SOUNDS MONOPOLY |
| r31373 | r31374 | |
| 28569 | 28569 | } |
| 28570 | 28570 | |
| 28571 | 28571 | INPUT_PORTS_START( sc4mondx ) // this structure is generated |
| 28572 | PORT_INCLUDE( sc4_base ) | |
| 28573 | PORT_MODIFY("IN-1") | |
| 28574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 28575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 28576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 28577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 28578 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 28579 | PORT_MODIFY("IN-2") | |
| 28580 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 28581 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28582 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28583 | PORT_MODIFY("IN-16") | |
| 28584 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28585 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 28586 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 28587 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 28588 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 28589 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28590 | PORT_MODIFY("IN-17") | |
| 28591 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28592 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 28593 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 28594 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 28595 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 28596 | PORT_MODIFY("IN-18") | |
| 28597 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28598 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 28599 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 28600 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 28601 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 28602 | PORT_MODIFY("IN-19") | |
| 28603 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28604 | PORT_MODIFY("IN-20") | |
| 28605 | // 0x0001 - "test" // standard input (motherboard) | |
| 28606 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 28607 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 28608 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 28609 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28572 | PORT_INCLUDE( sc4_base ) | |
| 28573 | PORT_MODIFY("IN-1") | |
| 28574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 28575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 28576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 28577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 28578 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 28579 | PORT_MODIFY("IN-2") | |
| 28580 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 28581 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28582 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28583 | PORT_MODIFY("IN-16") | |
| 28584 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28585 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 28586 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 28587 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 28588 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 28589 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28590 | PORT_MODIFY("IN-17") | |
| 28591 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28592 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 28593 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 28594 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 28595 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 28596 | PORT_MODIFY("IN-18") | |
| 28597 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28598 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 28599 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 28600 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 28601 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 28602 | PORT_MODIFY("IN-19") | |
| 28603 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 28604 | PORT_MODIFY("IN-20") | |
| 28605 | // 0x0001 - "test" // standard input (motherboard) | |
| 28606 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 28607 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 28608 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 28609 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28610 | 28610 | INPUT_PORTS_END |
| 28611 | 28611 | |
| 28612 | 28612 | // So which Top Box roms should thse use? Why do some play without one? |
| r31373 | r31374 | |
| 28630 | 28630 | |
| 28631 | 28631 | |
| 28632 | 28632 | INPUT_PORTS_START( sc4mont ) // this structure is generated |
| 28633 | PORT_INCLUDE( sc4_base ) | |
| 28634 | PORT_MODIFY("IN-1") | |
| 28635 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28636 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28637 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28638 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28639 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("streak") | |
| 28640 | PORT_MODIFY("IN-2") | |
| 28641 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 28642 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 28643 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28644 | PORT_MODIFY("IN-4") | |
| 28645 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 28646 | PORT_MODIFY("IN-16") | |
| 28647 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28648 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28649 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28650 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28651 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28652 | PORT_MODIFY("IN-17") | |
| 28653 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28654 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28655 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28656 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28657 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28658 | PORT_MODIFY("IN-18") | |
| 28659 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28660 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28661 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28662 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28663 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28664 | PORT_MODIFY("IN-19") | |
| 28665 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28666 | PORT_MODIFY("IN-20") | |
| 28667 | // 0x0001 - "test" // standard input (motherboard) | |
| 28668 | // 0x0002 - "botdor" // standard input (expected here) | |
| 28669 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28670 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 28671 | // 0x0010 - "topdor" // standard input (expected here) | |
| 28633 | PORT_INCLUDE( sc4_base ) | |
| 28634 | PORT_MODIFY("IN-1") | |
| 28635 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28636 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28637 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28638 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28639 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("streak") | |
| 28640 | PORT_MODIFY("IN-2") | |
| 28641 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 28642 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 28643 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28644 | PORT_MODIFY("IN-4") | |
| 28645 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 28646 | PORT_MODIFY("IN-16") | |
| 28647 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28648 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28649 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28650 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28651 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28652 | PORT_MODIFY("IN-17") | |
| 28653 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28654 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28655 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28656 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28657 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28658 | PORT_MODIFY("IN-18") | |
| 28659 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28660 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28661 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28662 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28663 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28664 | PORT_MODIFY("IN-19") | |
| 28665 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28666 | PORT_MODIFY("IN-20") | |
| 28667 | // 0x0001 - "test" // standard input (motherboard) | |
| 28668 | // 0x0002 - "botdor" // standard input (expected here) | |
| 28669 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28670 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 28671 | // 0x0010 - "topdor" // standard input (expected here) | |
| 28672 | 28672 | INPUT_PORTS_END |
| 28673 | 28673 | |
| 28674 | 28674 | |
| r31373 | r31374 | |
| 28719 | 28719 | } |
| 28720 | 28720 | |
| 28721 | 28721 | INPUT_PORTS_START( sc4mou ) // this structure is generated |
| 28722 | PORT_INCLUDE( sc4_base ) | |
| 28723 | PORT_MODIFY("IN-1") | |
| 28724 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28725 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28726 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28727 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28728 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 28729 | PORT_MODIFY("IN-2") | |
| 28730 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 28731 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28732 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28733 | PORT_MODIFY("IN-8") | |
| 28734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 28735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi l") | |
| 28736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo l") | |
| 28737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("change") | |
| 28738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo r") | |
| 28739 | PORT_MODIFY("IN-9") | |
| 28740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi r") | |
| 28741 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("nudge") | |
| 28742 | PORT_MODIFY("IN-16") | |
| 28743 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28744 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28745 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28746 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28747 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28748 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28749 | PORT_MODIFY("IN-17") | |
| 28750 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28751 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28752 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28753 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28754 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28755 | PORT_MODIFY("IN-18") | |
| 28756 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28757 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28758 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28759 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28760 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28761 | PORT_MODIFY("IN-19") | |
| 28762 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28763 | PORT_MODIFY("IN-20") | |
| 28764 | // 0x0001 - "test" // standard input (motherboard) | |
| 28765 | // 0x0002 - "lock" // standard input (expected here) | |
| 28766 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28767 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28768 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28722 | PORT_INCLUDE( sc4_base ) | |
| 28723 | PORT_MODIFY("IN-1") | |
| 28724 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28725 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28726 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 28727 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 28728 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 28729 | PORT_MODIFY("IN-2") | |
| 28730 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 28731 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28732 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28733 | PORT_MODIFY("IN-8") | |
| 28734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 28735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi l") | |
| 28736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo l") | |
| 28737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("change") | |
| 28738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo r") | |
| 28739 | PORT_MODIFY("IN-9") | |
| 28740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi r") | |
| 28741 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("nudge") | |
| 28742 | PORT_MODIFY("IN-16") | |
| 28743 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28744 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28745 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28746 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28747 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28748 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28749 | PORT_MODIFY("IN-17") | |
| 28750 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28751 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28752 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28753 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28754 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28755 | PORT_MODIFY("IN-18") | |
| 28756 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28757 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28758 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28759 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28760 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28761 | PORT_MODIFY("IN-19") | |
| 28762 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28763 | PORT_MODIFY("IN-20") | |
| 28764 | // 0x0001 - "test" // standard input (motherboard) | |
| 28765 | // 0x0002 - "lock" // standard input (expected here) | |
| 28766 | // 0x0004 - "topdor" // standard input (expected here) | |
| 28767 | // 0x0008 - "botdor" // standard input (expected here) | |
| 28768 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28769 | 28769 | INPUT_PORTS_END |
| 28770 | 28770 | |
| 28771 | 28771 | // PR2523 MOVE ON UP V1.0 MOVEONUPSND MOVE ON UP |
| r31373 | r31374 | |
| 28790 | 28790 | } |
| 28791 | 28791 | |
| 28792 | 28792 | INPUT_PORTS_START( sc4nmtj ) // this structure is generated |
| 28793 | PORT_INCLUDE( sc4_base ) | |
| 28794 | PORT_MODIFY("IN-1") | |
| 28795 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 28796 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 28797 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 28798 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 28799 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 28800 | PORT_MODIFY("IN-2") | |
| 28801 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 28802 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 28803 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28804 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28805 | PORT_MODIFY("IN-8") | |
| 28806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 28807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 28808 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 28809 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 28810 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 28811 | PORT_MODIFY("IN-9") | |
| 28812 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 28813 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 28814 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 28815 | PORT_MODIFY("IN-16") | |
| 28816 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28817 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28818 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28819 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28820 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28821 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28822 | PORT_MODIFY("IN-17") | |
| 28823 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28824 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28825 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28826 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28827 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28828 | PORT_MODIFY("IN-18") | |
| 28829 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28830 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28831 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28832 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 28833 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 28834 | PORT_MODIFY("IN-19") | |
| 28835 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 28836 | PORT_MODIFY("IN-20") | |
| 28837 | // 0x0001 - "test" // standard input (motherboard) | |
| 28838 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 28839 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 28840 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 28841 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28793 | PORT_INCLUDE( sc4_base ) | |
| 28794 | PORT_MODIFY("IN-1") | |
| 28795 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 28796 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 28797 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 28798 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 28799 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 28800 | PORT_MODIFY("IN-2") | |
| 28801 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 28802 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 28803 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28804 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28805 | PORT_MODIFY("IN-8") | |
| 28806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 28807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 28808 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 28809 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 28810 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 28811 | PORT_MODIFY("IN-9") | |
| 28812 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 28813 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 28814 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 28815 | PORT_MODIFY("IN-16") | |
| 28816 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28817 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28818 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28819 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28820 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28821 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 28822 | PORT_MODIFY("IN-17") | |
| 28823 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28824 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28825 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28826 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28827 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28828 | PORT_MODIFY("IN-18") | |
| 28829 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28830 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 28831 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 28832 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 28833 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 28834 | PORT_MODIFY("IN-19") | |
| 28835 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 28836 | PORT_MODIFY("IN-20") | |
| 28837 | // 0x0001 - "test" // standard input (motherboard) | |
| 28838 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 28839 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 28840 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 28841 | // 0x0010 - "deflt" // standard input (expected here) | |
| 28842 | 28842 | INPUT_PORTS_END |
| 28843 | 28843 | |
| 28844 | 28844 | // PR2171 NEVER MIND JPS NMTJ SOUNDS NEVER MIND JPS |
| r31373 | r31374 | |
| 28865 | 28865 | } |
| 28866 | 28866 | |
| 28867 | 28867 | INPUT_PORTS_START( sc4oyf ) // this structure is generated |
| 28868 | PORT_INCLUDE( sc4_base ) | |
| 28869 | PORT_MODIFY("IN-1") | |
| 28870 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28871 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28872 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28873 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28874 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("st/col") | |
| 28875 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 28876 | PORT_MODIFY("IN-2") | |
| 28877 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 28878 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28879 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28880 | PORT_MODIFY("IN-3") | |
| 28881 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28882 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28883 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28884 | PORT_MODIFY("IN-4") | |
| 28885 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 28886 | PORT_MODIFY("IN-5") | |
| 28887 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28888 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28889 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28890 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28891 | PORT_MODIFY("IN-6") | |
| 28892 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28893 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28894 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28895 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28896 | PORT_MODIFY("IN-8") | |
| 28897 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 28898 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("coll") | |
| 28899 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudges") | |
| 28900 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("notes") | |
| 28901 | PORT_MODIFY("IN-16") | |
| 28902 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28903 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28904 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28905 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28906 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28907 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 28908 | PORT_MODIFY("IN-17") | |
| 28909 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28910 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28911 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28912 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28913 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28914 | PORT_MODIFY("IN-18") | |
| 28915 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28916 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28917 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28918 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28919 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28920 | PORT_MODIFY("IN-19") | |
| 28921 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28922 | PORT_MODIFY("IN-20") | |
| 28923 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28924 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28925 | // 0x0004 - "serdor" // standard input (expected here) | |
| 28926 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 28927 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28868 | PORT_INCLUDE( sc4_base ) | |
| 28869 | PORT_MODIFY("IN-1") | |
| 28870 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28871 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 28872 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 28873 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 28874 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("st/col") | |
| 28875 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 28876 | PORT_MODIFY("IN-2") | |
| 28877 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 28878 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28879 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28880 | PORT_MODIFY("IN-3") | |
| 28881 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28882 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28883 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28884 | PORT_MODIFY("IN-4") | |
| 28885 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 28886 | PORT_MODIFY("IN-5") | |
| 28887 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28888 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28889 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28890 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28891 | PORT_MODIFY("IN-6") | |
| 28892 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28893 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28894 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28895 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28896 | PORT_MODIFY("IN-8") | |
| 28897 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 28898 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("coll") | |
| 28899 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudges") | |
| 28900 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("notes") | |
| 28901 | PORT_MODIFY("IN-16") | |
| 28902 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28903 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28904 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28905 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28906 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28907 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 28908 | PORT_MODIFY("IN-17") | |
| 28909 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28910 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28911 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28912 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28913 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 28914 | PORT_MODIFY("IN-18") | |
| 28915 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 28916 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 28917 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 28918 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 28919 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 28920 | PORT_MODIFY("IN-19") | |
| 28921 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 28922 | PORT_MODIFY("IN-20") | |
| 28923 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 28924 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 28925 | // 0x0004 - "serdor" // standard input (expected here) | |
| 28926 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 28927 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28928 | 28928 | INPUT_PORTS_END |
| 28929 | 28929 | |
| 28930 | 28930 | // PR1310 AWP OFF YOUR FACE PR1310 OFF YOUR FACE SOUNDS11 |
| r31373 | r31374 | |
| 28949 | 28949 | } |
| 28950 | 28950 | |
| 28951 | 28951 | INPUT_PORTS_START( sc4opses ) // this structure is generated |
| 28952 | PORT_INCLUDE( sc4_base ) | |
| 28953 | PORT_MODIFY("IN-1") | |
| 28954 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28955 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28956 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 28957 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 28958 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 28959 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 28960 | PORT_MODIFY("IN-2") | |
| 28961 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 28962 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28963 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28964 | PORT_MODIFY("IN-3") | |
| 28965 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28966 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28967 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28968 | PORT_MODIFY("IN-5") | |
| 28969 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28970 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28971 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28972 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28973 | PORT_MODIFY("IN-6") | |
| 28974 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28975 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28976 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28977 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28978 | PORT_MODIFY("IN-8") | |
| 28979 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 28980 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 28981 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk ss") | |
| 28982 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk sht") | |
| 28983 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk haz") | |
| 28984 | PORT_MODIFY("IN-16") | |
| 28985 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28986 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28987 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28988 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28989 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28990 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28991 | PORT_MODIFY("IN-17") | |
| 28992 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28993 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28994 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28995 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28996 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28997 | PORT_MODIFY("IN-18") | |
| 28998 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28999 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29000 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29001 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29002 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29003 | PORT_MODIFY("IN-19") | |
| 29004 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29005 | PORT_MODIFY("IN-20") | |
| 29006 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29007 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29008 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29009 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29010 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 28952 | PORT_INCLUDE( sc4_base ) | |
| 28953 | PORT_MODIFY("IN-1") | |
| 28954 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 28955 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 28956 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 28957 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 28958 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 28959 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 28960 | PORT_MODIFY("IN-2") | |
| 28961 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 28962 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 28963 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 28964 | PORT_MODIFY("IN-3") | |
| 28965 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 28966 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 28967 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 28968 | PORT_MODIFY("IN-5") | |
| 28969 | // 0x0001 - "priz4" // standard input (expected here) | |
| 28970 | // 0x0002 - "priz3" // standard input (expected here) | |
| 28971 | // 0x0004 - "priz2" // standard input (expected here) | |
| 28972 | // 0x0008 - "priz1" // standard input (expected here) | |
| 28973 | PORT_MODIFY("IN-6") | |
| 28974 | // 0x0001 - "perc1" // standard input (expected here) | |
| 28975 | // 0x0002 - "perc2" // standard input (expected here) | |
| 28976 | // 0x0004 - "perc3" // standard input (expected here) | |
| 28977 | // 0x0008 - "perc4" // standard input (expected here) | |
| 28978 | PORT_MODIFY("IN-8") | |
| 28979 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 28980 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 28981 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk ss") | |
| 28982 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk sht") | |
| 28983 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk haz") | |
| 28984 | PORT_MODIFY("IN-16") | |
| 28985 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 28986 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 28987 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 28988 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 28989 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 28990 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 28991 | PORT_MODIFY("IN-17") | |
| 28992 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 28993 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 28994 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 28995 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 28996 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 28997 | PORT_MODIFY("IN-18") | |
| 28998 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 28999 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29000 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29001 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29002 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29003 | PORT_MODIFY("IN-19") | |
| 29004 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29005 | PORT_MODIFY("IN-20") | |
| 29006 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29007 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29008 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29009 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29010 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29011 | 29011 | INPUT_PORTS_END |
| 29012 | 29012 | |
| 29013 | 29013 | // PR1106 OPEN SESAME PR1106 OPEN SESAME SOUNDS11 |
| r31373 | r31374 | |
| 29032 | 29032 | } |
| 29033 | 29033 | |
| 29034 | 29034 | INPUT_PORTS_START( sc4paccl ) // this structure is generated |
| 29035 | PORT_INCLUDE( sc4_base ) | |
| 29036 | PORT_MODIFY("IN-1") | |
| 29037 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold1") | |
| 29038 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold2") | |
| 29039 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold3") | |
| 29040 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold4") | |
| 29041 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 29042 | PORT_MODIFY("IN-2") | |
| 29043 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 29044 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 29045 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29046 | PORT_MODIFY("IN-7") | |
| 29047 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("tk nud") | |
| 29048 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_1 ) PORT_NAME("tk sht") | |
| 29049 | PORT_MODIFY("IN-8") | |
| 29050 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk met") | |
| 29051 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 29052 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mickey") | |
| 29053 | PORT_MODIFY("IN-16") | |
| 29054 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29055 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29056 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29057 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29058 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29059 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29060 | PORT_MODIFY("IN-17") | |
| 29061 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29062 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29063 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29064 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29065 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29066 | PORT_MODIFY("IN-18") | |
| 29067 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29068 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29069 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29070 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29071 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29072 | PORT_MODIFY("IN-19") | |
| 29073 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29074 | PORT_MODIFY("IN-20") | |
| 29075 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 29076 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 29077 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 29078 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 29079 | // 0x0010 - "deflt" // standard input (expected here) | |
| 29035 | PORT_INCLUDE( sc4_base ) | |
| 29036 | PORT_MODIFY("IN-1") | |
| 29037 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold1") | |
| 29038 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold2") | |
| 29039 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold3") | |
| 29040 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold4") | |
| 29041 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 29042 | PORT_MODIFY("IN-2") | |
| 29043 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 29044 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 29045 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29046 | PORT_MODIFY("IN-7") | |
| 29047 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("tk nud") | |
| 29048 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_1 ) PORT_NAME("tk sht") | |
| 29049 | PORT_MODIFY("IN-8") | |
| 29050 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk met") | |
| 29051 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 29052 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mickey") | |
| 29053 | PORT_MODIFY("IN-16") | |
| 29054 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29055 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29056 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29057 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29058 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29059 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29060 | PORT_MODIFY("IN-17") | |
| 29061 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29062 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29063 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29064 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29065 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29066 | PORT_MODIFY("IN-18") | |
| 29067 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29068 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29069 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29070 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29071 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29072 | PORT_MODIFY("IN-19") | |
| 29073 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29074 | PORT_MODIFY("IN-20") | |
| 29075 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 29076 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 29077 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 29078 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 29079 | // 0x0010 - "deflt" // standard input (expected here) | |
| 29080 | 29080 | INPUT_PORTS_END |
| 29081 | 29081 | |
| 29082 | 29082 | // PR2018 PACMAN CLUB CLUB PACMAN SOUNDS PACMAN C L U B |
| r31373 | r31374 | |
| 29102 | 29102 | } |
| 29103 | 29103 | |
| 29104 | 29104 | INPUT_PORTS_START( sc4pmani ) // this structure is generated |
| 29105 | PORT_INCLUDE( sc4_base ) | |
| 29106 | PORT_MODIFY("IN-1") | |
| 29107 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29108 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 29109 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 29110 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 29111 | PORT_MODIFY("IN-2") | |
| 29112 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excnge") | |
| 29113 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29114 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("coll") | |
| 29115 | PORT_MODIFY("IN-8") | |
| 29116 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("higher") | |
| 29117 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lower") | |
| 29118 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk prz") | |
| 29119 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 29120 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 29121 | PORT_MODIFY("IN-16") | |
| 29122 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29123 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29124 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29125 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29126 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29127 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29128 | PORT_MODIFY("IN-17") | |
| 29129 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29130 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29131 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29132 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29133 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29134 | PORT_MODIFY("IN-18") | |
| 29135 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29136 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29137 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29138 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29139 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29140 | PORT_MODIFY("IN-19") | |
| 29141 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29142 | PORT_MODIFY("IN-20") | |
| 29143 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 29144 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 29145 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 29146 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 29147 | // 0x0010 - "deflt" // standard input (expected here) | |
| 29105 | PORT_INCLUDE( sc4_base ) | |
| 29106 | PORT_MODIFY("IN-1") | |
| 29107 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29108 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 29109 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 29110 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 29111 | PORT_MODIFY("IN-2") | |
| 29112 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excnge") | |
| 29113 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29114 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("coll") | |
| 29115 | PORT_MODIFY("IN-8") | |
| 29116 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("higher") | |
| 29117 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lower") | |
| 29118 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk prz") | |
| 29119 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 29120 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 29121 | PORT_MODIFY("IN-16") | |
| 29122 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29123 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29124 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29125 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29126 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29127 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29128 | PORT_MODIFY("IN-17") | |
| 29129 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29130 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29131 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29132 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29133 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29134 | PORT_MODIFY("IN-18") | |
| 29135 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29136 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29137 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29138 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29139 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29140 | PORT_MODIFY("IN-19") | |
| 29141 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29142 | PORT_MODIFY("IN-20") | |
| 29143 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 29144 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 29145 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 29146 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 29147 | // 0x0010 - "deflt" // standard input (expected here) | |
| 29148 | 29148 | INPUT_PORTS_END |
| 29149 | 29149 | |
| 29150 | 29150 | // REEL 4 ERR 24 |
| r31373 | r31374 | |
| 29170 | 29170 | } |
| 29171 | 29171 | |
| 29172 | 29172 | INPUT_PORTS_START( sc4pgold ) // this structure is generated |
| 29173 | PORT_INCLUDE( sc4_base ) | |
| 29174 | PORT_MODIFY("IN-1") | |
| 29175 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29176 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29177 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29178 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29179 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 29180 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 29181 | PORT_MODIFY("IN-2") | |
| 29182 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 29183 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29184 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29185 | PORT_MODIFY("IN-3") | |
| 29186 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 29187 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 29188 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 29189 | PORT_MODIFY("IN-5") | |
| 29190 | // 0x0001 - "priz4" // standard input (expected here) | |
| 29191 | // 0x0002 - "priz3" // standard input (expected here) | |
| 29192 | // 0x0004 - "priz2" // standard input (expected here) | |
| 29193 | // 0x0008 - "priz1" // standard input (expected here) | |
| 29194 | PORT_MODIFY("IN-6") | |
| 29195 | // 0x0001 - "perc1" // standard input (expected here) | |
| 29196 | // 0x0002 - "perc2" // standard input (expected here) | |
| 29197 | // 0x0004 - "perc3" // standard input (expected here) | |
| 29198 | // 0x0008 - "perc4" // standard input (expected here) | |
| 29199 | PORT_MODIFY("IN-8") | |
| 29200 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk eye") | |
| 29201 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 29202 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 29203 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("high") | |
| 29204 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("low") | |
| 29205 | PORT_MODIFY("IN-16") | |
| 29206 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29207 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29208 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29209 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29210 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29211 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29212 | PORT_MODIFY("IN-17") | |
| 29213 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29214 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29215 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29216 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29217 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 29218 | PORT_MODIFY("IN-18") | |
| 29219 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 29220 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29221 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29222 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29223 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29224 | PORT_MODIFY("IN-19") | |
| 29225 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29226 | PORT_MODIFY("IN-20") | |
| 29227 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29228 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29229 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29230 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29231 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29173 | PORT_INCLUDE( sc4_base ) | |
| 29174 | PORT_MODIFY("IN-1") | |
| 29175 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29176 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29177 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29178 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29179 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 29180 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 29181 | PORT_MODIFY("IN-2") | |
| 29182 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 29183 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29184 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29185 | PORT_MODIFY("IN-3") | |
| 29186 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 29187 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 29188 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 29189 | PORT_MODIFY("IN-5") | |
| 29190 | // 0x0001 - "priz4" // standard input (expected here) | |
| 29191 | // 0x0002 - "priz3" // standard input (expected here) | |
| 29192 | // 0x0004 - "priz2" // standard input (expected here) | |
| 29193 | // 0x0008 - "priz1" // standard input (expected here) | |
| 29194 | PORT_MODIFY("IN-6") | |
| 29195 | // 0x0001 - "perc1" // standard input (expected here) | |
| 29196 | // 0x0002 - "perc2" // standard input (expected here) | |
| 29197 | // 0x0004 - "perc3" // standard input (expected here) | |
| 29198 | // 0x0008 - "perc4" // standard input (expected here) | |
| 29199 | PORT_MODIFY("IN-8") | |
| 29200 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk eye") | |
| 29201 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 29202 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 29203 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("high") | |
| 29204 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("low") | |
| 29205 | PORT_MODIFY("IN-16") | |
| 29206 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29207 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29208 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29209 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29210 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29211 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29212 | PORT_MODIFY("IN-17") | |
| 29213 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29214 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29215 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29216 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29217 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 29218 | PORT_MODIFY("IN-18") | |
| 29219 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 29220 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29221 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29222 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29223 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29224 | PORT_MODIFY("IN-19") | |
| 29225 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29226 | PORT_MODIFY("IN-20") | |
| 29227 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29228 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29229 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29230 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29231 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29232 | 29232 | INPUT_PORTS_END |
| 29233 | 29233 | |
| 29234 | 29234 | // PR1012 PHARAOH'S GOLD PR1012 PHARAOHS GOLD SOUNDS11 |
| r31373 | r31374 | |
| 29258 | 29258 | } |
| 29259 | 29259 | |
| 29260 | 29260 | INPUT_PORTS_START( sc4ppclb ) // this structure is generated |
| 29261 | PORT_INCLUDE( sc4_base ) | |
| 29262 | PORT_MODIFY("IN-1") | |
| 29263 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29264 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29265 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29266 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29267 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 29268 | PORT_MODIFY("IN-2") | |
| 29269 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29270 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 29271 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29272 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29273 | PORT_MODIFY("IN-8") | |
| 29274 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 29275 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudge") | |
| 29276 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin p") | |
| 29277 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin c") | |
| 29278 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c pot") | |
| 29279 | PORT_MODIFY("IN-16") | |
| 29280 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29281 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29282 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29283 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29284 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29285 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29286 | PORT_MODIFY("IN-17") | |
| 29287 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29288 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29289 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29290 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29291 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29292 | PORT_MODIFY("IN-18") | |
| 29293 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29294 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29295 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29296 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29297 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29298 | PORT_MODIFY("IN-19") | |
| 29299 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29300 | PORT_MODIFY("IN-20") | |
| 29301 | // 0x0001 - "test" // standard input (motherboard) | |
| 29302 | // 0x0002 - "lock" // standard input (expected here) | |
| 29303 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29304 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29305 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29261 | PORT_INCLUDE( sc4_base ) | |
| 29262 | PORT_MODIFY("IN-1") | |
| 29263 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29264 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29265 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29266 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29267 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 29268 | PORT_MODIFY("IN-2") | |
| 29269 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29270 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 29271 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29272 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29273 | PORT_MODIFY("IN-8") | |
| 29274 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 29275 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudge") | |
| 29276 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin p") | |
| 29277 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin c") | |
| 29278 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c pot") | |
| 29279 | PORT_MODIFY("IN-16") | |
| 29280 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29281 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29282 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29283 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29284 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29285 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29286 | PORT_MODIFY("IN-17") | |
| 29287 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29288 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29289 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29290 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29291 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29292 | PORT_MODIFY("IN-18") | |
| 29293 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29294 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29295 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29296 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29297 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29298 | PORT_MODIFY("IN-19") | |
| 29299 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29300 | PORT_MODIFY("IN-20") | |
| 29301 | // 0x0001 - "test" // standard input (motherboard) | |
| 29302 | // 0x0002 - "lock" // standard input (expected here) | |
| 29303 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29304 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29305 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29306 | 29306 | INPUT_PORTS_END |
| 29307 | 29307 | |
| 29308 | 29308 | // PR2236 CLUB PINK PANTHER 411 CLUBPINKPANTHERSND CLUB PINKPANTHER |
| r31373 | r31374 | |
| 29329 | 29329 | } |
| 29330 | 29330 | |
| 29331 | 29331 | INPUT_PORTS_START( sc4pipe ) // this structure is generated |
| 29332 | PORT_INCLUDE( sc4_base ) | |
| 29333 | PORT_MODIFY("IN-1") | |
| 29334 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 29335 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 29336 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 29337 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 29338 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 29339 | PORT_MODIFY("IN-2") | |
| 29340 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 29341 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29342 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 29343 | PORT_MODIFY("IN-8") | |
| 29344 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkecs") | |
| 29345 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cshhi") | |
| 29346 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cshlo") | |
| 29347 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("fetlo") | |
| 29348 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fethi") | |
| 29349 | PORT_MODIFY("IN-16") | |
| 29350 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29351 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29352 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29353 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29354 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29355 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29356 | PORT_MODIFY("IN-17") | |
| 29357 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29358 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29359 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29360 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29361 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 29362 | PORT_MODIFY("IN-18") | |
| 29363 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 29364 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29365 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29366 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29367 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29368 | PORT_MODIFY("IN-19") | |
| 29369 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29370 | PORT_MODIFY("IN-20") | |
| 29371 | // 0x0001 - "test" // standard input (motherboard) | |
| 29372 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 29373 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 29374 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 29375 | // 0x0010 - "deflt" // standard input (expected here) | |
| 29332 | PORT_INCLUDE( sc4_base ) | |
| 29333 | PORT_MODIFY("IN-1") | |
| 29334 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 29335 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 29336 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 29337 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 29338 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 29339 | PORT_MODIFY("IN-2") | |
| 29340 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 29341 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29342 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 29343 | PORT_MODIFY("IN-8") | |
| 29344 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkecs") | |
| 29345 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cshhi") | |
| 29346 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cshlo") | |
| 29347 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("fetlo") | |
| 29348 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fethi") | |
| 29349 | PORT_MODIFY("IN-16") | |
| 29350 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29351 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29352 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29353 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29354 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29355 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29356 | PORT_MODIFY("IN-17") | |
| 29357 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29358 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29359 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29360 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29361 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 29362 | PORT_MODIFY("IN-18") | |
| 29363 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 29364 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29365 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29366 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29367 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29368 | PORT_MODIFY("IN-19") | |
| 29369 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29370 | PORT_MODIFY("IN-20") | |
| 29371 | // 0x0001 - "test" // standard input (motherboard) | |
| 29372 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 29373 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 29374 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 29375 | // 0x0010 - "deflt" // standard input (expected here) | |
| 29376 | 29376 | INPUT_PORTS_END |
| 29377 | 29377 | |
| 29378 | 29378 | // PR2110 PIPING HOT PIPE SOUNDS PIPING HOT |
| r31373 | r31374 | |
| 29396 | 29396 | } |
| 29397 | 29397 | |
| 29398 | 29398 | INPUT_PORTS_START( sc4plumb ) // this structure is generated |
| 29399 | PORT_INCLUDE( sc4_base ) | |
| 29400 | PORT_MODIFY("IN-1") | |
| 29401 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29402 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29403 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29404 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29405 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 29406 | PORT_MODIFY("IN-2") | |
| 29407 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29408 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29409 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29410 | PORT_MODIFY("IN-8") | |
| 29411 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 29412 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 29413 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 29414 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c pot") | |
| 29415 | PORT_MODIFY("IN-16") | |
| 29416 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29417 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29418 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29419 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29420 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29421 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29422 | PORT_MODIFY("IN-17") | |
| 29423 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29424 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29425 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29426 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29427 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29428 | PORT_MODIFY("IN-18") | |
| 29429 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29430 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29431 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29432 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29433 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29434 | PORT_MODIFY("IN-19") | |
| 29435 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29436 | PORT_MODIFY("IN-20") | |
| 29437 | // 0x0001 - "test" // standard input (motherboard) | |
| 29438 | // 0x0002 - "lock" // standard input (expected here) | |
| 29439 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29440 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29441 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29399 | PORT_INCLUDE( sc4_base ) | |
| 29400 | PORT_MODIFY("IN-1") | |
| 29401 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29402 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29403 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29404 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29405 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 29406 | PORT_MODIFY("IN-2") | |
| 29407 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29408 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29409 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29410 | PORT_MODIFY("IN-8") | |
| 29411 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 29412 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 29413 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 29414 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c pot") | |
| 29415 | PORT_MODIFY("IN-16") | |
| 29416 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29417 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29418 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29419 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29420 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29421 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29422 | PORT_MODIFY("IN-17") | |
| 29423 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29424 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29425 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29426 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29427 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29428 | PORT_MODIFY("IN-18") | |
| 29429 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29430 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29431 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29432 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29433 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29434 | PORT_MODIFY("IN-19") | |
| 29435 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29436 | PORT_MODIFY("IN-20") | |
| 29437 | // 0x0001 - "test" // standard input (motherboard) | |
| 29438 | // 0x0002 - "lock" // standard input (expected here) | |
| 29439 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29440 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29441 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29442 | 29442 | INPUT_PORTS_END |
| 29443 | 29443 | |
| 29444 | 29444 | // QPS142 CLUB PLUMB CRAZY 413 CLUBPLUMBCRAZYSND CLUB PLUMB CRAZY |
| r31373 | r31374 | |
| 29469 | 29469 | } |
| 29470 | 29470 | |
| 29471 | 29471 | INPUT_PORTS_START( sc4polic ) // this structure is generated |
| 29472 | PORT_INCLUDE( sc4_base ) | |
| 29473 | PORT_MODIFY("IN-1") | |
| 29474 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29475 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29476 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29477 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29478 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 29479 | PORT_MODIFY("IN-2") | |
| 29480 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29481 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29482 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29483 | PORT_MODIFY("IN-16") | |
| 29484 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29485 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29486 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29487 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29488 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29489 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29490 | PORT_MODIFY("IN-17") | |
| 29491 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29492 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29493 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29494 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29495 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29496 | PORT_MODIFY("IN-18") | |
| 29497 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29498 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29499 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29500 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29501 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29502 | PORT_MODIFY("IN-19") | |
| 29503 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29504 | PORT_MODIFY("IN-20") | |
| 29505 | // 0x0001 - "test" // standard input (motherboard) | |
| 29506 | // 0x0002 - "lock" // standard input (expected here) | |
| 29507 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29508 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29509 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29472 | PORT_INCLUDE( sc4_base ) | |
| 29473 | PORT_MODIFY("IN-1") | |
| 29474 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29475 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29476 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29477 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29478 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 29479 | PORT_MODIFY("IN-2") | |
| 29480 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29481 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29482 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29483 | PORT_MODIFY("IN-16") | |
| 29484 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29485 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29486 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29487 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29488 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29489 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29490 | PORT_MODIFY("IN-17") | |
| 29491 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29492 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29493 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29494 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29495 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29496 | PORT_MODIFY("IN-18") | |
| 29497 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29498 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29499 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29500 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29501 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29502 | PORT_MODIFY("IN-19") | |
| 29503 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29504 | PORT_MODIFY("IN-20") | |
| 29505 | // 0x0001 - "test" // standard input (motherboard) | |
| 29506 | // 0x0002 - "lock" // standard input (expected here) | |
| 29507 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29508 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29509 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29510 | 29510 | INPUT_PORTS_END |
| 29511 | 29511 | |
| 29512 | 29512 | // PR2514 POLICE SQUID V1.0 POLICESQUIDSND POLICE SQUID |
| r31373 | r31374 | |
| 29534 | 29534 | } |
| 29535 | 29535 | |
| 29536 | 29536 | INPUT_PORTS_START( sc4potsh ) // this structure is generated |
| 29537 | PORT_INCLUDE( sc4_base ) | |
| 29538 | PORT_MODIFY("IN-1") | |
| 29539 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29540 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 29541 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 29542 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 29543 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 29544 | PORT_MODIFY("IN-2") | |
| 29545 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29546 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29547 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29548 | PORT_MODIFY("IN-8") | |
| 29549 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 29550 | PORT_MODIFY("IN-16") | |
| 29551 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29552 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29553 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29554 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29555 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29556 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29557 | PORT_MODIFY("IN-17") | |
| 29558 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29559 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29560 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29561 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29562 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29563 | PORT_MODIFY("IN-18") | |
| 29564 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29565 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29566 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29567 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29568 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29569 | PORT_MODIFY("IN-19") | |
| 29570 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29571 | PORT_MODIFY("IN-20") | |
| 29572 | // 0x0001 - "test" // standard input (motherboard) | |
| 29573 | // 0x0002 - "lock" // standard input (expected here) | |
| 29574 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29575 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29576 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29537 | PORT_INCLUDE( sc4_base ) | |
| 29538 | PORT_MODIFY("IN-1") | |
| 29539 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29540 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 29541 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 29542 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 29543 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 29544 | PORT_MODIFY("IN-2") | |
| 29545 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29546 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29547 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29548 | PORT_MODIFY("IN-8") | |
| 29549 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 29550 | PORT_MODIFY("IN-16") | |
| 29551 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29552 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29553 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29554 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29555 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29556 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29557 | PORT_MODIFY("IN-17") | |
| 29558 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29559 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29560 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29561 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29562 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29563 | PORT_MODIFY("IN-18") | |
| 29564 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29565 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29566 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29567 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29568 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29569 | PORT_MODIFY("IN-19") | |
| 29570 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29571 | PORT_MODIFY("IN-20") | |
| 29572 | // 0x0001 - "test" // standard input (motherboard) | |
| 29573 | // 0x0002 - "lock" // standard input (expected here) | |
| 29574 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29575 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29576 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29577 | 29577 | INPUT_PORTS_END |
| 29578 | 29578 | |
| 29579 | 29579 | // QPS143 POT SHOT V1.0 POTSHOTSND POT SHOT |
| r31373 | r31374 | |
| 29598 | 29598 | } |
| 29599 | 29599 | |
| 29600 | 29600 | INPUT_PORTS_START( sc4pogbl ) // this structure is generated |
| 29601 | PORT_INCLUDE( sc4_base ) | |
| 29602 | PORT_MODIFY("IN-1") | |
| 29603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29607 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 29608 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 29609 | PORT_MODIFY("IN-2") | |
| 29610 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collec") | |
| 29611 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop") | |
| 29612 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("tra/ex") | |
| 29613 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29614 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 29615 | PORT_MODIFY("IN-3") | |
| 29616 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 29617 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 29618 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 29619 | PORT_MODIFY("IN-4") | |
| 29620 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 29621 | PORT_MODIFY("IN-5") | |
| 29622 | // 0x0001 - "priz4" // standard input (expected here) | |
| 29623 | // 0x0002 - "priz3" // standard input (expected here) | |
| 29624 | // 0x0004 - "priz2" // standard input (expected here) | |
| 29625 | // 0x0008 - "priz1" // standard input (expected here) | |
| 29626 | PORT_MODIFY("IN-16") | |
| 29627 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29628 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29629 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29630 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29631 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29632 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29633 | PORT_MODIFY("IN-17") | |
| 29634 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29635 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29636 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29637 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29638 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 29639 | PORT_MODIFY("IN-18") | |
| 29640 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 29641 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29642 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29643 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29644 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29645 | PORT_MODIFY("IN-19") | |
| 29646 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29647 | PORT_MODIFY("IN-20") | |
| 29648 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29649 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29650 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29651 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29652 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29601 | PORT_INCLUDE( sc4_base ) | |
| 29602 | PORT_MODIFY("IN-1") | |
| 29603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29607 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 29608 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 29609 | PORT_MODIFY("IN-2") | |
| 29610 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collec") | |
| 29611 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop") | |
| 29612 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("tra/ex") | |
| 29613 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29614 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 29615 | PORT_MODIFY("IN-3") | |
| 29616 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 29617 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 29618 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 29619 | PORT_MODIFY("IN-4") | |
| 29620 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 29621 | PORT_MODIFY("IN-5") | |
| 29622 | // 0x0001 - "priz4" // standard input (expected here) | |
| 29623 | // 0x0002 - "priz3" // standard input (expected here) | |
| 29624 | // 0x0004 - "priz2" // standard input (expected here) | |
| 29625 | // 0x0008 - "priz1" // standard input (expected here) | |
| 29626 | PORT_MODIFY("IN-16") | |
| 29627 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29628 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29629 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29630 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29631 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29632 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 29633 | PORT_MODIFY("IN-17") | |
| 29634 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29635 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29636 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29637 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29638 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 29639 | PORT_MODIFY("IN-18") | |
| 29640 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 29641 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 29642 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 29643 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 29644 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 29645 | PORT_MODIFY("IN-19") | |
| 29646 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 29647 | PORT_MODIFY("IN-20") | |
| 29648 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29649 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29650 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29651 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29652 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29653 | 29653 | INPUT_PORTS_END |
| 29654 | 29654 | |
| 29655 | 29655 | // PR3083 CLUB POTS OF GOLD POTS OF GOLD CLUB PR3082 C POTS OF GOLD SOUNDS11 POTS OF GOLD |
| r31373 | r31374 | |
| 29677 | 29677 | } |
| 29678 | 29678 | |
| 29679 | 29679 | INPUT_PORTS_START( sc4pwrsg ) // this structure is generated |
| 29680 | PORT_INCLUDE( sc4_base ) | |
| 29681 | PORT_MODIFY("IN-1") | |
| 29682 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29683 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29684 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29685 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29686 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchge") | |
| 29687 | PORT_MODIFY("IN-2") | |
| 29688 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 29689 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29690 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29691 | PORT_MODIFY("IN-8") | |
| 29692 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step r") | |
| 29693 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step l") | |
| 29694 | PORT_MODIFY("IN-16") | |
| 29695 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29696 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29697 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29698 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29699 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29700 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29701 | PORT_MODIFY("IN-17") | |
| 29702 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29703 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29704 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29705 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29706 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29707 | PORT_MODIFY("IN-18") | |
| 29708 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29709 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29710 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29711 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29712 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29713 | PORT_MODIFY("IN-19") | |
| 29714 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29715 | PORT_MODIFY("IN-20") | |
| 29716 | // 0x0001 - "test" // standard input (motherboard) | |
| 29717 | // 0x0002 - "lock" // standard input (expected here) | |
| 29718 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29719 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29720 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29680 | PORT_INCLUDE( sc4_base ) | |
| 29681 | PORT_MODIFY("IN-1") | |
| 29682 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29683 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29684 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29685 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29686 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchge") | |
| 29687 | PORT_MODIFY("IN-2") | |
| 29688 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 29689 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29690 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29691 | PORT_MODIFY("IN-8") | |
| 29692 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step r") | |
| 29693 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step l") | |
| 29694 | PORT_MODIFY("IN-16") | |
| 29695 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29696 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29697 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29698 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29699 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29700 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29701 | PORT_MODIFY("IN-17") | |
| 29702 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29703 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29704 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29705 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29706 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29707 | PORT_MODIFY("IN-18") | |
| 29708 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29709 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29710 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29711 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29712 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29713 | PORT_MODIFY("IN-19") | |
| 29714 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29715 | PORT_MODIFY("IN-20") | |
| 29716 | // 0x0001 - "test" // standard input (motherboard) | |
| 29717 | // 0x0002 - "lock" // standard input (expected here) | |
| 29718 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29719 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29720 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29721 | 29721 | INPUT_PORTS_END |
| 29722 | 29722 | |
| 29723 | 29723 | // PR2053 POWERSURGE SURGESND POWERSURGE |
| r31373 | r31374 | |
| 29743 | 29743 | } |
| 29744 | 29744 | |
| 29745 | 29745 | INPUT_PORTS_START( sc4pir ) // this structure is generated |
| 29746 | PORT_INCLUDE( sc4_base ) | |
| 29747 | PORT_MODIFY("IN-1") | |
| 29748 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29749 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 29750 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 29751 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 29752 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 29753 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 29754 | PORT_MODIFY("IN-2") | |
| 29755 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 29756 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29757 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29758 | PORT_MODIFY("IN-3") | |
| 29759 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 29760 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 29761 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 29762 | PORT_MODIFY("IN-4") | |
| 29763 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 29764 | PORT_MODIFY("IN-5") | |
| 29765 | // 0x0001 - "priz4" // standard input (expected here) | |
| 29766 | // 0x0002 - "priz3" // standard input (expected here) | |
| 29767 | // 0x0004 - "priz2" // standard input (expected here) | |
| 29768 | // 0x0008 - "priz1" // standard input (expected here) | |
| 29769 | PORT_MODIFY("IN-6") | |
| 29770 | // 0x0001 - "perc1" // standard input (expected here) | |
| 29771 | // 0x0002 - "perc2" // standard input (expected here) | |
| 29772 | // 0x0004 - "perc3" // standard input (expected here) | |
| 29773 | // 0x0008 - "perc4" // standard input (expected here) | |
| 29774 | PORT_MODIFY("IN-8") | |
| 29775 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 29776 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 29777 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 29778 | PORT_MODIFY("IN-16") | |
| 29779 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29780 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29781 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29782 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29783 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29784 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 29785 | PORT_MODIFY("IN-17") | |
| 29786 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29787 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29788 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29789 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29790 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29791 | PORT_MODIFY("IN-18") | |
| 29792 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29793 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29794 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29795 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29796 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29797 | PORT_MODIFY("IN-19") | |
| 29798 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29799 | PORT_MODIFY("IN-20") | |
| 29800 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29801 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29802 | // 0x0004 - "serdor" // standard input (expected here) | |
| 29803 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 29804 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29746 | PORT_INCLUDE( sc4_base ) | |
| 29747 | PORT_MODIFY("IN-1") | |
| 29748 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29749 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 29750 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 29751 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 29752 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 29753 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 29754 | PORT_MODIFY("IN-2") | |
| 29755 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 29756 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29757 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29758 | PORT_MODIFY("IN-3") | |
| 29759 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 29760 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 29761 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 29762 | PORT_MODIFY("IN-4") | |
| 29763 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 29764 | PORT_MODIFY("IN-5") | |
| 29765 | // 0x0001 - "priz4" // standard input (expected here) | |
| 29766 | // 0x0002 - "priz3" // standard input (expected here) | |
| 29767 | // 0x0004 - "priz2" // standard input (expected here) | |
| 29768 | // 0x0008 - "priz1" // standard input (expected here) | |
| 29769 | PORT_MODIFY("IN-6") | |
| 29770 | // 0x0001 - "perc1" // standard input (expected here) | |
| 29771 | // 0x0002 - "perc2" // standard input (expected here) | |
| 29772 | // 0x0004 - "perc3" // standard input (expected here) | |
| 29773 | // 0x0008 - "perc4" // standard input (expected here) | |
| 29774 | PORT_MODIFY("IN-8") | |
| 29775 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 29776 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 29777 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 29778 | PORT_MODIFY("IN-16") | |
| 29779 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29780 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29781 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29782 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29783 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29784 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 29785 | PORT_MODIFY("IN-17") | |
| 29786 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29787 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29788 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29789 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29790 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29791 | PORT_MODIFY("IN-18") | |
| 29792 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29793 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29794 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29795 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29796 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29797 | PORT_MODIFY("IN-19") | |
| 29798 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29799 | PORT_MODIFY("IN-20") | |
| 29800 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 29801 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 29802 | // 0x0004 - "serdor" // standard input (expected here) | |
| 29803 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 29804 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29805 | 29805 | INPUT_PORTS_END |
| 29806 | 29806 | |
| 29807 | 29807 | // PR1303 THE PRIZE IS RIGHT PR1303 T PRIZE I R SOUNDS11 |
| r31373 | r31374 | |
| 29831 | 29831 | } |
| 29832 | 29832 | |
| 29833 | 29833 | INPUT_PORTS_START( sc4qmodo ) // this structure is generated |
| 29834 | PORT_INCLUDE( sc4_base ) | |
| 29835 | PORT_MODIFY("IN-1") | |
| 29836 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29837 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29838 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29839 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29840 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 29841 | PORT_MODIFY("IN-2") | |
| 29842 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excha") | |
| 29843 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stake") | |
| 29844 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29845 | PORT_MODIFY("IN-7") | |
| 29846 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("bonus") | |
| 29847 | PORT_MODIFY("IN-16") | |
| 29848 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29849 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29850 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29851 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29852 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29853 | PORT_MODIFY("IN-17") | |
| 29854 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29855 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29856 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29857 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29858 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29859 | PORT_MODIFY("IN-18") | |
| 29860 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29861 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29862 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29863 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29864 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29865 | PORT_MODIFY("IN-19") | |
| 29866 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29867 | PORT_MODIFY("IN-20") | |
| 29868 | // 0x0001 - "green" // standard input (motherboard) | |
| 29834 | PORT_INCLUDE( sc4_base ) | |
| 29835 | PORT_MODIFY("IN-1") | |
| 29836 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29837 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29838 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29839 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29840 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 29841 | PORT_MODIFY("IN-2") | |
| 29842 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excha") | |
| 29843 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stake") | |
| 29844 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29845 | PORT_MODIFY("IN-7") | |
| 29846 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("bonus") | |
| 29847 | PORT_MODIFY("IN-16") | |
| 29848 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29849 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29850 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29851 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29852 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29853 | PORT_MODIFY("IN-17") | |
| 29854 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29855 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29856 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29857 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29858 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29859 | PORT_MODIFY("IN-18") | |
| 29860 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29861 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29862 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29863 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29864 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29865 | PORT_MODIFY("IN-19") | |
| 29866 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29867 | PORT_MODIFY("IN-20") | |
| 29868 | // 0x0001 - "green" // standard input (motherboard) | |
| 29869 | 29869 | INPUT_PORTS_END |
| 29870 | 29870 | |
| 29871 | 29871 | // QUAZZI MO' DOUGH..........QUAZZSND....... (no standard header) |
| r31373 | r31374 | |
| 29892 | 29892 | } |
| 29893 | 29893 | |
| 29894 | 29894 | INPUT_PORTS_START( sc4quidr ) // this structure is generated |
| 29895 | PORT_INCLUDE( sc4_base ) | |
| 29896 | PORT_MODIFY("IN-1") | |
| 29897 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29898 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29899 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29900 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29901 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 29902 | PORT_MODIFY("IN-2") | |
| 29903 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29904 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29905 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29906 | PORT_MODIFY("IN-8") | |
| 29907 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nshoot") | |
| 29908 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 29909 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cshoot") | |
| 29910 | PORT_MODIFY("IN-16") | |
| 29911 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29912 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29913 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29914 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29915 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29916 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29917 | PORT_MODIFY("IN-17") | |
| 29918 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29919 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29920 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29921 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29922 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29923 | PORT_MODIFY("IN-18") | |
| 29924 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29925 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29926 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29927 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29928 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29929 | PORT_MODIFY("IN-19") | |
| 29930 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29931 | PORT_MODIFY("IN-20") | |
| 29932 | // 0x0001 - "test" // standard input (motherboard) | |
| 29933 | // 0x0002 - "lock" // standard input (expected here) | |
| 29934 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29935 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29936 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29895 | PORT_INCLUDE( sc4_base ) | |
| 29896 | PORT_MODIFY("IN-1") | |
| 29897 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 29898 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 29899 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 29900 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 29901 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 29902 | PORT_MODIFY("IN-2") | |
| 29903 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29904 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29905 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29906 | PORT_MODIFY("IN-8") | |
| 29907 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nshoot") | |
| 29908 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 29909 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cshoot") | |
| 29910 | PORT_MODIFY("IN-16") | |
| 29911 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29912 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29913 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29914 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29915 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29916 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29917 | PORT_MODIFY("IN-17") | |
| 29918 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29919 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29920 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29921 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29922 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29923 | PORT_MODIFY("IN-18") | |
| 29924 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29925 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29926 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29927 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29928 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29929 | PORT_MODIFY("IN-19") | |
| 29930 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29931 | PORT_MODIFY("IN-20") | |
| 29932 | // 0x0001 - "test" // standard input (motherboard) | |
| 29933 | // 0x0002 - "lock" // standard input (expected here) | |
| 29934 | // 0x0004 - "topdor" // standard input (expected here) | |
| 29935 | // 0x0008 - "botdor" // standard input (expected here) | |
| 29936 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29937 | 29937 | INPUT_PORTS_END |
| 29938 | 29938 | |
| 29939 | 29939 | GAMEL( 200?, sc4quidr ,0, sc4, sc4quidr, sc4_state, sc4quidr, ROT0, "Qps","Quid Rock (Qps) (Scorpion 4) (set 1)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| r31373 | r31374 | |
| 29958 | 29958 | } |
| 29959 | 29959 | |
| 29960 | 29960 | INPUT_PORTS_START( sc4rdrag ) // this structure is generated |
| 29961 | PORT_INCLUDE( sc4_base ) | |
| 29962 | PORT_MODIFY("IN-1") | |
| 29963 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 29964 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 29965 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 29966 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 29967 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 29968 | PORT_MODIFY("IN-2") | |
| 29969 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29970 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29971 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29972 | PORT_MODIFY("IN-8") | |
| 29973 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 29974 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 29975 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 29976 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c pot") | |
| 29977 | PORT_MODIFY("IN-16") | |
| 29978 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29979 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29980 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29981 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29982 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29983 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29984 | PORT_MODIFY("IN-17") | |
| 29985 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29986 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29987 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29988 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29989 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29990 | PORT_MODIFY("IN-18") | |
| 29991 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29992 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29993 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29994 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29995 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29996 | PORT_MODIFY("IN-19") | |
| 29997 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29998 | PORT_MODIFY("IN-20") | |
| 29999 | // 0x0001 - "test" // standard input (motherboard) | |
| 30000 | // 0x0002 - "lock" // standard input (expected here) | |
| 30001 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30002 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30003 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 29961 | PORT_INCLUDE( sc4_base ) | |
| 29962 | PORT_MODIFY("IN-1") | |
| 29963 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 29964 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 29965 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 29966 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 29967 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 29968 | PORT_MODIFY("IN-2") | |
| 29969 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 29970 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 29971 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 29972 | PORT_MODIFY("IN-8") | |
| 29973 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 29974 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 29975 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 29976 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c pot") | |
| 29977 | PORT_MODIFY("IN-16") | |
| 29978 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 29979 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 29980 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 29981 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 29982 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 29983 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 29984 | PORT_MODIFY("IN-17") | |
| 29985 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 29986 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 29987 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 29988 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 29989 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 29990 | PORT_MODIFY("IN-18") | |
| 29991 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 29992 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 29993 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 29994 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 29995 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 29996 | PORT_MODIFY("IN-19") | |
| 29997 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 29998 | PORT_MODIFY("IN-20") | |
| 29999 | // 0x0001 - "test" // standard input (motherboard) | |
| 30000 | // 0x0002 - "lock" // standard input (expected here) | |
| 30001 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30002 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30003 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30004 | 30004 | INPUT_PORTS_END |
| 30005 | 30005 | |
| 30006 | 30006 | // PR2542 RED DRAGON 011 REDDRAGONSND RED DRAGON |
| r31373 | r31374 | |
| 30028 | 30028 | } |
| 30029 | 30029 | |
| 30030 | 30030 | INPUT_PORTS_START( sc4rdrcl ) // this structure is generated |
| 30031 | PORT_INCLUDE( sc4_base ) | |
| 30032 | PORT_MODIFY("IN-1") | |
| 30033 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30034 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 30035 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 30036 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 30037 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 30038 | PORT_MODIFY("IN-2") | |
| 30039 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30040 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 30041 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30042 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30043 | PORT_MODIFY("IN-8") | |
| 30044 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 30045 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 30046 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 30047 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c pot") | |
| 30048 | PORT_MODIFY("IN-16") | |
| 30049 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30050 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30051 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30052 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30053 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30054 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30055 | PORT_MODIFY("IN-17") | |
| 30056 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30057 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30058 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30059 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30060 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30061 | PORT_MODIFY("IN-18") | |
| 30062 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30063 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30064 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30065 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30066 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30067 | PORT_MODIFY("IN-19") | |
| 30068 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30069 | PORT_MODIFY("IN-20") | |
| 30070 | // 0x0001 - "test" // standard input (motherboard) | |
| 30071 | // 0x0002 - "lock" // standard input (expected here) | |
| 30072 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30073 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30074 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30031 | PORT_INCLUDE( sc4_base ) | |
| 30032 | PORT_MODIFY("IN-1") | |
| 30033 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30034 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 30035 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 30036 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 30037 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 30038 | PORT_MODIFY("IN-2") | |
| 30039 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30040 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 30041 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30042 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30043 | PORT_MODIFY("IN-8") | |
| 30044 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudge") | |
| 30045 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 30046 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 30047 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c pot") | |
| 30048 | PORT_MODIFY("IN-16") | |
| 30049 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30050 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30051 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30052 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30053 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30054 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30055 | PORT_MODIFY("IN-17") | |
| 30056 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30057 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30058 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30059 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30060 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30061 | PORT_MODIFY("IN-18") | |
| 30062 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30063 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30064 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30065 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30066 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30067 | PORT_MODIFY("IN-19") | |
| 30068 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30069 | PORT_MODIFY("IN-20") | |
| 30070 | // 0x0001 - "test" // standard input (motherboard) | |
| 30071 | // 0x0002 - "lock" // standard input (expected here) | |
| 30072 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30073 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30074 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30075 | 30075 | INPUT_PORTS_END |
| 30076 | 30076 | |
| 30077 | 30077 | // QPS160 CLUB RED DRAGON 411 CLUBREDDRAGONSND CLUB RED DRAGON |
| r31373 | r31374 | |
| 30098 | 30098 | } |
| 30099 | 30099 | |
| 30100 | 30100 | INPUT_PORTS_START( sc4relcz ) // this structure is generated |
| 30101 | PORT_INCLUDE( sc4_base ) | |
| 30102 | PORT_MODIFY("IN-1") | |
| 30103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 30105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 30106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 30107 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 30108 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 30109 | PORT_MODIFY("IN-2") | |
| 30110 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 30111 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30112 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30113 | PORT_MODIFY("IN-3") | |
| 30114 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30115 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30116 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30117 | PORT_MODIFY("IN-5") | |
| 30118 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30119 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30120 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30121 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30122 | PORT_MODIFY("IN-6") | |
| 30123 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30124 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30125 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30126 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30127 | PORT_MODIFY("IN-8") | |
| 30128 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk ko") | |
| 30129 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t blst") | |
| 30130 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 30131 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi") | |
| 30132 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo") | |
| 30133 | PORT_MODIFY("IN-16") | |
| 30134 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30135 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30136 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30137 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30138 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30139 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30140 | PORT_MODIFY("IN-17") | |
| 30141 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30142 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30143 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30144 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30145 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30146 | PORT_MODIFY("IN-18") | |
| 30147 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30148 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30149 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30150 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30151 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30152 | PORT_MODIFY("IN-19") | |
| 30153 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30154 | PORT_MODIFY("IN-20") | |
| 30155 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 30156 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 30157 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30158 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30159 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30101 | PORT_INCLUDE( sc4_base ) | |
| 30102 | PORT_MODIFY("IN-1") | |
| 30103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 30105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 30106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 30107 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 30108 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 30109 | PORT_MODIFY("IN-2") | |
| 30110 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 30111 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30112 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30113 | PORT_MODIFY("IN-3") | |
| 30114 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30115 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30116 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30117 | PORT_MODIFY("IN-5") | |
| 30118 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30119 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30120 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30121 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30122 | PORT_MODIFY("IN-6") | |
| 30123 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30124 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30125 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30126 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30127 | PORT_MODIFY("IN-8") | |
| 30128 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk ko") | |
| 30129 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t blst") | |
| 30130 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 30131 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi") | |
| 30132 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo") | |
| 30133 | PORT_MODIFY("IN-16") | |
| 30134 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30135 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30136 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30137 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30138 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30139 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30140 | PORT_MODIFY("IN-17") | |
| 30141 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30142 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30143 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30144 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30145 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30146 | PORT_MODIFY("IN-18") | |
| 30147 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30148 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30149 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30150 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30151 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30152 | PORT_MODIFY("IN-19") | |
| 30153 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30154 | PORT_MODIFY("IN-20") | |
| 30155 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 30156 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 30157 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30158 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30159 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30160 | 30160 | INPUT_PORTS_END |
| 30161 | 30161 | |
| 30162 | 30162 | // PR1015 REELY CRAZY PR1015 REELY CRAZY SOUNDS11 |
| r31373 | r31374 | |
| 30183 | 30183 | } |
| 30184 | 30184 | |
| 30185 | 30185 | INPUT_PORTS_START( sc4rotc ) // this structure is generated |
| 30186 | PORT_INCLUDE( sc4_base ) | |
| 30187 | PORT_MODIFY("IN-1") | |
| 30188 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30189 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 30190 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30191 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30192 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30193 | PORT_MODIFY("IN-2") | |
| 30194 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 30195 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 30196 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30197 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30198 | PORT_MODIFY("IN-8") | |
| 30199 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 30200 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cas") | |
| 30201 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 30202 | PORT_MODIFY("IN-16") | |
| 30203 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30204 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30205 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30206 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30207 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30208 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30209 | PORT_MODIFY("IN-17") | |
| 30210 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30211 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30212 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30213 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30214 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30215 | PORT_MODIFY("IN-18") | |
| 30216 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30217 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30218 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30219 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30220 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30221 | PORT_MODIFY("IN-19") | |
| 30222 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30223 | PORT_MODIFY("IN-20") | |
| 30224 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30225 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30226 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30227 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30228 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30186 | PORT_INCLUDE( sc4_base ) | |
| 30187 | PORT_MODIFY("IN-1") | |
| 30188 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30189 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 30190 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30191 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30192 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30193 | PORT_MODIFY("IN-2") | |
| 30194 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 30195 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 30196 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30197 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30198 | PORT_MODIFY("IN-8") | |
| 30199 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 30200 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cas") | |
| 30201 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 30202 | PORT_MODIFY("IN-16") | |
| 30203 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30204 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30205 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30206 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30207 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30208 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30209 | PORT_MODIFY("IN-17") | |
| 30210 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30211 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30212 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30213 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30214 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30215 | PORT_MODIFY("IN-18") | |
| 30216 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30217 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30218 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30219 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30220 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30221 | PORT_MODIFY("IN-19") | |
| 30222 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30223 | PORT_MODIFY("IN-20") | |
| 30224 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30225 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30226 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30227 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30228 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30229 | 30229 | INPUT_PORTS_END |
| 30230 | 30230 | |
| 30231 | 30231 | // PR2132 RETURN OF THE COUNT ROTC SOUNDS THE COUNT |
| r31373 | r31374 | |
| 30259 | 30259 | } |
| 30260 | 30260 | |
| 30261 | 30261 | INPUT_PORTS_START( sc4rttt ) // this structure is generated |
| 30262 | PORT_INCLUDE( sc4_base ) | |
| 30263 | PORT_MODIFY("IN-1") | |
| 30264 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30265 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 30266 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30267 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30268 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30269 | PORT_MODIFY("IN-2") | |
| 30270 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 30271 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30272 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30273 | PORT_MODIFY("IN-8") | |
| 30274 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tke ft") | |
| 30275 | PORT_MODIFY("IN-16") | |
| 30276 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30277 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30278 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30279 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30280 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30281 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30282 | PORT_MODIFY("IN-17") | |
| 30283 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30284 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30285 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30286 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30287 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30288 | PORT_MODIFY("IN-18") | |
| 30289 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30290 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30291 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30292 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30293 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30294 | PORT_MODIFY("IN-19") | |
| 30295 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30296 | PORT_MODIFY("IN-20") | |
| 30297 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30298 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30299 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30300 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30301 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30262 | PORT_INCLUDE( sc4_base ) | |
| 30263 | PORT_MODIFY("IN-1") | |
| 30264 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30265 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 30266 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30267 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30268 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30269 | PORT_MODIFY("IN-2") | |
| 30270 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 30271 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30272 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30273 | PORT_MODIFY("IN-8") | |
| 30274 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tke ft") | |
| 30275 | PORT_MODIFY("IN-16") | |
| 30276 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30277 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30278 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30279 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30280 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30281 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30282 | PORT_MODIFY("IN-17") | |
| 30283 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30284 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30285 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30286 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30287 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30288 | PORT_MODIFY("IN-18") | |
| 30289 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30290 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30291 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30292 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30293 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30294 | PORT_MODIFY("IN-19") | |
| 30295 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30296 | PORT_MODIFY("IN-20") | |
| 30297 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30298 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30299 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30300 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30301 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30302 | 30302 | INPUT_PORTS_END |
| 30303 | 30303 | |
| 30304 | 30304 | // PR2089 RISE TO THE TOP RISE SOUNDS RISE TO THE TOP |
| r31373 | r31374 | |
| 30326 | 30326 | } |
| 30327 | 30327 | |
| 30328 | 30328 | INPUT_PORTS_START( sc4roksc ) // this structure is generated |
| 30329 | PORT_INCLUDE( sc4_base ) | |
| 30330 | PORT_MODIFY("IN-1") | |
| 30331 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30332 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collet") | |
| 30333 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 30334 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 30335 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 30336 | PORT_MODIFY("IN-2") | |
| 30337 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30338 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30339 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30340 | PORT_MODIFY("IN-8") | |
| 30341 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 30342 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 30343 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudge") | |
| 30344 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("sushot") | |
| 30345 | PORT_MODIFY("IN-16") | |
| 30346 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30347 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30348 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30349 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30350 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30351 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30352 | PORT_MODIFY("IN-17") | |
| 30353 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30354 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30355 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30356 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30357 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30358 | PORT_MODIFY("IN-18") | |
| 30359 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30360 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30361 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30362 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30363 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30364 | PORT_MODIFY("IN-19") | |
| 30365 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30366 | PORT_MODIFY("IN-20") | |
| 30367 | // 0x0001 - "test" // standard input (motherboard) | |
| 30368 | // 0x0002 - "lock" // standard input (expected here) | |
| 30369 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30370 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30371 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30329 | PORT_INCLUDE( sc4_base ) | |
| 30330 | PORT_MODIFY("IN-1") | |
| 30331 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30332 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collet") | |
| 30333 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 30334 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 30335 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 30336 | PORT_MODIFY("IN-2") | |
| 30337 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30338 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30339 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30340 | PORT_MODIFY("IN-8") | |
| 30341 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 30342 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 30343 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudge") | |
| 30344 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("sushot") | |
| 30345 | PORT_MODIFY("IN-16") | |
| 30346 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30347 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30348 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30349 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30350 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30351 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30352 | PORT_MODIFY("IN-17") | |
| 30353 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30354 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30355 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30356 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30357 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30358 | PORT_MODIFY("IN-18") | |
| 30359 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30360 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30361 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30362 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30363 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30364 | PORT_MODIFY("IN-19") | |
| 30365 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30366 | PORT_MODIFY("IN-20") | |
| 30367 | // 0x0001 - "test" // standard input (motherboard) | |
| 30368 | // 0x0002 - "lock" // standard input (expected here) | |
| 30369 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30370 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30371 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30372 | 30372 | INPUT_PORTS_END |
| 30373 | 30373 | |
| 30374 | 30374 | // PR2527 ROCKET SCIENCE V1.1 ROCKETSCIENCESND ROCKET SCIENCE |
| r31373 | r31374 | |
| 30395 | 30395 | } |
| 30396 | 30396 | |
| 30397 | 30397 | INPUT_PORTS_START( sc4blast ) // this structure is generated |
| 30398 | PORT_INCLUDE( sc4_base ) | |
| 30399 | PORT_MODIFY("IN-1") | |
| 30400 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 30401 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 30402 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 30403 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 30404 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 30405 | PORT_MODIFY("IN-2") | |
| 30406 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30407 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30408 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30409 | PORT_MODIFY("IN-8") | |
| 30410 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 30411 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 30412 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudge") | |
| 30413 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("sushot") | |
| 30414 | PORT_MODIFY("IN-16") | |
| 30415 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30416 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30417 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30418 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30419 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30420 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30421 | PORT_MODIFY("IN-17") | |
| 30422 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30423 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30424 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30425 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30426 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30427 | PORT_MODIFY("IN-18") | |
| 30428 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30429 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30430 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30431 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30432 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30433 | PORT_MODIFY("IN-19") | |
| 30434 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30435 | PORT_MODIFY("IN-20") | |
| 30436 | // 0x0001 - "test" // standard input (motherboard) | |
| 30437 | // 0x0002 - "lock" // standard input (expected here) | |
| 30438 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30439 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30440 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30398 | PORT_INCLUDE( sc4_base ) | |
| 30399 | PORT_MODIFY("IN-1") | |
| 30400 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 30401 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 30402 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 30403 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 30404 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 30405 | PORT_MODIFY("IN-2") | |
| 30406 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30407 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30408 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30409 | PORT_MODIFY("IN-8") | |
| 30410 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("feat") | |
| 30411 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 30412 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudge") | |
| 30413 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("sushot") | |
| 30414 | PORT_MODIFY("IN-16") | |
| 30415 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30416 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30417 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30418 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30419 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30420 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30421 | PORT_MODIFY("IN-17") | |
| 30422 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30423 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30424 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30425 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30426 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30427 | PORT_MODIFY("IN-18") | |
| 30428 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30429 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30430 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30431 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30432 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30433 | PORT_MODIFY("IN-19") | |
| 30434 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30435 | PORT_MODIFY("IN-20") | |
| 30436 | // 0x0001 - "test" // standard input (motherboard) | |
| 30437 | // 0x0002 - "lock" // standard input (expected here) | |
| 30438 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30439 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30440 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30441 | 30441 | INPUT_PORTS_END |
| 30442 | 30442 | |
| 30443 | 30443 | // only starts 2nd time (requires valid ram?) |
| r31373 | r31374 | |
| 30470 | 30470 | } |
| 30471 | 30471 | |
| 30472 | 30472 | INPUT_PORTS_START( sc4rogds ) // this structure is generated |
| 30473 | PORT_INCLUDE( sc4_base ) | |
| 30474 | PORT_MODIFY("IN-1") | |
| 30475 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30476 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 30477 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 30478 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 30479 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 30480 | PORT_MODIFY("IN-2") | |
| 30481 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30482 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30483 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30484 | PORT_MODIFY("IN-8") | |
| 30485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo r") | |
| 30486 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo l") | |
| 30487 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi l") | |
| 30488 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi r") | |
| 30489 | PORT_MODIFY("IN-16") | |
| 30490 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30491 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30492 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30493 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30494 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30495 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30496 | PORT_MODIFY("IN-17") | |
| 30497 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30498 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30499 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30500 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30501 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30502 | PORT_MODIFY("IN-18") | |
| 30503 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30504 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30505 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30506 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30507 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30508 | PORT_MODIFY("IN-19") | |
| 30509 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30510 | PORT_MODIFY("IN-20") | |
| 30511 | // 0x0001 - "test" // standard input (motherboard) | |
| 30512 | // 0x0002 - "lock" // standard input (expected here) | |
| 30513 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30514 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30515 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30473 | PORT_INCLUDE( sc4_base ) | |
| 30474 | PORT_MODIFY("IN-1") | |
| 30475 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30476 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 30477 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 30478 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 30479 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 30480 | PORT_MODIFY("IN-2") | |
| 30481 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 30482 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30483 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30484 | PORT_MODIFY("IN-8") | |
| 30485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo r") | |
| 30486 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo l") | |
| 30487 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi l") | |
| 30488 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi r") | |
| 30489 | PORT_MODIFY("IN-16") | |
| 30490 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30491 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30492 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30493 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30494 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30495 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30496 | PORT_MODIFY("IN-17") | |
| 30497 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30498 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30499 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30500 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30501 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30502 | PORT_MODIFY("IN-18") | |
| 30503 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30504 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30505 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30506 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30507 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30508 | PORT_MODIFY("IN-19") | |
| 30509 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30510 | PORT_MODIFY("IN-20") | |
| 30511 | // 0x0001 - "test" // standard input (motherboard) | |
| 30512 | // 0x0002 - "lock" // standard input (expected here) | |
| 30513 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30514 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30515 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30516 | 30516 | INPUT_PORTS_END |
| 30517 | 30517 | |
| 30518 | 30518 | |
| r31373 | r31374 | |
| 30547 | 30547 | } |
| 30548 | 30548 | |
| 30549 | 30549 | INPUT_PORTS_START( sc4rt ) // this structure is generated |
| 30550 | PORT_INCLUDE( sc4_base ) | |
| 30551 | PORT_MODIFY("IN-1") | |
| 30552 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30553 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 30554 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30555 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30556 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30557 | PORT_MODIFY("IN-2") | |
| 30558 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collct") | |
| 30559 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ft exc") | |
| 30560 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30561 | PORT_MODIFY("IN-8") | |
| 30562 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh lo") | |
| 30563 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spn lo") | |
| 30564 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ndg lo") | |
| 30565 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("ndg hi") | |
| 30566 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("spn hi") | |
| 30567 | PORT_MODIFY("IN-9") | |
| 30568 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("csh hi") | |
| 30569 | PORT_MODIFY("IN-16") | |
| 30570 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30571 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30572 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30573 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30574 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30575 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30576 | PORT_MODIFY("IN-17") | |
| 30577 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30578 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30579 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30580 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30581 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30582 | PORT_MODIFY("IN-18") | |
| 30583 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30584 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30585 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30586 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30587 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30588 | PORT_MODIFY("IN-19") | |
| 30589 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30590 | PORT_MODIFY("IN-20") | |
| 30591 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30592 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30593 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30594 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30595 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30550 | PORT_INCLUDE( sc4_base ) | |
| 30551 | PORT_MODIFY("IN-1") | |
| 30552 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30553 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 30554 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30555 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30556 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30557 | PORT_MODIFY("IN-2") | |
| 30558 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collct") | |
| 30559 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ft exc") | |
| 30560 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30561 | PORT_MODIFY("IN-8") | |
| 30562 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh lo") | |
| 30563 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spn lo") | |
| 30564 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ndg lo") | |
| 30565 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("ndg hi") | |
| 30566 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("spn hi") | |
| 30567 | PORT_MODIFY("IN-9") | |
| 30568 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("csh hi") | |
| 30569 | PORT_MODIFY("IN-16") | |
| 30570 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30571 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30572 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30573 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30574 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30575 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30576 | PORT_MODIFY("IN-17") | |
| 30577 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30578 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30579 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30580 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30581 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30582 | PORT_MODIFY("IN-18") | |
| 30583 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30584 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30585 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30586 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30587 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30588 | PORT_MODIFY("IN-19") | |
| 30589 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30590 | PORT_MODIFY("IN-20") | |
| 30591 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30592 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30593 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30594 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30595 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30596 | 30596 | INPUT_PORTS_END |
| 30597 | 30597 | |
| 30598 | 30598 | |
| r31373 | r31374 | |
| 30620 | 30620 | } |
| 30621 | 30621 | |
| 30622 | 30622 | INPUT_PORTS_START( sc4broll ) // this structure is generated |
| 30623 | PORT_INCLUDE( sc4_base ) | |
| 30624 | PORT_MODIFY("IN-1") | |
| 30625 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30626 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 30627 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30628 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30629 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30630 | PORT_MODIFY("IN-2") | |
| 30631 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collct") | |
| 30632 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ft exc") | |
| 30633 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30634 | PORT_MODIFY("IN-8") | |
| 30635 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh lo") | |
| 30636 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spn lo") | |
| 30637 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ndg lo") | |
| 30638 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("ndg hi") | |
| 30639 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("spn hi") | |
| 30640 | PORT_MODIFY("IN-9") | |
| 30641 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("csh hi") | |
| 30642 | PORT_MODIFY("IN-16") | |
| 30643 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30644 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30645 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30646 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30647 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30648 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30649 | PORT_MODIFY("IN-17") | |
| 30650 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30651 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30652 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30653 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30654 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30655 | PORT_MODIFY("IN-18") | |
| 30656 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30657 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30658 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30659 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30660 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30661 | PORT_MODIFY("IN-19") | |
| 30662 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30663 | PORT_MODIFY("IN-20") | |
| 30664 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30665 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30666 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30667 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30668 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30623 | PORT_INCLUDE( sc4_base ) | |
| 30624 | PORT_MODIFY("IN-1") | |
| 30625 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30626 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 30627 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30628 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30629 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30630 | PORT_MODIFY("IN-2") | |
| 30631 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collct") | |
| 30632 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ft exc") | |
| 30633 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30634 | PORT_MODIFY("IN-8") | |
| 30635 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh lo") | |
| 30636 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spn lo") | |
| 30637 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ndg lo") | |
| 30638 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("ndg hi") | |
| 30639 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("spn hi") | |
| 30640 | PORT_MODIFY("IN-9") | |
| 30641 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("csh hi") | |
| 30642 | PORT_MODIFY("IN-16") | |
| 30643 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30644 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30645 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30646 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30647 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30648 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30649 | PORT_MODIFY("IN-17") | |
| 30650 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30651 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30652 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30653 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30654 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30655 | PORT_MODIFY("IN-18") | |
| 30656 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30657 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 30658 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 30659 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 30660 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 30661 | PORT_MODIFY("IN-19") | |
| 30662 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 30663 | PORT_MODIFY("IN-20") | |
| 30664 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 30665 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30666 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30667 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30668 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30669 | 30669 | INPUT_PORTS_END |
| 30670 | 30670 | |
| 30671 | 30671 | // missing sound roms, doesn't play, same game code and sound ident as Rolling Thunder? |
| r31373 | r31374 | |
| 30694 | 30694 | } |
| 30695 | 30695 | |
| 30696 | 30696 | INPUT_PORTS_START( sc4rbank ) // this structure is generated |
| 30697 | PORT_INCLUDE( sc4_base ) | |
| 30698 | PORT_MODIFY("IN-1") | |
| 30699 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30700 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 30701 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 30702 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 30703 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 30704 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 30705 | PORT_MODIFY("IN-2") | |
| 30706 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 30707 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30708 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30709 | PORT_MODIFY("IN-3") | |
| 30710 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30711 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30712 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30713 | PORT_MODIFY("IN-5") | |
| 30714 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30715 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30716 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30717 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30718 | PORT_MODIFY("IN-6") | |
| 30719 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30720 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30721 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30722 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30723 | PORT_MODIFY("IN-8") | |
| 30724 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 30725 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 30726 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fea") | |
| 30727 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk haz") | |
| 30728 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk ss") | |
| 30729 | PORT_MODIFY("IN-16") | |
| 30730 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30731 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30732 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30733 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30734 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30735 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30736 | PORT_MODIFY("IN-17") | |
| 30737 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30738 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30739 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30740 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30741 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30742 | PORT_MODIFY("IN-18") | |
| 30743 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30744 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30745 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30746 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30747 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30748 | PORT_MODIFY("IN-19") | |
| 30749 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30750 | PORT_MODIFY("IN-20") | |
| 30751 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 30752 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 30753 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30754 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30755 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30697 | PORT_INCLUDE( sc4_base ) | |
| 30698 | PORT_MODIFY("IN-1") | |
| 30699 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30700 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 30701 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 30702 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 30703 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 30704 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 30705 | PORT_MODIFY("IN-2") | |
| 30706 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 30707 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30708 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30709 | PORT_MODIFY("IN-3") | |
| 30710 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30711 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30712 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30713 | PORT_MODIFY("IN-5") | |
| 30714 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30715 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30716 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30717 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30718 | PORT_MODIFY("IN-6") | |
| 30719 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30720 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30721 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30722 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30723 | PORT_MODIFY("IN-8") | |
| 30724 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 30725 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 30726 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fea") | |
| 30727 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk haz") | |
| 30728 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk ss") | |
| 30729 | PORT_MODIFY("IN-16") | |
| 30730 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30731 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30732 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30733 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30734 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30735 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 30736 | PORT_MODIFY("IN-17") | |
| 30737 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30738 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30739 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30740 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30741 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30742 | PORT_MODIFY("IN-18") | |
| 30743 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30744 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30745 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30746 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30747 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30748 | PORT_MODIFY("IN-19") | |
| 30749 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30750 | PORT_MODIFY("IN-20") | |
| 30751 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 30752 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 30753 | // 0x0004 - "topdor" // standard input (expected here) | |
| 30754 | // 0x0008 - "botdor" // standard input (expected here) | |
| 30755 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30756 | 30756 | INPUT_PORTS_END |
| 30757 | 30757 | |
| 30758 | 30758 | // PR1111 ROYAL BANKER PR1111 ROYLEBANKER SOUNDS11 |
| r31373 | r31374 | |
| 30779 | 30779 | } |
| 30780 | 30780 | |
| 30781 | 30781 | INPUT_PORTS_START( sc4royle ) // this structure is generated |
| 30782 | PORT_INCLUDE( sc4_base ) | |
| 30783 | PORT_MODIFY("IN-1") | |
| 30784 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30785 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 30786 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30787 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30788 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30789 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 30790 | PORT_MODIFY("IN-2") | |
| 30791 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 30792 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30793 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30794 | PORT_MODIFY("IN-3") | |
| 30795 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30796 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30797 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30798 | PORT_MODIFY("IN-4") | |
| 30799 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 30800 | PORT_MODIFY("IN-5") | |
| 30801 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30802 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30803 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30804 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30805 | PORT_MODIFY("IN-6") | |
| 30806 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30807 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30808 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30809 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30810 | PORT_MODIFY("IN-8") | |
| 30811 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 30812 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 30813 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 30814 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi nud") | |
| 30815 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi csh") | |
| 30816 | PORT_MODIFY("IN-9") | |
| 30817 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fet") | |
| 30818 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo nud") | |
| 30819 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("lo csh") | |
| 30820 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("lo fet") | |
| 30821 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk brc") | |
| 30822 | PORT_MODIFY("IN-16") | |
| 30823 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30824 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30825 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30826 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30827 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30828 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 30829 | PORT_MODIFY("IN-17") | |
| 30830 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30831 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30832 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30833 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30834 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30835 | PORT_MODIFY("IN-18") | |
| 30836 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30837 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30838 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30839 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30840 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30841 | PORT_MODIFY("IN-19") | |
| 30842 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30843 | PORT_MODIFY("IN-20") | |
| 30844 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 30845 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 30846 | // 0x0004 - "serdor" // standard input (expected here) | |
| 30847 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 30848 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30782 | PORT_INCLUDE( sc4_base ) | |
| 30783 | PORT_MODIFY("IN-1") | |
| 30784 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30785 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 30786 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 30787 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 30788 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 30789 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 30790 | PORT_MODIFY("IN-2") | |
| 30791 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 30792 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30793 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30794 | PORT_MODIFY("IN-3") | |
| 30795 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30796 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30797 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30798 | PORT_MODIFY("IN-4") | |
| 30799 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 30800 | PORT_MODIFY("IN-5") | |
| 30801 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30802 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30803 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30804 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30805 | PORT_MODIFY("IN-6") | |
| 30806 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30807 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30808 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30809 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30810 | PORT_MODIFY("IN-8") | |
| 30811 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 30812 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 30813 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 30814 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi nud") | |
| 30815 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi csh") | |
| 30816 | PORT_MODIFY("IN-9") | |
| 30817 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fet") | |
| 30818 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo nud") | |
| 30819 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("lo csh") | |
| 30820 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("lo fet") | |
| 30821 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk brc") | |
| 30822 | PORT_MODIFY("IN-16") | |
| 30823 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30824 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30825 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30826 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30827 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30828 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 30829 | PORT_MODIFY("IN-17") | |
| 30830 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30831 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30832 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30833 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30834 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30835 | PORT_MODIFY("IN-18") | |
| 30836 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30837 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30838 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30839 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30840 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30841 | PORT_MODIFY("IN-19") | |
| 30842 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30843 | PORT_MODIFY("IN-20") | |
| 30844 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 30845 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 30846 | // 0x0004 - "serdor" // standard input (expected here) | |
| 30847 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 30848 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30849 | 30849 | INPUT_PORTS_END |
| 30850 | 30850 | |
| 30851 | 30851 | // PR1102 ROYLEFAMILY PR1102 ROYLEFAMILY SOUNDS11 |
| r31373 | r31374 | |
| 30883 | 30883 | } |
| 30884 | 30884 | |
| 30885 | 30885 | INPUT_PORTS_START( sc4sidsp ) // this structure is generated |
| 30886 | PORT_INCLUDE( sc4_base ) | |
| 30887 | PORT_MODIFY("IN-1") | |
| 30888 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 30889 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 30890 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 30891 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 30892 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 30893 | PORT_MODIFY("IN-2") | |
| 30894 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 30895 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30896 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30897 | PORT_MODIFY("IN-8") | |
| 30898 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 30899 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 30900 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkcsh") | |
| 30901 | PORT_MODIFY("IN-16") | |
| 30902 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30903 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30904 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30905 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30906 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30907 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30908 | PORT_MODIFY("IN-17") | |
| 30909 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30910 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30911 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30912 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30913 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30914 | PORT_MODIFY("IN-18") | |
| 30915 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30916 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30917 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30918 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30919 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30920 | PORT_MODIFY("IN-19") | |
| 30921 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30922 | PORT_MODIFY("IN-20") | |
| 30923 | // 0x0001 - "test" // standard input (motherboard) | |
| 30924 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30925 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30926 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30927 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30886 | PORT_INCLUDE( sc4_base ) | |
| 30887 | PORT_MODIFY("IN-1") | |
| 30888 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 30889 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 30890 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 30891 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 30892 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 30893 | PORT_MODIFY("IN-2") | |
| 30894 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 30895 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30896 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30897 | PORT_MODIFY("IN-8") | |
| 30898 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 30899 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 30900 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkcsh") | |
| 30901 | PORT_MODIFY("IN-16") | |
| 30902 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30903 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30904 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30905 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30906 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30907 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 30908 | PORT_MODIFY("IN-17") | |
| 30909 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30910 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30911 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30912 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30913 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 30914 | PORT_MODIFY("IN-18") | |
| 30915 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 30916 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 30917 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 30918 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 30919 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 30920 | PORT_MODIFY("IN-19") | |
| 30921 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 30922 | PORT_MODIFY("IN-20") | |
| 30923 | // 0x0001 - "test" // standard input (motherboard) | |
| 30924 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 30925 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 30926 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 30927 | // 0x0010 - "deflt" // standard input (expected here) | |
| 30928 | 30928 | INPUT_PORTS_END |
| 30929 | 30929 | |
| 30930 | 30930 | // PR2117 SIDE SPLITTER SSPT SOUNDS SIDE SPLITTER |
| r31373 | r31374 | |
| 30950 | 30950 | } |
| 30951 | 30951 | |
| 30952 | 30952 | INPUT_PORTS_START( sc4srr ) // this structure is generated |
| 30953 | PORT_INCLUDE( sc4_base ) | |
| 30954 | PORT_MODIFY("IN-1") | |
| 30955 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30956 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 30957 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 30958 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 30959 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 30960 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 30961 | PORT_MODIFY("IN-2") | |
| 30962 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 30963 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30964 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30965 | PORT_MODIFY("IN-3") | |
| 30966 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30967 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30968 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30969 | PORT_MODIFY("IN-4") | |
| 30970 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 30971 | PORT_MODIFY("IN-5") | |
| 30972 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30973 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30974 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30975 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30976 | PORT_MODIFY("IN-6") | |
| 30977 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30978 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30979 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30980 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30981 | PORT_MODIFY("IN-8") | |
| 30982 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auto n") | |
| 30983 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 30984 | PORT_MODIFY("IN-16") | |
| 30985 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30986 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30987 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30988 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30989 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30990 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 30991 | PORT_MODIFY("IN-17") | |
| 30992 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30993 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30994 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30995 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30996 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30997 | PORT_MODIFY("IN-18") | |
| 30998 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30999 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31000 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31001 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31002 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31003 | PORT_MODIFY("IN-19") | |
| 31004 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31005 | PORT_MODIFY("IN-20") | |
| 31006 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31007 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31008 | // 0x0004 - "serdor" // standard input (expected here) | |
| 31009 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 31010 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 30953 | PORT_INCLUDE( sc4_base ) | |
| 30954 | PORT_MODIFY("IN-1") | |
| 30955 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 30956 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 30957 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 30958 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 30959 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 30960 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 30961 | PORT_MODIFY("IN-2") | |
| 30962 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 30963 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 30964 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 30965 | PORT_MODIFY("IN-3") | |
| 30966 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 30967 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 30968 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 30969 | PORT_MODIFY("IN-4") | |
| 30970 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 30971 | PORT_MODIFY("IN-5") | |
| 30972 | // 0x0001 - "priz4" // standard input (expected here) | |
| 30973 | // 0x0002 - "priz3" // standard input (expected here) | |
| 30974 | // 0x0004 - "priz2" // standard input (expected here) | |
| 30975 | // 0x0008 - "priz1" // standard input (expected here) | |
| 30976 | PORT_MODIFY("IN-6") | |
| 30977 | // 0x0001 - "perc1" // standard input (expected here) | |
| 30978 | // 0x0002 - "perc2" // standard input (expected here) | |
| 30979 | // 0x0004 - "perc3" // standard input (expected here) | |
| 30980 | // 0x0008 - "perc4" // standard input (expected here) | |
| 30981 | PORT_MODIFY("IN-8") | |
| 30982 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auto n") | |
| 30983 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 30984 | PORT_MODIFY("IN-16") | |
| 30985 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 30986 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 30987 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 30988 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 30989 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 30990 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 30991 | PORT_MODIFY("IN-17") | |
| 30992 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 30993 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 30994 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 30995 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 30996 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 30997 | PORT_MODIFY("IN-18") | |
| 30998 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 30999 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31000 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31001 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31002 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31003 | PORT_MODIFY("IN-19") | |
| 31004 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31005 | PORT_MODIFY("IN-20") | |
| 31006 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31007 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31008 | // 0x0004 - "serdor" // standard input (expected here) | |
| 31009 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 31010 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31011 | 31011 | INPUT_PORTS_END |
| 31012 | 31012 | |
| 31013 | 31013 | |
| r31373 | r31374 | |
| 31040 | 31040 | } |
| 31041 | 31041 | |
| 31042 | 31042 | INPUT_PORTS_START( sc4slc ) // this structure is generated |
| 31043 | PORT_INCLUDE( sc4_base ) | |
| 31044 | PORT_MODIFY("IN-1") | |
| 31045 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 31046 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31047 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31048 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31049 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 31050 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 31051 | PORT_MODIFY("IN-2") | |
| 31052 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 31053 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 31054 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 31055 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31056 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 31057 | PORT_MODIFY("IN-3") | |
| 31058 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31059 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31060 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31061 | PORT_MODIFY("IN-4") | |
| 31062 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 31063 | PORT_MODIFY("IN-5") | |
| 31064 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31065 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31066 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31067 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31068 | PORT_MODIFY("IN-8") | |
| 31069 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk win") | |
| 31070 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 31071 | PORT_MODIFY("IN-16") | |
| 31072 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31073 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31074 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31075 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31076 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31077 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31078 | PORT_MODIFY("IN-17") | |
| 31079 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31080 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31081 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31082 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31083 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31084 | PORT_MODIFY("IN-18") | |
| 31085 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31086 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31087 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31088 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 31089 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 31090 | PORT_MODIFY("IN-19") | |
| 31091 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 31092 | PORT_MODIFY("IN-20") | |
| 31093 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31094 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31095 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31096 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31097 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31043 | PORT_INCLUDE( sc4_base ) | |
| 31044 | PORT_MODIFY("IN-1") | |
| 31045 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 31046 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31047 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31048 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31049 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 31050 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 31051 | PORT_MODIFY("IN-2") | |
| 31052 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 31053 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 31054 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 31055 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31056 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 31057 | PORT_MODIFY("IN-3") | |
| 31058 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31059 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31060 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31061 | PORT_MODIFY("IN-4") | |
| 31062 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 31063 | PORT_MODIFY("IN-5") | |
| 31064 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31065 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31066 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31067 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31068 | PORT_MODIFY("IN-8") | |
| 31069 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk win") | |
| 31070 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 31071 | PORT_MODIFY("IN-16") | |
| 31072 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31073 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31074 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31075 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31076 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31077 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31078 | PORT_MODIFY("IN-17") | |
| 31079 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31080 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31081 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31082 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31083 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31084 | PORT_MODIFY("IN-18") | |
| 31085 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31086 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31087 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31088 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 31089 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 31090 | PORT_MODIFY("IN-19") | |
| 31091 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 31092 | PORT_MODIFY("IN-20") | |
| 31093 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31094 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31095 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31096 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31097 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31098 | 31098 | INPUT_PORTS_END |
| 31099 | 31099 | |
| 31100 | 31100 | // PR1423 CLUB SNAKES N LADDERS PR1423 CSNK SOUNDS11 SNAKES N LADDERS |
| r31373 | r31374 | |
| 31133 | 31133 | } |
| 31134 | 31134 | |
| 31135 | 31135 | INPUT_PORTS_START( sc4solgl ) // this structure is generated |
| 31136 | PORT_INCLUDE( sc4_base ) | |
| 31137 | PORT_MODIFY("IN-1") | |
| 31138 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31139 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31140 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31141 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31142 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 31143 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 31144 | PORT_MODIFY("IN-2") | |
| 31145 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 31146 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31147 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31148 | PORT_MODIFY("IN-3") | |
| 31149 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31150 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31151 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31152 | PORT_MODIFY("IN-5") | |
| 31153 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31154 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31155 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31156 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31157 | PORT_MODIFY("IN-6") | |
| 31158 | // 0x0001 - "perc1" // standard input (expected here) | |
| 31159 | // 0x0002 - "perc2" // standard input (expected here) | |
| 31160 | // 0x0004 - "perc3" // standard input (expected here) | |
| 31161 | // 0x0008 - "perc4" // standard input (expected here) | |
| 31162 | PORT_MODIFY("IN-8") | |
| 31163 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk wsp") | |
| 31164 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi csh") | |
| 31165 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi fet") | |
| 31166 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk csh") | |
| 31167 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo csh") | |
| 31168 | PORT_MODIFY("IN-9") | |
| 31169 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("lo fet") | |
| 31170 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk fea") | |
| 31171 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("tk mat") | |
| 31172 | PORT_MODIFY("IN-16") | |
| 31173 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31174 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31175 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31176 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31177 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31178 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31179 | PORT_MODIFY("IN-17") | |
| 31180 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31181 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31182 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31183 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31184 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31185 | PORT_MODIFY("IN-18") | |
| 31186 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31187 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31188 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31189 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 31190 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 31191 | PORT_MODIFY("IN-19") | |
| 31192 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 31193 | PORT_MODIFY("IN-20") | |
| 31194 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31195 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31196 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31197 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31198 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31136 | PORT_INCLUDE( sc4_base ) | |
| 31137 | PORT_MODIFY("IN-1") | |
| 31138 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31139 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31140 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31141 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31142 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 31143 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 31144 | PORT_MODIFY("IN-2") | |
| 31145 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 31146 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31147 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31148 | PORT_MODIFY("IN-3") | |
| 31149 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31150 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31151 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31152 | PORT_MODIFY("IN-5") | |
| 31153 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31154 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31155 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31156 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31157 | PORT_MODIFY("IN-6") | |
| 31158 | // 0x0001 - "perc1" // standard input (expected here) | |
| 31159 | // 0x0002 - "perc2" // standard input (expected here) | |
| 31160 | // 0x0004 - "perc3" // standard input (expected here) | |
| 31161 | // 0x0008 - "perc4" // standard input (expected here) | |
| 31162 | PORT_MODIFY("IN-8") | |
| 31163 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk wsp") | |
| 31164 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi csh") | |
| 31165 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi fet") | |
| 31166 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk csh") | |
| 31167 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lo csh") | |
| 31168 | PORT_MODIFY("IN-9") | |
| 31169 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("lo fet") | |
| 31170 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk fea") | |
| 31171 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("tk mat") | |
| 31172 | PORT_MODIFY("IN-16") | |
| 31173 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31174 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31175 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31176 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31177 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31178 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31179 | PORT_MODIFY("IN-17") | |
| 31180 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31181 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31182 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31183 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31184 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31185 | PORT_MODIFY("IN-18") | |
| 31186 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31187 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31188 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31189 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 31190 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 31191 | PORT_MODIFY("IN-19") | |
| 31192 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 31193 | PORT_MODIFY("IN-20") | |
| 31194 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31195 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31196 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31197 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31198 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31199 | 31199 | INPUT_PORTS_END |
| 31200 | 31200 | |
| 31201 | 31201 | // PR1010 SOLID GOLD PR1010 SOLID GOLD SOUNDS11 |
| r31373 | r31374 | |
| 31221 | 31221 | } |
| 31222 | 31222 | |
| 31223 | 31223 | INPUT_PORTS_START( sc4sace ) // this structure is generated |
| 31224 | PORT_INCLUDE( sc4_base ) | |
| 31225 | PORT_MODIFY("IN-1") | |
| 31226 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31227 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31228 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31229 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31230 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31231 | PORT_MODIFY("IN-2") | |
| 31232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31233 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31234 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31235 | PORT_MODIFY("IN-8") | |
| 31236 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shots") | |
| 31237 | PORT_MODIFY("IN-16") | |
| 31238 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31239 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31240 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31241 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31242 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31243 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31244 | PORT_MODIFY("IN-17") | |
| 31245 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31246 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31247 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31248 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31249 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31250 | PORT_MODIFY("IN-18") | |
| 31251 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31252 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31253 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31254 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31255 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31256 | PORT_MODIFY("IN-19") | |
| 31257 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31258 | PORT_MODIFY("IN-20") | |
| 31259 | // 0x0001 - "test" // standard input (motherboard) | |
| 31260 | // 0x0002 - "lock" // standard input (expected here) | |
| 31261 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31262 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31263 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31224 | PORT_INCLUDE( sc4_base ) | |
| 31225 | PORT_MODIFY("IN-1") | |
| 31226 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31227 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31228 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31229 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31230 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31231 | PORT_MODIFY("IN-2") | |
| 31232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31233 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31234 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31235 | PORT_MODIFY("IN-8") | |
| 31236 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shots") | |
| 31237 | PORT_MODIFY("IN-16") | |
| 31238 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31239 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31240 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31241 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31242 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31243 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31244 | PORT_MODIFY("IN-17") | |
| 31245 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31246 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31247 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31248 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31249 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31250 | PORT_MODIFY("IN-18") | |
| 31251 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31252 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31253 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31254 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31255 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31256 | PORT_MODIFY("IN-19") | |
| 31257 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31258 | PORT_MODIFY("IN-20") | |
| 31259 | // 0x0001 - "test" // standard input (motherboard) | |
| 31260 | // 0x0002 - "lock" // standard input (expected here) | |
| 31261 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31262 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31263 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31264 | 31264 | INPUT_PORTS_END |
| 31265 | 31265 | |
| 31266 | 31266 | |
| r31373 | r31374 | |
| 31286 | 31286 | } |
| 31287 | 31287 | |
| 31288 | 31288 | INPUT_PORTS_START( sc4sbust ) // this structure is generated |
| 31289 | PORT_INCLUDE( sc4_base ) | |
| 31290 | PORT_MODIFY("IN-1") | |
| 31291 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31292 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31293 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31294 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31295 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31296 | PORT_MODIFY("IN-2") | |
| 31297 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31298 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31299 | PORT_MODIFY("IN-8") | |
| 31300 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step f") | |
| 31301 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step b") | |
| 31302 | PORT_MODIFY("IN-16") | |
| 31303 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31304 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31305 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31306 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31307 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31308 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31309 | PORT_MODIFY("IN-17") | |
| 31310 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31311 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31312 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31313 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31314 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31315 | PORT_MODIFY("IN-18") | |
| 31316 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31317 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31318 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31319 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31320 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31321 | PORT_MODIFY("IN-19") | |
| 31322 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31323 | PORT_MODIFY("IN-20") | |
| 31324 | // 0x0001 - "test" // standard input (motherboard) | |
| 31325 | // 0x0002 - "lock" // standard input (expected here) | |
| 31326 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31327 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31328 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31289 | PORT_INCLUDE( sc4_base ) | |
| 31290 | PORT_MODIFY("IN-1") | |
| 31291 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31292 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31293 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31294 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31295 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31296 | PORT_MODIFY("IN-2") | |
| 31297 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31298 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31299 | PORT_MODIFY("IN-8") | |
| 31300 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step f") | |
| 31301 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step b") | |
| 31302 | PORT_MODIFY("IN-16") | |
| 31303 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31304 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31305 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31306 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31307 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31308 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31309 | PORT_MODIFY("IN-17") | |
| 31310 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31311 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31312 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31313 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31314 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31315 | PORT_MODIFY("IN-18") | |
| 31316 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31317 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31318 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31319 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31320 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31321 | PORT_MODIFY("IN-19") | |
| 31322 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31323 | PORT_MODIFY("IN-20") | |
| 31324 | // 0x0001 - "test" // standard input (motherboard) | |
| 31325 | // 0x0002 - "lock" // standard input (expected here) | |
| 31326 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31327 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31328 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31329 | 31329 | INPUT_PORTS_END |
| 31330 | 31330 | |
| 31331 | 31331 | // PR2506 SPACEBUSTER BUSTERSND SPACEBUSTER |
| r31373 | r31374 | |
| 31351 | 31351 | } |
| 31352 | 31352 | |
| 31353 | 31353 | INPUT_PORTS_START( sc4stirc ) // this structure is generated |
| 31354 | PORT_INCLUDE( sc4_base ) | |
| 31355 | PORT_MODIFY("IN-1") | |
| 31356 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31357 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("excnge") | |
| 31358 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 31359 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 31360 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 31361 | PORT_MODIFY("IN-2") | |
| 31362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("coll") | |
| 31363 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31364 | PORT_MODIFY("IN-4") | |
| 31365 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 31366 | PORT_MODIFY("IN-8") | |
| 31367 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("higher") | |
| 31368 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lower") | |
| 31369 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk prz") | |
| 31370 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 31371 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 31372 | PORT_MODIFY("IN-16") | |
| 31373 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31374 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31375 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31376 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31377 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31378 | PORT_MODIFY("IN-17") | |
| 31379 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31380 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31381 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31382 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31383 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31384 | PORT_MODIFY("IN-18") | |
| 31385 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31386 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31387 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31388 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31389 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31390 | PORT_MODIFY("IN-19") | |
| 31391 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31392 | PORT_MODIFY("IN-20") | |
| 31393 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 31394 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 31395 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 31396 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 31397 | // 0x0010 - "deflt" // standard input (expected here) | |
| 31354 | PORT_INCLUDE( sc4_base ) | |
| 31355 | PORT_MODIFY("IN-1") | |
| 31356 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31357 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("excnge") | |
| 31358 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 31359 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 31360 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 31361 | PORT_MODIFY("IN-2") | |
| 31362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("coll") | |
| 31363 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31364 | PORT_MODIFY("IN-4") | |
| 31365 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 31366 | PORT_MODIFY("IN-8") | |
| 31367 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("higher") | |
| 31368 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lower") | |
| 31369 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk prz") | |
| 31370 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 31371 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 31372 | PORT_MODIFY("IN-16") | |
| 31373 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31374 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31375 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31376 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31377 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31378 | PORT_MODIFY("IN-17") | |
| 31379 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31380 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31381 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31382 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31383 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31384 | PORT_MODIFY("IN-18") | |
| 31385 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31386 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31387 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31388 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31389 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31390 | PORT_MODIFY("IN-19") | |
| 31391 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31392 | PORT_MODIFY("IN-20") | |
| 31393 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 31394 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 31395 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 31396 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 31397 | // 0x0010 - "deflt" // standard input (expected here) | |
| 31398 | 31398 | INPUT_PORTS_END |
| 31399 | 31399 | |
| 31400 | 31400 | // PR2005 STIR CRAZY STIR SOUNDS STIR CRAZY |
| r31373 | r31374 | |
| 31428 | 31428 | } |
| 31429 | 31429 | |
| 31430 | 31430 | INPUT_PORTS_START( sc4sahed ) // this structure is generated |
| 31431 | PORT_INCLUDE( sc4_base ) | |
| 31432 | PORT_MODIFY("IN-1") | |
| 31433 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31434 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31435 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31436 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31437 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31438 | PORT_MODIFY("IN-2") | |
| 31439 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31440 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31441 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31442 | PORT_MODIFY("IN-8") | |
| 31443 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("right") | |
| 31444 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up") | |
| 31445 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi r") | |
| 31446 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi l") | |
| 31447 | PORT_MODIFY("IN-9") | |
| 31448 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("lo r") | |
| 31449 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo l") | |
| 31450 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("streak") | |
| 31451 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("nudge") | |
| 31452 | PORT_MODIFY("IN-16") | |
| 31453 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31454 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31455 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31456 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31457 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31458 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31459 | PORT_MODIFY("IN-17") | |
| 31460 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31461 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31462 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31463 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31464 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31465 | PORT_MODIFY("IN-18") | |
| 31466 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31467 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31468 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31469 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31470 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31471 | PORT_MODIFY("IN-19") | |
| 31472 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31473 | PORT_MODIFY("IN-20") | |
| 31474 | // 0x0001 - "test" // standard input (motherboard) | |
| 31475 | // 0x0002 - "lock" // standard input (expected here) | |
| 31476 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31477 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31478 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31431 | PORT_INCLUDE( sc4_base ) | |
| 31432 | PORT_MODIFY("IN-1") | |
| 31433 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31434 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31435 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31436 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31437 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31438 | PORT_MODIFY("IN-2") | |
| 31439 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31440 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31441 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31442 | PORT_MODIFY("IN-8") | |
| 31443 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("right") | |
| 31444 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up") | |
| 31445 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi r") | |
| 31446 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi l") | |
| 31447 | PORT_MODIFY("IN-9") | |
| 31448 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("lo r") | |
| 31449 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo l") | |
| 31450 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("streak") | |
| 31451 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("nudge") | |
| 31452 | PORT_MODIFY("IN-16") | |
| 31453 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31454 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31455 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31456 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31457 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31458 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31459 | PORT_MODIFY("IN-17") | |
| 31460 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31461 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31462 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31463 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31464 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31465 | PORT_MODIFY("IN-18") | |
| 31466 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31467 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31468 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31469 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31470 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31471 | PORT_MODIFY("IN-19") | |
| 31472 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31473 | PORT_MODIFY("IN-20") | |
| 31474 | // 0x0001 - "test" // standard input (motherboard) | |
| 31475 | // 0x0002 - "lock" // standard input (expected here) | |
| 31476 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31477 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31478 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31479 | 31479 | INPUT_PORTS_END |
| 31480 | 31480 | |
| 31481 | 31481 | // PRxxxx STREAKS AHEAD V1.0 STREAKSSND STREAKS AHEAD |
| r31373 | r31374 | |
| 31500 | 31500 | } |
| 31501 | 31501 | |
| 31502 | 31502 | INPUT_PORTS_START( sc4strx ) // this structure is generated |
| 31503 | PORT_INCLUDE( sc4_base ) | |
| 31504 | PORT_MODIFY("IN-1") | |
| 31505 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31506 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 31507 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 31508 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 31509 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 31510 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 31511 | PORT_MODIFY("IN-2") | |
| 31512 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 31513 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31514 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31515 | PORT_MODIFY("IN-3") | |
| 31516 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31517 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31518 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31519 | PORT_MODIFY("IN-4") | |
| 31520 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 31521 | PORT_MODIFY("IN-5") | |
| 31522 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31523 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31524 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31525 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31526 | PORT_MODIFY("IN-6") | |
| 31527 | // 0x0001 - "perc1" // standard input (expected here) | |
| 31528 | // 0x0002 - "perc2" // standard input (expected here) | |
| 31529 | // 0x0004 - "perc3" // standard input (expected here) | |
| 31530 | // 0x0008 - "perc4" // standard input (expected here) | |
| 31531 | PORT_MODIFY("IN-8") | |
| 31532 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auto n") | |
| 31533 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 31534 | PORT_MODIFY("IN-16") | |
| 31535 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31536 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31537 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31538 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31539 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31540 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 31541 | PORT_MODIFY("IN-17") | |
| 31542 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31543 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31544 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31545 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31546 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31547 | PORT_MODIFY("IN-18") | |
| 31548 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31549 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31550 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31551 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31552 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31553 | PORT_MODIFY("IN-19") | |
| 31554 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31555 | PORT_MODIFY("IN-20") | |
| 31556 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31557 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31558 | // 0x0004 - "serdor" // standard input (expected here) | |
| 31559 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 31560 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31503 | PORT_INCLUDE( sc4_base ) | |
| 31504 | PORT_MODIFY("IN-1") | |
| 31505 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31506 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 31507 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 31508 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 31509 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 31510 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 31511 | PORT_MODIFY("IN-2") | |
| 31512 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("shuffl") | |
| 31513 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31514 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31515 | PORT_MODIFY("IN-3") | |
| 31516 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31517 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31518 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31519 | PORT_MODIFY("IN-4") | |
| 31520 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 31521 | PORT_MODIFY("IN-5") | |
| 31522 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31523 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31524 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31525 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31526 | PORT_MODIFY("IN-6") | |
| 31527 | // 0x0001 - "perc1" // standard input (expected here) | |
| 31528 | // 0x0002 - "perc2" // standard input (expected here) | |
| 31529 | // 0x0004 - "perc3" // standard input (expected here) | |
| 31530 | // 0x0008 - "perc4" // standard input (expected here) | |
| 31531 | PORT_MODIFY("IN-8") | |
| 31532 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auto n") | |
| 31533 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 31534 | PORT_MODIFY("IN-16") | |
| 31535 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31536 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31537 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31538 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31539 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31540 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 31541 | PORT_MODIFY("IN-17") | |
| 31542 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31543 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31544 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31545 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31546 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31547 | PORT_MODIFY("IN-18") | |
| 31548 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31549 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31550 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31551 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31552 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31553 | PORT_MODIFY("IN-19") | |
| 31554 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31555 | PORT_MODIFY("IN-20") | |
| 31556 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31557 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31558 | // 0x0004 - "serdor" // standard input (expected here) | |
| 31559 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 31560 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31561 | 31561 | INPUT_PORTS_END |
| 31562 | 31562 | |
| 31563 | 31563 | |
| r31373 | r31374 | |
| 31592 | 31592 | } |
| 31593 | 31593 | |
| 31594 | 31594 | INPUT_PORTS_START( sc4suscl ) // this structure is generated |
| 31595 | PORT_INCLUDE( sc4_base ) | |
| 31596 | PORT_MODIFY("IN-1") | |
| 31597 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 31598 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 31599 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 31600 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 31601 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 31602 | PORT_MODIFY("IN-2") | |
| 31603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 31604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 31605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 31606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31607 | PORT_MODIFY("IN-3") | |
| 31608 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31609 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31610 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31611 | PORT_MODIFY("IN-5") | |
| 31612 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31613 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31614 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31615 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31616 | PORT_MODIFY("IN-8") | |
| 31617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 31618 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 31619 | PORT_MODIFY("IN-16") | |
| 31620 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31621 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31622 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31623 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31624 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31625 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31626 | PORT_MODIFY("IN-17") | |
| 31627 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31628 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31629 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31630 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31631 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31632 | PORT_MODIFY("IN-18") | |
| 31633 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31634 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31635 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31636 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 31637 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 31638 | PORT_MODIFY("IN-19") | |
| 31639 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 31640 | PORT_MODIFY("IN-20") | |
| 31641 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31642 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31643 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31644 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31645 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31595 | PORT_INCLUDE( sc4_base ) | |
| 31596 | PORT_MODIFY("IN-1") | |
| 31597 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 31598 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 31599 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 31600 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 31601 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 31602 | PORT_MODIFY("IN-2") | |
| 31603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 31604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 31605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 31606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31607 | PORT_MODIFY("IN-3") | |
| 31608 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31609 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31610 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31611 | PORT_MODIFY("IN-5") | |
| 31612 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31613 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31614 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31615 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31616 | PORT_MODIFY("IN-8") | |
| 31617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 31618 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 31619 | PORT_MODIFY("IN-16") | |
| 31620 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31621 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31622 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31623 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31624 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31625 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31626 | PORT_MODIFY("IN-17") | |
| 31627 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31628 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31629 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31630 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31631 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31632 | PORT_MODIFY("IN-18") | |
| 31633 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31634 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31635 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31636 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 31637 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 31638 | PORT_MODIFY("IN-19") | |
| 31639 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 31640 | PORT_MODIFY("IN-20") | |
| 31641 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31642 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31643 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31644 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31645 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31646 | 31646 | INPUT_PORTS_END |
| 31647 | 31647 | |
| 31648 | 31648 | // PR2357 CLUB SUITS U SIR SUITS U SIR CLUB CLUB SUIT SOUNDS |
| r31373 | r31374 | |
| 31676 | 31676 | } |
| 31677 | 31677 | |
| 31678 | 31678 | INPUT_PORTS_START( sc4taekw ) // this structure is generated |
| 31679 | PORT_INCLUDE( sc4_base ) | |
| 31680 | PORT_MODIFY("IN-1") | |
| 31681 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31682 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31683 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31684 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31685 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31686 | PORT_MODIFY("IN-2") | |
| 31687 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31688 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31689 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31690 | PORT_MODIFY("IN-8") | |
| 31691 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("low r") | |
| 31692 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low l") | |
| 31693 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("high l") | |
| 31694 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("high r") | |
| 31695 | PORT_MODIFY("IN-16") | |
| 31696 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31697 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31698 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31699 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31700 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31701 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31702 | PORT_MODIFY("IN-17") | |
| 31703 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31704 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31705 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31706 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31707 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31708 | PORT_MODIFY("IN-18") | |
| 31709 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31710 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31711 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31712 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31713 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31714 | PORT_MODIFY("IN-19") | |
| 31715 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31716 | PORT_MODIFY("IN-20") | |
| 31717 | // 0x0001 - "test" // standard input (motherboard) | |
| 31718 | // 0x0002 - "lock" // standard input (expected here) | |
| 31719 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31720 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31721 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31679 | PORT_INCLUDE( sc4_base ) | |
| 31680 | PORT_MODIFY("IN-1") | |
| 31681 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31682 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31683 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31684 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31685 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 31686 | PORT_MODIFY("IN-2") | |
| 31687 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31688 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31689 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31690 | PORT_MODIFY("IN-8") | |
| 31691 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("low r") | |
| 31692 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low l") | |
| 31693 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("high l") | |
| 31694 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("high r") | |
| 31695 | PORT_MODIFY("IN-16") | |
| 31696 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31697 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31698 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31699 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31700 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31701 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 31702 | PORT_MODIFY("IN-17") | |
| 31703 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31704 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31705 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31706 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31707 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31708 | PORT_MODIFY("IN-18") | |
| 31709 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31710 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31711 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31712 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31713 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31714 | PORT_MODIFY("IN-19") | |
| 31715 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31716 | PORT_MODIFY("IN-20") | |
| 31717 | // 0x0001 - "test" // standard input (motherboard) | |
| 31718 | // 0x0002 - "lock" // standard input (expected here) | |
| 31719 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31720 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31721 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31722 | 31722 | INPUT_PORTS_END |
| 31723 | 31723 | |
| 31724 | 31724 | |
| r31373 | r31374 | |
| 31753 | 31753 | } |
| 31754 | 31754 | |
| 31755 | 31755 | INPUT_PORTS_START( sc4taknt ) // this structure is generated |
| 31756 | PORT_INCLUDE( sc4_base ) | |
| 31757 | PORT_MODIFY("IN-1") | |
| 31758 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31759 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 31760 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 31761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 31762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("st/col") | |
| 31763 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 31764 | PORT_MODIFY("IN-2") | |
| 31765 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 31766 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31767 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31768 | PORT_MODIFY("IN-3") | |
| 31769 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31770 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31771 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31772 | PORT_MODIFY("IN-4") | |
| 31773 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 31774 | PORT_MODIFY("IN-5") | |
| 31775 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31776 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31777 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31778 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31779 | PORT_MODIFY("IN-6") | |
| 31780 | // 0x0001 - "perc1" // standard input (expected here) | |
| 31781 | // 0x0002 - "perc2" // standard input (expected here) | |
| 31782 | // 0x0004 - "perc3" // standard input (expected here) | |
| 31783 | // 0x0008 - "perc4" // standard input (expected here) | |
| 31784 | PORT_MODIFY("IN-8") | |
| 31785 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 31786 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("coll") | |
| 31787 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudges") | |
| 31788 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("notes") | |
| 31789 | PORT_MODIFY("IN-16") | |
| 31790 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31791 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31792 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31793 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31794 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31795 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 31796 | PORT_MODIFY("IN-17") | |
| 31797 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31798 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31799 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31800 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31801 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31802 | PORT_MODIFY("IN-18") | |
| 31803 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31804 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31805 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31806 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31807 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31808 | PORT_MODIFY("IN-19") | |
| 31809 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31810 | PORT_MODIFY("IN-20") | |
| 31811 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31812 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31813 | // 0x0004 - "serdor" // standard input (expected here) | |
| 31814 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 31815 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31756 | PORT_INCLUDE( sc4_base ) | |
| 31757 | PORT_MODIFY("IN-1") | |
| 31758 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31759 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 31760 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 31761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 31762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("st/col") | |
| 31763 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 31764 | PORT_MODIFY("IN-2") | |
| 31765 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 31766 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31767 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31768 | PORT_MODIFY("IN-3") | |
| 31769 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31770 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31771 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31772 | PORT_MODIFY("IN-4") | |
| 31773 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 31774 | PORT_MODIFY("IN-5") | |
| 31775 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31776 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31777 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31778 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31779 | PORT_MODIFY("IN-6") | |
| 31780 | // 0x0001 - "perc1" // standard input (expected here) | |
| 31781 | // 0x0002 - "perc2" // standard input (expected here) | |
| 31782 | // 0x0004 - "perc3" // standard input (expected here) | |
| 31783 | // 0x0008 - "perc4" // standard input (expected here) | |
| 31784 | PORT_MODIFY("IN-8") | |
| 31785 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 31786 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("coll") | |
| 31787 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nudges") | |
| 31788 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("notes") | |
| 31789 | PORT_MODIFY("IN-16") | |
| 31790 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31791 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31792 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31793 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31794 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31795 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 31796 | PORT_MODIFY("IN-17") | |
| 31797 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31798 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31799 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31800 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31801 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31802 | PORT_MODIFY("IN-18") | |
| 31803 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31804 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31805 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31806 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31807 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31808 | PORT_MODIFY("IN-19") | |
| 31809 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31810 | PORT_MODIFY("IN-20") | |
| 31811 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31812 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31813 | // 0x0004 - "serdor" // standard input (expected here) | |
| 31814 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 31815 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31816 | 31816 | INPUT_PORTS_END |
| 31817 | 31817 | |
| 31818 | 31818 | // PR1302 AWP TAKE NOTE PR1302 TAKE NOTE SOUNDS11 |
| r31373 | r31374 | |
| 31842 | 31842 | } |
| 31843 | 31843 | |
| 31844 | 31844 | INPUT_PORTS_START( sc4takcl ) // this structure is generated |
| 31845 | PORT_INCLUDE( sc4_base ) | |
| 31846 | PORT_MODIFY("IN-1") | |
| 31847 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancol") | |
| 31848 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31849 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31850 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31851 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 31852 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 31853 | PORT_MODIFY("IN-2") | |
| 31854 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 31855 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 31856 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31857 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31858 | PORT_MODIFY("IN-3") | |
| 31859 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31860 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31861 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31862 | PORT_MODIFY("IN-4") | |
| 31863 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 31864 | PORT_MODIFY("IN-5") | |
| 31865 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31866 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31867 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31868 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31869 | PORT_MODIFY("IN-8") | |
| 31870 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c nuds") | |
| 31871 | PORT_MODIFY("IN-16") | |
| 31872 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31873 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31874 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31875 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31876 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31877 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31878 | PORT_MODIFY("IN-17") | |
| 31879 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31880 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31881 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31882 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31883 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31884 | PORT_MODIFY("IN-18") | |
| 31885 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31886 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31887 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31888 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 31889 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 31890 | PORT_MODIFY("IN-19") | |
| 31891 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 31892 | PORT_MODIFY("IN-20") | |
| 31893 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31894 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31895 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31896 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31897 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31845 | PORT_INCLUDE( sc4_base ) | |
| 31846 | PORT_MODIFY("IN-1") | |
| 31847 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancol") | |
| 31848 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 31849 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 31850 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 31851 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 31852 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 31853 | PORT_MODIFY("IN-2") | |
| 31854 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 31855 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 31856 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31857 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 31858 | PORT_MODIFY("IN-3") | |
| 31859 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 31860 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 31861 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 31862 | PORT_MODIFY("IN-4") | |
| 31863 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 31864 | PORT_MODIFY("IN-5") | |
| 31865 | // 0x0001 - "priz4" // standard input (expected here) | |
| 31866 | // 0x0002 - "priz3" // standard input (expected here) | |
| 31867 | // 0x0004 - "priz2" // standard input (expected here) | |
| 31868 | // 0x0008 - "priz1" // standard input (expected here) | |
| 31869 | PORT_MODIFY("IN-8") | |
| 31870 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c nuds") | |
| 31871 | PORT_MODIFY("IN-16") | |
| 31872 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31873 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31874 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31875 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31876 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31877 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 31878 | PORT_MODIFY("IN-17") | |
| 31879 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31880 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31881 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31882 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31883 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 31884 | PORT_MODIFY("IN-18") | |
| 31885 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 31886 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 31887 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 31888 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 31889 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 31890 | PORT_MODIFY("IN-19") | |
| 31891 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 31892 | PORT_MODIFY("IN-20") | |
| 31893 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 31894 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 31895 | // 0x0004 - "topdor" // standard input (expected here) | |
| 31896 | // 0x0008 - "botdor" // standard input (expected here) | |
| 31897 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 31898 | 31898 | INPUT_PORTS_END |
| 31899 | 31899 | |
| 31900 | 31900 | // PR1323 CLUB TAKE NOTE PR1323 CNOT SOUNDS11 |
| r31373 | r31374 | |
| 31930 | 31930 | } |
| 31931 | 31931 | |
| 31932 | 31932 | INPUT_PORTS_START( sc4tetri ) // this structure is generated |
| 31933 | PORT_INCLUDE( sc4_base ) | |
| 31934 | PORT_MODIFY("IN-1") | |
| 31935 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31936 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 31937 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 31938 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 31939 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 31940 | PORT_MODIFY("IN-2") | |
| 31941 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31942 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31943 | PORT_MODIFY("IN-8") | |
| 31944 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk spn") | |
| 31945 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk ndg") | |
| 31946 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 31947 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 31948 | PORT_MODIFY("IN-16") | |
| 31949 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31950 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31951 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31952 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31953 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31954 | PORT_MODIFY("IN-17") | |
| 31955 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31956 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31957 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31958 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31959 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31960 | PORT_MODIFY("IN-18") | |
| 31961 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31962 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31963 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31964 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31965 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31966 | PORT_MODIFY("IN-19") | |
| 31967 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31968 | PORT_MODIFY("IN-20") | |
| 31969 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 31933 | PORT_INCLUDE( sc4_base ) | |
| 31934 | PORT_MODIFY("IN-1") | |
| 31935 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 31936 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 31937 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 31938 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 31939 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 31940 | PORT_MODIFY("IN-2") | |
| 31941 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 31942 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 31943 | PORT_MODIFY("IN-8") | |
| 31944 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk spn") | |
| 31945 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk ndg") | |
| 31946 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 31947 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 31948 | PORT_MODIFY("IN-16") | |
| 31949 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 31950 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 31951 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 31952 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 31953 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 31954 | PORT_MODIFY("IN-17") | |
| 31955 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 31956 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 31957 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 31958 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 31959 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 31960 | PORT_MODIFY("IN-18") | |
| 31961 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 31962 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 31963 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 31964 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 31965 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 31966 | PORT_MODIFY("IN-19") | |
| 31967 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 31968 | PORT_MODIFY("IN-20") | |
| 31969 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 31970 | 31970 | INPUT_PORTS_END |
| 31971 | 31971 | |
| 31972 | 31972 | |
| r31373 | r31374 | |
| 32002 | 32002 | } |
| 32003 | 32003 | |
| 32004 | 32004 | INPUT_PORTS_START( sc4tbana ) // this structure is generated |
| 32005 | PORT_INCLUDE( sc4_base ) | |
| 32006 | PORT_MODIFY("IN-1") | |
| 32007 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32008 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 32009 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1 OR high") | |
| 32010 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2 OR low") | |
| 32011 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 32012 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32013 | PORT_MODIFY("IN-2") | |
| 32014 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32015 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32016 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32017 | PORT_MODIFY("IN-3") | |
| 32018 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32019 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32020 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32021 | PORT_MODIFY("IN-5") | |
| 32022 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32023 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32024 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32025 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32026 | PORT_MODIFY("IN-6") | |
| 32027 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32028 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32029 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32030 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32031 | PORT_MODIFY("IN-8") | |
| 32032 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 32033 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 32034 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk ss") | |
| 32035 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk fea") | |
| 32036 | PORT_MODIFY("IN-16") | |
| 32037 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32038 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32039 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32040 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32041 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32042 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32043 | PORT_MODIFY("IN-17") | |
| 32044 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32045 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32046 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32047 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32048 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32049 | PORT_MODIFY("IN-18") | |
| 32050 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32051 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32052 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32053 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32054 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32055 | PORT_MODIFY("IN-19") | |
| 32056 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32057 | PORT_MODIFY("IN-20") | |
| 32058 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32059 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32060 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32061 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32062 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32005 | PORT_INCLUDE( sc4_base ) | |
| 32006 | PORT_MODIFY("IN-1") | |
| 32007 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32008 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 32009 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1 OR high") | |
| 32010 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2 OR low") | |
| 32011 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 32012 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32013 | PORT_MODIFY("IN-2") | |
| 32014 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32015 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32016 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32017 | PORT_MODIFY("IN-3") | |
| 32018 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32019 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32020 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32021 | PORT_MODIFY("IN-5") | |
| 32022 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32023 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32024 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32025 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32026 | PORT_MODIFY("IN-6") | |
| 32027 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32028 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32029 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32030 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32031 | PORT_MODIFY("IN-8") | |
| 32032 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 32033 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 32034 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk ss") | |
| 32035 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk fea") | |
| 32036 | PORT_MODIFY("IN-16") | |
| 32037 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32038 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32039 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32040 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32041 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32042 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32043 | PORT_MODIFY("IN-17") | |
| 32044 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32045 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32046 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32047 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32048 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32049 | PORT_MODIFY("IN-18") | |
| 32050 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32051 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32052 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32053 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32054 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32055 | PORT_MODIFY("IN-19") | |
| 32056 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32057 | PORT_MODIFY("IN-20") | |
| 32058 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32059 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32060 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32061 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32062 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32063 | 32063 | INPUT_PORTS_END |
| 32064 | 32064 | |
| 32065 | 32065 | // PR1110 TOP BANANA PR1110 TOP BANANA SOUNDS11 |
| r31373 | r31374 | |
| 32083 | 32083 | } |
| 32084 | 32084 | |
| 32085 | 32085 | INPUT_PORTS_START( sc4tgear ) // this structure is generated |
| 32086 | PORT_INCLUDE( sc4_base ) | |
| 32087 | PORT_MODIFY("IN-1") | |
| 32088 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32089 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 32090 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 32091 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 32092 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 32093 | PORT_MODIFY("IN-2") | |
| 32094 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("runmon") | |
| 32095 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchge") | |
| 32096 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32097 | PORT_MODIFY("IN-8") | |
| 32098 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 32099 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 32100 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("higher") | |
| 32101 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lower") | |
| 32102 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk prz") | |
| 32103 | PORT_MODIFY("IN-16") | |
| 32104 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32105 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32106 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32107 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32108 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32109 | PORT_MODIFY("IN-17") | |
| 32110 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32111 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32112 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32113 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32114 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32115 | PORT_MODIFY("IN-18") | |
| 32116 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32117 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32118 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32119 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32120 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32121 | PORT_MODIFY("IN-19") | |
| 32122 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32123 | PORT_MODIFY("IN-20") | |
| 32124 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 32086 | PORT_INCLUDE( sc4_base ) | |
| 32087 | PORT_MODIFY("IN-1") | |
| 32088 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32089 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 32090 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 32091 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 32092 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 32093 | PORT_MODIFY("IN-2") | |
| 32094 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("runmon") | |
| 32095 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchge") | |
| 32096 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32097 | PORT_MODIFY("IN-8") | |
| 32098 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 32099 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 32100 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("higher") | |
| 32101 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lower") | |
| 32102 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk prz") | |
| 32103 | PORT_MODIFY("IN-16") | |
| 32104 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32105 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32106 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32107 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32108 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32109 | PORT_MODIFY("IN-17") | |
| 32110 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32111 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32112 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32113 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32114 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32115 | PORT_MODIFY("IN-18") | |
| 32116 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32117 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32118 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32119 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32120 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32121 | PORT_MODIFY("IN-19") | |
| 32122 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32123 | PORT_MODIFY("IN-20") | |
| 32124 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 32125 | 32125 | INPUT_PORTS_END |
| 32126 | 32126 | |
| 32127 | 32127 | // REEL 4 ERR 24 |
| r31373 | r31374 | |
| 32153 | 32153 | } |
| 32154 | 32154 | |
| 32155 | 32155 | INPUT_PORTS_START( sc4tload ) // this structure is generated |
| 32156 | PORT_INCLUDE( sc4_base ) | |
| 32157 | PORT_MODIFY("IN-1") | |
| 32158 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32159 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 32160 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 32161 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 32162 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 32163 | PORT_MODIFY("IN-2") | |
| 32164 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 32165 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32166 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32167 | PORT_MODIFY("IN-8") | |
| 32168 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take f") | |
| 32169 | PORT_MODIFY("IN-16") | |
| 32170 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32171 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32172 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32173 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32174 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32175 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32176 | PORT_MODIFY("IN-17") | |
| 32177 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32178 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32179 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32180 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32181 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32182 | PORT_MODIFY("IN-18") | |
| 32183 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32184 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32185 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32186 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32187 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32188 | PORT_MODIFY("IN-19") | |
| 32189 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32190 | PORT_MODIFY("IN-20") | |
| 32191 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 32192 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 32193 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 32194 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 32195 | // 0x0010 - "deflt" // standard input (expected here) | |
| 32156 | PORT_INCLUDE( sc4_base ) | |
| 32157 | PORT_MODIFY("IN-1") | |
| 32158 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32159 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 32160 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 32161 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 32162 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 32163 | PORT_MODIFY("IN-2") | |
| 32164 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 32165 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32166 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32167 | PORT_MODIFY("IN-8") | |
| 32168 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take f") | |
| 32169 | PORT_MODIFY("IN-16") | |
| 32170 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32171 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32172 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32173 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32174 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32175 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32176 | PORT_MODIFY("IN-17") | |
| 32177 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32178 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32179 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32180 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32181 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32182 | PORT_MODIFY("IN-18") | |
| 32183 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32184 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32185 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32186 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32187 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32188 | PORT_MODIFY("IN-19") | |
| 32189 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32190 | PORT_MODIFY("IN-20") | |
| 32191 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 32192 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 32193 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 32194 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 32195 | // 0x0010 - "deflt" // standard input (expected here) | |
| 32196 | 32196 | INPUT_PORTS_END |
| 32197 | 32197 | |
| 32198 | 32198 | // PR2112 TOP LOADER LOAD SOUNDS TOP LOADER |
| r31373 | r31374 | |
| 32217 | 32217 | } |
| 32218 | 32218 | |
| 32219 | 32219 | INPUT_PORTS_START( sc4ttomb ) // this structure is generated |
| 32220 | PORT_INCLUDE( sc4_base ) | |
| 32221 | PORT_MODIFY("IN-1") | |
| 32222 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32223 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32224 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32225 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32226 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32227 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32228 | PORT_MODIFY("IN-2") | |
| 32229 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32230 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32231 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32232 | PORT_MODIFY("IN-3") | |
| 32233 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32234 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32235 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32236 | PORT_MODIFY("IN-5") | |
| 32237 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32238 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32239 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32240 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32241 | PORT_MODIFY("IN-6") | |
| 32242 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32243 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32244 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32245 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32246 | PORT_MODIFY("IN-8") | |
| 32247 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk sht") | |
| 32248 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blu lo") | |
| 32249 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("red lo") | |
| 32250 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("gre lo") | |
| 32251 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk stp") | |
| 32252 | PORT_MODIFY("IN-9") | |
| 32253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("blu hi") | |
| 32254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("red hi") | |
| 32255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("gre hi") | |
| 32256 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("col rd") | |
| 32257 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk nud") | |
| 32258 | PORT_MODIFY("IN-10") | |
| 32259 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("col bl") | |
| 32260 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_2 ) PORT_NAME("col gr") | |
| 32261 | PORT_MODIFY("IN-16") | |
| 32262 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32263 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32264 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32265 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32266 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32267 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32268 | PORT_MODIFY("IN-17") | |
| 32269 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32270 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32271 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32272 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32273 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32274 | PORT_MODIFY("IN-18") | |
| 32275 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32276 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32277 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32278 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32279 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32280 | PORT_MODIFY("IN-19") | |
| 32281 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32282 | PORT_MODIFY("IN-20") | |
| 32283 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32284 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32285 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32286 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32287 | // 0x0010 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 32220 | PORT_INCLUDE( sc4_base ) | |
| 32221 | PORT_MODIFY("IN-1") | |
| 32222 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32223 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32224 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32225 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32226 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32227 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32228 | PORT_MODIFY("IN-2") | |
| 32229 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32230 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32231 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32232 | PORT_MODIFY("IN-3") | |
| 32233 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32234 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32235 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32236 | PORT_MODIFY("IN-5") | |
| 32237 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32238 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32239 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32240 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32241 | PORT_MODIFY("IN-6") | |
| 32242 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32243 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32244 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32245 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32246 | PORT_MODIFY("IN-8") | |
| 32247 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk sht") | |
| 32248 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blu lo") | |
| 32249 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("red lo") | |
| 32250 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("gre lo") | |
| 32251 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk stp") | |
| 32252 | PORT_MODIFY("IN-9") | |
| 32253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("blu hi") | |
| 32254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("red hi") | |
| 32255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("gre hi") | |
| 32256 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("col rd") | |
| 32257 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk nud") | |
| 32258 | PORT_MODIFY("IN-10") | |
| 32259 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("col bl") | |
| 32260 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_2 ) PORT_NAME("col gr") | |
| 32261 | PORT_MODIFY("IN-16") | |
| 32262 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32263 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32264 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32265 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32266 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32267 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32268 | PORT_MODIFY("IN-17") | |
| 32269 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32270 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32271 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32272 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32273 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32274 | PORT_MODIFY("IN-18") | |
| 32275 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32276 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32277 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32278 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32279 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32280 | PORT_MODIFY("IN-19") | |
| 32281 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32282 | PORT_MODIFY("IN-20") | |
| 32283 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32284 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32285 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32286 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32287 | // 0x0010 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 32288 | 32288 | INPUT_PORTS_END |
| 32289 | 32289 | |
| 32290 | 32290 | // PR1305 TREASURE TOMB PR1305 TRES TOMB SOUNDS11 / HIT SHOT |
| r31373 | r31374 | |
| 32311 | 32311 | } |
| 32312 | 32312 | |
| 32313 | 32313 | INPUT_PORTS_START( sc4tridn ) // this structure is generated |
| 32314 | PORT_INCLUDE( sc4_base ) | |
| 32315 | PORT_MODIFY("IN-1") | |
| 32316 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32317 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 32318 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 32319 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 32320 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 32321 | PORT_MODIFY("IN-2") | |
| 32322 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 32323 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32324 | PORT_MODIFY("IN-16") | |
| 32325 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32326 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32327 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32328 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32329 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32330 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32331 | PORT_MODIFY("IN-17") | |
| 32332 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32333 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32334 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32335 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32336 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32337 | PORT_MODIFY("IN-18") | |
| 32338 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32339 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32340 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32341 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32342 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32343 | PORT_MODIFY("IN-19") | |
| 32344 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32345 | PORT_MODIFY("IN-20") | |
| 32346 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 32347 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 32348 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 32349 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 32350 | // 0x0010 - "deflt" // standard input (expected here) | |
| 32314 | PORT_INCLUDE( sc4_base ) | |
| 32315 | PORT_MODIFY("IN-1") | |
| 32316 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32317 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 32318 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 32319 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 32320 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 32321 | PORT_MODIFY("IN-2") | |
| 32322 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 32323 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32324 | PORT_MODIFY("IN-16") | |
| 32325 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32326 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32327 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32328 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32329 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32330 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32331 | PORT_MODIFY("IN-17") | |
| 32332 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32333 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32334 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32335 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32336 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32337 | PORT_MODIFY("IN-18") | |
| 32338 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32339 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32340 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32341 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32342 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32343 | PORT_MODIFY("IN-19") | |
| 32344 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32345 | PORT_MODIFY("IN-20") | |
| 32346 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 32347 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 32348 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 32349 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 32350 | // 0x0010 - "deflt" // standard input (expected here) | |
| 32351 | 32351 | INPUT_PORTS_END |
| 32352 | 32352 | |
| 32353 | 32353 | // PR2103 THE TRIDENT TRID SOUNDS THE TRIDENT |
| r31373 | r31374 | |
| 32379 | 32379 | } |
| 32380 | 32380 | |
| 32381 | 32381 | INPUT_PORTS_START( sc4vrgcl ) // this structure is generated |
| 32382 | PORT_INCLUDE( sc4_base ) | |
| 32383 | PORT_MODIFY("IN-1") | |
| 32384 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 32385 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32386 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32387 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32388 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 32389 | PORT_MODIFY("IN-2") | |
| 32390 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 32391 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 32392 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32393 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32394 | PORT_MODIFY("IN-3") | |
| 32395 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32396 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32397 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32398 | PORT_MODIFY("IN-4") | |
| 32399 | // 0x0001 - "hop2lo" // unexpected here | |
| 32400 | // 0x0002 - "hop1lo" // known extended(?) input, sometimes 'hop hi' | |
| 32401 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 32402 | PORT_MODIFY("IN-5") | |
| 32403 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32404 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32405 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32406 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32407 | PORT_MODIFY("IN-8") | |
| 32408 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32409 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 32410 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk knk") | |
| 32411 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nud hi") | |
| 32412 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet hi") | |
| 32413 | PORT_MODIFY("IN-9") | |
| 32414 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("knk hi") | |
| 32415 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("nud lo") | |
| 32416 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("fet lo") | |
| 32417 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("knk lo") | |
| 32418 | PORT_MODIFY("IN-16") | |
| 32419 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32420 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32421 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32422 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32423 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32424 | PORT_MODIFY("IN-17") | |
| 32425 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32426 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32427 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32428 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32429 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32430 | PORT_MODIFY("IN-18") | |
| 32431 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32432 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32433 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32434 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 32435 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 32436 | PORT_MODIFY("IN-19") | |
| 32437 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 32438 | PORT_MODIFY("IN-20") | |
| 32439 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32440 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32441 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32442 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32443 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32382 | PORT_INCLUDE( sc4_base ) | |
| 32383 | PORT_MODIFY("IN-1") | |
| 32384 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 32385 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32386 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32387 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32388 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 32389 | PORT_MODIFY("IN-2") | |
| 32390 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 32391 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 32392 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32393 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32394 | PORT_MODIFY("IN-3") | |
| 32395 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32396 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32397 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32398 | PORT_MODIFY("IN-4") | |
| 32399 | // 0x0001 - "hop2lo" // unexpected here | |
| 32400 | // 0x0002 - "hop1lo" // known extended(?) input, sometimes 'hop hi' | |
| 32401 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 32402 | PORT_MODIFY("IN-5") | |
| 32403 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32404 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32405 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32406 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32407 | PORT_MODIFY("IN-8") | |
| 32408 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32409 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk fet") | |
| 32410 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk knk") | |
| 32411 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nud hi") | |
| 32412 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet hi") | |
| 32413 | PORT_MODIFY("IN-9") | |
| 32414 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("knk hi") | |
| 32415 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("nud lo") | |
| 32416 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("fet lo") | |
| 32417 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("knk lo") | |
| 32418 | PORT_MODIFY("IN-16") | |
| 32419 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32420 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32421 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32422 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32423 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32424 | PORT_MODIFY("IN-17") | |
| 32425 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32426 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32427 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32428 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32429 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32430 | PORT_MODIFY("IN-18") | |
| 32431 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32432 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32433 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32434 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 32435 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 32436 | PORT_MODIFY("IN-19") | |
| 32437 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 32438 | PORT_MODIFY("IN-20") | |
| 32439 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32440 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32441 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32442 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32443 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32444 | 32444 | INPUT_PORTS_END |
| 32445 | 32445 | |
| 32446 | 32446 | // PR1037 CLUB VERY RICH GEEZER PR1037 RICH SOUNDS11 VERY RICH GEEZER |
| r31373 | r31374 | |
| 32473 | 32473 | } |
| 32474 | 32474 | |
| 32475 | 32475 | INPUT_PORTS_START( sc4leg ) // this structure is generated |
| 32476 | PORT_INCLUDE( sc4_base ) | |
| 32477 | PORT_MODIFY("IN-1") | |
| 32478 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32479 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32480 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32481 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32482 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32483 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32484 | PORT_MODIFY("IN-2") | |
| 32485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32486 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32487 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32488 | PORT_MODIFY("IN-3") | |
| 32489 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32490 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32491 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32492 | PORT_MODIFY("IN-5") | |
| 32493 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32494 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32495 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32496 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32497 | PORT_MODIFY("IN-6") | |
| 32498 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32499 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32500 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32501 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32502 | PORT_MODIFY("IN-8") | |
| 32503 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32504 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sun") | |
| 32505 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 32506 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fsh") | |
| 32507 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("t high") | |
| 32508 | PORT_MODIFY("IN-9") | |
| 32509 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("t low") | |
| 32510 | PORT_MODIFY("IN-16") | |
| 32511 | // 0x0001 - "dil 1 OR dil sw" // standard input (motherboard) | |
| 32512 | // 0x0002 - "dil 2 OR dil sw" // standard input (motherboard) | |
| 32513 | // 0x0004 - "dil 3 OR dil sw" // standard input (motherboard) | |
| 32514 | // 0x0008 - "dil 4 OR dil sw" // standard input (motherboard) | |
| 32515 | // 0x0010 - "dil 5 OR dil sw" // standard input (motherboard) | |
| 32516 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32517 | PORT_MODIFY("IN-17") | |
| 32518 | // 0x0001 - "dil 6 OR dil sw" // standard input (motherboard) | |
| 32519 | // 0x0002 - "dil 7 OR dil sw" // standard input (motherboard) | |
| 32520 | // 0x0004 - "dil 8 OR dil sw" // standard input (motherboard) | |
| 32521 | // 0x0008 - "dil 9 OR dil sw" // standard input (motherboard) | |
| 32522 | // 0x0010 - "dil10 OR dil sw" // standard input (motherboard) | |
| 32523 | PORT_MODIFY("IN-18") | |
| 32524 | // 0x0001 - "dil11 OR dil sw" // standard input (motherboard) | |
| 32525 | // 0x0002 - "dil12 OR dil sw" // standard input (motherboard) | |
| 32526 | // 0x0004 - "dil13 OR dil sw" // standard input (motherboard) | |
| 32527 | // 0x0008 - "dil14 OR dil sw" // standard input (motherboard) | |
| 32528 | // 0x0010 - "dil15 OR dil sw" // standard input (motherboard) | |
| 32529 | PORT_MODIFY("IN-19") | |
| 32530 | // 0x0001 - "dil16 OR dil sw" // standard input (motherboard) | |
| 32531 | PORT_MODIFY("IN-20") | |
| 32532 | // 0x0001 - "grnbut OR green" // standard input (motherboard) | |
| 32533 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32534 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32535 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32536 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32476 | PORT_INCLUDE( sc4_base ) | |
| 32477 | PORT_MODIFY("IN-1") | |
| 32478 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32479 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32480 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32481 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32482 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32483 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32484 | PORT_MODIFY("IN-2") | |
| 32485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32486 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32487 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32488 | PORT_MODIFY("IN-3") | |
| 32489 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32490 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32491 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32492 | PORT_MODIFY("IN-5") | |
| 32493 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32494 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32495 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32496 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32497 | PORT_MODIFY("IN-6") | |
| 32498 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32499 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32500 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32501 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32502 | PORT_MODIFY("IN-8") | |
| 32503 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32504 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sun") | |
| 32505 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 32506 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fsh") | |
| 32507 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("t high") | |
| 32508 | PORT_MODIFY("IN-9") | |
| 32509 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("t low") | |
| 32510 | PORT_MODIFY("IN-16") | |
| 32511 | // 0x0001 - "dil 1 OR dil sw" // standard input (motherboard) | |
| 32512 | // 0x0002 - "dil 2 OR dil sw" // standard input (motherboard) | |
| 32513 | // 0x0004 - "dil 3 OR dil sw" // standard input (motherboard) | |
| 32514 | // 0x0008 - "dil 4 OR dil sw" // standard input (motherboard) | |
| 32515 | // 0x0010 - "dil 5 OR dil sw" // standard input (motherboard) | |
| 32516 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32517 | PORT_MODIFY("IN-17") | |
| 32518 | // 0x0001 - "dil 6 OR dil sw" // standard input (motherboard) | |
| 32519 | // 0x0002 - "dil 7 OR dil sw" // standard input (motherboard) | |
| 32520 | // 0x0004 - "dil 8 OR dil sw" // standard input (motherboard) | |
| 32521 | // 0x0008 - "dil 9 OR dil sw" // standard input (motherboard) | |
| 32522 | // 0x0010 - "dil10 OR dil sw" // standard input (motherboard) | |
| 32523 | PORT_MODIFY("IN-18") | |
| 32524 | // 0x0001 - "dil11 OR dil sw" // standard input (motherboard) | |
| 32525 | // 0x0002 - "dil12 OR dil sw" // standard input (motherboard) | |
| 32526 | // 0x0004 - "dil13 OR dil sw" // standard input (motherboard) | |
| 32527 | // 0x0008 - "dil14 OR dil sw" // standard input (motherboard) | |
| 32528 | // 0x0010 - "dil15 OR dil sw" // standard input (motherboard) | |
| 32529 | PORT_MODIFY("IN-19") | |
| 32530 | // 0x0001 - "dil16 OR dil sw" // standard input (motherboard) | |
| 32531 | PORT_MODIFY("IN-20") | |
| 32532 | // 0x0001 - "grnbut OR green" // standard input (motherboard) | |
| 32533 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32534 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32535 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32536 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32537 | 32537 | INPUT_PORTS_END |
| 32538 | 32538 | |
| 32539 | 32539 | // PR7120 WHO WANTS TO BE A LEGIONNAIRE PR7120 LEGIONNAIRE SOUNDS11 |
| r31373 | r31374 | |
| 32569 | 32569 | } |
| 32570 | 32570 | |
| 32571 | 32571 | INPUT_PORTS_START( sc4legcb ) // this structure is generated |
| 32572 | PORT_INCLUDE( sc4_base ) | |
| 32573 | PORT_MODIFY("IN-1") | |
| 32574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 32575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32578 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 32579 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 32580 | PORT_MODIFY("IN-2") | |
| 32581 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 32582 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 32583 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32584 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32585 | PORT_MODIFY("IN-3") | |
| 32586 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32587 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32588 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32589 | PORT_MODIFY("IN-4") | |
| 32590 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 32591 | PORT_MODIFY("IN-5") | |
| 32592 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32593 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32594 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32595 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32596 | PORT_MODIFY("IN-8") | |
| 32597 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32598 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sun") | |
| 32599 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 32600 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 32601 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("high") | |
| 32602 | PORT_MODIFY("IN-9") | |
| 32603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("low") | |
| 32604 | PORT_MODIFY("IN-16") | |
| 32605 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32606 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32607 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32608 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32609 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32610 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32611 | PORT_MODIFY("IN-17") | |
| 32612 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32613 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32614 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32615 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32616 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32617 | PORT_MODIFY("IN-18") | |
| 32618 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32619 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32620 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32621 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 32622 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 32623 | PORT_MODIFY("IN-19") | |
| 32624 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 32625 | PORT_MODIFY("IN-20") | |
| 32626 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32627 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32628 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32629 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32630 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32572 | PORT_INCLUDE( sc4_base ) | |
| 32573 | PORT_MODIFY("IN-1") | |
| 32574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 32575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32578 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 32579 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 32580 | PORT_MODIFY("IN-2") | |
| 32581 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 32582 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 32583 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32584 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32585 | PORT_MODIFY("IN-3") | |
| 32586 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32587 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32588 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32589 | PORT_MODIFY("IN-4") | |
| 32590 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 32591 | PORT_MODIFY("IN-5") | |
| 32592 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32593 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32594 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32595 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32596 | PORT_MODIFY("IN-8") | |
| 32597 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32598 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sun") | |
| 32599 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 32600 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 32601 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("high") | |
| 32602 | PORT_MODIFY("IN-9") | |
| 32603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("low") | |
| 32604 | PORT_MODIFY("IN-16") | |
| 32605 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32606 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32607 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32608 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32609 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32610 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32611 | PORT_MODIFY("IN-17") | |
| 32612 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32613 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32614 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32615 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32616 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32617 | PORT_MODIFY("IN-18") | |
| 32618 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32619 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32620 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32621 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 32622 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 32623 | PORT_MODIFY("IN-19") | |
| 32624 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 32625 | PORT_MODIFY("IN-20") | |
| 32626 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32627 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32628 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32629 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32630 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32631 | 32631 | INPUT_PORTS_END |
| 32632 | 32632 | |
| 32633 | 32633 | // PR1038 CLUB WHO WANTS TO BE A LEGIONNAIRE PR1038 CLUB WWTBAL SOUNDS11 |
| r31373 | r31374 | |
| 32657 | 32657 | } |
| 32658 | 32658 | |
| 32659 | 32659 | INPUT_PORTS_START( sc4wspin ) // this structure is generated |
| 32660 | PORT_INCLUDE( sc4_base ) | |
| 32661 | PORT_MODIFY("IN-1") | |
| 32662 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32663 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("blank") | |
| 32664 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 32665 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 32666 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 32667 | PORT_MODIFY("IN-2") | |
| 32668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 32669 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32670 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32671 | PORT_MODIFY("IN-16") | |
| 32672 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32673 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32674 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32675 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32676 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32677 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 32678 | PORT_MODIFY("IN-17") | |
| 32679 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32680 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32681 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32682 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32683 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32684 | PORT_MODIFY("IN-18") | |
| 32685 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32686 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32687 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32688 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32689 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32690 | PORT_MODIFY("IN-19") | |
| 32691 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32692 | PORT_MODIFY("IN-20") | |
| 32693 | // 0x0001 - "test" // standard input (motherboard) | |
| 32694 | // 0x0002 - "lock" // standard input (expected here) | |
| 32695 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32696 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32697 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32660 | PORT_INCLUDE( sc4_base ) | |
| 32661 | PORT_MODIFY("IN-1") | |
| 32662 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32663 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("blank") | |
| 32664 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 32665 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 32666 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 32667 | PORT_MODIFY("IN-2") | |
| 32668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 32669 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32670 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32671 | PORT_MODIFY("IN-16") | |
| 32672 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32673 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32674 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32675 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32676 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32677 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 32678 | PORT_MODIFY("IN-17") | |
| 32679 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32680 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32681 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32682 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32683 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32684 | PORT_MODIFY("IN-18") | |
| 32685 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32686 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32687 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32688 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32689 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32690 | PORT_MODIFY("IN-19") | |
| 32691 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32692 | PORT_MODIFY("IN-20") | |
| 32693 | // 0x0001 - "test" // standard input (motherboard) | |
| 32694 | // 0x0002 - "lock" // standard input (expected here) | |
| 32695 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32696 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32697 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32698 | 32698 | INPUT_PORTS_END |
| 32699 | 32699 | |
| 32700 | 32700 | // QPS162 WIN SPINNER Arcade Version 011 WINSPINNERSND WIN SPINNER |
| r31373 | r31374 | |
| 32721 | 32721 | } |
| 32722 | 32722 | |
| 32723 | 32723 | INPUT_PORTS_START( sc4wwys ) // this structure is generated |
| 32724 | PORT_INCLUDE( sc4_base ) | |
| 32725 | PORT_MODIFY("IN-1") | |
| 32726 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32727 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32728 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 32729 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 32730 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32731 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32732 | PORT_MODIFY("IN-2") | |
| 32733 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32734 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32735 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32736 | PORT_MODIFY("IN-3") | |
| 32737 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32738 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32739 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32740 | PORT_MODIFY("IN-5") | |
| 32741 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32742 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32743 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32744 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32745 | PORT_MODIFY("IN-6") | |
| 32746 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32747 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32748 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32749 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32750 | PORT_MODIFY("IN-8") | |
| 32751 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 32752 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo blt") | |
| 32753 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo ko") | |
| 32754 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo nud") | |
| 32755 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 32756 | PORT_MODIFY("IN-9") | |
| 32757 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk spr") | |
| 32758 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hi blt") | |
| 32759 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hi ko") | |
| 32760 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("hi nud") | |
| 32761 | PORT_MODIFY("IN-16") | |
| 32762 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32763 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32764 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32765 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32766 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32767 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32768 | PORT_MODIFY("IN-17") | |
| 32769 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32770 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32771 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32772 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32773 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32774 | PORT_MODIFY("IN-18") | |
| 32775 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32776 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32777 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32778 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32779 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32780 | PORT_MODIFY("IN-19") | |
| 32781 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32782 | PORT_MODIFY("IN-20") | |
| 32783 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32784 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32785 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32786 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32787 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32724 | PORT_INCLUDE( sc4_base ) | |
| 32725 | PORT_MODIFY("IN-1") | |
| 32726 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32727 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32728 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 32729 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 32730 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32731 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 32732 | PORT_MODIFY("IN-2") | |
| 32733 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32734 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32735 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32736 | PORT_MODIFY("IN-3") | |
| 32737 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32738 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32739 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32740 | PORT_MODIFY("IN-5") | |
| 32741 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32742 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32743 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32744 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32745 | PORT_MODIFY("IN-6") | |
| 32746 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32747 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32748 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32749 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32750 | PORT_MODIFY("IN-8") | |
| 32751 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 32752 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo blt") | |
| 32753 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo ko") | |
| 32754 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo nud") | |
| 32755 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 32756 | PORT_MODIFY("IN-9") | |
| 32757 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk spr") | |
| 32758 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hi blt") | |
| 32759 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hi ko") | |
| 32760 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("hi nud") | |
| 32761 | PORT_MODIFY("IN-16") | |
| 32762 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32763 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32764 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32765 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32766 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32767 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 32768 | PORT_MODIFY("IN-17") | |
| 32769 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32770 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32771 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32772 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32773 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32774 | PORT_MODIFY("IN-18") | |
| 32775 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32776 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32777 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32778 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32779 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32780 | PORT_MODIFY("IN-19") | |
| 32781 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32782 | PORT_MODIFY("IN-20") | |
| 32783 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32784 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32785 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32786 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32787 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32788 | 32788 | INPUT_PORTS_END |
| 32789 | 32789 | |
| 32790 | 32790 | // PR1301 WIN WHEN YOUR SPINNING PR1301 WIN W Y S SOUNDS11 |
| r31373 | r31374 | |
| 32825 | 32825 | } |
| 32826 | 32826 | |
| 32827 | 32827 | INPUT_PORTS_START( sc4winspa ) // this structure is generated |
| 32828 | PORT_INCLUDE( sc4_base ) | |
| 32829 | PORT_MODIFY("IN-1") | |
| 32830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32831 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32832 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32833 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32834 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 32835 | PORT_MODIFY("IN-2") | |
| 32836 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 32837 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 32838 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32839 | PORT_MODIFY("IN-4") | |
| 32840 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 32841 | PORT_MODIFY("IN-16") | |
| 32842 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32843 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32844 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32845 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32846 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32847 | PORT_MODIFY("IN-17") | |
| 32848 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32849 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32850 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32851 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32852 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32853 | PORT_MODIFY("IN-18") | |
| 32854 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32855 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32856 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32857 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32858 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32859 | PORT_MODIFY("IN-19") | |
| 32860 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32861 | PORT_MODIFY("IN-20") | |
| 32862 | // 0x0001 - "test" // standard input (motherboard) | |
| 32863 | // 0x0002 - "botdor OR botdor" // standard input (expected here) | |
| 32864 | // 0x0004 - "topdor OR topdor" // standard input (expected here) | |
| 32865 | // 0x0008 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 32866 | // 0x0010 - "topdor" // standard input (expected here) | |
| 32828 | PORT_INCLUDE( sc4_base ) | |
| 32829 | PORT_MODIFY("IN-1") | |
| 32830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32831 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32832 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 32833 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 32834 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 32835 | PORT_MODIFY("IN-2") | |
| 32836 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 32837 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 32838 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32839 | PORT_MODIFY("IN-4") | |
| 32840 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 32841 | PORT_MODIFY("IN-16") | |
| 32842 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32843 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32844 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32845 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32846 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32847 | PORT_MODIFY("IN-17") | |
| 32848 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32849 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32850 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32851 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32852 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 32853 | PORT_MODIFY("IN-18") | |
| 32854 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 32855 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 32856 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 32857 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 32858 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 32859 | PORT_MODIFY("IN-19") | |
| 32860 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 32861 | PORT_MODIFY("IN-20") | |
| 32862 | // 0x0001 - "test" // standard input (motherboard) | |
| 32863 | // 0x0002 - "botdor OR botdor" // standard input (expected here) | |
| 32864 | // 0x0004 - "topdor OR topdor" // standard input (expected here) | |
| 32865 | // 0x0008 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 32866 | // 0x0010 - "topdor" // standard input (expected here) | |
| 32867 | 32867 | INPUT_PORTS_END |
| 32868 | 32868 | |
| 32869 | 32869 | // PR2526 WINNING SPIN TOP BOX WINNINGSPINSND WINNING SPIN |
| r31373 | r31374 | |
| 32926 | 32926 | } |
| 32927 | 32927 | |
| 32928 | 32928 | INPUT_PORTS_START( sc4wondw ) // this structure is generated |
| 32929 | PORT_INCLUDE( sc4_base ) | |
| 32930 | PORT_MODIFY("IN-1") | |
| 32931 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32932 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32933 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 32934 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 32935 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32936 | PORT_MODIFY("IN-2") | |
| 32937 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32938 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32939 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32940 | PORT_MODIFY("IN-3") | |
| 32941 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32942 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32943 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32944 | PORT_MODIFY("IN-5") | |
| 32945 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32946 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32947 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32948 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32949 | PORT_MODIFY("IN-6") | |
| 32950 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32951 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32952 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32953 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32954 | PORT_MODIFY("IN-8") | |
| 32955 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32956 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht OR tk ss") | |
| 32957 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk haz") | |
| 32958 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fea") | |
| 32959 | PORT_MODIFY("IN-16") | |
| 32960 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32961 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32962 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32963 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32964 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32965 | PORT_MODIFY("IN-17") | |
| 32966 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32967 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32968 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32969 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32970 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32971 | PORT_MODIFY("IN-18") | |
| 32972 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32973 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32974 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32975 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32976 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32977 | PORT_MODIFY("IN-19") | |
| 32978 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32979 | PORT_MODIFY("IN-20") | |
| 32980 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32981 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32982 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32983 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32984 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32929 | PORT_INCLUDE( sc4_base ) | |
| 32930 | PORT_MODIFY("IN-1") | |
| 32931 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 32932 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 32933 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 32934 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 32935 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 32936 | PORT_MODIFY("IN-2") | |
| 32937 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 32938 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 32939 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 32940 | PORT_MODIFY("IN-3") | |
| 32941 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 32942 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 32943 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 32944 | PORT_MODIFY("IN-5") | |
| 32945 | // 0x0001 - "priz4" // standard input (expected here) | |
| 32946 | // 0x0002 - "priz3" // standard input (expected here) | |
| 32947 | // 0x0004 - "priz2" // standard input (expected here) | |
| 32948 | // 0x0008 - "priz1" // standard input (expected here) | |
| 32949 | PORT_MODIFY("IN-6") | |
| 32950 | // 0x0001 - "perc1" // standard input (expected here) | |
| 32951 | // 0x0002 - "perc2" // standard input (expected here) | |
| 32952 | // 0x0004 - "perc3" // standard input (expected here) | |
| 32953 | // 0x0008 - "perc4" // standard input (expected here) | |
| 32954 | PORT_MODIFY("IN-8") | |
| 32955 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 32956 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht OR tk ss") | |
| 32957 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk haz") | |
| 32958 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fea") | |
| 32959 | PORT_MODIFY("IN-16") | |
| 32960 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 32961 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 32962 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 32963 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 32964 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 32965 | PORT_MODIFY("IN-17") | |
| 32966 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 32967 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 32968 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 32969 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 32970 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 32971 | PORT_MODIFY("IN-18") | |
| 32972 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 32973 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 32974 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 32975 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 32976 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 32977 | PORT_MODIFY("IN-19") | |
| 32978 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 32979 | PORT_MODIFY("IN-20") | |
| 32980 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 32981 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 32982 | // 0x0004 - "topdor" // standard input (expected here) | |
| 32983 | // 0x0008 - "botdor" // standard input (expected here) | |
| 32984 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 32985 | 32985 | INPUT_PORTS_END |
| 32986 | 32986 | |
| 32987 | 32987 | // PR1318 WONDER WHEEL PR1314 WONDER WHEEL SOUNDS11 |
| r31373 | r31374 | |
| 33005 | 33005 | } |
| 33006 | 33006 | |
| 33007 | 33007 | INPUT_PORTS_START( sc4xmark ) // this structure is generated |
| 33008 | PORT_INCLUDE( sc4_base ) | |
| 33009 | PORT_MODIFY("IN-1") | |
| 33010 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33011 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33012 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33013 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33014 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 33015 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 33016 | PORT_MODIFY("IN-2") | |
| 33017 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33018 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33019 | PORT_MODIFY("IN-3") | |
| 33020 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33021 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33022 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33023 | PORT_MODIFY("IN-5") | |
| 33024 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33025 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33026 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33027 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33028 | PORT_MODIFY("IN-6") | |
| 33029 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33030 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33031 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33032 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33033 | PORT_MODIFY("IN-8") | |
| 33034 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("low 3") | |
| 33035 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low 2") | |
| 33036 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("low 1") | |
| 33037 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 33038 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk grd") | |
| 33039 | PORT_MODIFY("IN-9") | |
| 33040 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("high 1") | |
| 33041 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("high 2") | |
| 33042 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("high 3") | |
| 33043 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("tk csh") | |
| 33044 | PORT_MODIFY("IN-10") | |
| 33045 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("left") | |
| 33046 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("up") | |
| 33047 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_2 ) PORT_NAME("right") | |
| 33048 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_3 ) PORT_NAME("down") | |
| 33049 | PORT_MODIFY("IN-16") | |
| 33050 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33051 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 33052 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 33053 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 33054 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 33055 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33056 | PORT_MODIFY("IN-17") | |
| 33057 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33058 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 33059 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 33060 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 33061 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 33062 | PORT_MODIFY("IN-18") | |
| 33063 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33064 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 33065 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 33066 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 33067 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 33068 | PORT_MODIFY("IN-19") | |
| 33069 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33070 | PORT_MODIFY("IN-20") | |
| 33071 | // 0x0001 - "green" // standard input (motherboard) | |
| 33072 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33073 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33074 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33075 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33008 | PORT_INCLUDE( sc4_base ) | |
| 33009 | PORT_MODIFY("IN-1") | |
| 33010 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33011 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33012 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33013 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33014 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 33015 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 33016 | PORT_MODIFY("IN-2") | |
| 33017 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33018 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33019 | PORT_MODIFY("IN-3") | |
| 33020 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33021 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33022 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33023 | PORT_MODIFY("IN-5") | |
| 33024 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33025 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33026 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33027 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33028 | PORT_MODIFY("IN-6") | |
| 33029 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33030 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33031 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33032 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33033 | PORT_MODIFY("IN-8") | |
| 33034 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("low 3") | |
| 33035 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low 2") | |
| 33036 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("low 1") | |
| 33037 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 33038 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk grd") | |
| 33039 | PORT_MODIFY("IN-9") | |
| 33040 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("high 1") | |
| 33041 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("high 2") | |
| 33042 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("high 3") | |
| 33043 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("tk csh") | |
| 33044 | PORT_MODIFY("IN-10") | |
| 33045 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("left") | |
| 33046 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("up") | |
| 33047 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_2 ) PORT_NAME("right") | |
| 33048 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_3 ) PORT_NAME("down") | |
| 33049 | PORT_MODIFY("IN-16") | |
| 33050 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33051 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 33052 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 33053 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 33054 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 33055 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33056 | PORT_MODIFY("IN-17") | |
| 33057 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33058 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 33059 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 33060 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 33061 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 33062 | PORT_MODIFY("IN-18") | |
| 33063 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33064 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 33065 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 33066 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 33067 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 33068 | PORT_MODIFY("IN-19") | |
| 33069 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 33070 | PORT_MODIFY("IN-20") | |
| 33071 | // 0x0001 - "green" // standard input (motherboard) | |
| 33072 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33073 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33074 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33075 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33076 | 33076 | INPUT_PORTS_END |
| 33077 | 33077 | |
| 33078 | 33078 | // PR1116 X MARKS THE SPOT PR1116 X MARKS THE SPOT SOUNDS11 |
| r31373 | r31374 | |
| 33098 | 33098 | } |
| 33099 | 33099 | |
| 33100 | 33100 | INPUT_PORTS_START( sc4blokq ) // this structure is generated |
| 33101 | PORT_INCLUDE( sc4_base ) | |
| 33102 | PORT_MODIFY("IN-1") | |
| 33103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33107 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 33108 | PORT_MODIFY("IN-2") | |
| 33109 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 33110 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33111 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33112 | PORT_MODIFY("IN-4") | |
| 33113 | // 0x0010 - "topup" // known extended(?) input, sometimes 'top up' | |
| 33114 | PORT_MODIFY("IN-8") | |
| 33115 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("rig hi") | |
| 33116 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up hi") | |
| 33117 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lef hi") | |
| 33118 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef lo") | |
| 33119 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("up lo") | |
| 33120 | PORT_MODIFY("IN-9") | |
| 33121 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("rig lo") | |
| 33122 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("featre") | |
| 33123 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("cash") | |
| 33124 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("nudge") | |
| 33125 | PORT_MODIFY("IN-16") | |
| 33126 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33127 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33128 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33129 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33130 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33131 | PORT_MODIFY("IN-17") | |
| 33132 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33133 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33134 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33135 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33136 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33137 | PORT_MODIFY("IN-18") | |
| 33138 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33139 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33140 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33141 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33142 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33143 | PORT_MODIFY("IN-19") | |
| 33144 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33145 | PORT_MODIFY("IN-20") | |
| 33146 | // 0x0001 - "test" // standard input (motherboard) | |
| 33147 | // 0x0002 - "lock" // standard input (expected here) | |
| 33148 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33149 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33150 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33101 | PORT_INCLUDE( sc4_base ) | |
| 33102 | PORT_MODIFY("IN-1") | |
| 33103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33107 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 33108 | PORT_MODIFY("IN-2") | |
| 33109 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 33110 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33111 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33112 | PORT_MODIFY("IN-4") | |
| 33113 | // 0x0010 - "topup" // known extended(?) input, sometimes 'top up' | |
| 33114 | PORT_MODIFY("IN-8") | |
| 33115 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("rig hi") | |
| 33116 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up hi") | |
| 33117 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lef hi") | |
| 33118 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef lo") | |
| 33119 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("up lo") | |
| 33120 | PORT_MODIFY("IN-9") | |
| 33121 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("rig lo") | |
| 33122 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("featre") | |
| 33123 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("cash") | |
| 33124 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("nudge") | |
| 33125 | PORT_MODIFY("IN-16") | |
| 33126 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33127 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33128 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33129 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33130 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33131 | PORT_MODIFY("IN-17") | |
| 33132 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33133 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33134 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33135 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33136 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33137 | PORT_MODIFY("IN-18") | |
| 33138 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33139 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33140 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33141 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33142 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33143 | PORT_MODIFY("IN-19") | |
| 33144 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33145 | PORT_MODIFY("IN-20") | |
| 33146 | // 0x0001 - "test" // standard input (motherboard) | |
| 33147 | // 0x0002 - "lock" // standard input (expected here) | |
| 33148 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33149 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33150 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33151 | 33151 | INPUT_PORTS_END |
| 33152 | 33152 | |
| 33153 | 33153 | // PR2025 BLOCK BUSTER BUSTERSND BLOCK BUSTER |
| r31373 | r31374 | |
| 33178 | 33178 | } |
| 33179 | 33179 | |
| 33180 | 33180 | INPUT_PORTS_START( sc4onup ) // this structure is generated |
| 33181 | PORT_INCLUDE( sc4_base ) | |
| 33182 | PORT_MODIFY("IN-1") | |
| 33183 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33184 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 33185 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 33186 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 33187 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 33188 | PORT_MODIFY("IN-2") | |
| 33189 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 33190 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33191 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33192 | PORT_MODIFY("IN-8") | |
| 33193 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step") | |
| 33194 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("rgt hi") | |
| 33195 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("rgt lo") | |
| 33196 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef lo") | |
| 33197 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 33198 | PORT_MODIFY("IN-9") | |
| 33199 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 33200 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 33201 | PORT_MODIFY("IN-16") | |
| 33202 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33203 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33204 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33205 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33206 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33207 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33208 | PORT_MODIFY("IN-17") | |
| 33209 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33210 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33211 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33212 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33213 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33214 | PORT_MODIFY("IN-18") | |
| 33215 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33216 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33217 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33218 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33219 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33220 | PORT_MODIFY("IN-19") | |
| 33221 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33222 | PORT_MODIFY("IN-20") | |
| 33223 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 33224 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 33225 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 33226 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 33227 | // 0x0010 - "deflt" // standard input (expected here) | |
| 33181 | PORT_INCLUDE( sc4_base ) | |
| 33182 | PORT_MODIFY("IN-1") | |
| 33183 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33184 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 33185 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 33186 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 33187 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 33188 | PORT_MODIFY("IN-2") | |
| 33189 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 33190 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33191 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33192 | PORT_MODIFY("IN-8") | |
| 33193 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step") | |
| 33194 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("rgt hi") | |
| 33195 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("rgt lo") | |
| 33196 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef lo") | |
| 33197 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 33198 | PORT_MODIFY("IN-9") | |
| 33199 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 33200 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 33201 | PORT_MODIFY("IN-16") | |
| 33202 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33203 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33204 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33205 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33206 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33207 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33208 | PORT_MODIFY("IN-17") | |
| 33209 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33210 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33211 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33212 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33213 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33214 | PORT_MODIFY("IN-18") | |
| 33215 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33216 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33217 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33218 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33219 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33220 | PORT_MODIFY("IN-19") | |
| 33221 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33222 | PORT_MODIFY("IN-20") | |
| 33223 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 33224 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 33225 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 33226 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 33227 | // 0x0010 - "deflt" // standard input (expected here) | |
| 33228 | 33228 | INPUT_PORTS_END |
| 33229 | 33229 | |
| 33230 | 33230 | // PR2076 ON THE UP HYPE SOUNDS ON THE UP |
| r31373 | r31374 | |
| 33248 | 33248 | } |
| 33249 | 33249 | |
| 33250 | 33250 | INPUT_PORTS_START( sc4hyper ) // this structure is generated |
| 33251 | PORT_INCLUDE( sc4_base ) | |
| 33252 | PORT_MODIFY("IN-1") | |
| 33253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33256 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33257 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 33258 | PORT_MODIFY("IN-2") | |
| 33259 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 33260 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33261 | PORT_MODIFY("IN-8") | |
| 33262 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 33263 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("rgt lo") | |
| 33264 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mid lo") | |
| 33265 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef lo") | |
| 33266 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 33267 | PORT_MODIFY("IN-9") | |
| 33268 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 33269 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 33270 | PORT_MODIFY("IN-16") | |
| 33271 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33272 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33273 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33274 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33275 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33276 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33277 | PORT_MODIFY("IN-17") | |
| 33278 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33279 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33280 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33281 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33282 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33283 | PORT_MODIFY("IN-18") | |
| 33284 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33285 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33286 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33287 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33288 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33289 | PORT_MODIFY("IN-19") | |
| 33290 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33291 | PORT_MODIFY("IN-20") | |
| 33292 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 33293 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 33294 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 33295 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 33296 | // 0x0010 - "deflt" // standard input (expected here) | |
| 33251 | PORT_INCLUDE( sc4_base ) | |
| 33252 | PORT_MODIFY("IN-1") | |
| 33253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33256 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33257 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 33258 | PORT_MODIFY("IN-2") | |
| 33259 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 33260 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33261 | PORT_MODIFY("IN-8") | |
| 33262 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 33263 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("rgt lo") | |
| 33264 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mid lo") | |
| 33265 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef lo") | |
| 33266 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 33267 | PORT_MODIFY("IN-9") | |
| 33268 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 33269 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 33270 | PORT_MODIFY("IN-16") | |
| 33271 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33272 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33273 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33274 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33275 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33276 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33277 | PORT_MODIFY("IN-17") | |
| 33278 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33279 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33280 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33281 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33282 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33283 | PORT_MODIFY("IN-18") | |
| 33284 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33285 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33286 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33287 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33288 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33289 | PORT_MODIFY("IN-19") | |
| 33290 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33291 | PORT_MODIFY("IN-20") | |
| 33292 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 33293 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 33294 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 33295 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 33296 | // 0x0010 - "deflt" // standard input (expected here) | |
| 33297 | 33297 | INPUT_PORTS_END |
| 33298 | 33298 | |
| 33299 | 33299 | // PR2053 HYPERACTIVEL HYPE SOUNDS HYPERACTIVE |
| r31373 | r31374 | |
| 33318 | 33318 | } |
| 33319 | 33319 | |
| 33320 | 33320 | INPUT_PORTS_START( sc4pglcl ) // this structure is generated |
| 33321 | PORT_INCLUDE( sc4_base ) | |
| 33322 | PORT_MODIFY("IN-1") | |
| 33323 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold1") | |
| 33324 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold2 OR high") | |
| 33325 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold3 OR low") | |
| 33326 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold4") | |
| 33327 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("cancel") | |
| 33328 | PORT_MODIFY("IN-2") | |
| 33329 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stpcol") | |
| 33330 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 33331 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 33332 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33333 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 33334 | PORT_MODIFY("IN-4") | |
| 33335 | // 0x0001 - "hop2lo" // unexpected here | |
| 33336 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 33337 | PORT_MODIFY("IN-16") | |
| 33338 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33339 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33340 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33341 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33342 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33343 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33344 | PORT_MODIFY("IN-17") | |
| 33345 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33346 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33347 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33348 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33349 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33350 | PORT_MODIFY("IN-18") | |
| 33351 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33352 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33353 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33354 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33355 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33356 | PORT_MODIFY("IN-19") | |
| 33357 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33358 | PORT_MODIFY("IN-20") | |
| 33359 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33360 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33361 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33362 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33363 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33321 | PORT_INCLUDE( sc4_base ) | |
| 33322 | PORT_MODIFY("IN-1") | |
| 33323 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("hold1") | |
| 33324 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold2 OR high") | |
| 33325 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold3 OR low") | |
| 33326 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold4") | |
| 33327 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("cancel") | |
| 33328 | PORT_MODIFY("IN-2") | |
| 33329 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stpcol") | |
| 33330 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 33331 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 33332 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33333 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 33334 | PORT_MODIFY("IN-4") | |
| 33335 | // 0x0001 - "hop2lo" // unexpected here | |
| 33336 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 33337 | PORT_MODIFY("IN-16") | |
| 33338 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33339 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33340 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33341 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33342 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33343 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33344 | PORT_MODIFY("IN-17") | |
| 33345 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33346 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33347 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33348 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33349 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33350 | PORT_MODIFY("IN-18") | |
| 33351 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33352 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33353 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33354 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33355 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33356 | PORT_MODIFY("IN-19") | |
| 33357 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33358 | PORT_MODIFY("IN-20") | |
| 33359 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33360 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33361 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33362 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33363 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33364 | 33364 | INPUT_PORTS_END |
| 33365 | 33365 | |
| 33366 | 33366 | // PR1623 PHARAOHS GOLD PHARAOHS GOLD CLUB PR1623 CLASS PHAR GOLD SOUNDS11 |
| r31373 | r31374 | |
| 33397 | 33397 | } |
| 33398 | 33398 | |
| 33399 | 33399 | INPUT_PORTS_START( sc4po8 ) // this structure is generated |
| 33400 | PORT_INCLUDE( sc4_base ) | |
| 33401 | PORT_MODIFY("IN-1") | |
| 33402 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33403 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33404 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33405 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33406 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 33407 | PORT_MODIFY("IN-2") | |
| 33408 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 33409 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33410 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33411 | PORT_MODIFY("IN-8") | |
| 33412 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("right") | |
| 33413 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up") | |
| 33414 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 33415 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 33416 | PORT_MODIFY("IN-16") | |
| 33417 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33418 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33419 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33420 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33421 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33422 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 33423 | PORT_MODIFY("IN-17") | |
| 33424 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33425 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33426 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33427 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33428 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33429 | PORT_MODIFY("IN-18") | |
| 33430 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33431 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33432 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33433 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33434 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33435 | PORT_MODIFY("IN-19") | |
| 33436 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33437 | PORT_MODIFY("IN-20") | |
| 33438 | // 0x0001 - "test" // standard input (motherboard) | |
| 33439 | // 0x0002 - "lock" // standard input (expected here) | |
| 33440 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33441 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33442 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33400 | PORT_INCLUDE( sc4_base ) | |
| 33401 | PORT_MODIFY("IN-1") | |
| 33402 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33403 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33404 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33405 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33406 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 33407 | PORT_MODIFY("IN-2") | |
| 33408 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 33409 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33410 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33411 | PORT_MODIFY("IN-8") | |
| 33412 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("right") | |
| 33413 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("up") | |
| 33414 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 33415 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 33416 | PORT_MODIFY("IN-16") | |
| 33417 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33418 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33419 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33420 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33421 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33422 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 33423 | PORT_MODIFY("IN-17") | |
| 33424 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33425 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33426 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33427 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33428 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33429 | PORT_MODIFY("IN-18") | |
| 33430 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33431 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33432 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33433 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33434 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33435 | PORT_MODIFY("IN-19") | |
| 33436 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33437 | PORT_MODIFY("IN-20") | |
| 33438 | // 0x0001 - "test" // standard input (motherboard) | |
| 33439 | // 0x0002 - "lock" // standard input (expected here) | |
| 33440 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33441 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33442 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33443 | 33443 | INPUT_PORTS_END |
| 33444 | 33444 | |
| 33445 | 33445 | // PR2530 PIECES OF EIGHT V1.0 PIECESOFEIGHTSND PIECES OF EIGHT |
| r31373 | r31374 | |
| 33484 | 33484 | } |
| 33485 | 33485 | |
| 33486 | 33486 | INPUT_PORTS_START( sc4adjb ) // this structure is generated |
| 33487 | PORT_INCLUDE( sc4_base ) | |
| 33488 | PORT_MODIFY("IN-1") | |
| 33489 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33490 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33491 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33492 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33493 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 33494 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 33495 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 33496 | PORT_MODIFY("IN-2") | |
| 33497 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 33498 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 33499 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33500 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33501 | PORT_MODIFY("IN-3") | |
| 33502 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33503 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33504 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33505 | PORT_MODIFY("IN-5") | |
| 33506 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33507 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33508 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33509 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33510 | PORT_MODIFY("IN-6") | |
| 33511 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33512 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33513 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33514 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33515 | PORT_MODIFY("IN-8") | |
| 33516 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b gamb") | |
| 33517 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("leave") | |
| 33518 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("jiggy") | |
| 33519 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 33520 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("streak") | |
| 33521 | PORT_MODIFY("IN-16") | |
| 33522 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 33523 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 33524 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 33525 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 33526 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 33527 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33528 | PORT_MODIFY("IN-17") | |
| 33529 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 33530 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 33531 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 33532 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 33533 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33534 | PORT_MODIFY("IN-18") | |
| 33535 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33536 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33537 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33538 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33539 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33540 | PORT_MODIFY("IN-19") | |
| 33541 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33542 | PORT_MODIFY("IN-20") | |
| 33543 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33544 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33545 | // 0x0004 - "serdor" // standard input (expected here) | |
| 33546 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 33547 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33487 | PORT_INCLUDE( sc4_base ) | |
| 33488 | PORT_MODIFY("IN-1") | |
| 33489 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33490 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33491 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33492 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33493 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 33494 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 33495 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 33496 | PORT_MODIFY("IN-2") | |
| 33497 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 33498 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 33499 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33500 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33501 | PORT_MODIFY("IN-3") | |
| 33502 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33503 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33504 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33505 | PORT_MODIFY("IN-5") | |
| 33506 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33507 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33508 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33509 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33510 | PORT_MODIFY("IN-6") | |
| 33511 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33512 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33513 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33514 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33515 | PORT_MODIFY("IN-8") | |
| 33516 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b gamb") | |
| 33517 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("leave") | |
| 33518 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("jiggy") | |
| 33519 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 33520 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("streak") | |
| 33521 | PORT_MODIFY("IN-16") | |
| 33522 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 33523 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 33524 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 33525 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 33526 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 33527 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33528 | PORT_MODIFY("IN-17") | |
| 33529 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 33530 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 33531 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 33532 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 33533 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33534 | PORT_MODIFY("IN-18") | |
| 33535 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33536 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33537 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33538 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33539 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33540 | PORT_MODIFY("IN-19") | |
| 33541 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33542 | PORT_MODIFY("IN-20") | |
| 33543 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33544 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33545 | // 0x0004 - "serdor" // standard input (expected here) | |
| 33546 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 33547 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33548 | 33548 | INPUT_PORTS_END |
| 33549 | 33549 | |
| 33550 | 33550 | // PR3039 AWP ANT N DECS JIGGY BANK S4 PR3009 JIGGY BANK SOUNDS11 JIGGY BANK S.SITE |
| r31373 | r31374 | |
| 33576 | 33576 | } |
| 33577 | 33577 | |
| 33578 | 33578 | INPUT_PORTS_START( sc4adwta ) // this structure is generated |
| 33579 | PORT_INCLUDE( sc4_base ) | |
| 33580 | PORT_MODIFY("IN-1") | |
| 33581 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33582 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33583 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33584 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33585 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 33586 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 33587 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 33588 | PORT_MODIFY("IN-2") | |
| 33589 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 33590 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("colect") | |
| 33591 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 33592 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33593 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 33594 | PORT_MODIFY("IN-3") | |
| 33595 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33596 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 33597 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 33598 | PORT_MODIFY("IN-5") | |
| 33599 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33600 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33601 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33602 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33603 | PORT_MODIFY("IN-6") | |
| 33604 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33605 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33606 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33607 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33608 | PORT_MODIFY("IN-8") | |
| 33609 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("no") | |
| 33610 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("useky") | |
| 33611 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("yes") | |
| 33612 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("big gm") | |
| 33613 | PORT_MODIFY("IN-16") | |
| 33614 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 33615 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 33616 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 33617 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 33618 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 33619 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33620 | PORT_MODIFY("IN-17") | |
| 33621 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 33622 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 33623 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 33624 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 33625 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33626 | PORT_MODIFY("IN-18") | |
| 33627 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33628 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33629 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33630 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33631 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33632 | PORT_MODIFY("IN-19") | |
| 33633 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33634 | PORT_MODIFY("IN-20") | |
| 33635 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33636 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33637 | // 0x0004 - "serdor" // standard input (expected here) | |
| 33638 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 33639 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33579 | PORT_INCLUDE( sc4_base ) | |
| 33580 | PORT_MODIFY("IN-1") | |
| 33581 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33582 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33583 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33584 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33585 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 33586 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 33587 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 33588 | PORT_MODIFY("IN-2") | |
| 33589 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 33590 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("colect") | |
| 33591 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 33592 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33593 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 33594 | PORT_MODIFY("IN-3") | |
| 33595 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33596 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 33597 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 33598 | PORT_MODIFY("IN-5") | |
| 33599 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33600 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33601 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33602 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33603 | PORT_MODIFY("IN-6") | |
| 33604 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33605 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33606 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33607 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33608 | PORT_MODIFY("IN-8") | |
| 33609 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("no") | |
| 33610 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("useky") | |
| 33611 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("yes") | |
| 33612 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("big gm") | |
| 33613 | PORT_MODIFY("IN-16") | |
| 33614 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 33615 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 33616 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 33617 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 33618 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 33619 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33620 | PORT_MODIFY("IN-17") | |
| 33621 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 33622 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 33623 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 33624 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 33625 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33626 | PORT_MODIFY("IN-18") | |
| 33627 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33628 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33629 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33630 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33631 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33632 | PORT_MODIFY("IN-19") | |
| 33633 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33634 | PORT_MODIFY("IN-20") | |
| 33635 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33636 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33637 | // 0x0004 - "serdor" // standard input (expected here) | |
| 33638 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 33639 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33640 | 33640 | INPUT_PORTS_END |
| 33641 | 33641 | |
| 33642 | 33642 | // PR1940 AWP ANT N DECS WTAD S4 PR1940 ADSNT SHOWTIME SOUNDS11 ANTNDECSWTAD S.SITE |
| r31373 | r31374 | |
| 33660 | 33660 | } |
| 33661 | 33661 | |
| 33662 | 33662 | INPUT_PORTS_START( sc4a40 ) // this structure is generated |
| 33663 | PORT_INCLUDE( sc4_base ) | |
| 33664 | PORT_MODIFY("IN-1") | |
| 33665 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 33666 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 33667 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 33668 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 33669 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 33670 | PORT_MODIFY("IN-2") | |
| 33671 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 33672 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 33673 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33674 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33675 | PORT_MODIFY("IN-8") | |
| 33676 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h cash") | |
| 33677 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("h nuds") | |
| 33678 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkspin") | |
| 33679 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tkcpot") | |
| 33680 | PORT_MODIFY("IN-16") | |
| 33681 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33682 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33683 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33684 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33685 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33686 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 33687 | PORT_MODIFY("IN-17") | |
| 33688 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33689 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33690 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33691 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33692 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33693 | PORT_MODIFY("IN-18") | |
| 33694 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33695 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33696 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33697 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33698 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33699 | PORT_MODIFY("IN-19") | |
| 33700 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33701 | PORT_MODIFY("IN-20") | |
| 33702 | // 0x0001 - "test" // standard input (motherboard) | |
| 33703 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 33704 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 33705 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 33706 | // 0x0010 - "deflt" // standard input (expected here) | |
| 33663 | PORT_INCLUDE( sc4_base ) | |
| 33664 | PORT_MODIFY("IN-1") | |
| 33665 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 33666 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 33667 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 33668 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 33669 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 33670 | PORT_MODIFY("IN-2") | |
| 33671 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 33672 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 33673 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33674 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33675 | PORT_MODIFY("IN-8") | |
| 33676 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h cash") | |
| 33677 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("h nuds") | |
| 33678 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkspin") | |
| 33679 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tkcpot") | |
| 33680 | PORT_MODIFY("IN-16") | |
| 33681 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33682 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33683 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33684 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33685 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33686 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 33687 | PORT_MODIFY("IN-17") | |
| 33688 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33689 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33690 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33691 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33692 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33693 | PORT_MODIFY("IN-18") | |
| 33694 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33695 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33696 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33697 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33698 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33699 | PORT_MODIFY("IN-19") | |
| 33700 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33701 | PORT_MODIFY("IN-20") | |
| 33702 | // 0x0001 - "test" // standard input (motherboard) | |
| 33703 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 33704 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 33705 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 33706 | // 0x0010 - "deflt" // standard input (expected here) | |
| 33707 | 33707 | INPUT_PORTS_END |
| 33708 | 33708 | |
| 33709 | 33709 | // PR2200 AROUND THE BOARD AROU SOUNDS AROUND THE BOARD |
| r31373 | r31374 | |
| 33729 | 33729 | } |
| 33730 | 33730 | |
| 33731 | 33731 | INPUT_PORTS_START( sc4a40cl ) // this structure is generated |
| 33732 | PORT_INCLUDE( sc4_base ) | |
| 33733 | PORT_MODIFY("IN-1") | |
| 33734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 33735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 33739 | PORT_MODIFY("IN-2") | |
| 33740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 33741 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 33742 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 33743 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33744 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 33745 | PORT_MODIFY("IN-3") | |
| 33746 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33747 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33748 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33749 | PORT_MODIFY("IN-4") | |
| 33750 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 33751 | PORT_MODIFY("IN-5") | |
| 33752 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33753 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33754 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33755 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33756 | PORT_MODIFY("IN-8") | |
| 33757 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 33758 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk mtr") | |
| 33759 | PORT_MODIFY("IN-16") | |
| 33760 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33761 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33762 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33763 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33764 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33765 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33766 | PORT_MODIFY("IN-17") | |
| 33767 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33768 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33769 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33770 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33771 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33772 | PORT_MODIFY("IN-18") | |
| 33773 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33774 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33775 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33776 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 33777 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 33778 | PORT_MODIFY("IN-19") | |
| 33779 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 33780 | PORT_MODIFY("IN-20") | |
| 33781 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33782 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33783 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33784 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33785 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33732 | PORT_INCLUDE( sc4_base ) | |
| 33733 | PORT_MODIFY("IN-1") | |
| 33734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 33735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 33736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 33737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 33738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 33739 | PORT_MODIFY("IN-2") | |
| 33740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 33741 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 33742 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 33743 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33744 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 33745 | PORT_MODIFY("IN-3") | |
| 33746 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33747 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33748 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33749 | PORT_MODIFY("IN-4") | |
| 33750 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 33751 | PORT_MODIFY("IN-5") | |
| 33752 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33753 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33754 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33755 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33756 | PORT_MODIFY("IN-8") | |
| 33757 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 33758 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk mtr") | |
| 33759 | PORT_MODIFY("IN-16") | |
| 33760 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33761 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33762 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33763 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33764 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33765 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 33766 | PORT_MODIFY("IN-17") | |
| 33767 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33768 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33769 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33770 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33771 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33772 | PORT_MODIFY("IN-18") | |
| 33773 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33774 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33775 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33776 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 33777 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 33778 | PORT_MODIFY("IN-19") | |
| 33779 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 33780 | PORT_MODIFY("IN-20") | |
| 33781 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33782 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33783 | // 0x0004 - "topdor" // standard input (expected here) | |
| 33784 | // 0x0008 - "botdor" // standard input (expected here) | |
| 33785 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33786 | 33786 | INPUT_PORTS_END |
| 33787 | 33787 | |
| 33788 | 33788 | // PR2154 CLUB AROUND BOAR CLB AROUND BOARD CLUB AROU SOUNDS |
| r31373 | r31374 | |
| 33809 | 33809 | } |
| 33810 | 33810 | |
| 33811 | 33811 | INPUT_PORTS_START( sc4bantm ) // this structure is generated |
| 33812 | PORT_INCLUDE( sc4_base ) | |
| 33813 | PORT_MODIFY("IN-1") | |
| 33814 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 33815 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 33816 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 33817 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 33818 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 33819 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 33820 | PORT_MODIFY("IN-2") | |
| 33821 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 33822 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 33823 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33824 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33825 | PORT_MODIFY("IN-3") | |
| 33826 | // 0x0004 - "stk3" // standard input (expected here) | |
| 33827 | // 0x0008 - "stk1" // standard input (expected here) | |
| 33828 | // 0x0010 - "stk2" // standard input (expected here) | |
| 33829 | PORT_MODIFY("IN-5") | |
| 33830 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 33831 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 33832 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 33833 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 33834 | PORT_MODIFY("IN-6") | |
| 33835 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 33836 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 33837 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 33838 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 33839 | PORT_MODIFY("IN-8") | |
| 33840 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c hi") | |
| 33841 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c lo") | |
| 33842 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("b lo") | |
| 33843 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("b hi") | |
| 33844 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f lo") | |
| 33845 | PORT_MODIFY("IN-9") | |
| 33846 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("f hi") | |
| 33847 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("step") | |
| 33848 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("shoot") | |
| 33849 | PORT_MODIFY("IN-16") | |
| 33850 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33851 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33852 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33853 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33854 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33855 | // 0x0100 - "top up OR top up" // known extended input, usually 'top up' | |
| 33856 | PORT_MODIFY("IN-17") | |
| 33857 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33858 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33859 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33860 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33861 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33862 | PORT_MODIFY("IN-18") | |
| 33863 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33864 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33865 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33866 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33867 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33868 | PORT_MODIFY("IN-19") | |
| 33869 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33870 | PORT_MODIFY("IN-20") | |
| 33871 | // 0x0001 - "test" // standard input (motherboard) | |
| 33872 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 33873 | // 0x0004 - "topdr" // standard input (expected here) | |
| 33874 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 33875 | // 0x0010 - "dump" // standard input (expected here) | |
| 33812 | PORT_INCLUDE( sc4_base ) | |
| 33813 | PORT_MODIFY("IN-1") | |
| 33814 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 33815 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 33816 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 33817 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 33818 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 33819 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 33820 | PORT_MODIFY("IN-2") | |
| 33821 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 33822 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 33823 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33824 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33825 | PORT_MODIFY("IN-3") | |
| 33826 | // 0x0004 - "stk3" // standard input (expected here) | |
| 33827 | // 0x0008 - "stk1" // standard input (expected here) | |
| 33828 | // 0x0010 - "stk2" // standard input (expected here) | |
| 33829 | PORT_MODIFY("IN-5") | |
| 33830 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 33831 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 33832 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 33833 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 33834 | PORT_MODIFY("IN-6") | |
| 33835 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 33836 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 33837 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 33838 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 33839 | PORT_MODIFY("IN-8") | |
| 33840 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c hi") | |
| 33841 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c lo") | |
| 33842 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("b lo") | |
| 33843 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("b hi") | |
| 33844 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f lo") | |
| 33845 | PORT_MODIFY("IN-9") | |
| 33846 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("f hi") | |
| 33847 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("step") | |
| 33848 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("shoot") | |
| 33849 | PORT_MODIFY("IN-16") | |
| 33850 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33851 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33852 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33853 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33854 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33855 | // 0x0100 - "top up OR top up" // known extended input, usually 'top up' | |
| 33856 | PORT_MODIFY("IN-17") | |
| 33857 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33858 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33859 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33860 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33861 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 33862 | PORT_MODIFY("IN-18") | |
| 33863 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 33864 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 33865 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 33866 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 33867 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 33868 | PORT_MODIFY("IN-19") | |
| 33869 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 33870 | PORT_MODIFY("IN-20") | |
| 33871 | // 0x0001 - "test" // standard input (motherboard) | |
| 33872 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 33873 | // 0x0004 - "topdr" // standard input (expected here) | |
| 33874 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 33875 | // 0x0010 - "dump" // standard input (expected here) | |
| 33876 | 33876 | INPUT_PORTS_END |
| 33877 | 33877 | |
| 33878 | 33878 | // PR2301 BANTAM OF THE OPERA BANTAM SOUNDS BANTAMOFTHEOPERA |
| r31373 | r31374 | |
| 33899 | 33899 | } |
| 33900 | 33900 | |
| 33901 | 33901 | INPUT_PORTS_START( sc4bar7 ) // this structure is generated |
| 33902 | PORT_INCLUDE( sc4_base ) | |
| 33903 | PORT_MODIFY("IN-1") | |
| 33904 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("autply") | |
| 33905 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33906 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33907 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33908 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("cancel") | |
| 33909 | // 0x0100 - "pndlow" // known extended input, usually 'hopper fit' | |
| 33910 | PORT_MODIFY("IN-2") | |
| 33911 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33912 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33913 | // 0x0100 - "10plow" // unexpected here | |
| 33914 | PORT_MODIFY("IN-3") | |
| 33915 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33916 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33917 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33918 | PORT_MODIFY("IN-5") | |
| 33919 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33920 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33921 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33922 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33923 | PORT_MODIFY("IN-6") | |
| 33924 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33925 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33926 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33927 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33928 | PORT_MODIFY("IN-16") | |
| 33929 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33930 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33931 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33932 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33933 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33934 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 33935 | PORT_MODIFY("IN-17") | |
| 33936 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33937 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33938 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33939 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33940 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33941 | PORT_MODIFY("IN-18") | |
| 33942 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33943 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33944 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33945 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33946 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33947 | PORT_MODIFY("IN-19") | |
| 33948 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33949 | PORT_MODIFY("IN-20") | |
| 33950 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33951 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33952 | // 0x0004 - "serdor" // standard input (expected here) | |
| 33953 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 33954 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33902 | PORT_INCLUDE( sc4_base ) | |
| 33903 | PORT_MODIFY("IN-1") | |
| 33904 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("autply") | |
| 33905 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33906 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33907 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33908 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("cancel") | |
| 33909 | // 0x0100 - "pndlow" // known extended input, usually 'hopper fit' | |
| 33910 | PORT_MODIFY("IN-2") | |
| 33911 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 33912 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33913 | // 0x0100 - "10plow" // unexpected here | |
| 33914 | PORT_MODIFY("IN-3") | |
| 33915 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33916 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 33917 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 33918 | PORT_MODIFY("IN-5") | |
| 33919 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33920 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33921 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33922 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33923 | PORT_MODIFY("IN-6") | |
| 33924 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33925 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33926 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33927 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33928 | PORT_MODIFY("IN-16") | |
| 33929 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33930 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33931 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33932 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33933 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33934 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 33935 | PORT_MODIFY("IN-17") | |
| 33936 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33937 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33938 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33939 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33940 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33941 | PORT_MODIFY("IN-18") | |
| 33942 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 33943 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 33944 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 33945 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 33946 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 33947 | PORT_MODIFY("IN-19") | |
| 33948 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 33949 | PORT_MODIFY("IN-20") | |
| 33950 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 33951 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 33952 | // 0x0004 - "serdor" // standard input (expected here) | |
| 33953 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 33954 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 33955 | 33955 | INPUT_PORTS_END |
| 33956 | 33956 | |
| 33957 | 33957 | INPUT_PORTS_START( sc4bar7b ) // this structure is generated |
| 33958 | PORT_INCLUDE( sc4_base ) | |
| 33959 | PORT_MODIFY("IN-1") | |
| 33960 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33961 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33962 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33963 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33964 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autply") | |
| 33965 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("pndlow OR 10plow") | |
| 33966 | PORT_MODIFY("IN-2") | |
| 33967 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trnsfr") | |
| 33968 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 33969 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33970 | PORT_MODIFY("IN-3") | |
| 33971 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33972 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 33973 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 33974 | PORT_MODIFY("IN-4") | |
| 33975 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 33976 | PORT_MODIFY("IN-5") | |
| 33977 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33978 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33979 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33980 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33981 | PORT_MODIFY("IN-6") | |
| 33982 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33983 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33984 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33985 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33986 | PORT_MODIFY("IN-16") | |
| 33987 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33988 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33989 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33990 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33991 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33992 | PORT_MODIFY("IN-17") | |
| 33993 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33994 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33995 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33996 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33997 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33998 | PORT_MODIFY("IN-18") | |
| 33999 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34000 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34001 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34002 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34003 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34004 | PORT_MODIFY("IN-19") | |
| 34005 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34006 | PORT_MODIFY("IN-20") | |
| 34007 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34008 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34009 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 34010 | // 0x0010 - "cshdor" // standard input (expected here) | |
| 33958 | PORT_INCLUDE( sc4_base ) | |
| 33959 | PORT_MODIFY("IN-1") | |
| 33960 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 33961 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 33962 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 33963 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 33964 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autply") | |
| 33965 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("pndlow OR 10plow") | |
| 33966 | PORT_MODIFY("IN-2") | |
| 33967 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trnsfr") | |
| 33968 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 33969 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 33970 | PORT_MODIFY("IN-3") | |
| 33971 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 33972 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 33973 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 33974 | PORT_MODIFY("IN-4") | |
| 33975 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 33976 | PORT_MODIFY("IN-5") | |
| 33977 | // 0x0001 - "priz4" // standard input (expected here) | |
| 33978 | // 0x0002 - "priz3" // standard input (expected here) | |
| 33979 | // 0x0004 - "priz2" // standard input (expected here) | |
| 33980 | // 0x0008 - "priz1" // standard input (expected here) | |
| 33981 | PORT_MODIFY("IN-6") | |
| 33982 | // 0x0001 - "perc1" // standard input (expected here) | |
| 33983 | // 0x0002 - "perc2" // standard input (expected here) | |
| 33984 | // 0x0004 - "perc3" // standard input (expected here) | |
| 33985 | // 0x0008 - "perc4" // standard input (expected here) | |
| 33986 | PORT_MODIFY("IN-16") | |
| 33987 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 33988 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 33989 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 33990 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 33991 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 33992 | PORT_MODIFY("IN-17") | |
| 33993 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 33994 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 33995 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 33996 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 33997 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 33998 | PORT_MODIFY("IN-18") | |
| 33999 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34000 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34001 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34002 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34003 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34004 | PORT_MODIFY("IN-19") | |
| 34005 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34006 | PORT_MODIFY("IN-20") | |
| 34007 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34008 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34009 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 34010 | // 0x0010 - "cshdor" // standard input (expected here) | |
| 34011 | 34011 | INPUT_PORTS_END |
| 34012 | 34012 | |
| 34013 | 34013 | // PR1433 BAR7S PR1433 BAR SEVENS SOUNDS11 |
| r31373 | r31374 | |
| 34037 | 34037 | } |
| 34038 | 34038 | |
| 34039 | 34039 | INPUT_PORTS_START( sc4batl ) // this structure is generated |
| 34040 | PORT_INCLUDE( sc4_base ) | |
| 34041 | PORT_MODIFY("IN-1") | |
| 34042 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34043 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34044 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34045 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34046 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 34047 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34048 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34049 | PORT_MODIFY("IN-2") | |
| 34050 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34051 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 34052 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34053 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34054 | PORT_MODIFY("IN-3") | |
| 34055 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34056 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 34057 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 34058 | PORT_MODIFY("IN-5") | |
| 34059 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34060 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34061 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34062 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34063 | PORT_MODIFY("IN-6") | |
| 34064 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34065 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34066 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34067 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34068 | PORT_MODIFY("IN-8") | |
| 34069 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("death") | |
| 34070 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 34071 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featur") | |
| 34072 | PORT_MODIFY("IN-16") | |
| 34073 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34074 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34075 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34076 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34077 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34078 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34079 | PORT_MODIFY("IN-17") | |
| 34080 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34081 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34082 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34083 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34084 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34085 | PORT_MODIFY("IN-18") | |
| 34086 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34087 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34088 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34089 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34090 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34091 | PORT_MODIFY("IN-19") | |
| 34092 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34093 | PORT_MODIFY("IN-20") | |
| 34094 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34095 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34096 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34097 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34098 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34040 | PORT_INCLUDE( sc4_base ) | |
| 34041 | PORT_MODIFY("IN-1") | |
| 34042 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34043 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34044 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34045 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34046 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 34047 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34048 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34049 | PORT_MODIFY("IN-2") | |
| 34050 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34051 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 34052 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34053 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34054 | PORT_MODIFY("IN-3") | |
| 34055 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34056 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 34057 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 34058 | PORT_MODIFY("IN-5") | |
| 34059 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34060 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34061 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34062 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34063 | PORT_MODIFY("IN-6") | |
| 34064 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34065 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34066 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34067 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34068 | PORT_MODIFY("IN-8") | |
| 34069 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("death") | |
| 34070 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 34071 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featur") | |
| 34072 | PORT_MODIFY("IN-16") | |
| 34073 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34074 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34075 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34076 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34077 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34078 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34079 | PORT_MODIFY("IN-17") | |
| 34080 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34081 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34082 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34083 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34084 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34085 | PORT_MODIFY("IN-18") | |
| 34086 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34087 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34088 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34089 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34090 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34091 | PORT_MODIFY("IN-19") | |
| 34092 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34093 | PORT_MODIFY("IN-20") | |
| 34094 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34095 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34096 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34097 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34098 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34099 | 34099 | INPUT_PORTS_END |
| 34100 | 34100 | |
| 34101 | 34101 | // PR1724 AWP BATTLESHIPS AND CRUISERS S4 PR1704 B AND C SOUNDS11 BATTLESHIPSCRUIS S.SITE |
| r31373 | r31374 | |
| 34120 | 34120 | } |
| 34121 | 34121 | |
| 34122 | 34122 | INPUT_PORTS_START( sc4bull ) // this structure is generated |
| 34123 | PORT_INCLUDE( sc4_base ) | |
| 34124 | PORT_MODIFY("IN-1") | |
| 34125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 34126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34127 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34128 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34129 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 34130 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34131 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34132 | PORT_MODIFY("IN-2") | |
| 34133 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34134 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 34135 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34136 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34137 | PORT_MODIFY("IN-5") | |
| 34138 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34139 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34140 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34141 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34142 | PORT_MODIFY("IN-6") | |
| 34143 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34144 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34145 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34146 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34147 | PORT_MODIFY("IN-8") | |
| 34148 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 34149 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 34150 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 34151 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 34152 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 34153 | PORT_MODIFY("IN-9") | |
| 34154 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 34155 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 34156 | PORT_MODIFY("IN-16") | |
| 34157 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34158 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34159 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34160 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34161 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34162 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34163 | PORT_MODIFY("IN-17") | |
| 34164 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34165 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34166 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34167 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34168 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34169 | PORT_MODIFY("IN-18") | |
| 34170 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34171 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34172 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34173 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34174 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34175 | PORT_MODIFY("IN-19") | |
| 34176 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34177 | PORT_MODIFY("IN-20") | |
| 34178 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34179 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34180 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34181 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34182 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34123 | PORT_INCLUDE( sc4_base ) | |
| 34124 | PORT_MODIFY("IN-1") | |
| 34125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 34126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34127 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34128 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34129 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 34130 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34131 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34132 | PORT_MODIFY("IN-2") | |
| 34133 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34134 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 34135 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34136 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34137 | PORT_MODIFY("IN-5") | |
| 34138 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34139 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34140 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34141 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34142 | PORT_MODIFY("IN-6") | |
| 34143 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34144 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34145 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34146 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34147 | PORT_MODIFY("IN-8") | |
| 34148 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 34149 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 34150 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 34151 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 34152 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 34153 | PORT_MODIFY("IN-9") | |
| 34154 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 34155 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 34156 | PORT_MODIFY("IN-16") | |
| 34157 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34158 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34159 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34160 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34161 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34162 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34163 | PORT_MODIFY("IN-17") | |
| 34164 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34165 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34166 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34167 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34168 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34169 | PORT_MODIFY("IN-18") | |
| 34170 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34171 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34172 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34173 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34174 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34175 | PORT_MODIFY("IN-19") | |
| 34176 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34177 | PORT_MODIFY("IN-20") | |
| 34178 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34179 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34180 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34181 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34182 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34183 | 34183 | INPUT_PORTS_END |
| 34184 | 34184 | |
| 34185 | 34185 | // PR1722 AWP BULLSEYE SCORP4 PR1702 BULLSEYE SOUNDS11 BULLSEYE S.SITE |
| r31373 | r31374 | |
| 34205 | 34205 | } |
| 34206 | 34206 | |
| 34207 | 34207 | INPUT_PORTS_START( sc4bulcs ) // this structure is generated |
| 34208 | PORT_INCLUDE( sc4_base ) | |
| 34209 | PORT_MODIFY("IN-1") | |
| 34210 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34211 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34212 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34213 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34214 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34215 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34216 | PORT_MODIFY("IN-2") | |
| 34217 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("colect") | |
| 34218 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 34219 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34220 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34221 | PORT_MODIFY("IN-5") | |
| 34222 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34223 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34224 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34225 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34226 | PORT_MODIFY("IN-6") | |
| 34227 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34228 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34229 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34230 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34231 | PORT_MODIFY("IN-8") | |
| 34232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 34233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 34234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 34235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 34236 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 34237 | PORT_MODIFY("IN-9") | |
| 34238 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 34239 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 34240 | PORT_MODIFY("IN-16") | |
| 34241 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34242 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34243 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34244 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34245 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34246 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34247 | PORT_MODIFY("IN-17") | |
| 34248 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34249 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34250 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34251 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34252 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34253 | PORT_MODIFY("IN-18") | |
| 34254 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34255 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34256 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34257 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34258 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34259 | PORT_MODIFY("IN-19") | |
| 34260 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34261 | PORT_MODIFY("IN-20") | |
| 34262 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34263 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34264 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34265 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34266 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34208 | PORT_INCLUDE( sc4_base ) | |
| 34209 | PORT_MODIFY("IN-1") | |
| 34210 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34211 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34212 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34213 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34214 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34215 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34216 | PORT_MODIFY("IN-2") | |
| 34217 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("colect") | |
| 34218 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 34219 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34220 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34221 | PORT_MODIFY("IN-5") | |
| 34222 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34223 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34224 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34225 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34226 | PORT_MODIFY("IN-6") | |
| 34227 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34228 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34229 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34230 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34231 | PORT_MODIFY("IN-8") | |
| 34232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 34233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 34234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 34235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 34236 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 34237 | PORT_MODIFY("IN-9") | |
| 34238 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 34239 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 34240 | PORT_MODIFY("IN-16") | |
| 34241 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34242 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34243 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34244 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34245 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34246 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34247 | PORT_MODIFY("IN-17") | |
| 34248 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34249 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34250 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34251 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34252 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34253 | PORT_MODIFY("IN-18") | |
| 34254 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34255 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34256 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34257 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34258 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34259 | PORT_MODIFY("IN-19") | |
| 34260 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34261 | PORT_MODIFY("IN-20") | |
| 34262 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34263 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34264 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34265 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34266 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34267 | 34267 | INPUT_PORTS_END |
| 34268 | 34268 | |
| 34269 | 34269 | // PR1740 AWP BULLSEYE CLASSIC SCORP4 PR1702 BULLSEYE SOUNDS11 BULLSEYE CLASSIC S.SITE |
| r31373 | r31374 | |
| 34289 | 34289 | } |
| 34290 | 34290 | |
| 34291 | 34291 | INPUT_PORTS_START( sc4butch ) // this structure is generated |
| 34292 | PORT_INCLUDE( sc4_base ) | |
| 34293 | PORT_MODIFY("IN-1") | |
| 34294 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34295 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34296 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34297 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34298 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 34299 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34300 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34301 | PORT_MODIFY("IN-2") | |
| 34302 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34303 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 34304 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34305 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34306 | PORT_MODIFY("IN-3") | |
| 34307 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34308 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34309 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34310 | PORT_MODIFY("IN-5") | |
| 34311 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34312 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34313 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34314 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34315 | PORT_MODIFY("IN-6") | |
| 34316 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34317 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34318 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34319 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34320 | PORT_MODIFY("IN-8") | |
| 34321 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("dead") | |
| 34322 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo rig") | |
| 34323 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi rig") | |
| 34324 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo lef") | |
| 34325 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi lef") | |
| 34326 | PORT_MODIFY("IN-9") | |
| 34327 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("streak") | |
| 34328 | PORT_MODIFY("IN-16") | |
| 34329 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34330 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34331 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34332 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34333 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34334 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34335 | PORT_MODIFY("IN-17") | |
| 34336 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34337 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34338 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34339 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34340 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34341 | PORT_MODIFY("IN-18") | |
| 34342 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34343 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34344 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34345 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34346 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34347 | PORT_MODIFY("IN-19") | |
| 34348 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34349 | PORT_MODIFY("IN-20") | |
| 34350 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34351 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34352 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34353 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34354 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34292 | PORT_INCLUDE( sc4_base ) | |
| 34293 | PORT_MODIFY("IN-1") | |
| 34294 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34295 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34296 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34297 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34298 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 34299 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34300 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34301 | PORT_MODIFY("IN-2") | |
| 34302 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34303 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 34304 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34305 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34306 | PORT_MODIFY("IN-3") | |
| 34307 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34308 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34309 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34310 | PORT_MODIFY("IN-5") | |
| 34311 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34312 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34313 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34314 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34315 | PORT_MODIFY("IN-6") | |
| 34316 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34317 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34318 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34319 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34320 | PORT_MODIFY("IN-8") | |
| 34321 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("dead") | |
| 34322 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo rig") | |
| 34323 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi rig") | |
| 34324 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo lef") | |
| 34325 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi lef") | |
| 34326 | PORT_MODIFY("IN-9") | |
| 34327 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("streak") | |
| 34328 | PORT_MODIFY("IN-16") | |
| 34329 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34330 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34331 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34332 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34333 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34334 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34335 | PORT_MODIFY("IN-17") | |
| 34336 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34337 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34338 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34339 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34340 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34341 | PORT_MODIFY("IN-18") | |
| 34342 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34343 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34344 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34345 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34346 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34347 | PORT_MODIFY("IN-19") | |
| 34348 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34349 | PORT_MODIFY("IN-20") | |
| 34350 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34351 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34352 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34353 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34354 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34355 | 34355 | INPUT_PORTS_END |
| 34356 | 34356 | |
| 34357 | 34357 | // PR1930 AWP BUTCH CASHIDY AND THE SUNDANCE QUID S4 PR1910 B C AND THE S Q SOUNDS11 BUTCH N SUNDANCE S.SITE |
| r31373 | r31374 | |
| 34382 | 34382 | } |
| 34383 | 34383 | |
| 34384 | 34384 | INPUT_PORTS_START( sc4cabin ) // this structure is generated |
| 34385 | PORT_INCLUDE( sc4_base ) | |
| 34386 | PORT_MODIFY("IN-1") | |
| 34387 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 34388 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 34389 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 34390 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 34391 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 34392 | PORT_MODIFY("IN-2") | |
| 34393 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 34394 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 34395 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34396 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 34397 | PORT_MODIFY("IN-8") | |
| 34398 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 34399 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 34400 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 34401 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 34402 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 34403 | PORT_MODIFY("IN-9") | |
| 34404 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 34405 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 34406 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 34407 | PORT_MODIFY("IN-16") | |
| 34408 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34409 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34410 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34411 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34412 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34413 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 34414 | PORT_MODIFY("IN-17") | |
| 34415 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34416 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34417 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34418 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34419 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34420 | PORT_MODIFY("IN-18") | |
| 34421 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34422 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34423 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34424 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34425 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34426 | PORT_MODIFY("IN-19") | |
| 34427 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34428 | PORT_MODIFY("IN-20") | |
| 34429 | // 0x0001 - "test" // standard input (motherboard) | |
| 34430 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 34431 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 34432 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 34433 | // 0x0010 - "deflt" // standard input (expected here) | |
| 34385 | PORT_INCLUDE( sc4_base ) | |
| 34386 | PORT_MODIFY("IN-1") | |
| 34387 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 34388 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 34389 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 34390 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 34391 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 34392 | PORT_MODIFY("IN-2") | |
| 34393 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 34394 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 34395 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34396 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 34397 | PORT_MODIFY("IN-8") | |
| 34398 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 34399 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 34400 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 34401 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 34402 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 34403 | PORT_MODIFY("IN-9") | |
| 34404 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 34405 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 34406 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 34407 | PORT_MODIFY("IN-16") | |
| 34408 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34409 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34410 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34411 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34412 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34413 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 34414 | PORT_MODIFY("IN-17") | |
| 34415 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34416 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34417 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34418 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34419 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34420 | PORT_MODIFY("IN-18") | |
| 34421 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34422 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34423 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34424 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34425 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34426 | PORT_MODIFY("IN-19") | |
| 34427 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34428 | PORT_MODIFY("IN-20") | |
| 34429 | // 0x0001 - "test" // standard input (motherboard) | |
| 34430 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 34431 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 34432 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 34433 | // 0x0010 - "deflt" // standard input (expected here) | |
| 34434 | 34434 | INPUT_PORTS_END |
| 34435 | 34435 | |
| 34436 | 34436 | // PR2209 CABIN FEVER CABF SOUNDS CABIN FEVER |
| r31373 | r31374 | |
| 34466 | 34466 | } |
| 34467 | 34467 | |
| 34468 | 34468 | INPUT_PORTS_START( sc4cari ) // this structure is generated |
| 34469 | PORT_INCLUDE( sc4_base ) | |
| 34470 | PORT_MODIFY("IN-1") | |
| 34471 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh 1") | |
| 34472 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh 2") | |
| 34473 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh 3") | |
| 34474 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh 4") | |
| 34475 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh 4") | |
| 34476 | // 0x0100 - "hoplw" // known extended input, usually 'hopper fit' | |
| 34477 | PORT_MODIFY("IN-2") | |
| 34478 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh 3") | |
| 34479 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh 2") | |
| 34480 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh 1") | |
| 34481 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 34482 | PORT_MODIFY("IN-8") | |
| 34483 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 34484 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 34485 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 34486 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 34487 | PORT_MODIFY("IN-9") | |
| 34488 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("c hi") | |
| 34489 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("b hi") | |
| 34490 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("f hi") | |
| 34491 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("take") | |
| 34492 | PORT_MODIFY("IN-16") | |
| 34493 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34494 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34495 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34496 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34497 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34498 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 34499 | PORT_MODIFY("IN-17") | |
| 34500 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34501 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34502 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34503 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34504 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34505 | PORT_MODIFY("IN-18") | |
| 34506 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34507 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34508 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34509 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34510 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34511 | PORT_MODIFY("IN-19") | |
| 34512 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34513 | PORT_MODIFY("IN-20") | |
| 34514 | // 0x0001 - "test" // standard input (motherboard) | |
| 34515 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 34516 | // 0x0004 - "topdr" // standard input (expected here) | |
| 34517 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 34518 | // 0x0010 - "deflt" // standard input (expected here) | |
| 34469 | PORT_INCLUDE( sc4_base ) | |
| 34470 | PORT_MODIFY("IN-1") | |
| 34471 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh 1") | |
| 34472 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh 2") | |
| 34473 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh 3") | |
| 34474 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh 4") | |
| 34475 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh 4") | |
| 34476 | // 0x0100 - "hoplw" // known extended input, usually 'hopper fit' | |
| 34477 | PORT_MODIFY("IN-2") | |
| 34478 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh 3") | |
| 34479 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh 2") | |
| 34480 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh 1") | |
| 34481 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 34482 | PORT_MODIFY("IN-8") | |
| 34483 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 34484 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 34485 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 34486 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 34487 | PORT_MODIFY("IN-9") | |
| 34488 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("c hi") | |
| 34489 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("b hi") | |
| 34490 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("f hi") | |
| 34491 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("take") | |
| 34492 | PORT_MODIFY("IN-16") | |
| 34493 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34494 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34495 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34496 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34497 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34498 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 34499 | PORT_MODIFY("IN-17") | |
| 34500 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34501 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34502 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34503 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34504 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34505 | PORT_MODIFY("IN-18") | |
| 34506 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34507 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34508 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34509 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34510 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34511 | PORT_MODIFY("IN-19") | |
| 34512 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34513 | PORT_MODIFY("IN-20") | |
| 34514 | // 0x0001 - "test" // standard input (motherboard) | |
| 34515 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 34516 | // 0x0004 - "topdr" // standard input (expected here) | |
| 34517 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 34518 | // 0x0010 - "deflt" // standard input (expected here) | |
| 34519 | 34519 | INPUT_PORTS_END |
| 34520 | 34520 | |
| 34521 | 34521 | // PR2326 CARIBBEAN CASH CABC SOUNDS CARIBBEAN CASH |
| r31373 | r31374 | |
| 34544 | 34544 | } |
| 34545 | 34545 | |
| 34546 | 34546 | INPUT_PORTS_START( sc4cariq ) // this structure is generated |
| 34547 | PORT_INCLUDE( sc4_base ) | |
| 34548 | PORT_MODIFY("IN-1") | |
| 34549 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34550 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 34551 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 34552 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 34553 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 34554 | PORT_MODIFY("IN-2") | |
| 34555 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collec") | |
| 34556 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchan") | |
| 34557 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34558 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34559 | PORT_MODIFY("IN-4") | |
| 34560 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 34561 | PORT_MODIFY("IN-8") | |
| 34562 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 34563 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 34564 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 34565 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 34566 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("qps") | |
| 34567 | PORT_MODIFY("IN-16") | |
| 34568 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34569 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 34570 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 34571 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 34572 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 34573 | PORT_MODIFY("IN-17") | |
| 34574 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34575 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 34576 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 34577 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 34578 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 34579 | PORT_MODIFY("IN-18") | |
| 34580 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34581 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 34582 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 34583 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 34584 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 34585 | PORT_MODIFY("IN-19") | |
| 34586 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34587 | PORT_MODIFY("IN-20") | |
| 34588 | // 0x0001 - "green" // standard input (motherboard) | |
| 34589 | // 0x0002 - "pay dr" // standard input (expected here) | |
| 34590 | // 0x0004 - "bot dr" // standard input (expected here) | |
| 34591 | // 0x0008 - "dump" // standard input (expected here) | |
| 34592 | // 0x0010 - "top dr" // standard input (expected here) | |
| 34547 | PORT_INCLUDE( sc4_base ) | |
| 34548 | PORT_MODIFY("IN-1") | |
| 34549 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34550 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 34551 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 34552 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 34553 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 34554 | PORT_MODIFY("IN-2") | |
| 34555 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("collec") | |
| 34556 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchan") | |
| 34557 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34558 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34559 | PORT_MODIFY("IN-4") | |
| 34560 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 34561 | PORT_MODIFY("IN-8") | |
| 34562 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 34563 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 34564 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk fet") | |
| 34565 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 34566 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("qps") | |
| 34567 | PORT_MODIFY("IN-16") | |
| 34568 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34569 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 34570 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 34571 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 34572 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 34573 | PORT_MODIFY("IN-17") | |
| 34574 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34575 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 34576 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 34577 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 34578 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 34579 | PORT_MODIFY("IN-18") | |
| 34580 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34581 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 34582 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 34583 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 34584 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 34585 | PORT_MODIFY("IN-19") | |
| 34586 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 34587 | PORT_MODIFY("IN-20") | |
| 34588 | // 0x0001 - "green" // standard input (motherboard) | |
| 34589 | // 0x0002 - "pay dr" // standard input (expected here) | |
| 34590 | // 0x0004 - "bot dr" // standard input (expected here) | |
| 34591 | // 0x0008 - "dump" // standard input (expected here) | |
| 34592 | // 0x0010 - "top dr" // standard input (expected here) | |
| 34593 | 34593 | INPUT_PORTS_END |
| 34594 | 34594 | |
| 34595 | 34595 | // these lack identification strings, and it's not the same game as above |
| r31373 | r31374 | |
| 34619 | 34619 | } |
| 34620 | 34620 | |
| 34621 | 34621 | INPUT_PORTS_START( sc4cblas ) // this structure is generated |
| 34622 | PORT_INCLUDE( sc4_base ) | |
| 34623 | PORT_MODIFY("IN-1") | |
| 34624 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34625 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("holda") | |
| 34626 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("holdb") | |
| 34627 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("holdc") | |
| 34628 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 34629 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34630 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34631 | PORT_MODIFY("IN-2") | |
| 34632 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34633 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34634 | PORT_MODIFY("IN-3") | |
| 34635 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34636 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34637 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34638 | PORT_MODIFY("IN-5") | |
| 34639 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34640 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34641 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34642 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34643 | PORT_MODIFY("IN-6") | |
| 34644 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34645 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34646 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34647 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34648 | PORT_MODIFY("IN-8") | |
| 34649 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take f") | |
| 34650 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("take c") | |
| 34651 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take b") | |
| 34652 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take n") | |
| 34653 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("take s") | |
| 34654 | PORT_MODIFY("IN-9") | |
| 34655 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("take b") | |
| 34656 | PORT_MODIFY("IN-16") | |
| 34657 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34658 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34659 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34660 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34661 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34662 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34663 | PORT_MODIFY("IN-17") | |
| 34664 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34665 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34666 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34667 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34668 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 34669 | PORT_MODIFY("IN-18") | |
| 34670 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 34671 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 34672 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 34673 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 34674 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 34675 | PORT_MODIFY("IN-19") | |
| 34676 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 34677 | PORT_MODIFY("IN-20") | |
| 34678 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34679 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34680 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34681 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34682 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34622 | PORT_INCLUDE( sc4_base ) | |
| 34623 | PORT_MODIFY("IN-1") | |
| 34624 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34625 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("holda") | |
| 34626 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("holdb") | |
| 34627 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("holdc") | |
| 34628 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 34629 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34630 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34631 | PORT_MODIFY("IN-2") | |
| 34632 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34633 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34634 | PORT_MODIFY("IN-3") | |
| 34635 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34636 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34637 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34638 | PORT_MODIFY("IN-5") | |
| 34639 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34640 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34641 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34642 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34643 | PORT_MODIFY("IN-6") | |
| 34644 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34645 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34646 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34647 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34648 | PORT_MODIFY("IN-8") | |
| 34649 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take f") | |
| 34650 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("take c") | |
| 34651 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take b") | |
| 34652 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take n") | |
| 34653 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("take s") | |
| 34654 | PORT_MODIFY("IN-9") | |
| 34655 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("take b") | |
| 34656 | PORT_MODIFY("IN-16") | |
| 34657 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34658 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34659 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34660 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34661 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34662 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34663 | PORT_MODIFY("IN-17") | |
| 34664 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34665 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34666 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34667 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34668 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 34669 | PORT_MODIFY("IN-18") | |
| 34670 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 34671 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 34672 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 34673 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 34674 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 34675 | PORT_MODIFY("IN-19") | |
| 34676 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 34677 | PORT_MODIFY("IN-20") | |
| 34678 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34679 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34680 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34681 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34682 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34683 | 34683 | INPUT_PORTS_END |
| 34684 | 34684 | |
| 34685 | 34685 | // PR1683 BLAS14 |
| r31373 | r31374 | |
| 34704 | 34704 | } |
| 34705 | 34705 | |
| 34706 | 34706 | INPUT_PORTS_START( sc4casxt ) // this structure is generated |
| 34707 | PORT_INCLUDE( sc4_base ) | |
| 34708 | PORT_MODIFY("IN-1") | |
| 34709 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 34710 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34711 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34712 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34713 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 34714 | PORT_MODIFY("IN-2") | |
| 34715 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 34716 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 34717 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34718 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34719 | PORT_MODIFY("IN-3") | |
| 34720 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34721 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34722 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34723 | PORT_MODIFY("IN-4") | |
| 34724 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 34725 | PORT_MODIFY("IN-5") | |
| 34726 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34727 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34728 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34729 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34730 | PORT_MODIFY("IN-6") | |
| 34731 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34732 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34733 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34734 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34735 | PORT_MODIFY("IN-16") | |
| 34736 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34737 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34738 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34739 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34740 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34741 | PORT_MODIFY("IN-17") | |
| 34742 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34743 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34744 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34745 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34746 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 34747 | PORT_MODIFY("IN-18") | |
| 34748 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 34749 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 34750 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 34751 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 34752 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 34753 | PORT_MODIFY("IN-19") | |
| 34754 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 34755 | PORT_MODIFY("IN-20") | |
| 34756 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 34757 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 34758 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34759 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 34760 | // 0x0010 - "serdor" // standard input (expected here) | |
| 34707 | PORT_INCLUDE( sc4_base ) | |
| 34708 | PORT_MODIFY("IN-1") | |
| 34709 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 34710 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34711 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34712 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34713 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 34714 | PORT_MODIFY("IN-2") | |
| 34715 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 34716 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 34717 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34718 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34719 | PORT_MODIFY("IN-3") | |
| 34720 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34721 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34722 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34723 | PORT_MODIFY("IN-4") | |
| 34724 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 34725 | PORT_MODIFY("IN-5") | |
| 34726 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34727 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34728 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34729 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34730 | PORT_MODIFY("IN-6") | |
| 34731 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34732 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34733 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34734 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34735 | PORT_MODIFY("IN-16") | |
| 34736 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34737 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34738 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34739 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34740 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34741 | PORT_MODIFY("IN-17") | |
| 34742 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34743 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34744 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34745 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34746 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 34747 | PORT_MODIFY("IN-18") | |
| 34748 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 34749 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 34750 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 34751 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 34752 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 34753 | PORT_MODIFY("IN-19") | |
| 34754 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 34755 | PORT_MODIFY("IN-20") | |
| 34756 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 34757 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 34758 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34759 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 34760 | // 0x0010 - "serdor" // standard input (expected here) | |
| 34761 | 34761 | INPUT_PORTS_END |
| 34762 | 34762 | |
| 34763 | 34763 | // PR2338 XTRAVAGANZA XTRV SOUNDS XTRAVAGANZA |
| r31373 | r31374 | |
| 34785 | 34785 | } |
| 34786 | 34786 | |
| 34787 | 34787 | INPUT_PORTS_START( sc4chavi ) // this structure is generated |
| 34788 | PORT_INCLUDE( sc4_base ) | |
| 34789 | PORT_MODIFY("IN-1") | |
| 34790 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 34791 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34792 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34793 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34794 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 34795 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34796 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34797 | PORT_MODIFY("IN-2") | |
| 34798 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34799 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 34800 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34801 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34802 | PORT_MODIFY("IN-5") | |
| 34803 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34804 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34805 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34806 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34807 | PORT_MODIFY("IN-6") | |
| 34808 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34809 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34810 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34811 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34812 | PORT_MODIFY("IN-8") | |
| 34813 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("chav i") | |
| 34814 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("g bonu") | |
| 34815 | PORT_MODIFY("IN-16") | |
| 34816 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34817 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34818 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34819 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34820 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34821 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34822 | PORT_MODIFY("IN-17") | |
| 34823 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34824 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34825 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34826 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34827 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34828 | PORT_MODIFY("IN-18") | |
| 34829 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34830 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34831 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34832 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34833 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34834 | PORT_MODIFY("IN-19") | |
| 34835 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34836 | PORT_MODIFY("IN-20") | |
| 34837 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34838 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34839 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34840 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34841 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34788 | PORT_INCLUDE( sc4_base ) | |
| 34789 | PORT_MODIFY("IN-1") | |
| 34790 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 34791 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 34792 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 34793 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 34794 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 34795 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 34796 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34797 | PORT_MODIFY("IN-2") | |
| 34798 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34799 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 34800 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34801 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34802 | PORT_MODIFY("IN-5") | |
| 34803 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34804 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34805 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34806 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34807 | PORT_MODIFY("IN-6") | |
| 34808 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34809 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34810 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34811 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34812 | PORT_MODIFY("IN-8") | |
| 34813 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("chav i") | |
| 34814 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("g bonu") | |
| 34815 | PORT_MODIFY("IN-16") | |
| 34816 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 34817 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 34818 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 34819 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 34820 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 34821 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34822 | PORT_MODIFY("IN-17") | |
| 34823 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 34824 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 34825 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 34826 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 34827 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34828 | PORT_MODIFY("IN-18") | |
| 34829 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34830 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34831 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34832 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34833 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34834 | PORT_MODIFY("IN-19") | |
| 34835 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34836 | PORT_MODIFY("IN-20") | |
| 34837 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 34838 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 34839 | // 0x0004 - "serdor" // standard input (expected here) | |
| 34840 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 34841 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 34842 | 34842 | INPUT_PORTS_END |
| 34843 | 34843 | |
| 34844 | 34844 | // PR1731 AWP CHAV IT SCORP4 PR1711 CHAV IT SOUNDS11 CHAV IT S.SITE |
| r31373 | r31374 | |
| 34868 | 34868 | } |
| 34869 | 34869 | |
| 34870 | 34870 | INPUT_PORTS_START( sc4chavy ) // this structure is generated |
| 34871 | PORT_INCLUDE( sc4_base ) | |
| 34872 | PORT_MODIFY("IN-1") | |
| 34873 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 34874 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 34875 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 34876 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 34877 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 34878 | // 0x0100 - "hoplw" // known extended input, usually 'hopper fit' | |
| 34879 | PORT_MODIFY("IN-2") | |
| 34880 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 34881 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 34882 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34883 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 34884 | PORT_MODIFY("IN-8") | |
| 34885 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("pink") | |
| 34886 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("yell") | |
| 34887 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 34888 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nuds") | |
| 34889 | PORT_MODIFY("IN-16") | |
| 34890 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34891 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34892 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34893 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34894 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34895 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 34896 | PORT_MODIFY("IN-17") | |
| 34897 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34898 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34899 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34900 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34901 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34902 | PORT_MODIFY("IN-18") | |
| 34903 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34904 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34905 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34906 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34907 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34908 | PORT_MODIFY("IN-19") | |
| 34909 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34910 | PORT_MODIFY("IN-20") | |
| 34911 | // 0x0001 - "test" // standard input (motherboard) | |
| 34912 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 34913 | // 0x0004 - "topdr" // standard input (expected here) | |
| 34914 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 34915 | // 0x0010 - "deflt" // standard input (expected here) | |
| 34871 | PORT_INCLUDE( sc4_base ) | |
| 34872 | PORT_MODIFY("IN-1") | |
| 34873 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 34874 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 34875 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 34876 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 34877 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 34878 | // 0x0100 - "hoplw" // known extended input, usually 'hopper fit' | |
| 34879 | PORT_MODIFY("IN-2") | |
| 34880 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 34881 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 34882 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34883 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 34884 | PORT_MODIFY("IN-8") | |
| 34885 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("pink") | |
| 34886 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("yell") | |
| 34887 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 34888 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nuds") | |
| 34889 | PORT_MODIFY("IN-16") | |
| 34890 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34891 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34892 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34893 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34894 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34895 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 34896 | PORT_MODIFY("IN-17") | |
| 34897 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34898 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34899 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34900 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34901 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 34902 | PORT_MODIFY("IN-18") | |
| 34903 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 34904 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 34905 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 34906 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 34907 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 34908 | PORT_MODIFY("IN-19") | |
| 34909 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 34910 | PORT_MODIFY("IN-20") | |
| 34911 | // 0x0001 - "test" // standard input (motherboard) | |
| 34912 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 34913 | // 0x0004 - "topdr" // standard input (expected here) | |
| 34914 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 34915 | // 0x0010 - "deflt" // standard input (expected here) | |
| 34916 | 34916 | INPUT_PORTS_END |
| 34917 | 34917 | |
| 34918 | 34918 | // PR2305 CHAVVY CHASE CHVY SOUNDS |
| r31373 | r31374 | |
| 34943 | 34943 | } |
| 34944 | 34944 | |
| 34945 | 34945 | INPUT_PORTS_START( sc4cmani ) // this structure is generated |
| 34946 | PORT_INCLUDE( sc4_base ) | |
| 34947 | PORT_MODIFY("IN-1") | |
| 34948 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34949 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 34950 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 34951 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 34952 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 34953 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34954 | PORT_MODIFY("IN-2") | |
| 34955 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34956 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34957 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34958 | PORT_MODIFY("IN-3") | |
| 34959 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34960 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34961 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34962 | PORT_MODIFY("IN-5") | |
| 34963 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34964 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34965 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34966 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34967 | PORT_MODIFY("IN-6") | |
| 34968 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34969 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34970 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34971 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34972 | PORT_MODIFY("IN-8") | |
| 34973 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk sht") | |
| 34974 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blu lo") | |
| 34975 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("red lo") | |
| 34976 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("gre lo") | |
| 34977 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk stp") | |
| 34978 | PORT_MODIFY("IN-9") | |
| 34979 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("col bl") | |
| 34980 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("blu hi") | |
| 34981 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("red hi") | |
| 34982 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("gre hi") | |
| 34983 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk nud") | |
| 34984 | PORT_MODIFY("IN-10") | |
| 34985 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("col rd") | |
| 34986 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("col gr") | |
| 34987 | PORT_MODIFY("IN-16") | |
| 34988 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34989 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34990 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34991 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34992 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34993 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34994 | PORT_MODIFY("IN-17") | |
| 34995 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34996 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34997 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34998 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34999 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35000 | PORT_MODIFY("IN-18") | |
| 35001 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35002 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35003 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35004 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35005 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35006 | PORT_MODIFY("IN-19") | |
| 35007 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35008 | PORT_MODIFY("IN-20") | |
| 35009 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35010 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35011 | // 0x0004 - "topdor" // standard input (expected here) | |
| 35012 | // 0x0008 - "botdor" // standard input (expected here) | |
| 35013 | // 0x0010 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 34946 | PORT_INCLUDE( sc4_base ) | |
| 34947 | PORT_MODIFY("IN-1") | |
| 34948 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 34949 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 34950 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 34951 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 34952 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 34953 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 34954 | PORT_MODIFY("IN-2") | |
| 34955 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 34956 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 34957 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 34958 | PORT_MODIFY("IN-3") | |
| 34959 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 34960 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 34961 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 34962 | PORT_MODIFY("IN-5") | |
| 34963 | // 0x0001 - "priz4" // standard input (expected here) | |
| 34964 | // 0x0002 - "priz3" // standard input (expected here) | |
| 34965 | // 0x0004 - "priz2" // standard input (expected here) | |
| 34966 | // 0x0008 - "priz1" // standard input (expected here) | |
| 34967 | PORT_MODIFY("IN-6") | |
| 34968 | // 0x0001 - "perc1" // standard input (expected here) | |
| 34969 | // 0x0002 - "perc2" // standard input (expected here) | |
| 34970 | // 0x0004 - "perc3" // standard input (expected here) | |
| 34971 | // 0x0008 - "perc4" // standard input (expected here) | |
| 34972 | PORT_MODIFY("IN-8") | |
| 34973 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk sht") | |
| 34974 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blu lo") | |
| 34975 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("red lo") | |
| 34976 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("gre lo") | |
| 34977 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk stp") | |
| 34978 | PORT_MODIFY("IN-9") | |
| 34979 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("col bl") | |
| 34980 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("blu hi") | |
| 34981 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("red hi") | |
| 34982 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("gre hi") | |
| 34983 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("tk nud") | |
| 34984 | PORT_MODIFY("IN-10") | |
| 34985 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("col rd") | |
| 34986 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_1 ) PORT_NAME("col gr") | |
| 34987 | PORT_MODIFY("IN-16") | |
| 34988 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 34989 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 34990 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 34991 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 34992 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 34993 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 34994 | PORT_MODIFY("IN-17") | |
| 34995 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 34996 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 34997 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 34998 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 34999 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35000 | PORT_MODIFY("IN-18") | |
| 35001 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35002 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35003 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35004 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35005 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35006 | PORT_MODIFY("IN-19") | |
| 35007 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35008 | PORT_MODIFY("IN-20") | |
| 35009 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35010 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35011 | // 0x0004 - "topdor" // standard input (expected here) | |
| 35012 | // 0x0008 - "botdor" // standard input (expected here) | |
| 35013 | // 0x0010 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 35014 | 35014 | INPUT_PORTS_END |
| 35015 | 35015 | |
| 35016 | 35016 | // PR1308 COLOUR MANIA PR1308 COLOUR MAN SOUNDS11 |
| r31373 | r31374 | |
| 35035 | 35035 | } |
| 35036 | 35036 | |
| 35037 | 35037 | INPUT_PORTS_START( sc4ctl ) // this structure is generated |
| 35038 | PORT_INCLUDE( sc4_base ) | |
| 35039 | PORT_MODIFY("IN-1") | |
| 35040 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35041 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35042 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35043 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35044 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 35045 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35046 | PORT_MODIFY("IN-2") | |
| 35047 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 35048 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35049 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35050 | PORT_MODIFY("IN-3") | |
| 35051 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35052 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35053 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35054 | PORT_MODIFY("IN-4") | |
| 35055 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 35056 | PORT_MODIFY("IN-5") | |
| 35057 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35058 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35059 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35060 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35061 | PORT_MODIFY("IN-6") | |
| 35062 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35063 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35064 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35065 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35066 | PORT_MODIFY("IN-8") | |
| 35067 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 35068 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 35069 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 35070 | PORT_MODIFY("IN-16") | |
| 35071 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35072 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35073 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35074 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35075 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35076 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 35077 | PORT_MODIFY("IN-17") | |
| 35078 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35079 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35080 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35081 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35082 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35083 | PORT_MODIFY("IN-18") | |
| 35084 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35085 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35086 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35087 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35088 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35089 | PORT_MODIFY("IN-19") | |
| 35090 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35091 | PORT_MODIFY("IN-20") | |
| 35092 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35093 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35094 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35095 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35096 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35038 | PORT_INCLUDE( sc4_base ) | |
| 35039 | PORT_MODIFY("IN-1") | |
| 35040 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35041 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35042 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35043 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35044 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 35045 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35046 | PORT_MODIFY("IN-2") | |
| 35047 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 35048 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35049 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35050 | PORT_MODIFY("IN-3") | |
| 35051 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35052 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35053 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35054 | PORT_MODIFY("IN-4") | |
| 35055 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 35056 | PORT_MODIFY("IN-5") | |
| 35057 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35058 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35059 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35060 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35061 | PORT_MODIFY("IN-6") | |
| 35062 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35063 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35064 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35065 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35066 | PORT_MODIFY("IN-8") | |
| 35067 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 35068 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 35069 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 35070 | PORT_MODIFY("IN-16") | |
| 35071 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35072 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35073 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35074 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35075 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35076 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 35077 | PORT_MODIFY("IN-17") | |
| 35078 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35079 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35080 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35081 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35082 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35083 | PORT_MODIFY("IN-18") | |
| 35084 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35085 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35086 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35087 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35088 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35089 | PORT_MODIFY("IN-19") | |
| 35090 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35091 | PORT_MODIFY("IN-20") | |
| 35092 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35093 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35094 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35095 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35096 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35097 | 35097 | INPUT_PORTS_END |
| 35098 | 35098 | |
| 35099 | 35099 | |
| r31373 | r31374 | |
| 35107 | 35107 | |
| 35108 | 35108 | |
| 35109 | 35109 | INPUT_PORTS_START( sc4crsc ) // this structure is generated |
| 35110 | PORT_INCLUDE( sc4_base ) | |
| 35111 | PORT_MODIFY("IN-1") | |
| 35112 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 35113 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35114 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35115 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35116 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("safe c") | |
| 35117 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35118 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35119 | PORT_MODIFY("IN-2") | |
| 35120 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 35121 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 35122 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35123 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35124 | PORT_MODIFY("IN-3") | |
| 35125 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35126 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35127 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35128 | PORT_MODIFY("IN-5") | |
| 35129 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35130 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35131 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35132 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35133 | PORT_MODIFY("IN-6") | |
| 35134 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35135 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35136 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35137 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35138 | PORT_MODIFY("IN-8") | |
| 35139 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h or m") | |
| 35140 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("leave") | |
| 35141 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("takeit") | |
| 35142 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("streak") | |
| 35143 | PORT_MODIFY("IN-16") | |
| 35144 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35145 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35146 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35147 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35148 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35149 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35150 | PORT_MODIFY("IN-17") | |
| 35151 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35152 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35153 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35154 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35155 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35156 | PORT_MODIFY("IN-18") | |
| 35157 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35158 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35159 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35160 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35161 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35162 | PORT_MODIFY("IN-19") | |
| 35163 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35164 | PORT_MODIFY("IN-20") | |
| 35165 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35166 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35167 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35168 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35169 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35110 | PORT_INCLUDE( sc4_base ) | |
| 35111 | PORT_MODIFY("IN-1") | |
| 35112 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 35113 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35114 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35115 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35116 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("safe c") | |
| 35117 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35118 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35119 | PORT_MODIFY("IN-2") | |
| 35120 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 35121 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 35122 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35123 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35124 | PORT_MODIFY("IN-3") | |
| 35125 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35126 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35127 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35128 | PORT_MODIFY("IN-5") | |
| 35129 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35130 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35131 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35132 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35133 | PORT_MODIFY("IN-6") | |
| 35134 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35135 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35136 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35137 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35138 | PORT_MODIFY("IN-8") | |
| 35139 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h or m") | |
| 35140 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("leave") | |
| 35141 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("takeit") | |
| 35142 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("streak") | |
| 35143 | PORT_MODIFY("IN-16") | |
| 35144 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35145 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35146 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35147 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35148 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35149 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35150 | PORT_MODIFY("IN-17") | |
| 35151 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35152 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35153 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35154 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35155 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35156 | PORT_MODIFY("IN-18") | |
| 35157 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35158 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35159 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35160 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35161 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35162 | PORT_MODIFY("IN-19") | |
| 35163 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35164 | PORT_MODIFY("IN-20") | |
| 35165 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35166 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35167 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35168 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35169 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35170 | 35170 | INPUT_PORTS_END |
| 35171 | 35171 | |
| 35172 | 35172 | // PR3035 AWP COPS AND ROBBERS SAFE CRACKER S4 PR3005 SAFE CRACKER SOUNDS11 SAFE CRACKER S.SITE |
| r31373 | r31374 | |
| 35197 | 35197 | } |
| 35198 | 35198 | |
| 35199 | 35199 | INPUT_PORTS_START( sc4coro ) // this structure is generated |
| 35200 | PORT_INCLUDE( sc4_base ) | |
| 35201 | PORT_MODIFY("IN-1") | |
| 35202 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 35203 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 35204 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 35205 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 35206 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 35207 | PORT_MODIFY("IN-2") | |
| 35208 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 35209 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 35210 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35211 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35212 | PORT_MODIFY("IN-8") | |
| 35213 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 35214 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 35215 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 35216 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("levl1") | |
| 35217 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("levl2") | |
| 35218 | PORT_MODIFY("IN-9") | |
| 35219 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("levl3") | |
| 35220 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("levl4") | |
| 35221 | PORT_MODIFY("IN-16") | |
| 35222 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35223 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35224 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35225 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35226 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35227 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35228 | PORT_MODIFY("IN-17") | |
| 35229 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35230 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35231 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35232 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35233 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35234 | PORT_MODIFY("IN-18") | |
| 35235 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35236 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35237 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35238 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35239 | // 0x0010 - "dil 15 OR deflt" // standard input (motherboard) | |
| 35240 | PORT_MODIFY("IN-19") | |
| 35241 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35242 | PORT_MODIFY("IN-20") | |
| 35243 | // 0x0001 - "test" // standard input (motherboard) | |
| 35244 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 35245 | // 0x0004 - "topdr" // standard input (expected here) | |
| 35246 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 35247 | // 0x0010 - "hoplow" // standard input (expected here) | |
| 35200 | PORT_INCLUDE( sc4_base ) | |
| 35201 | PORT_MODIFY("IN-1") | |
| 35202 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 35203 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 35204 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 35205 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 35206 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 35207 | PORT_MODIFY("IN-2") | |
| 35208 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 35209 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 35210 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35211 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35212 | PORT_MODIFY("IN-8") | |
| 35213 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 35214 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 35215 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 35216 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("levl1") | |
| 35217 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("levl2") | |
| 35218 | PORT_MODIFY("IN-9") | |
| 35219 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("levl3") | |
| 35220 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("levl4") | |
| 35221 | PORT_MODIFY("IN-16") | |
| 35222 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35223 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35224 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35225 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35226 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35227 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35228 | PORT_MODIFY("IN-17") | |
| 35229 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35230 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35231 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35232 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35233 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35234 | PORT_MODIFY("IN-18") | |
| 35235 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35236 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35237 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35238 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35239 | // 0x0010 - "dil 15 OR deflt" // standard input (motherboard) | |
| 35240 | PORT_MODIFY("IN-19") | |
| 35241 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35242 | PORT_MODIFY("IN-20") | |
| 35243 | // 0x0001 - "test" // standard input (motherboard) | |
| 35244 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 35245 | // 0x0004 - "topdr" // standard input (expected here) | |
| 35246 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 35247 | // 0x0010 - "hoplow" // standard input (expected here) | |
| 35248 | 35248 | INPUT_PORTS_END |
| 35249 | 35249 | |
| 35250 | 35250 | // PR2252 CORONATION ST CORRY SOUNDS CORONATION ST |
| r31373 | r31374 | |
| 35292 | 35292 | } |
| 35293 | 35293 | |
| 35294 | 35294 | INPUT_PORTS_START( sc4coroc ) // this structure is generated |
| 35295 | PORT_INCLUDE( sc4_base ) | |
| 35296 | PORT_MODIFY("IN-1") | |
| 35297 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35298 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 35299 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 35300 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 35301 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 35302 | PORT_MODIFY("IN-2") | |
| 35303 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("blank") | |
| 35304 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 35305 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35306 | PORT_MODIFY("IN-4") | |
| 35307 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 35308 | PORT_MODIFY("IN-16") | |
| 35309 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35310 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35311 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35312 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35313 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35314 | PORT_MODIFY("IN-17") | |
| 35315 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35316 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35317 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35318 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35319 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35320 | PORT_MODIFY("IN-18") | |
| 35321 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35322 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35323 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35324 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35325 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35326 | PORT_MODIFY("IN-19") | |
| 35327 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35328 | PORT_MODIFY("IN-20") | |
| 35329 | // 0x0001 - "test" // standard input (motherboard) | |
| 35330 | // 0x0002 - "botdor OR botdor" // standard input (expected here) | |
| 35331 | // 0x0004 - "topdor OR topdor" // standard input (expected here) | |
| 35332 | // 0x0008 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 35333 | // 0x0010 - "topdor" // standard input (expected here) | |
| 35295 | PORT_INCLUDE( sc4_base ) | |
| 35296 | PORT_MODIFY("IN-1") | |
| 35297 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35298 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 35299 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 35300 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 35301 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 35302 | PORT_MODIFY("IN-2") | |
| 35303 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("blank") | |
| 35304 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 35305 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35306 | PORT_MODIFY("IN-4") | |
| 35307 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 35308 | PORT_MODIFY("IN-16") | |
| 35309 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35310 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35311 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35312 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35313 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35314 | PORT_MODIFY("IN-17") | |
| 35315 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35316 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35317 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35318 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35319 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35320 | PORT_MODIFY("IN-18") | |
| 35321 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35322 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35323 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35324 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35325 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35326 | PORT_MODIFY("IN-19") | |
| 35327 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35328 | PORT_MODIFY("IN-20") | |
| 35329 | // 0x0001 - "test" // standard input (motherboard) | |
| 35330 | // 0x0002 - "botdor OR botdor" // standard input (expected here) | |
| 35331 | // 0x0004 - "topdor OR topdor" // standard input (expected here) | |
| 35332 | // 0x0008 - "hopdmp OR hopdmp" // standard input (expected here) | |
| 35333 | // 0x0010 - "topdor" // standard input (expected here) | |
| 35334 | 35334 | INPUT_PORTS_END |
| 35335 | 35335 | |
| 35336 | 35336 | INPUT_PORTS_START( sc4corod ) // this structure is generated |
| 35337 | PORT_INCLUDE( sc4_base ) | |
| 35338 | PORT_MODIFY("IN-1") | |
| 35339 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR colect") | |
| 35340 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35341 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35342 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35343 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 35344 | PORT_MODIFY("IN-2") | |
| 35345 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 35346 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 35347 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35348 | PORT_MODIFY("IN-3") | |
| 35349 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35350 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35351 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35352 | PORT_MODIFY("IN-4") | |
| 35353 | // 0x0008 - "top up" // known extended(?) input, sometimes 'hop top' | |
| 35354 | PORT_MODIFY("IN-5") | |
| 35355 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35356 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35357 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35358 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35359 | PORT_MODIFY("IN-6") | |
| 35360 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35361 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35362 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35363 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35364 | PORT_MODIFY("IN-16") | |
| 35365 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35366 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35367 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35368 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35369 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35370 | PORT_MODIFY("IN-17") | |
| 35371 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35372 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35373 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35374 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35375 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35376 | PORT_MODIFY("IN-18") | |
| 35377 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35378 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35379 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35380 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35381 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35382 | PORT_MODIFY("IN-19") | |
| 35383 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35384 | PORT_MODIFY("IN-20") | |
| 35385 | // 0x0001 - "test" // standard input (motherboard) | |
| 35386 | // 0x0004 - "cshdor" // standard input (expected here) | |
| 35387 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 35388 | // 0x0010 - "serdor" // standard input (expected here) | |
| 35337 | PORT_INCLUDE( sc4_base ) | |
| 35338 | PORT_MODIFY("IN-1") | |
| 35339 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR colect") | |
| 35340 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35341 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35342 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35343 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 35344 | PORT_MODIFY("IN-2") | |
| 35345 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 35346 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 35347 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35348 | PORT_MODIFY("IN-3") | |
| 35349 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35350 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35351 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35352 | PORT_MODIFY("IN-4") | |
| 35353 | // 0x0008 - "top up" // known extended(?) input, sometimes 'hop top' | |
| 35354 | PORT_MODIFY("IN-5") | |
| 35355 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35356 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35357 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35358 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35359 | PORT_MODIFY("IN-6") | |
| 35360 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35361 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35362 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35363 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35364 | PORT_MODIFY("IN-16") | |
| 35365 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35366 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35367 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35368 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35369 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35370 | PORT_MODIFY("IN-17") | |
| 35371 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35372 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35373 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35374 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35375 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 35376 | PORT_MODIFY("IN-18") | |
| 35377 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 35378 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 35379 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 35380 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 35381 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 35382 | PORT_MODIFY("IN-19") | |
| 35383 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 35384 | PORT_MODIFY("IN-20") | |
| 35385 | // 0x0001 - "test" // standard input (motherboard) | |
| 35386 | // 0x0004 - "cshdor" // standard input (expected here) | |
| 35387 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 35388 | // 0x0010 - "serdor" // standard input (expected here) | |
| 35389 | 35389 | INPUT_PORTS_END |
| 35390 | 35390 | |
| 35391 | 35391 | |
| r31373 | r31374 | |
| 35422 | 35422 | } |
| 35423 | 35423 | |
| 35424 | 35424 | INPUT_PORTS_START( sc4corcl ) // this structure is generated |
| 35425 | PORT_INCLUDE( sc4_base ) | |
| 35426 | PORT_MODIFY("IN-1") | |
| 35427 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 35428 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 35429 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 35430 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 35431 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh5") | |
| 35432 | PORT_MODIFY("IN-2") | |
| 35433 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh4") | |
| 35434 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh3") | |
| 35435 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh2") | |
| 35436 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35437 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("rh1") | |
| 35438 | PORT_MODIFY("IN-3") | |
| 35439 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35440 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35441 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35442 | PORT_MODIFY("IN-4") | |
| 35443 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 35444 | PORT_MODIFY("IN-5") | |
| 35445 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35446 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35447 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35448 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35449 | PORT_MODIFY("IN-8") | |
| 35450 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("havnud") | |
| 35451 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 35452 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("level1") | |
| 35453 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("level2") | |
| 35454 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("level3") | |
| 35455 | PORT_MODIFY("IN-9") | |
| 35456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("level4") | |
| 35457 | PORT_MODIFY("IN-16") | |
| 35458 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35459 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35460 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35461 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35462 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35463 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35464 | PORT_MODIFY("IN-17") | |
| 35465 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35466 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35467 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35468 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35469 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35470 | PORT_MODIFY("IN-18") | |
| 35471 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35472 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35473 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35474 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 35475 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 35476 | PORT_MODIFY("IN-19") | |
| 35477 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 35478 | PORT_MODIFY("IN-20") | |
| 35479 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35480 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35481 | // 0x0004 - "topdor" // standard input (expected here) | |
| 35482 | // 0x0008 - "botdor" // standard input (expected here) | |
| 35483 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35425 | PORT_INCLUDE( sc4_base ) | |
| 35426 | PORT_MODIFY("IN-1") | |
| 35427 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 35428 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 35429 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 35430 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 35431 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh5") | |
| 35432 | PORT_MODIFY("IN-2") | |
| 35433 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh4") | |
| 35434 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh3") | |
| 35435 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh2") | |
| 35436 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35437 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("rh1") | |
| 35438 | PORT_MODIFY("IN-3") | |
| 35439 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35440 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35441 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35442 | PORT_MODIFY("IN-4") | |
| 35443 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 35444 | PORT_MODIFY("IN-5") | |
| 35445 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35446 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35447 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35448 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35449 | PORT_MODIFY("IN-8") | |
| 35450 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("havnud") | |
| 35451 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 35452 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("level1") | |
| 35453 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("level2") | |
| 35454 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("level3") | |
| 35455 | PORT_MODIFY("IN-9") | |
| 35456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("level4") | |
| 35457 | PORT_MODIFY("IN-16") | |
| 35458 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35459 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35460 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35461 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35462 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35463 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35464 | PORT_MODIFY("IN-17") | |
| 35465 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35466 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35467 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35468 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35469 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35470 | PORT_MODIFY("IN-18") | |
| 35471 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35472 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35473 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35474 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 35475 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 35476 | PORT_MODIFY("IN-19") | |
| 35477 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 35478 | PORT_MODIFY("IN-20") | |
| 35479 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35480 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35481 | // 0x0004 - "topdor" // standard input (expected here) | |
| 35482 | // 0x0008 - "botdor" // standard input (expected here) | |
| 35483 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35484 | 35484 | INPUT_PORTS_END |
| 35485 | 35485 | |
| 35486 | 35486 | // PR2383 CLUBCORONATIONSTREET CLUBCORONATIONST CLUB CCORO SOUNDS CLUB CORO ST |
| r31373 | r31374 | |
| 35504 | 35504 | } |
| 35505 | 35505 | |
| 35506 | 35506 | INPUT_PORTS_START( sc4count ) // this structure is generated |
| 35507 | PORT_INCLUDE( sc4_base ) | |
| 35508 | PORT_MODIFY("IN-1") | |
| 35509 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35510 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35511 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35512 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35513 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 35514 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35515 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35516 | PORT_MODIFY("IN-2") | |
| 35517 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 35518 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 35519 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35520 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35521 | PORT_MODIFY("IN-3") | |
| 35522 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35523 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35524 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35525 | PORT_MODIFY("IN-5") | |
| 35526 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35527 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35528 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35529 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35530 | PORT_MODIFY("IN-6") | |
| 35531 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35532 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35533 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35534 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35535 | PORT_MODIFY("IN-8") | |
| 35536 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 35537 | PORT_MODIFY("IN-16") | |
| 35538 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35539 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35540 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35541 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35542 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35543 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35544 | PORT_MODIFY("IN-17") | |
| 35545 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35546 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35547 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35548 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35549 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35550 | PORT_MODIFY("IN-18") | |
| 35551 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35552 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35553 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35554 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35555 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35556 | PORT_MODIFY("IN-19") | |
| 35557 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35558 | PORT_MODIFY("IN-20") | |
| 35559 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35560 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35561 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35562 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35563 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35507 | PORT_INCLUDE( sc4_base ) | |
| 35508 | PORT_MODIFY("IN-1") | |
| 35509 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35510 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35511 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35512 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35513 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 35514 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35515 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35516 | PORT_MODIFY("IN-2") | |
| 35517 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 35518 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 35519 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 35520 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35521 | PORT_MODIFY("IN-3") | |
| 35522 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35523 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35524 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35525 | PORT_MODIFY("IN-5") | |
| 35526 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35527 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35528 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35529 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35530 | PORT_MODIFY("IN-6") | |
| 35531 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35532 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35533 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35534 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35535 | PORT_MODIFY("IN-8") | |
| 35536 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 35537 | PORT_MODIFY("IN-16") | |
| 35538 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35539 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35540 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35541 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35542 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35543 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35544 | PORT_MODIFY("IN-17") | |
| 35545 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35546 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35547 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35548 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35549 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35550 | PORT_MODIFY("IN-18") | |
| 35551 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35552 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35553 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35554 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35555 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35556 | PORT_MODIFY("IN-19") | |
| 35557 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35558 | PORT_MODIFY("IN-20") | |
| 35559 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35560 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35561 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35562 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35563 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35564 | 35564 | INPUT_PORTS_END |
| 35565 | 35565 | |
| 35566 | 35566 | // PR1929 AWP COUNTDOWN S4 PR1909 COUNTDOWN SOUNDS11 COUNTDOWN S.SITE |
| r31373 | r31374 | |
| 35586 | 35586 | } |
| 35587 | 35587 | |
| 35588 | 35588 | INPUT_PORTS_START( sc4dnd ) // this structure is generated |
| 35589 | PORT_INCLUDE( sc4_base ) | |
| 35590 | PORT_MODIFY("IN-1") | |
| 35591 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35592 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35593 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35594 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35595 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 35596 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35597 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35598 | PORT_MODIFY("IN-2") | |
| 35599 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 35600 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("colect") | |
| 35601 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 35602 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35603 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 35604 | PORT_MODIFY("IN-3") | |
| 35605 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35606 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 35607 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 35608 | PORT_MODIFY("IN-5") | |
| 35609 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35610 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35611 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35612 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35613 | PORT_MODIFY("IN-6") | |
| 35614 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35615 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35616 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35617 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35618 | PORT_MODIFY("IN-8") | |
| 35619 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 35620 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("deal") | |
| 35621 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c or b") | |
| 35622 | PORT_MODIFY("IN-16") | |
| 35623 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35624 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35625 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35626 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35627 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35628 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35629 | PORT_MODIFY("IN-17") | |
| 35630 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35631 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35632 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35633 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35634 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35635 | PORT_MODIFY("IN-18") | |
| 35636 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35637 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35638 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35639 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35640 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35641 | PORT_MODIFY("IN-19") | |
| 35642 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35643 | PORT_MODIFY("IN-20") | |
| 35644 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35645 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35646 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35647 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35648 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35589 | PORT_INCLUDE( sc4_base ) | |
| 35590 | PORT_MODIFY("IN-1") | |
| 35591 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35592 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35593 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35594 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35595 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 35596 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35597 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35598 | PORT_MODIFY("IN-2") | |
| 35599 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 35600 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("colect") | |
| 35601 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 35602 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35603 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 35604 | PORT_MODIFY("IN-3") | |
| 35605 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35606 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 35607 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 35608 | PORT_MODIFY("IN-5") | |
| 35609 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35610 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35611 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35612 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35613 | PORT_MODIFY("IN-6") | |
| 35614 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35615 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35616 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35617 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35618 | PORT_MODIFY("IN-8") | |
| 35619 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 35620 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("deal") | |
| 35621 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c or b") | |
| 35622 | PORT_MODIFY("IN-16") | |
| 35623 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35624 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35625 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35626 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35627 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35628 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35629 | PORT_MODIFY("IN-17") | |
| 35630 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35631 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35632 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35633 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35634 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35635 | PORT_MODIFY("IN-18") | |
| 35636 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35637 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35638 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35639 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35640 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35641 | PORT_MODIFY("IN-19") | |
| 35642 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35643 | PORT_MODIFY("IN-20") | |
| 35644 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35645 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35646 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35647 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35648 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35649 | 35649 | INPUT_PORTS_END |
| 35650 | 35650 | INPUT_PORTS_START( sc4dnd25 ) |
| 35651 | 35651 | PORT_INCLUDE( sc4dnd ) |
| r31373 | r31374 | |
| 35698 | 35698 | } |
| 35699 | 35699 | |
| 35700 | 35700 | INPUT_PORTS_START( sc4dndcs ) // this structure is generated |
| 35701 | PORT_INCLUDE( sc4_base ) | |
| 35702 | PORT_MODIFY("IN-1") | |
| 35703 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35704 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35705 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35706 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35707 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 35708 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35709 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35710 | PORT_MODIFY("IN-2") | |
| 35711 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 35712 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("colect") | |
| 35713 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35714 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 35715 | PORT_MODIFY("IN-3") | |
| 35716 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35717 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 35718 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 35719 | PORT_MODIFY("IN-5") | |
| 35720 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35721 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35722 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35723 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35724 | PORT_MODIFY("IN-6") | |
| 35725 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35726 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35727 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35728 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35729 | PORT_MODIFY("IN-8") | |
| 35730 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 35731 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("deal") | |
| 35732 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c or b") | |
| 35733 | PORT_MODIFY("IN-16") | |
| 35734 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35735 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35736 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35737 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35738 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35739 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35740 | PORT_MODIFY("IN-17") | |
| 35741 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35742 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35743 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35744 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35745 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35746 | PORT_MODIFY("IN-18") | |
| 35747 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35748 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35749 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35750 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35751 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35752 | PORT_MODIFY("IN-19") | |
| 35753 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35754 | PORT_MODIFY("IN-20") | |
| 35755 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35756 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35757 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35758 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35759 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35701 | PORT_INCLUDE( sc4_base ) | |
| 35702 | PORT_MODIFY("IN-1") | |
| 35703 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35704 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 35705 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 35706 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 35707 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 35708 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35709 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35710 | PORT_MODIFY("IN-2") | |
| 35711 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 35712 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("colect") | |
| 35713 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35714 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 35715 | PORT_MODIFY("IN-3") | |
| 35716 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35717 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 35718 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 35719 | PORT_MODIFY("IN-5") | |
| 35720 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35721 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35722 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35723 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35724 | PORT_MODIFY("IN-6") | |
| 35725 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35726 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35727 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35728 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35729 | PORT_MODIFY("IN-8") | |
| 35730 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 35731 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("deal") | |
| 35732 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c or b") | |
| 35733 | PORT_MODIFY("IN-16") | |
| 35734 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35735 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35736 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35737 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35738 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35739 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35740 | PORT_MODIFY("IN-17") | |
| 35741 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35742 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35743 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35744 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35745 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35746 | PORT_MODIFY("IN-18") | |
| 35747 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35748 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35749 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35750 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35751 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35752 | PORT_MODIFY("IN-19") | |
| 35753 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35754 | PORT_MODIFY("IN-20") | |
| 35755 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35756 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35757 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35758 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35759 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35760 | 35760 | INPUT_PORTS_END |
| 35761 | 35761 | |
| 35762 | 35762 | INPUT_PORTS_START( sc4dndcs5 ) |
| r31373 | r31374 | |
| 35791 | 35791 | } |
| 35792 | 35792 | |
| 35793 | 35793 | INPUT_PORTS_START( sc4dndbb ) // this structure is generated |
| 35794 | PORT_INCLUDE( sc4_base ) | |
| 35795 | PORT_MODIFY("IN-1") | |
| 35796 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35797 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 35798 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 35799 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 35800 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 35801 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35802 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35803 | PORT_MODIFY("IN-2") | |
| 35804 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 35805 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 35806 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 35807 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35808 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 35809 | PORT_MODIFY("IN-3") | |
| 35810 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35811 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35812 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35813 | PORT_MODIFY("IN-5") | |
| 35814 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35815 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35816 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35817 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35818 | PORT_MODIFY("IN-6") | |
| 35819 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35820 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35821 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35822 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35823 | PORT_MODIFY("IN-8") | |
| 35824 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 35825 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 35826 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 35827 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 35828 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 35829 | PORT_MODIFY("IN-9") | |
| 35830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("pl del") | |
| 35831 | PORT_MODIFY("IN-16") | |
| 35832 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35833 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35834 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35835 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35836 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35837 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35838 | PORT_MODIFY("IN-17") | |
| 35839 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35840 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35841 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35842 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35843 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35844 | PORT_MODIFY("IN-18") | |
| 35845 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35846 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35847 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35848 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35849 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35850 | PORT_MODIFY("IN-19") | |
| 35851 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35852 | PORT_MODIFY("IN-20") | |
| 35853 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35854 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35855 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35856 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35857 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35794 | PORT_INCLUDE( sc4_base ) | |
| 35795 | PORT_MODIFY("IN-1") | |
| 35796 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35797 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 35798 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 35799 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 35800 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 35801 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 35802 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 35803 | PORT_MODIFY("IN-2") | |
| 35804 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 35805 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 35806 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 35807 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35808 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 35809 | PORT_MODIFY("IN-3") | |
| 35810 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35811 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35812 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35813 | PORT_MODIFY("IN-5") | |
| 35814 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35815 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35816 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35817 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35818 | PORT_MODIFY("IN-6") | |
| 35819 | // 0x0001 - "perc1" // standard input (expected here) | |
| 35820 | // 0x0002 - "perc2" // standard input (expected here) | |
| 35821 | // 0x0004 - "perc3" // standard input (expected here) | |
| 35822 | // 0x0008 - "perc4" // standard input (expected here) | |
| 35823 | PORT_MODIFY("IN-8") | |
| 35824 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 35825 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 35826 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 35827 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 35828 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 35829 | PORT_MODIFY("IN-9") | |
| 35830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("pl del") | |
| 35831 | PORT_MODIFY("IN-16") | |
| 35832 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 35833 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 35834 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 35835 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 35836 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 35837 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35838 | PORT_MODIFY("IN-17") | |
| 35839 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 35840 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 35841 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 35842 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 35843 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35844 | PORT_MODIFY("IN-18") | |
| 35845 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35846 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35847 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35848 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 35849 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 35850 | PORT_MODIFY("IN-19") | |
| 35851 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 35852 | PORT_MODIFY("IN-20") | |
| 35853 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35854 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35855 | // 0x0004 - "serdor" // standard input (expected here) | |
| 35856 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 35857 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35858 | 35858 | INPUT_PORTS_END |
| 35859 | 35859 | |
| 35860 | 35860 | INPUT_PORTS_START( sc4dndbb35 ) |
| r31373 | r31374 | |
| 35900 | 35900 | m_reel_setup = sc4dndcl_reel_configs; |
| 35901 | 35901 | } |
| 35902 | 35902 | INPUT_PORTS_START( sc4dndcl ) // this structure is generated |
| 35903 | PORT_INCLUDE( sc4_base ) | |
| 35904 | PORT_MODIFY("IN-1") | |
| 35905 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35906 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 35907 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 35908 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 35909 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 35910 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 35911 | PORT_MODIFY("IN-2") | |
| 35912 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("st/col") | |
| 35913 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch gme") | |
| 35914 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 35915 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35916 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("exchng") | |
| 35917 | PORT_MODIFY("IN-3") | |
| 35918 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35919 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35920 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35921 | PORT_MODIFY("IN-4") | |
| 35922 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 35923 | PORT_MODIFY("IN-5") | |
| 35924 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35925 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35926 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35927 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35928 | PORT_MODIFY("IN-8") | |
| 35929 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("start") | |
| 35930 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("gam ft") | |
| 35931 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 35932 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 35933 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("deal") | |
| 35934 | PORT_MODIFY("IN-16") | |
| 35935 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35936 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35937 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35938 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35939 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35940 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35941 | PORT_MODIFY("IN-17") | |
| 35942 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35943 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35944 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35945 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35946 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35947 | PORT_MODIFY("IN-18") | |
| 35948 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35949 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35950 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35951 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 35952 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 35953 | PORT_MODIFY("IN-19") | |
| 35954 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 35955 | PORT_MODIFY("IN-20") | |
| 35956 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35957 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35958 | // 0x0004 - "topdor" // standard input (expected here) | |
| 35959 | // 0x0008 - "botdor" // standard input (expected here) | |
| 35960 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35903 | PORT_INCLUDE( sc4_base ) | |
| 35904 | PORT_MODIFY("IN-1") | |
| 35905 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 35906 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 35907 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 35908 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 35909 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 35910 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 35911 | PORT_MODIFY("IN-2") | |
| 35912 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("st/col") | |
| 35913 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch gme") | |
| 35914 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 35915 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 35916 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("exchng") | |
| 35917 | PORT_MODIFY("IN-3") | |
| 35918 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 35919 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 35920 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 35921 | PORT_MODIFY("IN-4") | |
| 35922 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 35923 | PORT_MODIFY("IN-5") | |
| 35924 | // 0x0001 - "priz4" // standard input (expected here) | |
| 35925 | // 0x0002 - "priz3" // standard input (expected here) | |
| 35926 | // 0x0004 - "priz2" // standard input (expected here) | |
| 35927 | // 0x0008 - "priz1" // standard input (expected here) | |
| 35928 | PORT_MODIFY("IN-8") | |
| 35929 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("start") | |
| 35930 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("gam ft") | |
| 35931 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 35932 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 35933 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("deal") | |
| 35934 | PORT_MODIFY("IN-16") | |
| 35935 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 35936 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 35937 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 35938 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 35939 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 35940 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 35941 | PORT_MODIFY("IN-17") | |
| 35942 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 35943 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 35944 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 35945 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 35946 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 35947 | PORT_MODIFY("IN-18") | |
| 35948 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 35949 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 35950 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 35951 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 35952 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 35953 | PORT_MODIFY("IN-19") | |
| 35954 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 35955 | PORT_MODIFY("IN-20") | |
| 35956 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 35957 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 35958 | // 0x0004 - "topdor" // standard input (expected here) | |
| 35959 | // 0x0008 - "botdor" // standard input (expected here) | |
| 35960 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 35961 | 35961 | INPUT_PORTS_END |
| 35962 | 35962 | |
| 35963 | 35963 | INPUT_PORTS_START( sc4dndcl250 ) |
| r31373 | r31374 | |
| 36000 | 36000 | m_reel_setup = sc4dnddd_reel_configs; |
| 36001 | 36001 | } |
| 36002 | 36002 | INPUT_PORTS_START( sc4dnddd ) // this structure is generated |
| 36003 | PORT_INCLUDE( sc4_base ) | |
| 36004 | PORT_MODIFY("IN-1") | |
| 36005 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36006 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36007 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36008 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36009 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36010 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36011 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36012 | PORT_MODIFY("IN-2") | |
| 36013 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36014 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36015 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36016 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36017 | PORT_MODIFY("IN-3") | |
| 36018 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36019 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36020 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36021 | PORT_MODIFY("IN-5") | |
| 36022 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36023 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36024 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36025 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36026 | PORT_MODIFY("IN-6") | |
| 36027 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36028 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36029 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36030 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36031 | PORT_MODIFY("IN-8") | |
| 36032 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c or b") | |
| 36033 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("pl don") | |
| 36034 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("no dea") | |
| 36035 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36036 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 36037 | PORT_MODIFY("IN-16") | |
| 36038 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36039 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36040 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36041 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36042 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36043 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36044 | PORT_MODIFY("IN-17") | |
| 36045 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36046 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36047 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36048 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36049 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36050 | PORT_MODIFY("IN-18") | |
| 36051 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36052 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36053 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36054 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36055 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36056 | PORT_MODIFY("IN-19") | |
| 36057 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36058 | PORT_MODIFY("IN-20") | |
| 36059 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36060 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36061 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36062 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36063 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36003 | PORT_INCLUDE( sc4_base ) | |
| 36004 | PORT_MODIFY("IN-1") | |
| 36005 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36006 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36007 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36008 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36009 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36010 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36011 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36012 | PORT_MODIFY("IN-2") | |
| 36013 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36014 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36015 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36016 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36017 | PORT_MODIFY("IN-3") | |
| 36018 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36019 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36020 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36021 | PORT_MODIFY("IN-5") | |
| 36022 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36023 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36024 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36025 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36026 | PORT_MODIFY("IN-6") | |
| 36027 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36028 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36029 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36030 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36031 | PORT_MODIFY("IN-8") | |
| 36032 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c or b") | |
| 36033 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("pl don") | |
| 36034 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("no dea") | |
| 36035 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36036 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 36037 | PORT_MODIFY("IN-16") | |
| 36038 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36039 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36040 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36041 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36042 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36043 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36044 | PORT_MODIFY("IN-17") | |
| 36045 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36046 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36047 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36048 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36049 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36050 | PORT_MODIFY("IN-18") | |
| 36051 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36052 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36053 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36054 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36055 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36056 | PORT_MODIFY("IN-19") | |
| 36057 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36058 | PORT_MODIFY("IN-20") | |
| 36059 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36060 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36061 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36062 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36063 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36064 | 36064 | INPUT_PORTS_END |
| 36065 | 36065 | |
| 36066 | 36066 | INPUT_PORTS_START( sc4dnddd35 ) |
| r31373 | r31374 | |
| 36105 | 36105 | } |
| 36106 | 36106 | |
| 36107 | 36107 | INPUT_PORTS_START( sc4dndhf ) // this structure is generated |
| 36108 | PORT_INCLUDE( sc4_base ) | |
| 36109 | PORT_MODIFY("IN-1") | |
| 36110 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36111 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collct") | |
| 36112 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 36113 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 36114 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 36115 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36116 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36117 | PORT_MODIFY("IN-2") | |
| 36118 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 36119 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36120 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36121 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36122 | PORT_MODIFY("IN-3") | |
| 36123 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36124 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36125 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36126 | PORT_MODIFY("IN-5") | |
| 36127 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36128 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36129 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36130 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36131 | PORT_MODIFY("IN-6") | |
| 36132 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36133 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36134 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36135 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36136 | PORT_MODIFY("IN-8") | |
| 36137 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("autonu") | |
| 36138 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nodeal") | |
| 36139 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("play d") | |
| 36140 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36141 | PORT_MODIFY("IN-16") | |
| 36142 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36143 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36144 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36145 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36146 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36147 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 36148 | PORT_MODIFY("IN-17") | |
| 36149 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36150 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36151 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36152 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36153 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36154 | PORT_MODIFY("IN-18") | |
| 36155 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36156 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36157 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36158 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36159 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36160 | PORT_MODIFY("IN-19") | |
| 36161 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36162 | PORT_MODIFY("IN-20") | |
| 36163 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36164 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36165 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36166 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36167 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36108 | PORT_INCLUDE( sc4_base ) | |
| 36109 | PORT_MODIFY("IN-1") | |
| 36110 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36111 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collct") | |
| 36112 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 36113 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 36114 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 36115 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36116 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36117 | PORT_MODIFY("IN-2") | |
| 36118 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 36119 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36120 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36121 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36122 | PORT_MODIFY("IN-3") | |
| 36123 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36124 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36125 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36126 | PORT_MODIFY("IN-5") | |
| 36127 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36128 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36129 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36130 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36131 | PORT_MODIFY("IN-6") | |
| 36132 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36133 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36134 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36135 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36136 | PORT_MODIFY("IN-8") | |
| 36137 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("autonu") | |
| 36138 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nodeal") | |
| 36139 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("play d") | |
| 36140 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36141 | PORT_MODIFY("IN-16") | |
| 36142 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36143 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36144 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36145 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36146 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36147 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 36148 | PORT_MODIFY("IN-17") | |
| 36149 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36150 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36151 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36152 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36153 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36154 | PORT_MODIFY("IN-18") | |
| 36155 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36156 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36157 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36158 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36159 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36160 | PORT_MODIFY("IN-19") | |
| 36161 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36162 | PORT_MODIFY("IN-20") | |
| 36163 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36164 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36165 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36166 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36167 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36168 | 36168 | INPUT_PORTS_END |
| 36169 | 36169 | |
| 36170 | 36170 | |
| r31373 | r31374 | |
| 36214 | 36214 | } |
| 36215 | 36215 | |
| 36216 | 36216 | INPUT_PORTS_START( sc4dndys ) // this structure is generated |
| 36217 | PORT_INCLUDE( sc4_base ) | |
| 36218 | PORT_MODIFY("IN-1") | |
| 36219 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36220 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36221 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36222 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36223 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36224 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36225 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36226 | PORT_MODIFY("IN-2") | |
| 36227 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 36228 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchan") | |
| 36229 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36230 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36231 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36232 | PORT_MODIFY("IN-3") | |
| 36233 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36234 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36235 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36236 | PORT_MODIFY("IN-5") | |
| 36237 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36238 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36239 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36240 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36241 | PORT_MODIFY("IN-6") | |
| 36242 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36243 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36244 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36245 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36246 | PORT_MODIFY("IN-8") | |
| 36247 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bns gm") | |
| 36248 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo fea") | |
| 36249 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo sup") | |
| 36250 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo csh") | |
| 36251 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("step") | |
| 36252 | PORT_MODIFY("IN-9") | |
| 36253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fea") | |
| 36254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hi sup") | |
| 36255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hi csh") | |
| 36256 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("ply dl") | |
| 36257 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("nodeal") | |
| 36258 | PORT_MODIFY("IN-10") | |
| 36259 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("deal") | |
| 36260 | PORT_MODIFY("IN-16") | |
| 36261 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36262 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36263 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36264 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36265 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36266 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36267 | PORT_MODIFY("IN-17") | |
| 36268 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36269 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36270 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36271 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36272 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36273 | PORT_MODIFY("IN-18") | |
| 36274 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36275 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36276 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36277 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36278 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36279 | PORT_MODIFY("IN-19") | |
| 36280 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36281 | PORT_MODIFY("IN-20") | |
| 36282 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36283 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36284 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36285 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36286 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36217 | PORT_INCLUDE( sc4_base ) | |
| 36218 | PORT_MODIFY("IN-1") | |
| 36219 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36220 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36221 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36222 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36223 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36224 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36225 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36226 | PORT_MODIFY("IN-2") | |
| 36227 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 36228 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchan") | |
| 36229 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36230 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36231 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36232 | PORT_MODIFY("IN-3") | |
| 36233 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36234 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36235 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36236 | PORT_MODIFY("IN-5") | |
| 36237 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36238 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36239 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36240 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36241 | PORT_MODIFY("IN-6") | |
| 36242 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36243 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36244 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36245 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36246 | PORT_MODIFY("IN-8") | |
| 36247 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bns gm") | |
| 36248 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo fea") | |
| 36249 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo sup") | |
| 36250 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo csh") | |
| 36251 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("step") | |
| 36252 | PORT_MODIFY("IN-9") | |
| 36253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fea") | |
| 36254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hi sup") | |
| 36255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hi csh") | |
| 36256 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("ply dl") | |
| 36257 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("nodeal") | |
| 36258 | PORT_MODIFY("IN-10") | |
| 36259 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_10_0 ) PORT_NAME("deal") | |
| 36260 | PORT_MODIFY("IN-16") | |
| 36261 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36262 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36263 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36264 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36265 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36266 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36267 | PORT_MODIFY("IN-17") | |
| 36268 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36269 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36270 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36271 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36272 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36273 | PORT_MODIFY("IN-18") | |
| 36274 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36275 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36276 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36277 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36278 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36279 | PORT_MODIFY("IN-19") | |
| 36280 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36281 | PORT_MODIFY("IN-20") | |
| 36282 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36283 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36284 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36285 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36286 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36287 | 36287 | INPUT_PORTS_END |
| 36288 | 36288 | |
| 36289 | 36289 | INPUT_PORTS_START( sc4dndys35 ) |
| r31373 | r31374 | |
| 36325 | 36325 | } |
| 36326 | 36326 | |
| 36327 | 36327 | INPUT_PORTS_START( sc4dndlp ) // this structure is generated |
| 36328 | PORT_INCLUDE( sc4_base ) | |
| 36329 | PORT_MODIFY("IN-1") | |
| 36330 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36331 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36332 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36333 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36334 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36335 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36336 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36337 | PORT_MODIFY("IN-2") | |
| 36338 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36339 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 36340 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36341 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36342 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36343 | PORT_MODIFY("IN-3") | |
| 36344 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36345 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36346 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36347 | PORT_MODIFY("IN-5") | |
| 36348 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36349 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36350 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36351 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36352 | PORT_MODIFY("IN-6") | |
| 36353 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36354 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36355 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36356 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36357 | PORT_MODIFY("IN-8") | |
| 36358 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 36359 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 36360 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 36361 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("z1 but") | |
| 36362 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("z2 but") | |
| 36363 | PORT_MODIFY("IN-9") | |
| 36364 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("z3 but") | |
| 36365 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("z4 but") | |
| 36366 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("deal") | |
| 36367 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("pl del") | |
| 36368 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("nodeal") | |
| 36369 | PORT_MODIFY("IN-16") | |
| 36370 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36371 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36372 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36373 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36374 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36375 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36376 | PORT_MODIFY("IN-17") | |
| 36377 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36378 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36379 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36380 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36381 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36382 | PORT_MODIFY("IN-18") | |
| 36383 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36384 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36385 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36386 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36387 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36388 | PORT_MODIFY("IN-19") | |
| 36389 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36390 | PORT_MODIFY("IN-20") | |
| 36391 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36392 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36393 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36394 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36395 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36328 | PORT_INCLUDE( sc4_base ) | |
| 36329 | PORT_MODIFY("IN-1") | |
| 36330 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36331 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36332 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36333 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36334 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36335 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36336 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36337 | PORT_MODIFY("IN-2") | |
| 36338 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36339 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 36340 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36341 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36342 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36343 | PORT_MODIFY("IN-3") | |
| 36344 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36345 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36346 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36347 | PORT_MODIFY("IN-5") | |
| 36348 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36349 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36350 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36351 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36352 | PORT_MODIFY("IN-6") | |
| 36353 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36354 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36355 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36356 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36357 | PORT_MODIFY("IN-8") | |
| 36358 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 36359 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 36360 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 36361 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("z1 but") | |
| 36362 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("z2 but") | |
| 36363 | PORT_MODIFY("IN-9") | |
| 36364 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("z3 but") | |
| 36365 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("z4 but") | |
| 36366 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("deal") | |
| 36367 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("pl del") | |
| 36368 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("nodeal") | |
| 36369 | PORT_MODIFY("IN-16") | |
| 36370 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36371 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36372 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36373 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36374 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36375 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36376 | PORT_MODIFY("IN-17") | |
| 36377 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36378 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36379 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36380 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36381 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36382 | PORT_MODIFY("IN-18") | |
| 36383 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36384 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36385 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36386 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36387 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36388 | PORT_MODIFY("IN-19") | |
| 36389 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36390 | PORT_MODIFY("IN-20") | |
| 36391 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36392 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36393 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36394 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36395 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36396 | 36396 | INPUT_PORTS_END |
| 36397 | 36397 | |
| 36398 | 36398 | |
| r31373 | r31374 | |
| 36430 | 36430 | } |
| 36431 | 36431 | |
| 36432 | 36432 | INPUT_PORTS_START( sc4dndra ) // this structure is generated |
| 36433 | PORT_INCLUDE( sc4_base ) | |
| 36434 | PORT_MODIFY("IN-1") | |
| 36435 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36436 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36437 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36438 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36439 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36440 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36441 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36442 | PORT_MODIFY("IN-2") | |
| 36443 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36444 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36445 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36446 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36447 | PORT_MODIFY("IN-3") | |
| 36448 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36449 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36450 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36451 | PORT_MODIFY("IN-5") | |
| 36452 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36453 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36454 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36455 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36456 | PORT_MODIFY("IN-6") | |
| 36457 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36458 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36459 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36460 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36461 | PORT_MODIFY("IN-8") | |
| 36462 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b gamb") | |
| 36463 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 36464 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 36465 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("p deal") | |
| 36466 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("deal") | |
| 36467 | PORT_MODIFY("IN-9") | |
| 36468 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("p s bd") | |
| 36469 | PORT_MODIFY("IN-16") | |
| 36470 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36471 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36472 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36473 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36474 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36475 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36476 | PORT_MODIFY("IN-17") | |
| 36477 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36478 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36479 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36480 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36481 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36482 | PORT_MODIFY("IN-18") | |
| 36483 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36484 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36485 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36486 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36487 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36488 | PORT_MODIFY("IN-19") | |
| 36489 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36490 | PORT_MODIFY("IN-20") | |
| 36491 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36492 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36493 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36494 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36495 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36433 | PORT_INCLUDE( sc4_base ) | |
| 36434 | PORT_MODIFY("IN-1") | |
| 36435 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36436 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36437 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36438 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36439 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36440 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36441 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36442 | PORT_MODIFY("IN-2") | |
| 36443 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36444 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36445 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36446 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36447 | PORT_MODIFY("IN-3") | |
| 36448 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36449 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36450 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36451 | PORT_MODIFY("IN-5") | |
| 36452 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36453 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36454 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36455 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36456 | PORT_MODIFY("IN-6") | |
| 36457 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36458 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36459 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36460 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36461 | PORT_MODIFY("IN-8") | |
| 36462 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b gamb") | |
| 36463 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 36464 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 36465 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("p deal") | |
| 36466 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("deal") | |
| 36467 | PORT_MODIFY("IN-9") | |
| 36468 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("p s bd") | |
| 36469 | PORT_MODIFY("IN-16") | |
| 36470 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36471 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36472 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36473 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36474 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36475 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36476 | PORT_MODIFY("IN-17") | |
| 36477 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36478 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36479 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36480 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36481 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36482 | PORT_MODIFY("IN-18") | |
| 36483 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36484 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36485 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36486 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36487 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36488 | PORT_MODIFY("IN-19") | |
| 36489 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36490 | PORT_MODIFY("IN-20") | |
| 36491 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36492 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36493 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36494 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36495 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36496 | 36496 | INPUT_PORTS_END |
| 36497 | 36497 | |
| 36498 | 36498 | INPUT_PORTS_START( sc4dndra35 ) |
| r31373 | r31374 | |
| 36534 | 36534 | } |
| 36535 | 36535 | |
| 36536 | 36536 | INPUT_PORTS_START( sc4dndbd ) // this structure is generated |
| 36537 | PORT_INCLUDE( sc4_base ) | |
| 36538 | PORT_MODIFY("IN-1") | |
| 36539 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36540 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36541 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36542 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36543 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36544 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36545 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36546 | PORT_MODIFY("IN-2") | |
| 36547 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36548 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 36549 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36550 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36551 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36552 | PORT_MODIFY("IN-3") | |
| 36553 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36554 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36555 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36556 | PORT_MODIFY("IN-5") | |
| 36557 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36558 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36559 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36560 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36561 | PORT_MODIFY("IN-6") | |
| 36562 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36563 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36564 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36565 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36566 | PORT_MODIFY("IN-8") | |
| 36567 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 36568 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nodeal") | |
| 36569 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("pl del") | |
| 36570 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36571 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk mes") | |
| 36572 | PORT_MODIFY("IN-9") | |
| 36573 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk str") | |
| 36574 | PORT_MODIFY("IN-16") | |
| 36575 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36576 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36577 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36578 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36579 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36580 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36581 | PORT_MODIFY("IN-17") | |
| 36582 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36583 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36584 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36585 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36586 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36587 | PORT_MODIFY("IN-18") | |
| 36588 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36589 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36590 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36591 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36592 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36593 | PORT_MODIFY("IN-19") | |
| 36594 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36595 | PORT_MODIFY("IN-20") | |
| 36596 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36597 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36598 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36599 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36600 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36537 | PORT_INCLUDE( sc4_base ) | |
| 36538 | PORT_MODIFY("IN-1") | |
| 36539 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36540 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36541 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36542 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36543 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36544 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36545 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36546 | PORT_MODIFY("IN-2") | |
| 36547 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36548 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 36549 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36550 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36551 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36552 | PORT_MODIFY("IN-3") | |
| 36553 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36554 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36555 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36556 | PORT_MODIFY("IN-5") | |
| 36557 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36558 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36559 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36560 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36561 | PORT_MODIFY("IN-6") | |
| 36562 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36563 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36564 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36565 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36566 | PORT_MODIFY("IN-8") | |
| 36567 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 36568 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nodeal") | |
| 36569 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("pl del") | |
| 36570 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36571 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk mes") | |
| 36572 | PORT_MODIFY("IN-9") | |
| 36573 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk str") | |
| 36574 | PORT_MODIFY("IN-16") | |
| 36575 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36576 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36577 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36578 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36579 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36580 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36581 | PORT_MODIFY("IN-17") | |
| 36582 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36583 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36584 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36585 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36586 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36587 | PORT_MODIFY("IN-18") | |
| 36588 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36589 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36590 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36591 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36592 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36593 | PORT_MODIFY("IN-19") | |
| 36594 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36595 | PORT_MODIFY("IN-20") | |
| 36596 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36597 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36598 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36599 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36600 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36601 | 36601 | INPUT_PORTS_END |
| 36602 | 36602 | |
| 36603 | 36603 | INPUT_PORTS_START( sc4dndbd35 ) |
| r31373 | r31374 | |
| 36640 | 36640 | } |
| 36641 | 36641 | |
| 36642 | 36642 | INPUT_PORTS_START( sc4dndbr ) // this structure is generated |
| 36643 | PORT_INCLUDE( sc4_base ) | |
| 36644 | PORT_MODIFY("IN-1") | |
| 36645 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 36646 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36647 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36648 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36649 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchan") | |
| 36650 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36651 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36652 | PORT_MODIFY("IN-2") | |
| 36653 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36654 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36655 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36656 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36657 | PORT_MODIFY("IN-3") | |
| 36658 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36659 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36660 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36661 | PORT_MODIFY("IN-5") | |
| 36662 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36663 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36664 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36665 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36666 | PORT_MODIFY("IN-6") | |
| 36667 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36668 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36669 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36670 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36671 | PORT_MODIFY("IN-8") | |
| 36672 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 36673 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("play d") | |
| 36674 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 36675 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c or b") | |
| 36676 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk mes") | |
| 36677 | PORT_MODIFY("IN-16") | |
| 36678 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36679 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36680 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36681 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36682 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36683 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36684 | PORT_MODIFY("IN-17") | |
| 36685 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36686 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36687 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36688 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36689 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36690 | PORT_MODIFY("IN-18") | |
| 36691 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36692 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36693 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36694 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36695 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36696 | PORT_MODIFY("IN-19") | |
| 36697 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36698 | PORT_MODIFY("IN-20") | |
| 36699 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36700 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36701 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36702 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36703 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36643 | PORT_INCLUDE( sc4_base ) | |
| 36644 | PORT_MODIFY("IN-1") | |
| 36645 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 36646 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36647 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36648 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36649 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchan") | |
| 36650 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36651 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36652 | PORT_MODIFY("IN-2") | |
| 36653 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36654 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 36655 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 36656 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36657 | PORT_MODIFY("IN-3") | |
| 36658 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36659 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36660 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36661 | PORT_MODIFY("IN-5") | |
| 36662 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36663 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36664 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36665 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36666 | PORT_MODIFY("IN-6") | |
| 36667 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36668 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36669 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36670 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36671 | PORT_MODIFY("IN-8") | |
| 36672 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 36673 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("play d") | |
| 36674 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 36675 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c or b") | |
| 36676 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk mes") | |
| 36677 | PORT_MODIFY("IN-16") | |
| 36678 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36679 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36680 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36681 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36682 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36683 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36684 | PORT_MODIFY("IN-17") | |
| 36685 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36686 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36687 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36688 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36689 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36690 | PORT_MODIFY("IN-18") | |
| 36691 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36692 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36693 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36694 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36695 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36696 | PORT_MODIFY("IN-19") | |
| 36697 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36698 | PORT_MODIFY("IN-20") | |
| 36699 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36700 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36701 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36702 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36703 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36704 | 36704 | INPUT_PORTS_END |
| 36705 | 36705 | |
| 36706 | 36706 | INPUT_PORTS_START( sc4dndbr35 ) |
| r31373 | r31374 | |
| 36745 | 36745 | } |
| 36746 | 36746 | |
| 36747 | 36747 | INPUT_PORTS_START( sc4dndcc ) // this structure is generated |
| 36748 | PORT_INCLUDE( sc4_base ) | |
| 36749 | PORT_MODIFY("IN-1") | |
| 36750 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36751 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36752 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36753 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36754 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36755 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36756 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36757 | PORT_MODIFY("IN-2") | |
| 36758 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36759 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 36760 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36763 | PORT_MODIFY("IN-3") | |
| 36764 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36765 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36766 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36767 | PORT_MODIFY("IN-5") | |
| 36768 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36769 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36770 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36771 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36772 | PORT_MODIFY("IN-6") | |
| 36773 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36774 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36775 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36776 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36777 | PORT_MODIFY("IN-8") | |
| 36778 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 36779 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 36780 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 36781 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nodeal") | |
| 36782 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("pl del") | |
| 36783 | PORT_MODIFY("IN-9") | |
| 36784 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("deal") | |
| 36785 | PORT_MODIFY("IN-16") | |
| 36786 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36787 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36788 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36789 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36790 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36791 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36792 | PORT_MODIFY("IN-17") | |
| 36793 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36794 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36795 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36796 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36797 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36798 | PORT_MODIFY("IN-18") | |
| 36799 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36800 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36801 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36802 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36803 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36804 | PORT_MODIFY("IN-19") | |
| 36805 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36806 | PORT_MODIFY("IN-20") | |
| 36807 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36808 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36809 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36810 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36811 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36748 | PORT_INCLUDE( sc4_base ) | |
| 36749 | PORT_MODIFY("IN-1") | |
| 36750 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36751 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36752 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36753 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36754 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36755 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36756 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36757 | PORT_MODIFY("IN-2") | |
| 36758 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36759 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 36760 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36763 | PORT_MODIFY("IN-3") | |
| 36764 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36765 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36766 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36767 | PORT_MODIFY("IN-5") | |
| 36768 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36769 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36770 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36771 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36772 | PORT_MODIFY("IN-6") | |
| 36773 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36774 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36775 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36776 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36777 | PORT_MODIFY("IN-8") | |
| 36778 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 36779 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 36780 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 36781 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nodeal") | |
| 36782 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("pl del") | |
| 36783 | PORT_MODIFY("IN-9") | |
| 36784 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("deal") | |
| 36785 | PORT_MODIFY("IN-16") | |
| 36786 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36787 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36788 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36789 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36790 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36791 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36792 | PORT_MODIFY("IN-17") | |
| 36793 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36794 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36795 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36796 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36797 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36798 | PORT_MODIFY("IN-18") | |
| 36799 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36800 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36801 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36802 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36803 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36804 | PORT_MODIFY("IN-19") | |
| 36805 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36806 | PORT_MODIFY("IN-20") | |
| 36807 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36808 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36809 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36810 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36811 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36812 | 36812 | INPUT_PORTS_END |
| 36813 | 36813 | |
| 36814 | 36814 | INPUT_PORTS_START( sc4dndcc35 ) |
| r31373 | r31374 | |
| 36851 | 36851 | m_reel_setup = sc4dnddw_reel_configs; |
| 36852 | 36852 | } |
| 36853 | 36853 | INPUT_PORTS_START( sc4dnddw ) // this structure is generated |
| 36854 | PORT_INCLUDE( sc4_base ) | |
| 36855 | PORT_MODIFY("IN-1") | |
| 36856 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36857 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36858 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36859 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36860 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36861 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36862 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36863 | PORT_MODIFY("IN-2") | |
| 36864 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchan") | |
| 36865 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 36866 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36867 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36868 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36869 | PORT_MODIFY("IN-3") | |
| 36870 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36871 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36872 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36873 | PORT_MODIFY("IN-5") | |
| 36874 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36875 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36876 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36877 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36878 | PORT_MODIFY("IN-6") | |
| 36879 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36880 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36881 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36882 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36883 | PORT_MODIFY("IN-8") | |
| 36884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 36885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("p deal") | |
| 36886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("streak") | |
| 36887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("l deal") | |
| 36888 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("m deal") | |
| 36889 | PORT_MODIFY("IN-9") | |
| 36890 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("r deal") | |
| 36891 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("dond") | |
| 36892 | PORT_MODIFY("IN-16") | |
| 36893 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36894 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36895 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36896 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36897 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36898 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36899 | PORT_MODIFY("IN-17") | |
| 36900 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36901 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36902 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36903 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36904 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36905 | PORT_MODIFY("IN-18") | |
| 36906 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36907 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36908 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36909 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36910 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36911 | PORT_MODIFY("IN-19") | |
| 36912 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36913 | PORT_MODIFY("IN-20") | |
| 36914 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36915 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36916 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36917 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36918 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36854 | PORT_INCLUDE( sc4_base ) | |
| 36855 | PORT_MODIFY("IN-1") | |
| 36856 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36857 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36858 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36859 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36860 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 36861 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36862 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36863 | PORT_MODIFY("IN-2") | |
| 36864 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchan") | |
| 36865 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 36866 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 36867 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36868 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 36869 | PORT_MODIFY("IN-3") | |
| 36870 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36871 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36872 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36873 | PORT_MODIFY("IN-5") | |
| 36874 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36875 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36876 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36877 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36878 | PORT_MODIFY("IN-6") | |
| 36879 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36880 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36881 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36882 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36883 | PORT_MODIFY("IN-8") | |
| 36884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 36885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("p deal") | |
| 36886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("streak") | |
| 36887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("l deal") | |
| 36888 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("m deal") | |
| 36889 | PORT_MODIFY("IN-9") | |
| 36890 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("r deal") | |
| 36891 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("dond") | |
| 36892 | PORT_MODIFY("IN-16") | |
| 36893 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36894 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36895 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 36896 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 36897 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 36898 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 36899 | PORT_MODIFY("IN-17") | |
| 36900 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 36901 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 36902 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 36903 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 36904 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 36905 | PORT_MODIFY("IN-18") | |
| 36906 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 36907 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 36908 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 36909 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 36910 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 36911 | PORT_MODIFY("IN-19") | |
| 36912 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 36913 | PORT_MODIFY("IN-20") | |
| 36914 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 36915 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 36916 | // 0x0004 - "serdor" // standard input (expected here) | |
| 36917 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 36918 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36919 | 36919 | INPUT_PORTS_END |
| 36920 | 36920 | |
| 36921 | 36921 | INPUT_PORTS_START( sc4dnddw35 ) |
| r31373 | r31374 | |
| 36959 | 36959 | } |
| 36960 | 36960 | |
| 36961 | 36961 | INPUT_PORTS_START( sc4dnddf ) // this structure is generated |
| 36962 | PORT_INCLUDE( sc4_base ) | |
| 36963 | PORT_MODIFY("IN-1") | |
| 36964 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36965 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36966 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36967 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36968 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 36969 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36970 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36971 | PORT_MODIFY("IN-2") | |
| 36972 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36973 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tra/ex") | |
| 36974 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("sta/ga") | |
| 36975 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36976 | PORT_MODIFY("IN-3") | |
| 36977 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36978 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36979 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36980 | PORT_MODIFY("IN-5") | |
| 36981 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36982 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36983 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36984 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36985 | PORT_MODIFY("IN-6") | |
| 36986 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36987 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36988 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36989 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36990 | PORT_MODIFY("IN-8") | |
| 36991 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bns") | |
| 36992 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("bankit") | |
| 36993 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 36994 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36995 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ply dl") | |
| 36996 | PORT_MODIFY("IN-16") | |
| 36997 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36998 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36999 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37000 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37001 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37002 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37003 | PORT_MODIFY("IN-17") | |
| 37004 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37005 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37006 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37007 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37008 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37009 | PORT_MODIFY("IN-18") | |
| 37010 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37011 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37012 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37013 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37014 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37015 | PORT_MODIFY("IN-19") | |
| 37016 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37017 | PORT_MODIFY("IN-20") | |
| 37018 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37019 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37020 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37021 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37022 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 36962 | PORT_INCLUDE( sc4_base ) | |
| 36963 | PORT_MODIFY("IN-1") | |
| 36964 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 36965 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 36966 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 36967 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 36968 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 36969 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 36970 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 36971 | PORT_MODIFY("IN-2") | |
| 36972 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 36973 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tra/ex") | |
| 36974 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("sta/ga") | |
| 36975 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 36976 | PORT_MODIFY("IN-3") | |
| 36977 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 36978 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 36979 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 36980 | PORT_MODIFY("IN-5") | |
| 36981 | // 0x0001 - "priz4" // standard input (expected here) | |
| 36982 | // 0x0002 - "priz3" // standard input (expected here) | |
| 36983 | // 0x0004 - "priz2" // standard input (expected here) | |
| 36984 | // 0x0008 - "priz1" // standard input (expected here) | |
| 36985 | PORT_MODIFY("IN-6") | |
| 36986 | // 0x0001 - "perc1" // standard input (expected here) | |
| 36987 | // 0x0002 - "perc2" // standard input (expected here) | |
| 36988 | // 0x0004 - "perc3" // standard input (expected here) | |
| 36989 | // 0x0008 - "perc4" // standard input (expected here) | |
| 36990 | PORT_MODIFY("IN-8") | |
| 36991 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bns") | |
| 36992 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("bankit") | |
| 36993 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nodeal") | |
| 36994 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("deal") | |
| 36995 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ply dl") | |
| 36996 | PORT_MODIFY("IN-16") | |
| 36997 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 36998 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 36999 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37000 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37001 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37002 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37003 | PORT_MODIFY("IN-17") | |
| 37004 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37005 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37006 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37007 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37008 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37009 | PORT_MODIFY("IN-18") | |
| 37010 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37011 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37012 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37013 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37014 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37015 | PORT_MODIFY("IN-19") | |
| 37016 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37017 | PORT_MODIFY("IN-20") | |
| 37018 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37019 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37020 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37021 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37022 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37023 | 37023 | INPUT_PORTS_END |
| 37024 | 37024 | |
| 37025 | 37025 | INPUT_PORTS_START( sc4dnddf35 ) |
| r31373 | r31374 | |
| 37061 | 37061 | } |
| 37062 | 37062 | |
| 37063 | 37063 | INPUT_PORTS_START( sc4dndpg ) // this structure is generated |
| 37064 | PORT_INCLUDE( sc4_base ) | |
| 37065 | PORT_MODIFY("IN-1") | |
| 37066 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37067 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37068 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37069 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37070 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37071 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37072 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37073 | PORT_MODIFY("IN-2") | |
| 37074 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37075 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 37076 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 37077 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37078 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 37079 | PORT_MODIFY("IN-3") | |
| 37080 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37081 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37082 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37083 | PORT_MODIFY("IN-5") | |
| 37084 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37085 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37086 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37087 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37088 | PORT_MODIFY("IN-6") | |
| 37089 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37090 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37091 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37092 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37093 | PORT_MODIFY("IN-8") | |
| 37094 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 37095 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 37096 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37097 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nodeal") | |
| 37098 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("pl del") | |
| 37099 | PORT_MODIFY("IN-9") | |
| 37100 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("deal") | |
| 37101 | PORT_MODIFY("IN-16") | |
| 37102 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37103 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37104 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37105 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37106 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37107 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37108 | PORT_MODIFY("IN-17") | |
| 37109 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37110 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37111 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37112 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37113 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37114 | PORT_MODIFY("IN-18") | |
| 37115 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37116 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37117 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37118 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37119 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37120 | PORT_MODIFY("IN-19") | |
| 37121 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37122 | PORT_MODIFY("IN-20") | |
| 37123 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37124 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37125 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37126 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37127 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37064 | PORT_INCLUDE( sc4_base ) | |
| 37065 | PORT_MODIFY("IN-1") | |
| 37066 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37067 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37068 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37069 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37070 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37071 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37072 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37073 | PORT_MODIFY("IN-2") | |
| 37074 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37075 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 37076 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 37077 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37078 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 37079 | PORT_MODIFY("IN-3") | |
| 37080 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37081 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37082 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37083 | PORT_MODIFY("IN-5") | |
| 37084 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37085 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37086 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37087 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37088 | PORT_MODIFY("IN-6") | |
| 37089 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37090 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37091 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37092 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37093 | PORT_MODIFY("IN-8") | |
| 37094 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 37095 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 37096 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37097 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nodeal") | |
| 37098 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("pl del") | |
| 37099 | PORT_MODIFY("IN-9") | |
| 37100 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("deal") | |
| 37101 | PORT_MODIFY("IN-16") | |
| 37102 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37103 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37104 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37105 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37106 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37107 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37108 | PORT_MODIFY("IN-17") | |
| 37109 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37110 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37111 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37112 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37113 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37114 | PORT_MODIFY("IN-18") | |
| 37115 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37116 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37117 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37118 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37119 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37120 | PORT_MODIFY("IN-19") | |
| 37121 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37122 | PORT_MODIFY("IN-20") | |
| 37123 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37124 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37125 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37126 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37127 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37128 | 37128 | INPUT_PORTS_END |
| 37129 | 37129 | |
| 37130 | 37130 | INPUT_PORTS_START( sc4dndpg35 ) |
| r31373 | r31374 | |
| 37166 | 37166 | m_reel_setup = sc4dndtp_reel_configs; |
| 37167 | 37167 | } |
| 37168 | 37168 | INPUT_PORTS_START( sc4dndtp ) // this structure is generated |
| 37169 | PORT_INCLUDE( sc4_base ) | |
| 37170 | PORT_MODIFY("IN-1") | |
| 37171 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37172 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37173 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37174 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37175 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 37176 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37177 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37178 | PORT_MODIFY("IN-2") | |
| 37179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37180 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 37181 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37182 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37183 | PORT_MODIFY("IN-3") | |
| 37184 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37185 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37186 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37187 | PORT_MODIFY("IN-5") | |
| 37188 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37189 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37190 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37191 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37192 | PORT_MODIFY("IN-6") | |
| 37193 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37194 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37195 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37196 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37197 | PORT_MODIFY("IN-8") | |
| 37198 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 37199 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("dond") | |
| 37200 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 37201 | PORT_MODIFY("IN-16") | |
| 37202 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37203 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37204 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37205 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37206 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37207 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37208 | PORT_MODIFY("IN-17") | |
| 37209 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37210 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37211 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37212 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37213 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37214 | PORT_MODIFY("IN-18") | |
| 37215 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37216 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37217 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37218 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37219 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37220 | PORT_MODIFY("IN-19") | |
| 37221 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37222 | PORT_MODIFY("IN-20") | |
| 37223 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37224 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37225 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37226 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37227 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37169 | PORT_INCLUDE( sc4_base ) | |
| 37170 | PORT_MODIFY("IN-1") | |
| 37171 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37172 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37173 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37174 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37175 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 37176 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37177 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37178 | PORT_MODIFY("IN-2") | |
| 37179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37180 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 37181 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37182 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37183 | PORT_MODIFY("IN-3") | |
| 37184 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37185 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37186 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37187 | PORT_MODIFY("IN-5") | |
| 37188 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37189 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37190 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37191 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37192 | PORT_MODIFY("IN-6") | |
| 37193 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37194 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37195 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37196 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37197 | PORT_MODIFY("IN-8") | |
| 37198 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nodeal") | |
| 37199 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("dond") | |
| 37200 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 37201 | PORT_MODIFY("IN-16") | |
| 37202 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37203 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37204 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37205 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37206 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37207 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37208 | PORT_MODIFY("IN-17") | |
| 37209 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37210 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37211 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37212 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37213 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37214 | PORT_MODIFY("IN-18") | |
| 37215 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37216 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37217 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37218 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37219 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37220 | PORT_MODIFY("IN-19") | |
| 37221 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37222 | PORT_MODIFY("IN-20") | |
| 37223 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37224 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37225 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37226 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37227 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37228 | 37228 | INPUT_PORTS_END |
| 37229 | 37229 | |
| 37230 | 37230 | INPUT_PORTS_START( sc4dndtp35 ) |
| r31373 | r31374 | |
| 37268 | 37268 | } |
| 37269 | 37269 | |
| 37270 | 37270 | INPUT_PORTS_START( sc4dndww ) // this structure is generated |
| 37271 | PORT_INCLUDE( sc4_base ) | |
| 37272 | PORT_MODIFY("IN-1") | |
| 37273 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37274 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37275 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37276 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37277 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37278 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37279 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37280 | PORT_MODIFY("IN-2") | |
| 37281 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37282 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 37283 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 37284 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37285 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 37286 | PORT_MODIFY("IN-3") | |
| 37287 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37288 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37289 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37290 | PORT_MODIFY("IN-5") | |
| 37291 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37292 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37293 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37294 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37295 | PORT_MODIFY("IN-6") | |
| 37296 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37297 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37298 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37299 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37300 | PORT_MODIFY("IN-8") | |
| 37301 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b ndel") | |
| 37302 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b deal") | |
| 37303 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37304 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk bon") | |
| 37305 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 37306 | PORT_MODIFY("IN-9") | |
| 37307 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nodeal") | |
| 37308 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("pl del") | |
| 37309 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("deal") | |
| 37310 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("cs bus") | |
| 37311 | PORT_MODIFY("IN-16") | |
| 37312 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37313 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37314 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37315 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37316 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37317 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37318 | PORT_MODIFY("IN-17") | |
| 37319 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37320 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37321 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37322 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37323 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37324 | PORT_MODIFY("IN-18") | |
| 37325 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37326 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37327 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37328 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37329 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37330 | PORT_MODIFY("IN-19") | |
| 37331 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37332 | PORT_MODIFY("IN-20") | |
| 37333 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37334 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37335 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37336 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37337 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37271 | PORT_INCLUDE( sc4_base ) | |
| 37272 | PORT_MODIFY("IN-1") | |
| 37273 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37274 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37275 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37276 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37277 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37278 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37279 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37280 | PORT_MODIFY("IN-2") | |
| 37281 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37282 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 37283 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 37284 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37285 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 37286 | PORT_MODIFY("IN-3") | |
| 37287 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37288 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37289 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37290 | PORT_MODIFY("IN-5") | |
| 37291 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37292 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37293 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37294 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37295 | PORT_MODIFY("IN-6") | |
| 37296 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37297 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37298 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37299 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37300 | PORT_MODIFY("IN-8") | |
| 37301 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b ndel") | |
| 37302 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b deal") | |
| 37303 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37304 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk bon") | |
| 37305 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 37306 | PORT_MODIFY("IN-9") | |
| 37307 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nodeal") | |
| 37308 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("pl del") | |
| 37309 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("deal") | |
| 37310 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("cs bus") | |
| 37311 | PORT_MODIFY("IN-16") | |
| 37312 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37313 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37314 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37315 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37316 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37317 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37318 | PORT_MODIFY("IN-17") | |
| 37319 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37320 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37321 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37322 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37323 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37324 | PORT_MODIFY("IN-18") | |
| 37325 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37326 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37327 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37328 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37329 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37330 | PORT_MODIFY("IN-19") | |
| 37331 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37332 | PORT_MODIFY("IN-20") | |
| 37333 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37334 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37335 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37336 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37337 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37338 | 37338 | INPUT_PORTS_END |
| 37339 | 37339 | |
| 37340 | 37340 | INPUT_PORTS_START( sc4dndww35 ) |
| r31373 | r31374 | |
| 37370 | 37370 | } |
| 37371 | 37371 | |
| 37372 | 37372 | INPUT_PORTS_START( sc4dndcw ) // this structure is generated |
| 37373 | PORT_INCLUDE( sc4_base ) | |
| 37374 | PORT_MODIFY("IN-1") | |
| 37375 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37376 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37377 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37378 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37379 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37380 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37381 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37382 | PORT_MODIFY("IN-2") | |
| 37383 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchag") | |
| 37384 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 37385 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37386 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37387 | PORT_MODIFY("IN-3") | |
| 37388 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37389 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37390 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37391 | PORT_MODIFY("IN-5") | |
| 37392 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37393 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37394 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37395 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37396 | PORT_MODIFY("IN-6") | |
| 37397 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37398 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37399 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37400 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37401 | PORT_MODIFY("IN-8") | |
| 37402 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b ndel") | |
| 37403 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b deal") | |
| 37404 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37405 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk bon") | |
| 37406 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 37407 | PORT_MODIFY("IN-9") | |
| 37408 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nodeal") | |
| 37409 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("pl del") | |
| 37410 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("deal") | |
| 37411 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("cs bus") | |
| 37412 | PORT_MODIFY("IN-16") | |
| 37413 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37414 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37415 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37416 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37417 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37418 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37419 | PORT_MODIFY("IN-17") | |
| 37420 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37421 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37422 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37423 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37424 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37425 | PORT_MODIFY("IN-18") | |
| 37426 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37427 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37428 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37429 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37430 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37431 | PORT_MODIFY("IN-19") | |
| 37432 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37433 | PORT_MODIFY("IN-20") | |
| 37434 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37435 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37436 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37437 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37438 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37373 | PORT_INCLUDE( sc4_base ) | |
| 37374 | PORT_MODIFY("IN-1") | |
| 37375 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37376 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37377 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37378 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37379 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37380 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37381 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37382 | PORT_MODIFY("IN-2") | |
| 37383 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchag") | |
| 37384 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 37385 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37386 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37387 | PORT_MODIFY("IN-3") | |
| 37388 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37389 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37390 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37391 | PORT_MODIFY("IN-5") | |
| 37392 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37393 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37394 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37395 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37396 | PORT_MODIFY("IN-6") | |
| 37397 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37398 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37399 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37400 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37401 | PORT_MODIFY("IN-8") | |
| 37402 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b ndel") | |
| 37403 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b deal") | |
| 37404 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37405 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk bon") | |
| 37406 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 37407 | PORT_MODIFY("IN-9") | |
| 37408 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nodeal") | |
| 37409 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("pl del") | |
| 37410 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("deal") | |
| 37411 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("cs bus") | |
| 37412 | PORT_MODIFY("IN-16") | |
| 37413 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37414 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37415 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37416 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37417 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37418 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37419 | PORT_MODIFY("IN-17") | |
| 37420 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37421 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37422 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37423 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37424 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37425 | PORT_MODIFY("IN-18") | |
| 37426 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37427 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37428 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37429 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37430 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37431 | PORT_MODIFY("IN-19") | |
| 37432 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37433 | PORT_MODIFY("IN-20") | |
| 37434 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37435 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37436 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37437 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37438 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37439 | 37439 | INPUT_PORTS_END |
| 37440 | 37440 | |
| 37441 | 37441 | INPUT_PORTS_START( sc4dndcw5 ) |
| r31373 | r31374 | |
| 37469 | 37469 | } |
| 37470 | 37470 | |
| 37471 | 37471 | INPUT_PORTS_START( sc4dndtr ) // this structure is generated |
| 37472 | PORT_INCLUDE( sc4_base ) | |
| 37473 | PORT_MODIFY("IN-1") | |
| 37474 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 37475 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37476 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37477 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37478 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchan") | |
| 37479 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37480 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37481 | PORT_MODIFY("IN-2") | |
| 37482 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37483 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 37484 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37485 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37486 | PORT_MODIFY("IN-3") | |
| 37487 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37488 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37489 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37490 | PORT_MODIFY("IN-5") | |
| 37491 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37492 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37493 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37494 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37495 | PORT_MODIFY("IN-6") | |
| 37496 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37497 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37498 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37499 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37500 | PORT_MODIFY("IN-8") | |
| 37501 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("no dea") | |
| 37502 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("play g") | |
| 37503 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 37504 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk msg") | |
| 37505 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("csh bu") | |
| 37506 | PORT_MODIFY("IN-16") | |
| 37507 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37508 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37509 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37510 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37511 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37512 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37513 | PORT_MODIFY("IN-17") | |
| 37514 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37515 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37516 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37517 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37518 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37519 | PORT_MODIFY("IN-18") | |
| 37520 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37521 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37522 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37523 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37524 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37525 | PORT_MODIFY("IN-19") | |
| 37526 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37527 | PORT_MODIFY("IN-20") | |
| 37528 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37529 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37530 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37531 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37532 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37472 | PORT_INCLUDE( sc4_base ) | |
| 37473 | PORT_MODIFY("IN-1") | |
| 37474 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 37475 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37476 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37477 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37478 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exchan") | |
| 37479 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37480 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37481 | PORT_MODIFY("IN-2") | |
| 37482 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37483 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 37484 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37485 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37486 | PORT_MODIFY("IN-3") | |
| 37487 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37488 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37489 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37490 | PORT_MODIFY("IN-5") | |
| 37491 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37492 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37493 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37494 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37495 | PORT_MODIFY("IN-6") | |
| 37496 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37497 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37498 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37499 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37500 | PORT_MODIFY("IN-8") | |
| 37501 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("no dea") | |
| 37502 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("play g") | |
| 37503 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 37504 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk msg") | |
| 37505 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("csh bu") | |
| 37506 | PORT_MODIFY("IN-16") | |
| 37507 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37508 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37509 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37510 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37511 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37512 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37513 | PORT_MODIFY("IN-17") | |
| 37514 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37515 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37516 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37517 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37518 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37519 | PORT_MODIFY("IN-18") | |
| 37520 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37521 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37522 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37523 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37524 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37525 | PORT_MODIFY("IN-19") | |
| 37526 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37527 | PORT_MODIFY("IN-20") | |
| 37528 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37529 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37530 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37531 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37532 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37533 | 37533 | INPUT_PORTS_END |
| 37534 | 37534 | |
| 37535 | 37535 | INPUT_PORTS_START( sc4dndtr70 ) |
| r31373 | r31374 | |
| 37561 | 37561 | } |
| 37562 | 37562 | |
| 37563 | 37563 | INPUT_PORTS_START( sc4dndwb ) // this structure is generated |
| 37564 | PORT_INCLUDE( sc4_base ) | |
| 37565 | PORT_MODIFY("IN-1") | |
| 37566 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 37567 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37568 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37569 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37570 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 37571 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37572 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37573 | PORT_MODIFY("IN-2") | |
| 37574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 37576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37578 | PORT_MODIFY("IN-3") | |
| 37579 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37580 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37581 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37582 | PORT_MODIFY("IN-5") | |
| 37583 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37584 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37585 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37586 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37587 | PORT_MODIFY("IN-6") | |
| 37588 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37589 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37590 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37591 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37592 | PORT_MODIFY("IN-8") | |
| 37593 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step") | |
| 37594 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("csh lo") | |
| 37595 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("sup lo") | |
| 37596 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("fet lo") | |
| 37597 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("csh hi") | |
| 37598 | PORT_MODIFY("IN-9") | |
| 37599 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("sup hi") | |
| 37600 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("fet hi") | |
| 37601 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("nodeal") | |
| 37602 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("play") | |
| 37603 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("deal") | |
| 37604 | PORT_MODIFY("IN-16") | |
| 37605 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37606 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37607 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37608 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37609 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37610 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37611 | PORT_MODIFY("IN-17") | |
| 37612 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37613 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37614 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37615 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37616 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37617 | PORT_MODIFY("IN-18") | |
| 37618 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37619 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37620 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37621 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37622 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37623 | PORT_MODIFY("IN-19") | |
| 37624 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37625 | PORT_MODIFY("IN-20") | |
| 37626 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37627 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37628 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37629 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37630 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37564 | PORT_INCLUDE( sc4_base ) | |
| 37565 | PORT_MODIFY("IN-1") | |
| 37566 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 37567 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37568 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37569 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37570 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 37571 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37572 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37573 | PORT_MODIFY("IN-2") | |
| 37574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 37576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37578 | PORT_MODIFY("IN-3") | |
| 37579 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37580 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37581 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37582 | PORT_MODIFY("IN-5") | |
| 37583 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37584 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37585 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37586 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37587 | PORT_MODIFY("IN-6") | |
| 37588 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37589 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37590 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37591 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37592 | PORT_MODIFY("IN-8") | |
| 37593 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step") | |
| 37594 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("csh lo") | |
| 37595 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("sup lo") | |
| 37596 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("fet lo") | |
| 37597 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("csh hi") | |
| 37598 | PORT_MODIFY("IN-9") | |
| 37599 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("sup hi") | |
| 37600 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("fet hi") | |
| 37601 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("nodeal") | |
| 37602 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("play") | |
| 37603 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("deal") | |
| 37604 | PORT_MODIFY("IN-16") | |
| 37605 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37606 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37607 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37608 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37609 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37610 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37611 | PORT_MODIFY("IN-17") | |
| 37612 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37613 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37614 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37615 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37616 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37617 | PORT_MODIFY("IN-18") | |
| 37618 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37619 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37620 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37621 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37622 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37623 | PORT_MODIFY("IN-19") | |
| 37624 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37625 | PORT_MODIFY("IN-20") | |
| 37626 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37627 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37628 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37629 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37630 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37631 | 37631 | INPUT_PORTS_END |
| 37632 | 37632 | |
| 37633 | 37633 | INPUT_PORTS_START( sc4dndwb35 ) |
| r31373 | r31374 | |
| 37664 | 37664 | } |
| 37665 | 37665 | |
| 37666 | 37666 | INPUT_PORTS_START( sc4dndbe ) // this structure is generated |
| 37667 | PORT_INCLUDE( sc4_base ) | |
| 37668 | PORT_MODIFY("IN-1") | |
| 37669 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37670 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37671 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37672 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37673 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 37674 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37675 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37676 | PORT_MODIFY("IN-2") | |
| 37677 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("deal o") | |
| 37678 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 37679 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37680 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37681 | PORT_MODIFY("IN-3") | |
| 37682 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37683 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37684 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37685 | PORT_MODIFY("IN-5") | |
| 37686 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37687 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37688 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37689 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37690 | PORT_MODIFY("IN-6") | |
| 37691 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37692 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37693 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37694 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37695 | PORT_MODIFY("IN-8") | |
| 37696 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c or b") | |
| 37697 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nodeal") | |
| 37698 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 37699 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("streak") | |
| 37700 | PORT_MODIFY("IN-16") | |
| 37701 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37702 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37703 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37704 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37705 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37706 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37707 | PORT_MODIFY("IN-17") | |
| 37708 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37709 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37710 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37711 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37712 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37713 | PORT_MODIFY("IN-18") | |
| 37714 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37715 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37716 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37717 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37718 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37719 | PORT_MODIFY("IN-19") | |
| 37720 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37721 | PORT_MODIFY("IN-20") | |
| 37722 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37723 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37724 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37725 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37726 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37667 | PORT_INCLUDE( sc4_base ) | |
| 37668 | PORT_MODIFY("IN-1") | |
| 37669 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37670 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37671 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37672 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37673 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 37674 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37675 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37676 | PORT_MODIFY("IN-2") | |
| 37677 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("deal o") | |
| 37678 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 37679 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37680 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37681 | PORT_MODIFY("IN-3") | |
| 37682 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37683 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37684 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37685 | PORT_MODIFY("IN-5") | |
| 37686 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37687 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37688 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37689 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37690 | PORT_MODIFY("IN-6") | |
| 37691 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37692 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37693 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37694 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37695 | PORT_MODIFY("IN-8") | |
| 37696 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c or b") | |
| 37697 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nodeal") | |
| 37698 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("deal") | |
| 37699 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("streak") | |
| 37700 | PORT_MODIFY("IN-16") | |
| 37701 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37702 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37703 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37704 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37705 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37706 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37707 | PORT_MODIFY("IN-17") | |
| 37708 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37709 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37710 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37711 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37712 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37713 | PORT_MODIFY("IN-18") | |
| 37714 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37715 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37716 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37717 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37718 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37719 | PORT_MODIFY("IN-19") | |
| 37720 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37721 | PORT_MODIFY("IN-20") | |
| 37722 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37723 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37724 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37725 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37726 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37727 | 37727 | INPUT_PORTS_END |
| 37728 | 37728 | |
| 37729 | 37729 | INPUT_PORTS_START( sc4dndbe25 ) |
| r31373 | r31374 | |
| 37773 | 37773 | } |
| 37774 | 37774 | |
| 37775 | 37775 | INPUT_PORTS_START( sc4dndbc ) // this structure is generated |
| 37776 | PORT_INCLUDE( sc4_base ) | |
| 37777 | PORT_MODIFY("IN-1") | |
| 37778 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37779 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37780 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37781 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37782 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37783 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37784 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37785 | PORT_MODIFY("IN-2") | |
| 37786 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37787 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 37788 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 37789 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37790 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 37791 | PORT_MODIFY("IN-3") | |
| 37792 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37793 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37794 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37795 | PORT_MODIFY("IN-5") | |
| 37796 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37797 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37798 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37799 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37800 | PORT_MODIFY("IN-6") | |
| 37801 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37802 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37803 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37804 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37805 | PORT_MODIFY("IN-8") | |
| 37806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 37807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 37808 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37809 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nodeal") | |
| 37810 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("pl del") | |
| 37811 | PORT_MODIFY("IN-9") | |
| 37812 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("deal") | |
| 37813 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk stk") | |
| 37814 | PORT_MODIFY("IN-16") | |
| 37815 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37816 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37817 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37818 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37819 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37820 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37821 | PORT_MODIFY("IN-17") | |
| 37822 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37823 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37824 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37825 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37826 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37827 | PORT_MODIFY("IN-18") | |
| 37828 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37829 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37830 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37831 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37832 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37833 | PORT_MODIFY("IN-19") | |
| 37834 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37835 | PORT_MODIFY("IN-20") | |
| 37836 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37837 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37838 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37839 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37840 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37776 | PORT_INCLUDE( sc4_base ) | |
| 37777 | PORT_MODIFY("IN-1") | |
| 37778 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37779 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37780 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37781 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37782 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 37783 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37784 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 37785 | PORT_MODIFY("IN-2") | |
| 37786 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 37787 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 37788 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 37789 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37790 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 37791 | PORT_MODIFY("IN-3") | |
| 37792 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37793 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37794 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37795 | PORT_MODIFY("IN-5") | |
| 37796 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37797 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37798 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37799 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37800 | PORT_MODIFY("IN-6") | |
| 37801 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37802 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37803 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37804 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37805 | PORT_MODIFY("IN-8") | |
| 37806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cs bus") | |
| 37807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 37808 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mes") | |
| 37809 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nodeal") | |
| 37810 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("pl del") | |
| 37811 | PORT_MODIFY("IN-9") | |
| 37812 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("deal") | |
| 37813 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk stk") | |
| 37814 | PORT_MODIFY("IN-16") | |
| 37815 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 37816 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 37817 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 37818 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 37819 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 37820 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 37821 | PORT_MODIFY("IN-17") | |
| 37822 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 37823 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 37824 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 37825 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 37826 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 37827 | PORT_MODIFY("IN-18") | |
| 37828 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 37829 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 37830 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 37831 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 37832 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 37833 | PORT_MODIFY("IN-19") | |
| 37834 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 37835 | PORT_MODIFY("IN-20") | |
| 37836 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37837 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37838 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37839 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37840 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37841 | 37841 | INPUT_PORTS_END |
| 37842 | 37842 | |
| 37843 | 37843 | INPUT_PORTS_START( sc4dndbc70 ) |
| r31373 | r31374 | |
| 37869 | 37869 | } |
| 37870 | 37870 | |
| 37871 | 37871 | INPUT_PORTS_START( sc4dmine ) // this structure is generated |
| 37872 | PORT_INCLUDE( sc4_base ) | |
| 37873 | PORT_MODIFY("IN-1") | |
| 37874 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37875 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37876 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37877 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37878 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 37879 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37880 | PORT_MODIFY("IN-2") | |
| 37881 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37882 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37883 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37884 | PORT_MODIFY("IN-3") | |
| 37885 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37886 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37887 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37888 | PORT_MODIFY("IN-4") | |
| 37889 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 37890 | PORT_MODIFY("IN-5") | |
| 37891 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37892 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37893 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37894 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37895 | PORT_MODIFY("IN-6") | |
| 37896 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37897 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37898 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37899 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37900 | PORT_MODIFY("IN-8") | |
| 37901 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 37902 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 37903 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 37904 | PORT_MODIFY("IN-16") | |
| 37905 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 37906 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 37907 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 37908 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 37909 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 37910 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 37911 | PORT_MODIFY("IN-17") | |
| 37912 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 37913 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 37914 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 37915 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 37916 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 37917 | PORT_MODIFY("IN-18") | |
| 37918 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 37919 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 37920 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 37921 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 37922 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 37923 | PORT_MODIFY("IN-19") | |
| 37924 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 37925 | PORT_MODIFY("IN-20") | |
| 37926 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37927 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37928 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37929 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37930 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37872 | PORT_INCLUDE( sc4_base ) | |
| 37873 | PORT_MODIFY("IN-1") | |
| 37874 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37875 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37876 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37877 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37878 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 37879 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37880 | PORT_MODIFY("IN-2") | |
| 37881 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37882 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37883 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37884 | PORT_MODIFY("IN-3") | |
| 37885 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37886 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37887 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37888 | PORT_MODIFY("IN-4") | |
| 37889 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 37890 | PORT_MODIFY("IN-5") | |
| 37891 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37892 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37893 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37894 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37895 | PORT_MODIFY("IN-6") | |
| 37896 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37897 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37898 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37899 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37900 | PORT_MODIFY("IN-8") | |
| 37901 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 37902 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("spins") | |
| 37903 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 37904 | PORT_MODIFY("IN-16") | |
| 37905 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 37906 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 37907 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 37908 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 37909 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 37910 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 37911 | PORT_MODIFY("IN-17") | |
| 37912 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 37913 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 37914 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 37915 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 37916 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 37917 | PORT_MODIFY("IN-18") | |
| 37918 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 37919 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 37920 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 37921 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 37922 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 37923 | PORT_MODIFY("IN-19") | |
| 37924 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 37925 | PORT_MODIFY("IN-20") | |
| 37926 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 37927 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 37928 | // 0x0004 - "serdor" // standard input (expected here) | |
| 37929 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 37930 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37931 | 37931 | INPUT_PORTS_END |
| 37932 | 37932 | |
| 37933 | 37933 | // PR1307 AWP DIAMOND MINE PR1307 DIAM MINE SOUNDS11 |
| r31373 | r31374 | |
| 37962 | 37962 | } |
| 37963 | 37963 | |
| 37964 | 37964 | INPUT_PORTS_START( sc4ddosh ) // this structure is generated |
| 37965 | PORT_INCLUDE( sc4_base ) | |
| 37966 | PORT_MODIFY("IN-1") | |
| 37967 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37968 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37969 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37970 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37971 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 37972 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37973 | PORT_MODIFY("IN-2") | |
| 37974 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37975 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37976 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37977 | PORT_MODIFY("IN-3") | |
| 37978 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37979 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37980 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37981 | PORT_MODIFY("IN-4") | |
| 37982 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 37983 | PORT_MODIFY("IN-5") | |
| 37984 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37985 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37986 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37987 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37988 | PORT_MODIFY("IN-6") | |
| 37989 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37990 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37991 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37992 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37993 | PORT_MODIFY("IN-8") | |
| 37994 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 37995 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudges") | |
| 37996 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 37997 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 37998 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk kos") | |
| 37999 | PORT_MODIFY("IN-16") | |
| 38000 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38001 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38002 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38003 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38004 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38005 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 38006 | PORT_MODIFY("IN-17") | |
| 38007 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38008 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38009 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38010 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38011 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 38012 | PORT_MODIFY("IN-18") | |
| 38013 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 38014 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 38015 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 38016 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 38017 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 38018 | PORT_MODIFY("IN-19") | |
| 38019 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 38020 | PORT_MODIFY("IN-20") | |
| 38021 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38022 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38023 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38024 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38025 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 37965 | PORT_INCLUDE( sc4_base ) | |
| 37966 | PORT_MODIFY("IN-1") | |
| 37967 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 37968 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 37969 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 37970 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 37971 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 37972 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 37973 | PORT_MODIFY("IN-2") | |
| 37974 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 37975 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 37976 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 37977 | PORT_MODIFY("IN-3") | |
| 37978 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 37979 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 37980 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 37981 | PORT_MODIFY("IN-4") | |
| 37982 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 37983 | PORT_MODIFY("IN-5") | |
| 37984 | // 0x0001 - "priz4" // standard input (expected here) | |
| 37985 | // 0x0002 - "priz3" // standard input (expected here) | |
| 37986 | // 0x0004 - "priz2" // standard input (expected here) | |
| 37987 | // 0x0008 - "priz1" // standard input (expected here) | |
| 37988 | PORT_MODIFY("IN-6") | |
| 37989 | // 0x0001 - "perc1" // standard input (expected here) | |
| 37990 | // 0x0002 - "perc2" // standard input (expected here) | |
| 37991 | // 0x0004 - "perc3" // standard input (expected here) | |
| 37992 | // 0x0008 - "perc4" // standard input (expected here) | |
| 37993 | PORT_MODIFY("IN-8") | |
| 37994 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 37995 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nudges") | |
| 37996 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 37997 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 37998 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk kos") | |
| 37999 | PORT_MODIFY("IN-16") | |
| 38000 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38001 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38002 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38003 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38004 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38005 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 38006 | PORT_MODIFY("IN-17") | |
| 38007 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38008 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38009 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38010 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38011 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 38012 | PORT_MODIFY("IN-18") | |
| 38013 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 38014 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 38015 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 38016 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 38017 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 38018 | PORT_MODIFY("IN-19") | |
| 38019 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 38020 | PORT_MODIFY("IN-20") | |
| 38021 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38022 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38023 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38024 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38025 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38026 | 38026 | INPUT_PORTS_END |
| 38027 | 38027 | |
| 38028 | 38028 | // saw a crash on exit with this game, why? |
| r31373 | r31374 | |
| 38046 | 38046 | GAMEL( 200?, sc4ddoshk ,sc4ddosh, sc4, sc4ddosh, sc4_state, sc4ddosh_mbus, ROT0, "BFM","Doctor Dosh (Bellfruit) (Scorpion 4) (set 16)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 38047 | 38047 | |
| 38048 | 38048 | INPUT_PORTS_START( sc4dhh ) // this structure is generated |
| 38049 | PORT_INCLUDE( sc4_base ) | |
| 38050 | PORT_MODIFY("IN-1") | |
| 38051 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38052 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38053 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38054 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38055 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 38056 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38057 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38058 | PORT_MODIFY("IN-2") | |
| 38059 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38060 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38061 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38062 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38063 | PORT_MODIFY("IN-3") | |
| 38064 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38065 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 38066 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 38067 | PORT_MODIFY("IN-5") | |
| 38068 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38069 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38070 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38071 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38072 | PORT_MODIFY("IN-6") | |
| 38073 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38074 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38075 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38076 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38077 | PORT_MODIFY("IN-8") | |
| 38078 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("sink") | |
| 38079 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo rig") | |
| 38080 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi rig") | |
| 38081 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo lef") | |
| 38082 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi lef") | |
| 38083 | PORT_MODIFY("IN-9") | |
| 38084 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("streak") | |
| 38085 | PORT_MODIFY("IN-16") | |
| 38086 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38087 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38088 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38089 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38090 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38091 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38092 | PORT_MODIFY("IN-17") | |
| 38093 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38094 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38095 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38096 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38097 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38098 | PORT_MODIFY("IN-18") | |
| 38099 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38100 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38101 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38102 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38103 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38104 | PORT_MODIFY("IN-19") | |
| 38105 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38106 | PORT_MODIFY("IN-20") | |
| 38107 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38108 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38109 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38110 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38111 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38049 | PORT_INCLUDE( sc4_base ) | |
| 38050 | PORT_MODIFY("IN-1") | |
| 38051 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38052 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38053 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38054 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38055 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 38056 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38057 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38058 | PORT_MODIFY("IN-2") | |
| 38059 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38060 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38061 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38062 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38063 | PORT_MODIFY("IN-3") | |
| 38064 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38065 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 38066 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 38067 | PORT_MODIFY("IN-5") | |
| 38068 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38069 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38070 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38071 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38072 | PORT_MODIFY("IN-6") | |
| 38073 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38074 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38075 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38076 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38077 | PORT_MODIFY("IN-8") | |
| 38078 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("sink") | |
| 38079 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo rig") | |
| 38080 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi rig") | |
| 38081 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo lef") | |
| 38082 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi lef") | |
| 38083 | PORT_MODIFY("IN-9") | |
| 38084 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("streak") | |
| 38085 | PORT_MODIFY("IN-16") | |
| 38086 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38087 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38088 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38089 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38090 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38091 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38092 | PORT_MODIFY("IN-17") | |
| 38093 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38094 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38095 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38096 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38097 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38098 | PORT_MODIFY("IN-18") | |
| 38099 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38100 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38101 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38102 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38103 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38104 | PORT_MODIFY("IN-19") | |
| 38105 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38106 | PORT_MODIFY("IN-20") | |
| 38107 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38108 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38109 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38110 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38111 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38112 | 38112 | INPUT_PORTS_END |
| 38113 | 38113 | |
| 38114 | 38114 | // board positions & steppa feature don't light anything, investigate (might only be a problem in demo mode?) |
| r31373 | r31374 | |
| 38137 | 38137 | } |
| 38138 | 38138 | |
| 38139 | 38139 | INPUT_PORTS_START( sc4dough ) // this structure is generated |
| 38140 | PORT_INCLUDE( sc4_base ) | |
| 38141 | PORT_MODIFY("IN-1") | |
| 38142 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 38143 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38144 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38145 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38146 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 38147 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38148 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38149 | PORT_MODIFY("IN-2") | |
| 38150 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38151 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 38152 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38153 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38154 | PORT_MODIFY("IN-5") | |
| 38155 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38156 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38157 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38158 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38159 | PORT_MODIFY("IN-6") | |
| 38160 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38161 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38162 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38163 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38164 | PORT_MODIFY("IN-8") | |
| 38165 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 38166 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low") | |
| 38167 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("sshoot") | |
| 38168 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("f shot") | |
| 38169 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk bon") | |
| 38170 | PORT_MODIFY("IN-9") | |
| 38171 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("high") | |
| 38172 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c shot") | |
| 38173 | PORT_MODIFY("IN-16") | |
| 38174 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38175 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38176 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38177 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38178 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38179 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38180 | PORT_MODIFY("IN-17") | |
| 38181 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38182 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38183 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38184 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38185 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38186 | PORT_MODIFY("IN-18") | |
| 38187 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38188 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38189 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38190 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38191 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38192 | PORT_MODIFY("IN-19") | |
| 38193 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38194 | PORT_MODIFY("IN-20") | |
| 38195 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38196 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38197 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38198 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38199 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38140 | PORT_INCLUDE( sc4_base ) | |
| 38141 | PORT_MODIFY("IN-1") | |
| 38142 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 38143 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38144 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38145 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38146 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 38147 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38148 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38149 | PORT_MODIFY("IN-2") | |
| 38150 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38151 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 38152 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38153 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38154 | PORT_MODIFY("IN-5") | |
| 38155 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38156 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38157 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38158 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38159 | PORT_MODIFY("IN-6") | |
| 38160 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38161 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38162 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38163 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38164 | PORT_MODIFY("IN-8") | |
| 38165 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 38166 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("low") | |
| 38167 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("sshoot") | |
| 38168 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("f shot") | |
| 38169 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk bon") | |
| 38170 | PORT_MODIFY("IN-9") | |
| 38171 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("high") | |
| 38172 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c shot") | |
| 38173 | PORT_MODIFY("IN-16") | |
| 38174 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38175 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38176 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38177 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38178 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38179 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38180 | PORT_MODIFY("IN-17") | |
| 38181 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38182 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38183 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38184 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38185 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38186 | PORT_MODIFY("IN-18") | |
| 38187 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38188 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38189 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38190 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38191 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38192 | PORT_MODIFY("IN-19") | |
| 38193 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38194 | PORT_MODIFY("IN-20") | |
| 38195 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38196 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38197 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38198 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38199 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38200 | 38200 | INPUT_PORTS_END |
| 38201 | 38201 | |
| 38202 | 38202 | // PR1615 AWP DOUGH SELECTA SCORP4 PR1615 DOUGH SELECTA SOUNDS11 DOUGH SELECTA S.SITE |
| r31373 | r31374 | |
| 38220 | 38220 | } |
| 38221 | 38221 | |
| 38222 | 38222 | INPUT_PORTS_START( sc4emmer ) // this structure is generated |
| 38223 | PORT_INCLUDE( sc4_base ) | |
| 38224 | PORT_MODIFY("IN-1") | |
| 38225 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 38226 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 38227 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 38228 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 38229 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 38230 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 38231 | PORT_MODIFY("IN-2") | |
| 38232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 38233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 38234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 38235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38236 | PORT_MODIFY("IN-3") | |
| 38237 | // 0x0004 - "stk3" // standard input (expected here) | |
| 38238 | // 0x0008 - "stk1" // standard input (expected here) | |
| 38239 | // 0x0010 - "stk2" // standard input (expected here) | |
| 38240 | PORT_MODIFY("IN-5") | |
| 38241 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 38242 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 38243 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 38244 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 38245 | PORT_MODIFY("IN-6") | |
| 38246 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 38247 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 38248 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 38249 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 38250 | PORT_MODIFY("IN-8") | |
| 38251 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo") | |
| 38252 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi") | |
| 38253 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 38254 | PORT_MODIFY("IN-16") | |
| 38255 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38256 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38257 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38258 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38259 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38260 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38261 | PORT_MODIFY("IN-17") | |
| 38262 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38263 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38264 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38265 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38266 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38267 | PORT_MODIFY("IN-18") | |
| 38268 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38269 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38270 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38271 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38272 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38273 | PORT_MODIFY("IN-19") | |
| 38274 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38275 | PORT_MODIFY("IN-20") | |
| 38276 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 38277 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 38278 | // 0x0004 - "topdr" // standard input (expected here) | |
| 38279 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 38280 | // 0x0010 - "dump" // standard input (expected here) | |
| 38223 | PORT_INCLUDE( sc4_base ) | |
| 38224 | PORT_MODIFY("IN-1") | |
| 38225 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 38226 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 38227 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 38228 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 38229 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 38230 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 38231 | PORT_MODIFY("IN-2") | |
| 38232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 38233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 38234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 38235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38236 | PORT_MODIFY("IN-3") | |
| 38237 | // 0x0004 - "stk3" // standard input (expected here) | |
| 38238 | // 0x0008 - "stk1" // standard input (expected here) | |
| 38239 | // 0x0010 - "stk2" // standard input (expected here) | |
| 38240 | PORT_MODIFY("IN-5") | |
| 38241 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 38242 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 38243 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 38244 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 38245 | PORT_MODIFY("IN-6") | |
| 38246 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 38247 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 38248 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 38249 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 38250 | PORT_MODIFY("IN-8") | |
| 38251 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo") | |
| 38252 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi") | |
| 38253 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 38254 | PORT_MODIFY("IN-16") | |
| 38255 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38256 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38257 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38258 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38259 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38260 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38261 | PORT_MODIFY("IN-17") | |
| 38262 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38263 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38264 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38265 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38266 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38267 | PORT_MODIFY("IN-18") | |
| 38268 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38269 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38270 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38271 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38272 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38273 | PORT_MODIFY("IN-19") | |
| 38274 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38275 | PORT_MODIFY("IN-20") | |
| 38276 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 38277 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 38278 | // 0x0004 - "topdr" // standard input (expected here) | |
| 38279 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 38280 | // 0x0010 - "dump" // standard input (expected here) | |
| 38281 | 38281 | INPUT_PORTS_END |
| 38282 | 38282 | |
| 38283 | 38283 | // PR2313 EMMERDALE EMMR SOUNDS EMMERDALE |
| r31373 | r31374 | |
| 38304 | 38304 | } |
| 38305 | 38305 | |
| 38306 | 38306 | INPUT_PORTS_START( sc4evol ) // this structure is generated |
| 38307 | PORT_INCLUDE( sc4_base ) | |
| 38308 | PORT_MODIFY("IN-1") | |
| 38309 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 38310 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 38311 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 38312 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 38313 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 38314 | PORT_MODIFY("IN-2") | |
| 38315 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 38316 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 38317 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38318 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38319 | PORT_MODIFY("IN-8") | |
| 38320 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 38321 | PORT_MODIFY("IN-16") | |
| 38322 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38323 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38324 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38325 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38326 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38327 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 38328 | PORT_MODIFY("IN-17") | |
| 38329 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38330 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38331 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38332 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38333 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38334 | PORT_MODIFY("IN-18") | |
| 38335 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38336 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38337 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38338 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38339 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38340 | PORT_MODIFY("IN-19") | |
| 38341 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38342 | PORT_MODIFY("IN-20") | |
| 38343 | // 0x0001 - "test" // standard input (motherboard) | |
| 38344 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 38345 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 38346 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 38347 | // 0x0010 - "deflt" // standard input (expected here) | |
| 38307 | PORT_INCLUDE( sc4_base ) | |
| 38308 | PORT_MODIFY("IN-1") | |
| 38309 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 38310 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 38311 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 38312 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 38313 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 38314 | PORT_MODIFY("IN-2") | |
| 38315 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 38316 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 38317 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38318 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38319 | PORT_MODIFY("IN-8") | |
| 38320 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 38321 | PORT_MODIFY("IN-16") | |
| 38322 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38323 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38324 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38325 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38326 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38327 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 38328 | PORT_MODIFY("IN-17") | |
| 38329 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38330 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38331 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38332 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38333 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38334 | PORT_MODIFY("IN-18") | |
| 38335 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38336 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38337 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38338 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38339 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38340 | PORT_MODIFY("IN-19") | |
| 38341 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38342 | PORT_MODIFY("IN-20") | |
| 38343 | // 0x0001 - "test" // standard input (motherboard) | |
| 38344 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 38345 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 38346 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 38347 | // 0x0010 - "deflt" // standard input (expected here) | |
| 38348 | 38348 | INPUT_PORTS_END |
| 38349 | 38349 | |
| 38350 | 38350 | // PR2135 EVOLUTION EVOL SOUNDS EVOLUTION |
| r31373 | r31374 | |
| 38374 | 38374 | } |
| 38375 | 38375 | |
| 38376 | 38376 | INPUT_PORTS_START( sc4fguy ) // this structure is generated |
| 38377 | PORT_INCLUDE( sc4_base ) | |
| 38378 | PORT_MODIFY("IN-1") | |
| 38379 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38380 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38381 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38382 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38383 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 38384 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38385 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38386 | PORT_MODIFY("IN-2") | |
| 38387 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 38388 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38389 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38390 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38391 | PORT_MODIFY("IN-3") | |
| 38392 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38393 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38394 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38395 | PORT_MODIFY("IN-5") | |
| 38396 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38397 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38398 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38399 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38400 | PORT_MODIFY("IN-6") | |
| 38401 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38402 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38403 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38404 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38405 | PORT_MODIFY("IN-8") | |
| 38406 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c or b") | |
| 38407 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("ply fg") | |
| 38408 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 38409 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 38410 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("streak") | |
| 38411 | PORT_MODIFY("IN-16") | |
| 38412 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38413 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38414 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38415 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38416 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38417 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38418 | PORT_MODIFY("IN-17") | |
| 38419 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38420 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38421 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38422 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38423 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38424 | PORT_MODIFY("IN-18") | |
| 38425 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38426 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38427 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38428 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38429 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38430 | PORT_MODIFY("IN-19") | |
| 38431 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38432 | PORT_MODIFY("IN-20") | |
| 38433 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38434 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38435 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38436 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38437 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38377 | PORT_INCLUDE( sc4_base ) | |
| 38378 | PORT_MODIFY("IN-1") | |
| 38379 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38380 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38381 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38382 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38383 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 38384 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38385 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38386 | PORT_MODIFY("IN-2") | |
| 38387 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 38388 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38389 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38390 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38391 | PORT_MODIFY("IN-3") | |
| 38392 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38393 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38394 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38395 | PORT_MODIFY("IN-5") | |
| 38396 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38397 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38398 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38399 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38400 | PORT_MODIFY("IN-6") | |
| 38401 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38402 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38403 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38404 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38405 | PORT_MODIFY("IN-8") | |
| 38406 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c or b") | |
| 38407 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("ply fg") | |
| 38408 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 38409 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 38410 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("streak") | |
| 38411 | PORT_MODIFY("IN-16") | |
| 38412 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38413 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38414 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38415 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38416 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38417 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38418 | PORT_MODIFY("IN-17") | |
| 38419 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38420 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38421 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38422 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38423 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38424 | PORT_MODIFY("IN-18") | |
| 38425 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38426 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38427 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38428 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38429 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38430 | PORT_MODIFY("IN-19") | |
| 38431 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38432 | PORT_MODIFY("IN-20") | |
| 38433 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38434 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38435 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38436 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38437 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38438 | 38438 | INPUT_PORTS_END |
| 38439 | 38439 | |
| 38440 | 38440 | INPUT_PORTS_START( sc4fguy35 ) |
| r31373 | r31374 | |
| 38476 | 38476 | } |
| 38477 | 38477 | |
| 38478 | 38478 | INPUT_PORTS_START( sc4fbspn ) // this structure is generated |
| 38479 | PORT_INCLUDE( sc4_base ) | |
| 38480 | PORT_MODIFY("IN-1") | |
| 38481 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 38482 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38483 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38484 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38485 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 38486 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38487 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38488 | PORT_MODIFY("IN-2") | |
| 38489 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38490 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 38491 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38492 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38493 | PORT_MODIFY("IN-4") | |
| 38494 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 38495 | PORT_MODIFY("IN-5") | |
| 38496 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38497 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38498 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38499 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38500 | PORT_MODIFY("IN-6") | |
| 38501 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38502 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38503 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38504 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38505 | PORT_MODIFY("IN-8") | |
| 38506 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("g gutz") | |
| 38507 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("g bonu") | |
| 38508 | PORT_MODIFY("IN-16") | |
| 38509 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38510 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38511 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38512 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38513 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38514 | PORT_MODIFY("IN-17") | |
| 38515 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38516 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38517 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38518 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38519 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38520 | PORT_MODIFY("IN-18") | |
| 38521 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38522 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38523 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38524 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38525 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38526 | PORT_MODIFY("IN-19") | |
| 38527 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38528 | PORT_MODIFY("IN-20") | |
| 38529 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38530 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38531 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38532 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38533 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38479 | PORT_INCLUDE( sc4_base ) | |
| 38480 | PORT_MODIFY("IN-1") | |
| 38481 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 38482 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38483 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38484 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38485 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 38486 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38487 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38488 | PORT_MODIFY("IN-2") | |
| 38489 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38490 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 38491 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38492 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38493 | PORT_MODIFY("IN-4") | |
| 38494 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 38495 | PORT_MODIFY("IN-5") | |
| 38496 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38497 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38498 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38499 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38500 | PORT_MODIFY("IN-6") | |
| 38501 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38502 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38503 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38504 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38505 | PORT_MODIFY("IN-8") | |
| 38506 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("g gutz") | |
| 38507 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("g bonu") | |
| 38508 | PORT_MODIFY("IN-16") | |
| 38509 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38510 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38511 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38512 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38513 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38514 | PORT_MODIFY("IN-17") | |
| 38515 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38516 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38517 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38518 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38519 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38520 | PORT_MODIFY("IN-18") | |
| 38521 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38522 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38523 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38524 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38525 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38526 | PORT_MODIFY("IN-19") | |
| 38527 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38528 | PORT_MODIFY("IN-20") | |
| 38529 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38530 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38531 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38532 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38533 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38534 | 38534 | INPUT_PORTS_END |
| 38535 | 38535 | |
| 38536 | 38536 | // PR1721 AWP FAT BOY SPIN SCORP4 PR1701 FAT BOY SPIN SOUNDS11 FAT BOY SPIN S.SITE |
| r31373 | r31374 | |
| 38557 | 38557 | } |
| 38558 | 38558 | |
| 38559 | 38559 | INPUT_PORTS_START( sc4fmj ) // this structure is generated |
| 38560 | PORT_INCLUDE( sc4_base ) | |
| 38561 | PORT_MODIFY("IN-1") | |
| 38562 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 38563 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 38564 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 38565 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 38566 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 38567 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 38568 | PORT_MODIFY("IN-2") | |
| 38569 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 38570 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 38571 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 38572 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38573 | PORT_MODIFY("IN-3") | |
| 38574 | // 0x0004 - "stk3" // standard input (expected here) | |
| 38575 | // 0x0008 - "stk1" // standard input (expected here) | |
| 38576 | // 0x0010 - "stk2" // standard input (expected here) | |
| 38577 | PORT_MODIFY("IN-5") | |
| 38578 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 38579 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 38580 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 38581 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 38582 | PORT_MODIFY("IN-6") | |
| 38583 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 38584 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 38585 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 38586 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 38587 | PORT_MODIFY("IN-8") | |
| 38588 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bon") | |
| 38589 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 38590 | PORT_MODIFY("IN-16") | |
| 38591 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38592 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38593 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38594 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38595 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38596 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38597 | PORT_MODIFY("IN-17") | |
| 38598 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38599 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38600 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38601 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38602 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38603 | PORT_MODIFY("IN-18") | |
| 38604 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38605 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38606 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38607 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38608 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38609 | PORT_MODIFY("IN-19") | |
| 38610 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38611 | PORT_MODIFY("IN-20") | |
| 38612 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 38613 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 38614 | // 0x0004 - "topdr" // standard input (expected here) | |
| 38615 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 38616 | // 0x0010 - "dump" // standard input (expected here) | |
| 38560 | PORT_INCLUDE( sc4_base ) | |
| 38561 | PORT_MODIFY("IN-1") | |
| 38562 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 38563 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 38564 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 38565 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 38566 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 38567 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 38568 | PORT_MODIFY("IN-2") | |
| 38569 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 38570 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 38571 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 38572 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38573 | PORT_MODIFY("IN-3") | |
| 38574 | // 0x0004 - "stk3" // standard input (expected here) | |
| 38575 | // 0x0008 - "stk1" // standard input (expected here) | |
| 38576 | // 0x0010 - "stk2" // standard input (expected here) | |
| 38577 | PORT_MODIFY("IN-5") | |
| 38578 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 38579 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 38580 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 38581 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 38582 | PORT_MODIFY("IN-6") | |
| 38583 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 38584 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 38585 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 38586 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 38587 | PORT_MODIFY("IN-8") | |
| 38588 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bon") | |
| 38589 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 38590 | PORT_MODIFY("IN-16") | |
| 38591 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38592 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38593 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38594 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38595 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38596 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38597 | PORT_MODIFY("IN-17") | |
| 38598 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38599 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38600 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38601 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38602 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38603 | PORT_MODIFY("IN-18") | |
| 38604 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38605 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38606 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38607 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38608 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38609 | PORT_MODIFY("IN-19") | |
| 38610 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38611 | PORT_MODIFY("IN-20") | |
| 38612 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 38613 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 38614 | // 0x0004 - "topdr" // standard input (expected here) | |
| 38615 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 38616 | // 0x0010 - "dump" // standard input (expected here) | |
| 38617 | 38617 | INPUT_PORTS_END |
| 38618 | 38618 | |
| 38619 | 38619 | // PR2328 FULL METAL JACKPOT FULLM SOUNDS F METAL JACKPOT |
| r31373 | r31374 | |
| 38640 | 38640 | } |
| 38641 | 38641 | |
| 38642 | 38642 | INPUT_PORTS_START( sc4gd ) // this structure is generated |
| 38643 | PORT_INCLUDE( sc4_base ) | |
| 38644 | PORT_MODIFY("IN-1") | |
| 38645 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38646 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 38647 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 38648 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 38649 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 38650 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38651 | PORT_MODIFY("IN-2") | |
| 38652 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38653 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38654 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38655 | PORT_MODIFY("IN-3") | |
| 38656 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38657 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38658 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38659 | PORT_MODIFY("IN-5") | |
| 38660 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38661 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38662 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38663 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38664 | PORT_MODIFY("IN-6") | |
| 38665 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38666 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38667 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38668 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38669 | PORT_MODIFY("IN-8") | |
| 38670 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk haz") | |
| 38671 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk ss") | |
| 38672 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 38673 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk sht") | |
| 38674 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk fea") | |
| 38675 | PORT_MODIFY("IN-16") | |
| 38676 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38677 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38678 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38679 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38680 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38681 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38682 | PORT_MODIFY("IN-17") | |
| 38683 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38684 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38685 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38686 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38687 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38688 | PORT_MODIFY("IN-18") | |
| 38689 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38690 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38691 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38692 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38693 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38694 | PORT_MODIFY("IN-19") | |
| 38695 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38696 | PORT_MODIFY("IN-20") | |
| 38697 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38698 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38699 | // 0x0004 - "topdor" // standard input (expected here) | |
| 38700 | // 0x0008 - "botdor" // standard input (expected here) | |
| 38701 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38643 | PORT_INCLUDE( sc4_base ) | |
| 38644 | PORT_MODIFY("IN-1") | |
| 38645 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38646 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 38647 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 38648 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 38649 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 38650 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38651 | PORT_MODIFY("IN-2") | |
| 38652 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38653 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38654 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38655 | PORT_MODIFY("IN-3") | |
| 38656 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38657 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38658 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38659 | PORT_MODIFY("IN-5") | |
| 38660 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38661 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38662 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38663 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38664 | PORT_MODIFY("IN-6") | |
| 38665 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38666 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38667 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38668 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38669 | PORT_MODIFY("IN-8") | |
| 38670 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk haz") | |
| 38671 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk ss") | |
| 38672 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 38673 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk sht") | |
| 38674 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk fea") | |
| 38675 | PORT_MODIFY("IN-16") | |
| 38676 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38677 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38678 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38679 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38680 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38681 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38682 | PORT_MODIFY("IN-17") | |
| 38683 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38684 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38685 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38686 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38687 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38688 | PORT_MODIFY("IN-18") | |
| 38689 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38690 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38691 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38692 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38693 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38694 | PORT_MODIFY("IN-19") | |
| 38695 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38696 | PORT_MODIFY("IN-20") | |
| 38697 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38698 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38699 | // 0x0004 - "topdor" // standard input (expected here) | |
| 38700 | // 0x0008 - "botdor" // standard input (expected here) | |
| 38701 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38702 | 38702 | INPUT_PORTS_END |
| 38703 | 38703 | |
| 38704 | 38704 | // PR1016 GOLD DIGGER PR1016 GOLD DIGGER SOUNDS11 |
| r31373 | r31374 | |
| 38729 | 38729 | |
| 38730 | 38730 | |
| 38731 | 38731 | INPUT_PORTS_START( sc4gdclb ) // this structure is generated |
| 38732 | PORT_INCLUDE( sc4_base ) | |
| 38733 | PORT_MODIFY("IN-1") | |
| 38734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 38735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 38736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 38737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 38738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 38739 | PORT_MODIFY("IN-2") | |
| 38740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 38741 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 38742 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38743 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38744 | PORT_MODIFY("IN-3") | |
| 38745 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38746 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38747 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38748 | PORT_MODIFY("IN-4") | |
| 38749 | // 0x0001 - "hop2lo" // unexpected here | |
| 38750 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 38751 | PORT_MODIFY("IN-5") | |
| 38752 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38753 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38754 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38755 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38756 | PORT_MODIFY("IN-16") | |
| 38757 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38758 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38759 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38760 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38761 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38762 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38763 | PORT_MODIFY("IN-17") | |
| 38764 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38765 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38766 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38767 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38768 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38769 | PORT_MODIFY("IN-18") | |
| 38770 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38771 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38772 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38773 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 38774 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 38775 | PORT_MODIFY("IN-19") | |
| 38776 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 38777 | PORT_MODIFY("IN-20") | |
| 38778 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38779 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38780 | // 0x0004 - "topdor" // standard input (expected here) | |
| 38781 | // 0x0008 - "botdor" // standard input (expected here) | |
| 38782 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38732 | PORT_INCLUDE( sc4_base ) | |
| 38733 | PORT_MODIFY("IN-1") | |
| 38734 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 38735 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 38736 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 38737 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 38738 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 38739 | PORT_MODIFY("IN-2") | |
| 38740 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 38741 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 38742 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38743 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38744 | PORT_MODIFY("IN-3") | |
| 38745 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38746 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38747 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38748 | PORT_MODIFY("IN-4") | |
| 38749 | // 0x0001 - "hop2lo" // unexpected here | |
| 38750 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 38751 | PORT_MODIFY("IN-5") | |
| 38752 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38753 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38754 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38755 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38756 | PORT_MODIFY("IN-16") | |
| 38757 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 38758 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 38759 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 38760 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 38761 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 38762 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38763 | PORT_MODIFY("IN-17") | |
| 38764 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 38765 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 38766 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 38767 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 38768 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38769 | PORT_MODIFY("IN-18") | |
| 38770 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38771 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38772 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38773 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 38774 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 38775 | PORT_MODIFY("IN-19") | |
| 38776 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 38777 | PORT_MODIFY("IN-20") | |
| 38778 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38779 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38780 | // 0x0004 - "topdor" // standard input (expected here) | |
| 38781 | // 0x0008 - "botdor" // standard input (expected here) | |
| 38782 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38783 | 38783 | INPUT_PORTS_END |
| 38784 | 38784 | |
| 38785 | 38785 | // PR1137 CLUB GOLD DIGGER PR1137 GOLDD CL SOUNDS11 |
| r31373 | r31374 | |
| 38813 | 38813 | } |
| 38814 | 38814 | |
| 38815 | 38815 | INPUT_PORTS_START( sc4gball ) // this structure is generated |
| 38816 | PORT_INCLUDE( sc4_base ) | |
| 38817 | PORT_MODIFY("IN-1") | |
| 38818 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38819 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38820 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38821 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38822 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 38823 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38824 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38825 | PORT_MODIFY("IN-2") | |
| 38826 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38827 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38828 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38829 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38830 | PORT_MODIFY("IN-3") | |
| 38831 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38832 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 38833 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 38834 | PORT_MODIFY("IN-4") | |
| 38835 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 38836 | PORT_MODIFY("IN-5") | |
| 38837 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38838 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38839 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38840 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38841 | PORT_MODIFY("IN-6") | |
| 38842 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38843 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38844 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38845 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38846 | PORT_MODIFY("IN-16") | |
| 38847 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38848 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38849 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38850 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38851 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38852 | PORT_MODIFY("IN-17") | |
| 38853 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38854 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38855 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38856 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38857 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38858 | PORT_MODIFY("IN-18") | |
| 38859 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38860 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38861 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38862 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38863 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38864 | PORT_MODIFY("IN-19") | |
| 38865 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38866 | PORT_MODIFY("IN-20") | |
| 38867 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38868 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38869 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38870 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38871 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38816 | PORT_INCLUDE( sc4_base ) | |
| 38817 | PORT_MODIFY("IN-1") | |
| 38818 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38819 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38820 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38821 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38822 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 38823 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38824 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38825 | PORT_MODIFY("IN-2") | |
| 38826 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 38827 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38828 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38829 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38830 | PORT_MODIFY("IN-3") | |
| 38831 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38832 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 38833 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 38834 | PORT_MODIFY("IN-4") | |
| 38835 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 38836 | PORT_MODIFY("IN-5") | |
| 38837 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38838 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38839 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38840 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38841 | PORT_MODIFY("IN-6") | |
| 38842 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38843 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38844 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38845 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38846 | PORT_MODIFY("IN-16") | |
| 38847 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38848 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38849 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38850 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38851 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38852 | PORT_MODIFY("IN-17") | |
| 38853 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38854 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38855 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38856 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38857 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38858 | PORT_MODIFY("IN-18") | |
| 38859 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38860 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38861 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38862 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38863 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38864 | PORT_MODIFY("IN-19") | |
| 38865 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38866 | PORT_MODIFY("IN-20") | |
| 38867 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38868 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38869 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38870 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38871 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38872 | 38872 | INPUT_PORTS_END |
| 38873 | 38873 | |
| 38874 | 38874 | // this is a football themed game... completely different to golden balls casino |
| r31373 | r31374 | |
| 38895 | 38895 | } |
| 38896 | 38896 | |
| 38897 | 38897 | INPUT_PORTS_START( sc4gunp ) // this structure is generated |
| 38898 | PORT_INCLUDE( sc4_base ) | |
| 38899 | PORT_MODIFY("IN-1") | |
| 38900 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38901 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38902 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38903 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38904 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 38905 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38906 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38907 | PORT_MODIFY("IN-2") | |
| 38908 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 38909 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38910 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38911 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38912 | PORT_MODIFY("IN-3") | |
| 38913 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38914 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38915 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38916 | PORT_MODIFY("IN-5") | |
| 38917 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38918 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38919 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38920 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38921 | PORT_MODIFY("IN-6") | |
| 38922 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38923 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38924 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38925 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38926 | PORT_MODIFY("IN-8") | |
| 38927 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("do/die") | |
| 38928 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("sp d/d") | |
| 38929 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bns") | |
| 38930 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("s mess") | |
| 38931 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 38932 | PORT_MODIFY("IN-16") | |
| 38933 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38934 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38935 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38936 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38937 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38938 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38939 | PORT_MODIFY("IN-17") | |
| 38940 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38941 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38942 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38943 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38944 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38945 | PORT_MODIFY("IN-18") | |
| 38946 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38947 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38948 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38949 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38950 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38951 | PORT_MODIFY("IN-19") | |
| 38952 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38953 | PORT_MODIFY("IN-20") | |
| 38954 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38955 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38956 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38957 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38958 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38898 | PORT_INCLUDE( sc4_base ) | |
| 38899 | PORT_MODIFY("IN-1") | |
| 38900 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38901 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38902 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38903 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38904 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 38905 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38906 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 38907 | PORT_MODIFY("IN-2") | |
| 38908 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 38909 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 38910 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38911 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 38912 | PORT_MODIFY("IN-3") | |
| 38913 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 38914 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 38915 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 38916 | PORT_MODIFY("IN-5") | |
| 38917 | // 0x0001 - "priz4" // standard input (expected here) | |
| 38918 | // 0x0002 - "priz3" // standard input (expected here) | |
| 38919 | // 0x0004 - "priz2" // standard input (expected here) | |
| 38920 | // 0x0008 - "priz1" // standard input (expected here) | |
| 38921 | PORT_MODIFY("IN-6") | |
| 38922 | // 0x0001 - "perc1" // standard input (expected here) | |
| 38923 | // 0x0002 - "perc2" // standard input (expected here) | |
| 38924 | // 0x0004 - "perc3" // standard input (expected here) | |
| 38925 | // 0x0008 - "perc4" // standard input (expected here) | |
| 38926 | PORT_MODIFY("IN-8") | |
| 38927 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("do/die") | |
| 38928 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("sp d/d") | |
| 38929 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bns") | |
| 38930 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("s mess") | |
| 38931 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 38932 | PORT_MODIFY("IN-16") | |
| 38933 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 38934 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 38935 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 38936 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 38937 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 38938 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 38939 | PORT_MODIFY("IN-17") | |
| 38940 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 38941 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 38942 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 38943 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 38944 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 38945 | PORT_MODIFY("IN-18") | |
| 38946 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 38947 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 38948 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 38949 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 38950 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 38951 | PORT_MODIFY("IN-19") | |
| 38952 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 38953 | PORT_MODIFY("IN-20") | |
| 38954 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 38955 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 38956 | // 0x0004 - "serdor" // standard input (expected here) | |
| 38957 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 38958 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38959 | 38959 | INPUT_PORTS_END |
| 38960 | 38960 | |
| 38961 | 38961 | // PR3046 AWP THE GUNPOWDER SLOT S4 PR3016 GUNPOWDER SLOT SOUNDS11 GUNPOWDER SLOT S.SITE |
| r31373 | r31374 | |
| 38985 | 38985 | } |
| 38986 | 38986 | |
| 38987 | 38987 | INPUT_PORTS_START( sc4hapnt ) // this structure is generated |
| 38988 | PORT_INCLUDE( sc4_base ) | |
| 38989 | PORT_MODIFY("IN-1") | |
| 38990 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38991 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38992 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38993 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38994 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 38995 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38996 | PORT_MODIFY("IN-2") | |
| 38997 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 38998 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38999 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39000 | PORT_MODIFY("IN-4") | |
| 39001 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 39002 | PORT_MODIFY("IN-5") | |
| 39003 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39004 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39005 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39006 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39007 | PORT_MODIFY("IN-6") | |
| 39008 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39009 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39010 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39011 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39012 | PORT_MODIFY("IN-8") | |
| 39013 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk not") | |
| 39014 | PORT_MODIFY("IN-16") | |
| 39015 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39016 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39017 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39018 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39019 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39020 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 39021 | PORT_MODIFY("IN-17") | |
| 39022 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39023 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39024 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39025 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39026 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39027 | PORT_MODIFY("IN-18") | |
| 39028 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39029 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39030 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39031 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39032 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39033 | PORT_MODIFY("IN-19") | |
| 39034 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39035 | PORT_MODIFY("IN-20") | |
| 39036 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39037 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39038 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39039 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39040 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 38988 | PORT_INCLUDE( sc4_base ) | |
| 38989 | PORT_MODIFY("IN-1") | |
| 38990 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 38991 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 38992 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 38993 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 38994 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 38995 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 38996 | PORT_MODIFY("IN-2") | |
| 38997 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 38998 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 38999 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39000 | PORT_MODIFY("IN-4") | |
| 39001 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 39002 | PORT_MODIFY("IN-5") | |
| 39003 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39004 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39005 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39006 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39007 | PORT_MODIFY("IN-6") | |
| 39008 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39009 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39010 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39011 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39012 | PORT_MODIFY("IN-8") | |
| 39013 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk not") | |
| 39014 | PORT_MODIFY("IN-16") | |
| 39015 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39016 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39017 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39018 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39019 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39020 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 39021 | PORT_MODIFY("IN-17") | |
| 39022 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39023 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39024 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39025 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39026 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39027 | PORT_MODIFY("IN-18") | |
| 39028 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39029 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39030 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39031 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39032 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39033 | PORT_MODIFY("IN-19") | |
| 39034 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39035 | PORT_MODIFY("IN-20") | |
| 39036 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39037 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39038 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39039 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39040 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39041 | 39041 | INPUT_PORTS_END |
| 39042 | 39042 | |
| 39043 | 39043 | // PR1306 AWP HAPPY NOTES PR1306 HAPPY NOTES SOUNDS11 |
| r31373 | r31374 | |
| 39050 | 39050 | |
| 39051 | 39051 | |
| 39052 | 39052 | INPUT_PORTS_START( sc4hellb ) // this structure is generated |
| 39053 | PORT_INCLUDE( sc4_base ) | |
| 39054 | PORT_MODIFY("IN-1") | |
| 39055 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39056 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39057 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39058 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39059 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 39060 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39061 | PORT_MODIFY("IN-2") | |
| 39062 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39063 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39064 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39065 | PORT_MODIFY("IN-3") | |
| 39066 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39067 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39068 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39069 | PORT_MODIFY("IN-5") | |
| 39070 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39071 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39072 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39073 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39074 | PORT_MODIFY("IN-6") | |
| 39075 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39076 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39077 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39078 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39079 | PORT_MODIFY("IN-8") | |
| 39080 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 39081 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 39082 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 39083 | PORT_MODIFY("IN-16") | |
| 39084 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39085 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39086 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39087 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39088 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39089 | PORT_MODIFY("IN-17") | |
| 39090 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39091 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39092 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39093 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39094 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39095 | PORT_MODIFY("IN-18") | |
| 39096 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39097 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39098 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39099 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39100 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39101 | PORT_MODIFY("IN-19") | |
| 39102 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39103 | PORT_MODIFY("IN-20") | |
| 39104 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39105 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39106 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39107 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39108 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39053 | PORT_INCLUDE( sc4_base ) | |
| 39054 | PORT_MODIFY("IN-1") | |
| 39055 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39056 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39057 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39058 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39059 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 39060 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39061 | PORT_MODIFY("IN-2") | |
| 39062 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39063 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39064 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39065 | PORT_MODIFY("IN-3") | |
| 39066 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39067 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39068 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39069 | PORT_MODIFY("IN-5") | |
| 39070 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39071 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39072 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39073 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39074 | PORT_MODIFY("IN-6") | |
| 39075 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39076 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39077 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39078 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39079 | PORT_MODIFY("IN-8") | |
| 39080 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 39081 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 39082 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 39083 | PORT_MODIFY("IN-16") | |
| 39084 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39085 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39086 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39087 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39088 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39089 | PORT_MODIFY("IN-17") | |
| 39090 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39091 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39092 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39093 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39094 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39095 | PORT_MODIFY("IN-18") | |
| 39096 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39097 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39098 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39099 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39100 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39101 | PORT_MODIFY("IN-19") | |
| 39102 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39103 | PORT_MODIFY("IN-20") | |
| 39104 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39105 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39106 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39107 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39108 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39109 | 39109 | INPUT_PORTS_END |
| 39110 | 39110 | |
| 39111 | 39111 | // PR1419 AWP HELLS BELLS PR1402 HELLS BELLS SOUNDS11 |
| r31373 | r31374 | |
| 39139 | 39139 | } |
| 39140 | 39140 | |
| 39141 | 39141 | INPUT_PORTS_START( sc4hill ) // this structure is generated |
| 39142 | PORT_INCLUDE( sc4_base ) | |
| 39143 | PORT_MODIFY("IN-1") | |
| 39144 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 39145 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39146 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39147 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39148 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 39149 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39150 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39151 | PORT_MODIFY("IN-2") | |
| 39152 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39153 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 39154 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39155 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39156 | PORT_MODIFY("IN-3") | |
| 39157 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39158 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39159 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39160 | PORT_MODIFY("IN-4") | |
| 39161 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 39162 | PORT_MODIFY("IN-5") | |
| 39163 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39164 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39165 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39166 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39167 | PORT_MODIFY("IN-6") | |
| 39168 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39169 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39170 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39171 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39172 | PORT_MODIFY("IN-8") | |
| 39173 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 39174 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 39175 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 39176 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 39177 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 39178 | PORT_MODIFY("IN-9") | |
| 39179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 39180 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 39181 | PORT_MODIFY("IN-16") | |
| 39182 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39183 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39184 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39185 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39186 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39187 | PORT_MODIFY("IN-17") | |
| 39188 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39189 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39190 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39191 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39192 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39193 | PORT_MODIFY("IN-18") | |
| 39194 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39195 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39196 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39197 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39198 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39199 | PORT_MODIFY("IN-19") | |
| 39200 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39201 | PORT_MODIFY("IN-20") | |
| 39202 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39203 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39204 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39205 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39206 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39142 | PORT_INCLUDE( sc4_base ) | |
| 39143 | PORT_MODIFY("IN-1") | |
| 39144 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 39145 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39146 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39147 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39148 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 39149 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39150 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39151 | PORT_MODIFY("IN-2") | |
| 39152 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39153 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 39154 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39155 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39156 | PORT_MODIFY("IN-3") | |
| 39157 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39158 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39159 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39160 | PORT_MODIFY("IN-4") | |
| 39161 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 39162 | PORT_MODIFY("IN-5") | |
| 39163 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39164 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39165 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39166 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39167 | PORT_MODIFY("IN-6") | |
| 39168 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39169 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39170 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39171 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39172 | PORT_MODIFY("IN-8") | |
| 39173 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 39174 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 39175 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 39176 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 39177 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 39178 | PORT_MODIFY("IN-9") | |
| 39179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 39180 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 39181 | PORT_MODIFY("IN-16") | |
| 39182 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39183 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39184 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39185 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39186 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39187 | PORT_MODIFY("IN-17") | |
| 39188 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39189 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39190 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39191 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39192 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39193 | PORT_MODIFY("IN-18") | |
| 39194 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39195 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39196 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39197 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39198 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39199 | PORT_MODIFY("IN-19") | |
| 39200 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39201 | PORT_MODIFY("IN-20") | |
| 39202 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39203 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39204 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39205 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39206 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39207 | 39207 | INPUT_PORTS_END |
| 39208 | 39208 | |
| 39209 | 39209 | // PR1643 AWP HILLBILLIONAIRE SCORP4 PR1613 HILLBILLIONAIRE SOUNDS11 HILLBILLIONAIRE S.SITE |
| r31373 | r31374 | |
| 39228 | 39228 | } |
| 39229 | 39229 | |
| 39230 | 39230 | INPUT_PORTS_START( sc4hiss ) // this structure is generated |
| 39231 | PORT_INCLUDE( sc4_base ) | |
| 39232 | PORT_MODIFY("IN-1") | |
| 39233 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 39234 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 39235 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 39236 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 39237 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 39238 | PORT_MODIFY("IN-2") | |
| 39239 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 39240 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 39241 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39242 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 39243 | PORT_MODIFY("IN-8") | |
| 39244 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 39245 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 39246 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 39247 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c hi") | |
| 39248 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("b hi") | |
| 39249 | PORT_MODIFY("IN-9") | |
| 39250 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("f hi") | |
| 39251 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("step") | |
| 39252 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 39253 | PORT_MODIFY("IN-16") | |
| 39254 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39255 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39256 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39257 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39258 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39259 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39260 | PORT_MODIFY("IN-17") | |
| 39261 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39262 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39263 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39264 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39265 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39266 | PORT_MODIFY("IN-18") | |
| 39267 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39268 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39269 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39270 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39271 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39272 | PORT_MODIFY("IN-19") | |
| 39273 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39274 | PORT_MODIFY("IN-20") | |
| 39275 | // 0x0001 - "test" // standard input (motherboard) | |
| 39276 | // 0x0002 - "lock" // standard input (expected here) | |
| 39277 | // 0x0004 - "topdor" // standard input (expected here) | |
| 39278 | // 0x0008 - "botdor" // standard input (expected here) | |
| 39279 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39231 | PORT_INCLUDE( sc4_base ) | |
| 39232 | PORT_MODIFY("IN-1") | |
| 39233 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 39234 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 39235 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 39236 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 39237 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 39238 | PORT_MODIFY("IN-2") | |
| 39239 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 39240 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 39241 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39242 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 39243 | PORT_MODIFY("IN-8") | |
| 39244 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 39245 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 39246 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 39247 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c hi") | |
| 39248 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("b hi") | |
| 39249 | PORT_MODIFY("IN-9") | |
| 39250 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("f hi") | |
| 39251 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("step") | |
| 39252 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 39253 | PORT_MODIFY("IN-16") | |
| 39254 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39255 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39256 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39257 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39258 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39259 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39260 | PORT_MODIFY("IN-17") | |
| 39261 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39262 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39263 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39264 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39265 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39266 | PORT_MODIFY("IN-18") | |
| 39267 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39268 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39269 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39270 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39271 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39272 | PORT_MODIFY("IN-19") | |
| 39273 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39274 | PORT_MODIFY("IN-20") | |
| 39275 | // 0x0001 - "test" // standard input (motherboard) | |
| 39276 | // 0x0002 - "lock" // standard input (expected here) | |
| 39277 | // 0x0004 - "topdor" // standard input (expected here) | |
| 39278 | // 0x0008 - "botdor" // standard input (expected here) | |
| 39279 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39280 | 39280 | INPUT_PORTS_END |
| 39281 | 39281 | |
| 39282 | 39282 | // PR2176 HISSING QUID VIPA SOUNDS HISSING QUID |
| r31373 | r31374 | |
| 39307 | 39307 | } |
| 39308 | 39308 | |
| 39309 | 39309 | INPUT_PORTS_START( sc4hotrd ) // this structure is generated |
| 39310 | PORT_INCLUDE( sc4_base ) | |
| 39311 | PORT_MODIFY("IN-1") | |
| 39312 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 39313 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39314 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39315 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39316 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 39317 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39318 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39319 | PORT_MODIFY("IN-2") | |
| 39320 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39321 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 39322 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39323 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39324 | PORT_MODIFY("IN-5") | |
| 39325 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39326 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39327 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39328 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39329 | PORT_MODIFY("IN-6") | |
| 39330 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39331 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39332 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39333 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39334 | PORT_MODIFY("IN-8") | |
| 39335 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lose") | |
| 39336 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hole8") | |
| 39337 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hole7") | |
| 39338 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hole6") | |
| 39339 | PORT_MODIFY("IN-9") | |
| 39340 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hole5") | |
| 39341 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hole4") | |
| 39342 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hole3") | |
| 39343 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("hole2") | |
| 39344 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("hole1") | |
| 39345 | PORT_MODIFY("IN-16") | |
| 39346 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39347 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39348 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39349 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39350 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39351 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39352 | PORT_MODIFY("IN-17") | |
| 39353 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39354 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39355 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39356 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39357 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39358 | PORT_MODIFY("IN-18") | |
| 39359 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39360 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39361 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39362 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39363 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39364 | PORT_MODIFY("IN-19") | |
| 39365 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39366 | PORT_MODIFY("IN-20") | |
| 39367 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39368 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39369 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39370 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39371 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39310 | PORT_INCLUDE( sc4_base ) | |
| 39311 | PORT_MODIFY("IN-1") | |
| 39312 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 39313 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39314 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39315 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39316 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 39317 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39318 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39319 | PORT_MODIFY("IN-2") | |
| 39320 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39321 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 39322 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39323 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39324 | PORT_MODIFY("IN-5") | |
| 39325 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39326 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39327 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39328 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39329 | PORT_MODIFY("IN-6") | |
| 39330 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39331 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39332 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39333 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39334 | PORT_MODIFY("IN-8") | |
| 39335 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lose") | |
| 39336 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hole8") | |
| 39337 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hole7") | |
| 39338 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hole6") | |
| 39339 | PORT_MODIFY("IN-9") | |
| 39340 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hole5") | |
| 39341 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hole4") | |
| 39342 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hole3") | |
| 39343 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("hole2") | |
| 39344 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("hole1") | |
| 39345 | PORT_MODIFY("IN-16") | |
| 39346 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39347 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39348 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39349 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39350 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39351 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39352 | PORT_MODIFY("IN-17") | |
| 39353 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39354 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39355 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39356 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39357 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39358 | PORT_MODIFY("IN-18") | |
| 39359 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39360 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39361 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39362 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39363 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39364 | PORT_MODIFY("IN-19") | |
| 39365 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39366 | PORT_MODIFY("IN-20") | |
| 39367 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39368 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39369 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39370 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39371 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39372 | 39372 | INPUT_PORTS_END |
| 39373 | 39373 | |
| 39374 | 39374 | // PR1733 AWP HOT ROD SCORP4 PR1713 HOT ROD SOUNDS11 HOT ROD S.SITE |
| r31373 | r31374 | |
| 39392 | 39392 | } |
| 39393 | 39393 | |
| 39394 | 39394 | INPUT_PORTS_START( sc4hotsh ) // this structure is generated |
| 39395 | PORT_INCLUDE( sc4_base ) | |
| 39396 | PORT_MODIFY("IN-1") | |
| 39397 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39398 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39399 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39400 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39401 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 39402 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39403 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39404 | PORT_MODIFY("IN-2") | |
| 39405 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 39406 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchan") | |
| 39407 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 39408 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39409 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 39410 | PORT_MODIFY("IN-3") | |
| 39411 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39412 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39413 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39414 | PORT_MODIFY("IN-5") | |
| 39415 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39416 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39417 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39418 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39419 | PORT_MODIFY("IN-6") | |
| 39420 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39421 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39422 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39423 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39424 | PORT_MODIFY("IN-8") | |
| 39425 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h or m") | |
| 39426 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk str") | |
| 39427 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 39428 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk tip") | |
| 39429 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ply hs") | |
| 39430 | PORT_MODIFY("IN-9") | |
| 39431 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("bankit") | |
| 39432 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("shoot") | |
| 39433 | PORT_MODIFY("IN-16") | |
| 39434 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39435 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39436 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39437 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39438 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39439 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39440 | PORT_MODIFY("IN-17") | |
| 39441 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39442 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39443 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39444 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39445 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39446 | PORT_MODIFY("IN-18") | |
| 39447 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39448 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39449 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39450 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39451 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39452 | PORT_MODIFY("IN-19") | |
| 39453 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39454 | PORT_MODIFY("IN-20") | |
| 39455 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39456 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39457 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39458 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39459 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39395 | PORT_INCLUDE( sc4_base ) | |
| 39396 | PORT_MODIFY("IN-1") | |
| 39397 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39398 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39399 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39400 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39401 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 39402 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39403 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39404 | PORT_MODIFY("IN-2") | |
| 39405 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 39406 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchan") | |
| 39407 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 39408 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39409 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 39410 | PORT_MODIFY("IN-3") | |
| 39411 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39412 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39413 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39414 | PORT_MODIFY("IN-5") | |
| 39415 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39416 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39417 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39418 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39419 | PORT_MODIFY("IN-6") | |
| 39420 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39421 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39422 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39423 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39424 | PORT_MODIFY("IN-8") | |
| 39425 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h or m") | |
| 39426 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk str") | |
| 39427 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 39428 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk tip") | |
| 39429 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ply hs") | |
| 39430 | PORT_MODIFY("IN-9") | |
| 39431 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("bankit") | |
| 39432 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("shoot") | |
| 39433 | PORT_MODIFY("IN-16") | |
| 39434 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39435 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39436 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39437 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39438 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39439 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39440 | PORT_MODIFY("IN-17") | |
| 39441 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39442 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39443 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39444 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39445 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39446 | PORT_MODIFY("IN-18") | |
| 39447 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39448 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39449 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39450 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39451 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39452 | PORT_MODIFY("IN-19") | |
| 39453 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39454 | PORT_MODIFY("IN-20") | |
| 39455 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39456 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39457 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39458 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39459 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39460 | 39460 | INPUT_PORTS_END |
| 39461 | 39461 | |
| 39462 | 39462 | // PR3231 AWP HOT SHOT SCORP4 PR3211 HOT SHOT SOUNDS11 HOT SHOT S.SITE |
| r31373 | r31374 | |
| 39482 | 39482 | |
| 39483 | 39483 | |
| 39484 | 39484 | INPUT_PORTS_START( sc4hotwd ) // this structure is generated |
| 39485 | PORT_INCLUDE( sc4_base ) | |
| 39486 | PORT_MODIFY("IN-1") | |
| 39487 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39488 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 39489 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 39490 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 39491 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 39492 | PORT_MODIFY("IN-2") | |
| 39493 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39494 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39495 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39496 | PORT_MODIFY("IN-3") | |
| 39497 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39498 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39499 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39500 | PORT_MODIFY("IN-5") | |
| 39501 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39502 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39503 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39504 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39505 | PORT_MODIFY("IN-6") | |
| 39506 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39507 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39508 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39509 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39510 | PORT_MODIFY("IN-8") | |
| 39511 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 39512 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 39513 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk haz") | |
| 39514 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 39515 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk ss") | |
| 39516 | PORT_MODIFY("IN-16") | |
| 39517 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39518 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39519 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39520 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39521 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39522 | PORT_MODIFY("IN-17") | |
| 39523 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39524 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39525 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39526 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39527 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39528 | PORT_MODIFY("IN-18") | |
| 39529 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39530 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39531 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39532 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39533 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39534 | PORT_MODIFY("IN-19") | |
| 39535 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39536 | PORT_MODIFY("IN-20") | |
| 39537 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39538 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39539 | // 0x0004 - "topdor" // standard input (expected here) | |
| 39540 | // 0x0008 - "botdor" // standard input (expected here) | |
| 39541 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39485 | PORT_INCLUDE( sc4_base ) | |
| 39486 | PORT_MODIFY("IN-1") | |
| 39487 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39488 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 39489 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 39490 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 39491 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 39492 | PORT_MODIFY("IN-2") | |
| 39493 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39494 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39495 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39496 | PORT_MODIFY("IN-3") | |
| 39497 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39498 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39499 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39500 | PORT_MODIFY("IN-5") | |
| 39501 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39502 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39503 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39504 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39505 | PORT_MODIFY("IN-6") | |
| 39506 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39507 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39508 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39509 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39510 | PORT_MODIFY("IN-8") | |
| 39511 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 39512 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 39513 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk haz") | |
| 39514 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk nud") | |
| 39515 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk ss") | |
| 39516 | PORT_MODIFY("IN-16") | |
| 39517 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39518 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39519 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39520 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39521 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39522 | PORT_MODIFY("IN-17") | |
| 39523 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39524 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39525 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39526 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39527 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39528 | PORT_MODIFY("IN-18") | |
| 39529 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39530 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39531 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39532 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39533 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39534 | PORT_MODIFY("IN-19") | |
| 39535 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39536 | PORT_MODIFY("IN-20") | |
| 39537 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39538 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39539 | // 0x0004 - "topdor" // standard input (expected here) | |
| 39540 | // 0x0008 - "botdor" // standard input (expected here) | |
| 39541 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39542 | 39542 | INPUT_PORTS_END |
| 39543 | 39543 | |
| 39544 | 39544 | // PR1311 HOT WAD PR1311 HOT WAD SOUNDS11 |
| r31373 | r31374 | |
| 39569 | 39569 | } |
| 39570 | 39570 | |
| 39571 | 39571 | INPUT_PORTS_START( sc4celeb ) // this structure is generated |
| 39572 | PORT_INCLUDE( sc4_base ) | |
| 39573 | PORT_MODIFY("IN-1") | |
| 39574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 39576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 39577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 39578 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 39579 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39580 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39581 | PORT_MODIFY("IN-2") | |
| 39582 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39583 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 39584 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39585 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39586 | PORT_MODIFY("IN-3") | |
| 39587 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39588 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 39589 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 39590 | PORT_MODIFY("IN-4") | |
| 39591 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 39592 | PORT_MODIFY("IN-5") | |
| 39593 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39594 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39595 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39596 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39597 | PORT_MODIFY("IN-6") | |
| 39598 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39599 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39600 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39601 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39602 | PORT_MODIFY("IN-8") | |
| 39603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("get me") | |
| 39604 | PORT_MODIFY("IN-16") | |
| 39605 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39606 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39607 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39608 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39609 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39610 | PORT_MODIFY("IN-17") | |
| 39611 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39612 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39613 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39614 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39615 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39616 | PORT_MODIFY("IN-18") | |
| 39617 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39618 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39619 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39620 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39621 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39622 | PORT_MODIFY("IN-19") | |
| 39623 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39624 | PORT_MODIFY("IN-20") | |
| 39625 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39626 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39627 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39628 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39629 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39572 | PORT_INCLUDE( sc4_base ) | |
| 39573 | PORT_MODIFY("IN-1") | |
| 39574 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39575 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 39576 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 39577 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 39578 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 39579 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39580 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39581 | PORT_MODIFY("IN-2") | |
| 39582 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39583 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 39584 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39585 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39586 | PORT_MODIFY("IN-3") | |
| 39587 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39588 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 39589 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 39590 | PORT_MODIFY("IN-4") | |
| 39591 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 39592 | PORT_MODIFY("IN-5") | |
| 39593 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39594 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39595 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39596 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39597 | PORT_MODIFY("IN-6") | |
| 39598 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39599 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39600 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39601 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39602 | PORT_MODIFY("IN-8") | |
| 39603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("get me") | |
| 39604 | PORT_MODIFY("IN-16") | |
| 39605 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39606 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39607 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39608 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39609 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39610 | PORT_MODIFY("IN-17") | |
| 39611 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39612 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39613 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39614 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39615 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39616 | PORT_MODIFY("IN-18") | |
| 39617 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39618 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39619 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39620 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39621 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39622 | PORT_MODIFY("IN-19") | |
| 39623 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39624 | PORT_MODIFY("IN-20") | |
| 39625 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39626 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39627 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39628 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39629 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39630 | 39630 | INPUT_PORTS_END |
| 39631 | 39631 | |
| 39632 | 39632 | // PR1603 AWP IM A CELEBRITY PR1603 IM A CELEB SOUNDS11 IM A CELEBRITY S.SITE |
| r31373 | r31374 | |
| 39654 | 39654 | } |
| 39655 | 39655 | |
| 39656 | 39656 | INPUT_PORTS_START( sc4inspn ) // this structure is generated |
| 39657 | PORT_INCLUDE( sc4_base ) | |
| 39658 | PORT_MODIFY("IN-1") | |
| 39659 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 39660 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 39661 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 39662 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 39663 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 39664 | PORT_MODIFY("IN-2") | |
| 39665 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 39666 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39667 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39668 | PORT_MODIFY("IN-8") | |
| 39669 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take s") | |
| 39670 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cashpo") | |
| 39671 | PORT_MODIFY("IN-16") | |
| 39672 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39673 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39674 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39675 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39676 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39677 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 39678 | PORT_MODIFY("IN-17") | |
| 39679 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39680 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39681 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39682 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39683 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39684 | PORT_MODIFY("IN-18") | |
| 39685 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39686 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39687 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39688 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39689 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39690 | PORT_MODIFY("IN-19") | |
| 39691 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39692 | PORT_MODIFY("IN-20") | |
| 39693 | // 0x0001 - "test" // standard input (motherboard) | |
| 39694 | // 0x0002 - "lock" // standard input (expected here) | |
| 39695 | // 0x0004 - "topdor" // standard input (expected here) | |
| 39696 | // 0x0008 - "botdor" // standard input (expected here) | |
| 39697 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39657 | PORT_INCLUDE( sc4_base ) | |
| 39658 | PORT_MODIFY("IN-1") | |
| 39659 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 39660 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 39661 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 39662 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 39663 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 39664 | PORT_MODIFY("IN-2") | |
| 39665 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 39666 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39667 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39668 | PORT_MODIFY("IN-8") | |
| 39669 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take s") | |
| 39670 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cashpo") | |
| 39671 | PORT_MODIFY("IN-16") | |
| 39672 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39673 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39674 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39675 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39676 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39677 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 39678 | PORT_MODIFY("IN-17") | |
| 39679 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39680 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39681 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39682 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39683 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39684 | PORT_MODIFY("IN-18") | |
| 39685 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39686 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39687 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39688 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39689 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39690 | PORT_MODIFY("IN-19") | |
| 39691 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39692 | PORT_MODIFY("IN-20") | |
| 39693 | // 0x0001 - "test" // standard input (motherboard) | |
| 39694 | // 0x0002 - "lock" // standard input (expected here) | |
| 39695 | // 0x0004 - "topdor" // standard input (expected here) | |
| 39696 | // 0x0008 - "botdor" // standard input (expected here) | |
| 39697 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39698 | 39698 | INPUT_PORTS_END |
| 39699 | 39699 | |
| 39700 | 39700 | // PR2555 INNER SPIN V013 INNERSPINSND INNER SPIN |
| r31373 | r31374 | |
| 39719 | 39719 | } |
| 39720 | 39720 | |
| 39721 | 39721 | INPUT_PORTS_START( sc4ijob ) // this structure is generated |
| 39722 | PORT_INCLUDE( sc4_base ) | |
| 39723 | PORT_MODIFY("IN-1") | |
| 39724 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 39725 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("ch stk") | |
| 39726 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 39727 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 39728 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 39729 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39730 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39731 | PORT_MODIFY("IN-2") | |
| 39732 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ply it") | |
| 39733 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 39734 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39735 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39736 | PORT_MODIFY("IN-3") | |
| 39737 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39738 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39739 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39740 | PORT_MODIFY("IN-5") | |
| 39741 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39742 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39743 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39744 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39745 | PORT_MODIFY("IN-6") | |
| 39746 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39747 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39748 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39749 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39750 | PORT_MODIFY("IN-8") | |
| 39751 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("get aw") | |
| 39752 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("streak") | |
| 39753 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 39754 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 39755 | PORT_MODIFY("IN-16") | |
| 39756 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39757 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39758 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39759 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39760 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39761 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39762 | PORT_MODIFY("IN-17") | |
| 39763 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39764 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39765 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39766 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39767 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39768 | PORT_MODIFY("IN-18") | |
| 39769 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39770 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39771 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39772 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39773 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39774 | PORT_MODIFY("IN-19") | |
| 39775 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39776 | PORT_MODIFY("IN-20") | |
| 39777 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39778 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39779 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39780 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39781 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39722 | PORT_INCLUDE( sc4_base ) | |
| 39723 | PORT_MODIFY("IN-1") | |
| 39724 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 39725 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("ch stk") | |
| 39726 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 39727 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 39728 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 39729 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39730 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39731 | PORT_MODIFY("IN-2") | |
| 39732 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ply it") | |
| 39733 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 39734 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39735 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39736 | PORT_MODIFY("IN-3") | |
| 39737 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39738 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39739 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39740 | PORT_MODIFY("IN-5") | |
| 39741 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39742 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39743 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39744 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39745 | PORT_MODIFY("IN-6") | |
| 39746 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39747 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39748 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39749 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39750 | PORT_MODIFY("IN-8") | |
| 39751 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("get aw") | |
| 39752 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("streak") | |
| 39753 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 39754 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 39755 | PORT_MODIFY("IN-16") | |
| 39756 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39757 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39758 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39759 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39760 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39761 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39762 | PORT_MODIFY("IN-17") | |
| 39763 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39764 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39765 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39766 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39767 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39768 | PORT_MODIFY("IN-18") | |
| 39769 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39770 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39771 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39772 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39773 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39774 | PORT_MODIFY("IN-19") | |
| 39775 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39776 | PORT_MODIFY("IN-20") | |
| 39777 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39778 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39779 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39780 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39781 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39782 | 39782 | INPUT_PORTS_END |
| 39783 | 39783 | |
| 39784 | 39784 | |
| r31373 | r31374 | |
| 39815 | 39815 | } |
| 39816 | 39816 | |
| 39817 | 39817 | INPUT_PORTS_START( sc4ldvl ) // this structure is generated |
| 39818 | PORT_INCLUDE( sc4_base ) | |
| 39819 | PORT_MODIFY("IN-1") | |
| 39820 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39821 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 39822 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 39823 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 39824 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 39825 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 39826 | PORT_MODIFY("IN-2") | |
| 39827 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 39828 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("chgstk") | |
| 39829 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39830 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39831 | PORT_MODIFY("IN-3") | |
| 39832 | // 0x0004 - "stk3" // standard input (expected here) | |
| 39833 | // 0x0008 - "stk1" // standard input (expected here) | |
| 39834 | // 0x0010 - "stk2" // standard input (expected here) | |
| 39835 | PORT_MODIFY("IN-5") | |
| 39836 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 39837 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 39838 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 39839 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 39840 | PORT_MODIFY("IN-6") | |
| 39841 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 39842 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 39843 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 39844 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 39845 | PORT_MODIFY("IN-8") | |
| 39846 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 39847 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("move u") | |
| 39848 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk cpo") | |
| 39849 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk sho") | |
| 39850 | PORT_MODIFY("IN-16") | |
| 39851 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39852 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39853 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39854 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39855 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39856 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39857 | PORT_MODIFY("IN-17") | |
| 39858 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39859 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39860 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39861 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39862 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39863 | PORT_MODIFY("IN-18") | |
| 39864 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39865 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39866 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39867 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39868 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39869 | PORT_MODIFY("IN-19") | |
| 39870 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39871 | PORT_MODIFY("IN-20") | |
| 39872 | // 0x0001 - "test" // standard input (motherboard) | |
| 39873 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 39874 | // 0x0004 - "topdr" // standard input (expected here) | |
| 39875 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 39876 | // 0x0010 - "dump" // standard input (expected here) | |
| 39818 | PORT_INCLUDE( sc4_base ) | |
| 39819 | PORT_MODIFY("IN-1") | |
| 39820 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39821 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 39822 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 39823 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 39824 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 39825 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 39826 | PORT_MODIFY("IN-2") | |
| 39827 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 39828 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("chgstk") | |
| 39829 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39830 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39831 | PORT_MODIFY("IN-3") | |
| 39832 | // 0x0004 - "stk3" // standard input (expected here) | |
| 39833 | // 0x0008 - "stk1" // standard input (expected here) | |
| 39834 | // 0x0010 - "stk2" // standard input (expected here) | |
| 39835 | PORT_MODIFY("IN-5") | |
| 39836 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 39837 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 39838 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 39839 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 39840 | PORT_MODIFY("IN-6") | |
| 39841 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 39842 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 39843 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 39844 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 39845 | PORT_MODIFY("IN-8") | |
| 39846 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 39847 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("move u") | |
| 39848 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk cpo") | |
| 39849 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk sho") | |
| 39850 | PORT_MODIFY("IN-16") | |
| 39851 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 39852 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 39853 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 39854 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 39855 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 39856 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 39857 | PORT_MODIFY("IN-17") | |
| 39858 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 39859 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 39860 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 39861 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 39862 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 39863 | PORT_MODIFY("IN-18") | |
| 39864 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 39865 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 39866 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 39867 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 39868 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 39869 | PORT_MODIFY("IN-19") | |
| 39870 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 39871 | PORT_MODIFY("IN-20") | |
| 39872 | // 0x0001 - "test" // standard input (motherboard) | |
| 39873 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 39874 | // 0x0004 - "topdr" // standard input (expected here) | |
| 39875 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 39876 | // 0x0010 - "dump" // standard input (expected here) | |
| 39877 | 39877 | INPUT_PORTS_END |
| 39878 | 39878 | |
| 39879 | 39879 | // PR2376 LITTLE DEVIL LDEVIL SOUNDS LITTLE DEVIL |
| r31373 | r31374 | |
| 39900 | 39900 | } |
| 39901 | 39901 | |
| 39902 | 39902 | INPUT_PORTS_START( sc4lotrr ) // this structure is generated |
| 39903 | PORT_INCLUDE( sc4_base ) | |
| 39904 | PORT_MODIFY("IN-1") | |
| 39905 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39906 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39907 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39908 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39909 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 39910 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39911 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39912 | PORT_MODIFY("IN-2") | |
| 39913 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39914 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 39915 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39916 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39917 | PORT_MODIFY("IN-3") | |
| 39918 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39919 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39920 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39921 | PORT_MODIFY("IN-4") | |
| 39922 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 39923 | PORT_MODIFY("IN-5") | |
| 39924 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39925 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39926 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39927 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39928 | PORT_MODIFY("IN-6") | |
| 39929 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39930 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39931 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39932 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39933 | PORT_MODIFY("IN-16") | |
| 39934 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39935 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39936 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39937 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39938 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39939 | PORT_MODIFY("IN-17") | |
| 39940 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39941 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39942 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39943 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39944 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39945 | PORT_MODIFY("IN-18") | |
| 39946 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39947 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39948 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39949 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39950 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39951 | PORT_MODIFY("IN-19") | |
| 39952 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39953 | PORT_MODIFY("IN-20") | |
| 39954 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39955 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39956 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39957 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39958 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39903 | PORT_INCLUDE( sc4_base ) | |
| 39904 | PORT_MODIFY("IN-1") | |
| 39905 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39906 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39907 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39908 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39909 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 39910 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39911 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39912 | PORT_MODIFY("IN-2") | |
| 39913 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 39914 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 39915 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 39916 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 39917 | PORT_MODIFY("IN-3") | |
| 39918 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 39919 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 39920 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 39921 | PORT_MODIFY("IN-4") | |
| 39922 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 39923 | PORT_MODIFY("IN-5") | |
| 39924 | // 0x0001 - "priz4" // standard input (expected here) | |
| 39925 | // 0x0002 - "priz3" // standard input (expected here) | |
| 39926 | // 0x0004 - "priz2" // standard input (expected here) | |
| 39927 | // 0x0008 - "priz1" // standard input (expected here) | |
| 39928 | PORT_MODIFY("IN-6") | |
| 39929 | // 0x0001 - "perc1" // standard input (expected here) | |
| 39930 | // 0x0002 - "perc2" // standard input (expected here) | |
| 39931 | // 0x0004 - "perc3" // standard input (expected here) | |
| 39932 | // 0x0008 - "perc4" // standard input (expected here) | |
| 39933 | PORT_MODIFY("IN-16") | |
| 39934 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 39935 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 39936 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 39937 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 39938 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 39939 | PORT_MODIFY("IN-17") | |
| 39940 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 39941 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 39942 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 39943 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 39944 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 39945 | PORT_MODIFY("IN-18") | |
| 39946 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 39947 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 39948 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 39949 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 39950 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 39951 | PORT_MODIFY("IN-19") | |
| 39952 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 39953 | PORT_MODIFY("IN-20") | |
| 39954 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 39955 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 39956 | // 0x0004 - "serdor" // standard input (expected here) | |
| 39957 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 39958 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39959 | 39959 | INPUT_PORTS_END |
| 39960 | 39960 | |
| 39961 | 39961 | // PR1427 AWP RETURN OF THE KING PR1413 RETURN OF THE SOUNDS11 RETURN OF KING S.SITE |
| r31373 | r31374 | |
| 39984 | 39984 | } |
| 39985 | 39985 | |
| 39986 | 39986 | INPUT_PORTS_START( sc4manic ) // this structure is generated |
| 39987 | PORT_INCLUDE( sc4_base ) | |
| 39988 | PORT_MODIFY("IN-1") | |
| 39989 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39990 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39991 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39992 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39993 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 39994 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39995 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39996 | PORT_MODIFY("IN-2") | |
| 39997 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 39998 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tra/ex") | |
| 39999 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("sta/ga") | |
| 40000 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40001 | PORT_MODIFY("IN-3") | |
| 40002 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40003 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40004 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40005 | PORT_MODIFY("IN-5") | |
| 40006 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40007 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40008 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40009 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40010 | PORT_MODIFY("IN-6") | |
| 40011 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40012 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40013 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40014 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40015 | PORT_MODIFY("IN-8") | |
| 40016 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 40017 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bns") | |
| 40018 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 40019 | PORT_MODIFY("IN-16") | |
| 40020 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40021 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40022 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40023 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40024 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40025 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40026 | PORT_MODIFY("IN-17") | |
| 40027 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40028 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40029 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40030 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40031 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40032 | PORT_MODIFY("IN-18") | |
| 40033 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40034 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40035 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40036 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40037 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40038 | PORT_MODIFY("IN-19") | |
| 40039 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40040 | PORT_MODIFY("IN-20") | |
| 40041 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40042 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40043 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40044 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40045 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 39987 | PORT_INCLUDE( sc4_base ) | |
| 39988 | PORT_MODIFY("IN-1") | |
| 39989 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 39990 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 39991 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 39992 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 39993 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 39994 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 39995 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 39996 | PORT_MODIFY("IN-2") | |
| 39997 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 39998 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tra/ex") | |
| 39999 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("sta/ga") | |
| 40000 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40001 | PORT_MODIFY("IN-3") | |
| 40002 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40003 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40004 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40005 | PORT_MODIFY("IN-5") | |
| 40006 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40007 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40008 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40009 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40010 | PORT_MODIFY("IN-6") | |
| 40011 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40012 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40013 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40014 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40015 | PORT_MODIFY("IN-8") | |
| 40016 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 40017 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bns") | |
| 40018 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 40019 | PORT_MODIFY("IN-16") | |
| 40020 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40021 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40022 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40023 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40024 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40025 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40026 | PORT_MODIFY("IN-17") | |
| 40027 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40028 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40029 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40030 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40031 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40032 | PORT_MODIFY("IN-18") | |
| 40033 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40034 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40035 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40036 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40037 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40038 | PORT_MODIFY("IN-19") | |
| 40039 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40040 | PORT_MODIFY("IN-20") | |
| 40041 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40042 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40043 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40044 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40045 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40046 | 40046 | INPUT_PORTS_END |
| 40047 | 40047 | |
| 40048 | 40048 | // PR3034 AWP MANIC MINER SCORP4 PR3004 MANIC MINER SOUNDS11 MANIC MINER S.SITE |
| r31373 | r31374 | |
| 40072 | 40072 | } |
| 40073 | 40073 | |
| 40074 | 40074 | INPUT_PORTS_START( sc4mmm ) // this structure is generated |
| 40075 | PORT_INCLUDE( sc4_base ) | |
| 40076 | PORT_MODIFY("IN-1") | |
| 40077 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 40078 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 40079 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 40080 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 40081 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 40082 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 40083 | PORT_MODIFY("IN-2") | |
| 40084 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 40085 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tk fea") | |
| 40086 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40087 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40088 | PORT_MODIFY("IN-3") | |
| 40089 | // 0x0004 - "stk3" // standard input (expected here) | |
| 40090 | // 0x0008 - "stk1" // standard input (expected here) | |
| 40091 | // 0x0010 - "stk2" // standard input (expected here) | |
| 40092 | PORT_MODIFY("IN-5") | |
| 40093 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 40094 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 40095 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 40096 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 40097 | PORT_MODIFY("IN-6") | |
| 40098 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 40099 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 40100 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 40101 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 40102 | PORT_MODIFY("IN-8") | |
| 40103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bon ga") | |
| 40104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 40105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take m") | |
| 40106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("p supe") | |
| 40107 | PORT_MODIFY("IN-16") | |
| 40108 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40109 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40110 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40111 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40112 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40113 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40114 | PORT_MODIFY("IN-17") | |
| 40115 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40116 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40117 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40118 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40119 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40120 | PORT_MODIFY("IN-18") | |
| 40121 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40122 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40123 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40124 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40125 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40126 | PORT_MODIFY("IN-19") | |
| 40127 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40128 | PORT_MODIFY("IN-20") | |
| 40129 | // 0x0001 - "test" // standard input (motherboard) | |
| 40130 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40131 | // 0x0004 - "topdr" // standard input (expected here) | |
| 40132 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40133 | // 0x0010 - "dump" // standard input (expected here) | |
| 40075 | PORT_INCLUDE( sc4_base ) | |
| 40076 | PORT_MODIFY("IN-1") | |
| 40077 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 40078 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 40079 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 40080 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 40081 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 40082 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 40083 | PORT_MODIFY("IN-2") | |
| 40084 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 40085 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tk fea") | |
| 40086 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40087 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40088 | PORT_MODIFY("IN-3") | |
| 40089 | // 0x0004 - "stk3" // standard input (expected here) | |
| 40090 | // 0x0008 - "stk1" // standard input (expected here) | |
| 40091 | // 0x0010 - "stk2" // standard input (expected here) | |
| 40092 | PORT_MODIFY("IN-5") | |
| 40093 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 40094 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 40095 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 40096 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 40097 | PORT_MODIFY("IN-6") | |
| 40098 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 40099 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 40100 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 40101 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 40102 | PORT_MODIFY("IN-8") | |
| 40103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bon ga") | |
| 40104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 40105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take m") | |
| 40106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("p supe") | |
| 40107 | PORT_MODIFY("IN-16") | |
| 40108 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40109 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40110 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40111 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40112 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40113 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40114 | PORT_MODIFY("IN-17") | |
| 40115 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40116 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40117 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40118 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40119 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40120 | PORT_MODIFY("IN-18") | |
| 40121 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40122 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40123 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40124 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40125 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40126 | PORT_MODIFY("IN-19") | |
| 40127 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40128 | PORT_MODIFY("IN-20") | |
| 40129 | // 0x0001 - "test" // standard input (motherboard) | |
| 40130 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40131 | // 0x0004 - "topdr" // standard input (expected here) | |
| 40132 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40133 | // 0x0010 - "dump" // standard input (expected here) | |
| 40134 | 40134 | INPUT_PORTS_END |
| 40135 | 40135 | |
| 40136 | 40136 | |
| r31373 | r31374 | |
| 40161 | 40161 | } |
| 40162 | 40162 | |
| 40163 | 40163 | INPUT_PORTS_START( sc4mmad ) // this structure is generated |
| 40164 | PORT_INCLUDE( sc4_base ) | |
| 40165 | PORT_MODIFY("IN-1") | |
| 40166 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 40167 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 40168 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 40169 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 40170 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake") | |
| 40171 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40172 | PORT_MODIFY("IN-2") | |
| 40173 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 40174 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 40175 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40176 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40177 | PORT_MODIFY("IN-4") | |
| 40178 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 40179 | PORT_MODIFY("IN-8") | |
| 40180 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 40181 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 40182 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 40183 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 40184 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 40185 | PORT_MODIFY("IN-9") | |
| 40186 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 40187 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 40188 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 40189 | PORT_MODIFY("IN-16") | |
| 40190 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40191 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40192 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40193 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40194 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40195 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 40196 | PORT_MODIFY("IN-17") | |
| 40197 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40198 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40199 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40200 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40201 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40202 | PORT_MODIFY("IN-18") | |
| 40203 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40204 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40205 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40206 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40207 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40208 | PORT_MODIFY("IN-19") | |
| 40209 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40210 | PORT_MODIFY("IN-20") | |
| 40211 | // 0x0001 - "test" // standard input (motherboard) | |
| 40212 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40213 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 40214 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40215 | // 0x0010 - "deflt" // standard input (expected here) | |
| 40164 | PORT_INCLUDE( sc4_base ) | |
| 40165 | PORT_MODIFY("IN-1") | |
| 40166 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 40167 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 40168 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 40169 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 40170 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake") | |
| 40171 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40172 | PORT_MODIFY("IN-2") | |
| 40173 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 40174 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 40175 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40176 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40177 | PORT_MODIFY("IN-4") | |
| 40178 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 40179 | PORT_MODIFY("IN-8") | |
| 40180 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 40181 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 40182 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 40183 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 40184 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 40185 | PORT_MODIFY("IN-9") | |
| 40186 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 40187 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 40188 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 40189 | PORT_MODIFY("IN-16") | |
| 40190 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40191 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40192 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40193 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40194 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40195 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 40196 | PORT_MODIFY("IN-17") | |
| 40197 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40198 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40199 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40200 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40201 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40202 | PORT_MODIFY("IN-18") | |
| 40203 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40204 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40205 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40206 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40207 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40208 | PORT_MODIFY("IN-19") | |
| 40209 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40210 | PORT_MODIFY("IN-20") | |
| 40211 | // 0x0001 - "test" // standard input (motherboard) | |
| 40212 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40213 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 40214 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40215 | // 0x0010 - "deflt" // standard input (expected here) | |
| 40216 | 40216 | INPUT_PORTS_END |
| 40217 | 40217 | |
| 40218 | 40218 | // PR2533 MONEY MADNESS MONM SOUNDS MONEY MADNESS |
| r31373 | r31374 | |
| 40244 | 40244 | } |
| 40245 | 40245 | |
| 40246 | 40246 | INPUT_PORTS_START( sc4mdm ) // this structure is generated |
| 40247 | PORT_INCLUDE( sc4_base ) | |
| 40248 | PORT_MODIFY("IN-1") | |
| 40249 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40250 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40251 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40252 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40253 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 40254 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40255 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40256 | PORT_MODIFY("IN-2") | |
| 40257 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 40258 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 40259 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40260 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40261 | PORT_MODIFY("IN-3") | |
| 40262 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40263 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40264 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40265 | PORT_MODIFY("IN-5") | |
| 40266 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40267 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40268 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40269 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40270 | PORT_MODIFY("IN-6") | |
| 40271 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40272 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40273 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40274 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40275 | PORT_MODIFY("IN-8") | |
| 40276 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b or b") | |
| 40277 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("pl mon") | |
| 40278 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 40279 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 40280 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 40281 | PORT_MODIFY("IN-16") | |
| 40282 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40283 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40284 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40285 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40286 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40287 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40288 | PORT_MODIFY("IN-17") | |
| 40289 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40290 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40291 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40292 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40293 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40294 | PORT_MODIFY("IN-18") | |
| 40295 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40296 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40297 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40298 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40299 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40300 | PORT_MODIFY("IN-19") | |
| 40301 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40302 | PORT_MODIFY("IN-20") | |
| 40303 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40304 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40305 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40306 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40307 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40247 | PORT_INCLUDE( sc4_base ) | |
| 40248 | PORT_MODIFY("IN-1") | |
| 40249 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40250 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40251 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40252 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40253 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 40254 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40255 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40256 | PORT_MODIFY("IN-2") | |
| 40257 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 40258 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 40259 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40260 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40261 | PORT_MODIFY("IN-3") | |
| 40262 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40263 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40264 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40265 | PORT_MODIFY("IN-5") | |
| 40266 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40267 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40268 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40269 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40270 | PORT_MODIFY("IN-6") | |
| 40271 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40272 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40273 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40274 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40275 | PORT_MODIFY("IN-8") | |
| 40276 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b or b") | |
| 40277 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("pl mon") | |
| 40278 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 40279 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 40280 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk str") | |
| 40281 | PORT_MODIFY("IN-16") | |
| 40282 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40283 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40284 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40285 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40286 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40287 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40288 | PORT_MODIFY("IN-17") | |
| 40289 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40290 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40291 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40292 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40293 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40294 | PORT_MODIFY("IN-18") | |
| 40295 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40296 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40297 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40298 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40299 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40300 | PORT_MODIFY("IN-19") | |
| 40301 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40302 | PORT_MODIFY("IN-20") | |
| 40303 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40304 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40305 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40306 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40307 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40308 | 40308 | INPUT_PORTS_END |
| 40309 | 40309 | |
| 40310 | 40310 | // PR3333 AWP MONOPOLY DOUBLE MONEY S4 PR3308 MPOLY D MONEY SOUNDS11 DOUBLE MONEY S.SITE |
| r31373 | r31374 | |
| 40328 | 40328 | } |
| 40329 | 40329 | |
| 40330 | 40330 | INPUT_PORTS_START( sc4mhn ) // this structure is generated |
| 40331 | PORT_INCLUDE( sc4_base ) | |
| 40332 | PORT_MODIFY("IN-1") | |
| 40333 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 40334 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 40335 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 40336 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 40337 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 40338 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 40339 | PORT_MODIFY("IN-2") | |
| 40340 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 40341 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 40342 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 40343 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 40344 | PORT_MODIFY("IN-3") | |
| 40345 | // 0x0004 - "stk3" // standard input (expected here) | |
| 40346 | // 0x0008 - "stk1" // standard input (expected here) | |
| 40347 | // 0x0010 - "stk2" // standard input (expected here) | |
| 40348 | PORT_MODIFY("IN-5") | |
| 40349 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 40350 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 40351 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 40352 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 40353 | PORT_MODIFY("IN-6") | |
| 40354 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 40355 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 40356 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 40357 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 40358 | PORT_MODIFY("IN-8") | |
| 40359 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 40360 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 40361 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 40362 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shot") | |
| 40363 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 40364 | PORT_MODIFY("IN-9") | |
| 40365 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 40366 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 40367 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 40368 | PORT_MODIFY("IN-16") | |
| 40369 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40370 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40371 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40372 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40373 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40374 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 40375 | PORT_MODIFY("IN-17") | |
| 40376 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40377 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40378 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40379 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40380 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40381 | PORT_MODIFY("IN-18") | |
| 40382 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40383 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40384 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40385 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40386 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40387 | PORT_MODIFY("IN-19") | |
| 40388 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40389 | PORT_MODIFY("IN-20") | |
| 40390 | // 0x0001 - "test" // standard input (motherboard) | |
| 40391 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40392 | // 0x0004 - "topdr" // standard input (expected here) | |
| 40393 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40394 | // 0x0010 - "dump" // standard input (expected here) | |
| 40331 | PORT_INCLUDE( sc4_base ) | |
| 40332 | PORT_MODIFY("IN-1") | |
| 40333 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 40334 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 40335 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 40336 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 40337 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 40338 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 40339 | PORT_MODIFY("IN-2") | |
| 40340 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 40341 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 40342 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 40343 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 40344 | PORT_MODIFY("IN-3") | |
| 40345 | // 0x0004 - "stk3" // standard input (expected here) | |
| 40346 | // 0x0008 - "stk1" // standard input (expected here) | |
| 40347 | // 0x0010 - "stk2" // standard input (expected here) | |
| 40348 | PORT_MODIFY("IN-5") | |
| 40349 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 40350 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 40351 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 40352 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 40353 | PORT_MODIFY("IN-6") | |
| 40354 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 40355 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 40356 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 40357 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 40358 | PORT_MODIFY("IN-8") | |
| 40359 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 40360 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 40361 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 40362 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shot") | |
| 40363 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 40364 | PORT_MODIFY("IN-9") | |
| 40365 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 40366 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 40367 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 40368 | PORT_MODIFY("IN-16") | |
| 40369 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40370 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40371 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40372 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40373 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40374 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 40375 | PORT_MODIFY("IN-17") | |
| 40376 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40377 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40378 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40379 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40380 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40381 | PORT_MODIFY("IN-18") | |
| 40382 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40383 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40384 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40385 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40386 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40387 | PORT_MODIFY("IN-19") | |
| 40388 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40389 | PORT_MODIFY("IN-20") | |
| 40390 | // 0x0001 - "test" // standard input (motherboard) | |
| 40391 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40392 | // 0x0004 - "topdr" // standard input (expected here) | |
| 40393 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40394 | // 0x0010 - "dump" // standard input (expected here) | |
| 40395 | 40395 | INPUT_PORTS_END |
| 40396 | 40396 | |
| 40397 | 40397 | // PR2380 MONOPOLY HERE AND NOW MR2R SOUNDS NITH |
| r31373 | r31374 | |
| 40416 | 40416 | } |
| 40417 | 40417 | |
| 40418 | 40418 | INPUT_PORTS_START( sc4mhp ) // this structure is generated |
| 40419 | PORT_INCLUDE( sc4_base ) | |
| 40420 | PORT_MODIFY("IN-1") | |
| 40421 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 40422 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40423 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40424 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40425 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hot p") | |
| 40426 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40427 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40428 | PORT_MODIFY("IN-2") | |
| 40429 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 40430 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 40431 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40432 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40433 | PORT_MODIFY("IN-3") | |
| 40434 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40435 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40436 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40437 | PORT_MODIFY("IN-5") | |
| 40438 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40439 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40440 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40441 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40442 | PORT_MODIFY("IN-6") | |
| 40443 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40444 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40445 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40446 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40447 | PORT_MODIFY("IN-8") | |
| 40448 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("streak") | |
| 40449 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b or b") | |
| 40450 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("refuse") | |
| 40451 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("sell") | |
| 40452 | PORT_MODIFY("IN-16") | |
| 40453 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40454 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40455 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40456 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40457 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40458 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40459 | PORT_MODIFY("IN-17") | |
| 40460 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40461 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40462 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40463 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40464 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40465 | PORT_MODIFY("IN-18") | |
| 40466 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40467 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40468 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40469 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40470 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40471 | PORT_MODIFY("IN-19") | |
| 40472 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40473 | PORT_MODIFY("IN-20") | |
| 40474 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40475 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40476 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40477 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40478 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40419 | PORT_INCLUDE( sc4_base ) | |
| 40420 | PORT_MODIFY("IN-1") | |
| 40421 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 40422 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40423 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40424 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40425 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hot p") | |
| 40426 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40427 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40428 | PORT_MODIFY("IN-2") | |
| 40429 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 40430 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 40431 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40432 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40433 | PORT_MODIFY("IN-3") | |
| 40434 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40435 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40436 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40437 | PORT_MODIFY("IN-5") | |
| 40438 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40439 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40440 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40441 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40442 | PORT_MODIFY("IN-6") | |
| 40443 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40444 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40445 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40446 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40447 | PORT_MODIFY("IN-8") | |
| 40448 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("streak") | |
| 40449 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b or b") | |
| 40450 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("refuse") | |
| 40451 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("sell") | |
| 40452 | PORT_MODIFY("IN-16") | |
| 40453 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40454 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40455 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40456 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40457 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40458 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40459 | PORT_MODIFY("IN-17") | |
| 40460 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40461 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40462 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40463 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40464 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40465 | PORT_MODIFY("IN-18") | |
| 40466 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40467 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40468 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40469 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40470 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40471 | PORT_MODIFY("IN-19") | |
| 40472 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40473 | PORT_MODIFY("IN-20") | |
| 40474 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40475 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40476 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40477 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40478 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40479 | 40479 | INPUT_PORTS_END |
| 40480 | 40480 | |
| 40481 | 40481 | // PR2345 AWP MONOPOLY HOT PROPERTY S4 PR2345 HOT PROPERTY SOUNDS11 HOT PROPERTY S.SITE |
| r31373 | r31374 | |
| 40513 | 40513 | } |
| 40514 | 40514 | |
| 40515 | 40515 | INPUT_PORTS_START( sc4mmb ) // this structure is generated |
| 40516 | PORT_INCLUDE( sc4_base ) | |
| 40517 | PORT_MODIFY("IN-1") | |
| 40518 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40519 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 40520 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 40521 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 40522 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 40523 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40524 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40525 | PORT_MODIFY("IN-2") | |
| 40526 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 40527 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("takfet") | |
| 40528 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 40529 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40530 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 40531 | PORT_MODIFY("IN-5") | |
| 40532 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40533 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40534 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40535 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40536 | PORT_MODIFY("IN-6") | |
| 40537 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40538 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40539 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40540 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40541 | PORT_MODIFY("IN-8") | |
| 40542 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("sneakp") | |
| 40543 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("gamfet") | |
| 40544 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("gambon") | |
| 40545 | PORT_MODIFY("IN-16") | |
| 40546 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40547 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40548 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40549 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40550 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40551 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40552 | PORT_MODIFY("IN-17") | |
| 40553 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40554 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40555 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40556 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40557 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40558 | PORT_MODIFY("IN-18") | |
| 40559 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40560 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40561 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40562 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40563 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40564 | PORT_MODIFY("IN-19") | |
| 40565 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40566 | PORT_MODIFY("IN-20") | |
| 40567 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40568 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40569 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40570 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40571 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40516 | PORT_INCLUDE( sc4_base ) | |
| 40517 | PORT_MODIFY("IN-1") | |
| 40518 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40519 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 40520 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 40521 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 40522 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 40523 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40524 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40525 | PORT_MODIFY("IN-2") | |
| 40526 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 40527 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("takfet") | |
| 40528 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 40529 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40530 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 40531 | PORT_MODIFY("IN-5") | |
| 40532 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40533 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40534 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40535 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40536 | PORT_MODIFY("IN-6") | |
| 40537 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40538 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40539 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40540 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40541 | PORT_MODIFY("IN-8") | |
| 40542 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("sneakp") | |
| 40543 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("gamfet") | |
| 40544 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("gambon") | |
| 40545 | PORT_MODIFY("IN-16") | |
| 40546 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40547 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40548 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40549 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40550 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40551 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40552 | PORT_MODIFY("IN-17") | |
| 40553 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40554 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40555 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40556 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40557 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40558 | PORT_MODIFY("IN-18") | |
| 40559 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40560 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40561 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40562 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40563 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40564 | PORT_MODIFY("IN-19") | |
| 40565 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40566 | PORT_MODIFY("IN-20") | |
| 40567 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40568 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40569 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40570 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40571 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40572 | 40572 | INPUT_PORTS_END |
| 40573 | 40573 | |
| 40574 | 40574 | // PR1931 AWP MONOLOLY MONEY BAGS SCORP4 PR1911 MPOLY MONEYBAGS SOUNDS11 MONEYBAGS S.SITE |
| r31373 | r31374 | |
| 40592 | 40592 | } |
| 40593 | 40593 | |
| 40594 | 40594 | INPUT_PORTS_START( sc4mrh ) // this structure is generated |
| 40595 | PORT_INCLUDE( sc4_base ) | |
| 40596 | PORT_MODIFY("IN-1") | |
| 40597 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 40598 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40599 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40600 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40601 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 40602 | PORT_MODIFY("IN-2") | |
| 40603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 40604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 40605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40607 | PORT_MODIFY("IN-3") | |
| 40608 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40609 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40610 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40611 | PORT_MODIFY("IN-4") | |
| 40612 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 40613 | PORT_MODIFY("IN-5") | |
| 40614 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40615 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40616 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40617 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40618 | PORT_MODIFY("IN-6") | |
| 40619 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40620 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40621 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40622 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40623 | PORT_MODIFY("IN-16") | |
| 40624 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40625 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40626 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40627 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40628 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40629 | PORT_MODIFY("IN-17") | |
| 40630 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40631 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40632 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40633 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40634 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 40635 | PORT_MODIFY("IN-18") | |
| 40636 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 40637 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 40638 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 40639 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 40640 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 40641 | PORT_MODIFY("IN-19") | |
| 40642 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 40643 | PORT_MODIFY("IN-20") | |
| 40644 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 40645 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 40646 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40647 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 40648 | // 0x0010 - "serdor" // standard input (expected here) | |
| 40595 | PORT_INCLUDE( sc4_base ) | |
| 40596 | PORT_MODIFY("IN-1") | |
| 40597 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 40598 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40599 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40600 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40601 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 40602 | PORT_MODIFY("IN-2") | |
| 40603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 40604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 40605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40607 | PORT_MODIFY("IN-3") | |
| 40608 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40609 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40610 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40611 | PORT_MODIFY("IN-4") | |
| 40612 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 40613 | PORT_MODIFY("IN-5") | |
| 40614 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40615 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40616 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40617 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40618 | PORT_MODIFY("IN-6") | |
| 40619 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40620 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40621 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40622 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40623 | PORT_MODIFY("IN-16") | |
| 40624 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40625 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40626 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40627 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40628 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40629 | PORT_MODIFY("IN-17") | |
| 40630 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40631 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40632 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40633 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40634 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 40635 | PORT_MODIFY("IN-18") | |
| 40636 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 40637 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 40638 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 40639 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 40640 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 40641 | PORT_MODIFY("IN-19") | |
| 40642 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 40643 | PORT_MODIFY("IN-20") | |
| 40644 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 40645 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 40646 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40647 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 40648 | // 0x0010 - "serdor" // standard input (expected here) | |
| 40649 | 40649 | INPUT_PORTS_END |
| 40650 | 40650 | |
| 40651 | 40651 | // PR2363 RED HOT MONOP MONOPOLY ARCADE MONO SOUNDS MONOPOLY |
| r31373 | r31374 | |
| 40673 | 40673 | } |
| 40674 | 40674 | |
| 40675 | 40675 | INPUT_PORTS_START( sc4mr2r ) // this structure is generated |
| 40676 | PORT_INCLUDE( sc4_base ) | |
| 40677 | PORT_MODIFY("IN-1") | |
| 40678 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 40679 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 40680 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 40681 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 40682 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 40683 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 40684 | PORT_MODIFY("IN-2") | |
| 40685 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 40686 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 40687 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 40688 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40689 | PORT_MODIFY("IN-3") | |
| 40690 | // 0x0004 - "stk3" // standard input (expected here) | |
| 40691 | // 0x0008 - "stk1" // standard input (expected here) | |
| 40692 | // 0x0010 - "stk2" // standard input (expected here) | |
| 40693 | PORT_MODIFY("IN-5") | |
| 40694 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 40695 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 40696 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 40697 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 40698 | PORT_MODIFY("IN-6") | |
| 40699 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 40700 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 40701 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 40702 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 40703 | PORT_MODIFY("IN-8") | |
| 40704 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step") | |
| 40705 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("take m") | |
| 40706 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bon ga") | |
| 40707 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("p supe") | |
| 40708 | PORT_MODIFY("IN-16") | |
| 40709 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40710 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40711 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40712 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40713 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40714 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40715 | PORT_MODIFY("IN-17") | |
| 40716 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40717 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40718 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40719 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40720 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40721 | PORT_MODIFY("IN-18") | |
| 40722 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40723 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40724 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40725 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40726 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40727 | PORT_MODIFY("IN-19") | |
| 40728 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40729 | PORT_MODIFY("IN-20") | |
| 40730 | // 0x0001 - "test" // standard input (motherboard) | |
| 40731 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40732 | // 0x0004 - "topdr" // standard input (expected here) | |
| 40733 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40734 | // 0x0010 - "dump" // standard input (expected here) | |
| 40676 | PORT_INCLUDE( sc4_base ) | |
| 40677 | PORT_MODIFY("IN-1") | |
| 40678 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 40679 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 40680 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 40681 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 40682 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 40683 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 40684 | PORT_MODIFY("IN-2") | |
| 40685 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 40686 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 40687 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 40688 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40689 | PORT_MODIFY("IN-3") | |
| 40690 | // 0x0004 - "stk3" // standard input (expected here) | |
| 40691 | // 0x0008 - "stk1" // standard input (expected here) | |
| 40692 | // 0x0010 - "stk2" // standard input (expected here) | |
| 40693 | PORT_MODIFY("IN-5") | |
| 40694 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 40695 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 40696 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 40697 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 40698 | PORT_MODIFY("IN-6") | |
| 40699 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 40700 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 40701 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 40702 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 40703 | PORT_MODIFY("IN-8") | |
| 40704 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step") | |
| 40705 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("take m") | |
| 40706 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bon ga") | |
| 40707 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("p supe") | |
| 40708 | PORT_MODIFY("IN-16") | |
| 40709 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40710 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40711 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40712 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40713 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40714 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40715 | PORT_MODIFY("IN-17") | |
| 40716 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40717 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40718 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40719 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40720 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40721 | PORT_MODIFY("IN-18") | |
| 40722 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40723 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40724 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40725 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40726 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40727 | PORT_MODIFY("IN-19") | |
| 40728 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40729 | PORT_MODIFY("IN-20") | |
| 40730 | // 0x0001 - "test" // standard input (motherboard) | |
| 40731 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 40732 | // 0x0004 - "topdr" // standard input (expected here) | |
| 40733 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 40734 | // 0x0010 - "dump" // standard input (expected here) | |
| 40735 | 40735 | INPUT_PORTS_END |
| 40736 | 40736 | |
| 40737 | 40737 | // PR2329 MONOPOLY ROAD TO RICHES MR2R SOUNDS ROAD TO RICHES |
| r31373 | r31374 | |
| 40759 | 40759 | } |
| 40760 | 40760 | |
| 40761 | 40761 | INPUT_PORTS_START( sc4nmare ) // this structure is generated |
| 40762 | PORT_INCLUDE( sc4_base ) | |
| 40763 | PORT_MODIFY("IN-1") | |
| 40764 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40765 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collct") | |
| 40766 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 40767 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 40768 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 40769 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40770 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40771 | PORT_MODIFY("IN-2") | |
| 40772 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("hold 4") | |
| 40773 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 40774 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 40775 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40776 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 40777 | PORT_MODIFY("IN-3") | |
| 40778 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40779 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40780 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40781 | PORT_MODIFY("IN-5") | |
| 40782 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40783 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40784 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40785 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40786 | PORT_MODIFY("IN-6") | |
| 40787 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40788 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40789 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40790 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40791 | PORT_MODIFY("IN-8") | |
| 40792 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("s or g") | |
| 40793 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("grab") | |
| 40794 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("slash") | |
| 40795 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk stk") | |
| 40796 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("d or a") | |
| 40797 | PORT_MODIFY("IN-16") | |
| 40798 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40799 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40800 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40801 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40802 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40803 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40804 | PORT_MODIFY("IN-17") | |
| 40805 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40806 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40807 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40808 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40809 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40810 | PORT_MODIFY("IN-18") | |
| 40811 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40812 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40813 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40814 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40815 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40816 | PORT_MODIFY("IN-19") | |
| 40817 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40818 | PORT_MODIFY("IN-20") | |
| 40819 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40820 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40821 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40822 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40823 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40762 | PORT_INCLUDE( sc4_base ) | |
| 40763 | PORT_MODIFY("IN-1") | |
| 40764 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40765 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collct") | |
| 40766 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 40767 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 40768 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 40769 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40770 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40771 | PORT_MODIFY("IN-2") | |
| 40772 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("hold 4") | |
| 40773 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 40774 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 40775 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40776 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 40777 | PORT_MODIFY("IN-3") | |
| 40778 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40779 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40780 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40781 | PORT_MODIFY("IN-5") | |
| 40782 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40783 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40784 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40785 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40786 | PORT_MODIFY("IN-6") | |
| 40787 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40788 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40789 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40790 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40791 | PORT_MODIFY("IN-8") | |
| 40792 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("s or g") | |
| 40793 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("grab") | |
| 40794 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("slash") | |
| 40795 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk stk") | |
| 40796 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("d or a") | |
| 40797 | PORT_MODIFY("IN-16") | |
| 40798 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40799 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40800 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40801 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40802 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40803 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 40804 | PORT_MODIFY("IN-17") | |
| 40805 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40806 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40807 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40808 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40809 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40810 | PORT_MODIFY("IN-18") | |
| 40811 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40812 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40813 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40814 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40815 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40816 | PORT_MODIFY("IN-19") | |
| 40817 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40818 | PORT_MODIFY("IN-20") | |
| 40819 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40820 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40821 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40822 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40823 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40824 | 40824 | INPUT_PORTS_END |
| 40825 | 40825 | |
| 40826 | 40826 | // PR3032 AWP NIGHTMARE ON ELM STREET S4 PR3002 ELM STREET SOUNDS11 NIGHTMARE ELM ST S.SITE |
| r31373 | r31374 | |
| 40847 | 40847 | } |
| 40848 | 40848 | |
| 40849 | 40849 | INPUT_PORTS_START( sc4potp ) // this structure is generated |
| 40850 | PORT_INCLUDE( sc4_base ) | |
| 40851 | PORT_MODIFY("IN-1") | |
| 40852 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40853 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40854 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40855 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40856 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 40857 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40858 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40859 | PORT_MODIFY("IN-2") | |
| 40860 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 40861 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 40862 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40863 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40864 | PORT_MODIFY("IN-3") | |
| 40865 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40866 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40867 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40868 | PORT_MODIFY("IN-4") | |
| 40869 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 40870 | PORT_MODIFY("IN-5") | |
| 40871 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40872 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40873 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40874 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40875 | PORT_MODIFY("IN-6") | |
| 40876 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40877 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40878 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40879 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40880 | PORT_MODIFY("IN-8") | |
| 40881 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 40882 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c feat") | |
| 40883 | PORT_MODIFY("IN-16") | |
| 40884 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40885 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40886 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40887 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40888 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40889 | PORT_MODIFY("IN-17") | |
| 40890 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40891 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40892 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40893 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40894 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40895 | PORT_MODIFY("IN-18") | |
| 40896 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40897 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40898 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40899 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40900 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40901 | PORT_MODIFY("IN-19") | |
| 40902 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40903 | PORT_MODIFY("IN-20") | |
| 40904 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40905 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40906 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40907 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40908 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40850 | PORT_INCLUDE( sc4_base ) | |
| 40851 | PORT_MODIFY("IN-1") | |
| 40852 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 40853 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40854 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40855 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40856 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 40857 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 40858 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 40859 | PORT_MODIFY("IN-2") | |
| 40860 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 40861 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 40862 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 40863 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40864 | PORT_MODIFY("IN-3") | |
| 40865 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40866 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40867 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40868 | PORT_MODIFY("IN-4") | |
| 40869 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 40870 | PORT_MODIFY("IN-5") | |
| 40871 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40872 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40873 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40874 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40875 | PORT_MODIFY("IN-6") | |
| 40876 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40877 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40878 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40879 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40880 | PORT_MODIFY("IN-8") | |
| 40881 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 40882 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c feat") | |
| 40883 | PORT_MODIFY("IN-16") | |
| 40884 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 40885 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 40886 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 40887 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 40888 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 40889 | PORT_MODIFY("IN-17") | |
| 40890 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 40891 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 40892 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 40893 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 40894 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 40895 | PORT_MODIFY("IN-18") | |
| 40896 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 40897 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 40898 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 40899 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 40900 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 40901 | PORT_MODIFY("IN-19") | |
| 40902 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 40903 | PORT_MODIFY("IN-20") | |
| 40904 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 40905 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 40906 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40907 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 40908 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 40909 | 40909 | INPUT_PORTS_END |
| 40910 | 40910 | |
| 40911 | 40911 | // PR1612 PICK OF THE PACK PR1612 PICK OF THE PACK SOUNDS11 PICK OF THE PACK S.SITE |
| r31373 | r31374 | |
| 40914 | 40914 | |
| 40915 | 40915 | |
| 40916 | 40916 | INPUT_PORTS_START( sc4ppcr ) // this structure is generated |
| 40917 | PORT_INCLUDE( sc4_base ) | |
| 40918 | PORT_MODIFY("IN-1") | |
| 40919 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR colect") | |
| 40920 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40921 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40922 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40923 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 40924 | PORT_MODIFY("IN-2") | |
| 40925 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 40926 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 40927 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40928 | PORT_MODIFY("IN-3") | |
| 40929 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40930 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40931 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40932 | PORT_MODIFY("IN-4") | |
| 40933 | // 0x0008 - "top up" // known extended(?) input, sometimes 'hop top' | |
| 40934 | PORT_MODIFY("IN-5") | |
| 40935 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40936 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40937 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40938 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40939 | PORT_MODIFY("IN-6") | |
| 40940 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40941 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40942 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40943 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40944 | PORT_MODIFY("IN-16") | |
| 40945 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40946 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40947 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40948 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40949 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40950 | PORT_MODIFY("IN-17") | |
| 40951 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40952 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40953 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40954 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40955 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 40956 | PORT_MODIFY("IN-18") | |
| 40957 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 40958 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 40959 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 40960 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 40961 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 40962 | PORT_MODIFY("IN-19") | |
| 40963 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 40964 | PORT_MODIFY("IN-20") | |
| 40965 | // 0x0001 - "test" // standard input (motherboard) | |
| 40966 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 40967 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40968 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 40917 | PORT_INCLUDE( sc4_base ) | |
| 40918 | PORT_MODIFY("IN-1") | |
| 40919 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR colect") | |
| 40920 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 40921 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 40922 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 40923 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 40924 | PORT_MODIFY("IN-2") | |
| 40925 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 40926 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 40927 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 40928 | PORT_MODIFY("IN-3") | |
| 40929 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 40930 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 40931 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 40932 | PORT_MODIFY("IN-4") | |
| 40933 | // 0x0008 - "top up" // known extended(?) input, sometimes 'hop top' | |
| 40934 | PORT_MODIFY("IN-5") | |
| 40935 | // 0x0001 - "priz4" // standard input (expected here) | |
| 40936 | // 0x0002 - "priz3" // standard input (expected here) | |
| 40937 | // 0x0004 - "priz2" // standard input (expected here) | |
| 40938 | // 0x0008 - "priz1" // standard input (expected here) | |
| 40939 | PORT_MODIFY("IN-6") | |
| 40940 | // 0x0001 - "perc1" // standard input (expected here) | |
| 40941 | // 0x0002 - "perc2" // standard input (expected here) | |
| 40942 | // 0x0004 - "perc3" // standard input (expected here) | |
| 40943 | // 0x0008 - "perc4" // standard input (expected here) | |
| 40944 | PORT_MODIFY("IN-16") | |
| 40945 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 40946 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 40947 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 40948 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 40949 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 40950 | PORT_MODIFY("IN-17") | |
| 40951 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 40952 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 40953 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 40954 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 40955 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 40956 | PORT_MODIFY("IN-18") | |
| 40957 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 40958 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 40959 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 40960 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 40961 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 40962 | PORT_MODIFY("IN-19") | |
| 40963 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 40964 | PORT_MODIFY("IN-20") | |
| 40965 | // 0x0001 - "test" // standard input (motherboard) | |
| 40966 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 40967 | // 0x0004 - "serdor" // standard input (expected here) | |
| 40968 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 40969 | 40969 | INPUT_PORTS_END |
| 40970 | 40970 | |
| 40971 | 40971 | // PR2279 PINK PANTHER CLOUSEAUS REVENGE REVENGE QPS REVENGE SOUNDS |
| r31373 | r31374 | |
| 41000 | 41000 | } |
| 41001 | 41001 | |
| 41002 | 41002 | INPUT_PORTS_START( sc4ppctc ) // this structure is generated |
| 41003 | PORT_INCLUDE( sc4_base ) | |
| 41004 | PORT_MODIFY("IN-1") | |
| 41005 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41006 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41007 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41008 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41009 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 41010 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41011 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41012 | PORT_MODIFY("IN-2") | |
| 41013 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 41014 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 41015 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 41016 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41017 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 41018 | PORT_MODIFY("IN-3") | |
| 41019 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41020 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41021 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41022 | PORT_MODIFY("IN-5") | |
| 41023 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41024 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41025 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41026 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41027 | PORT_MODIFY("IN-6") | |
| 41028 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41029 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41030 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41031 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41032 | PORT_MODIFY("IN-8") | |
| 41033 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b leav") | |
| 41034 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b take") | |
| 41035 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk clu") | |
| 41036 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk bon") | |
| 41037 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cs bus") | |
| 41038 | PORT_MODIFY("IN-9") | |
| 41039 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk str") | |
| 41040 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("leave") | |
| 41041 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("pl ctc") | |
| 41042 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("take") | |
| 41043 | PORT_MODIFY("IN-16") | |
| 41044 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41045 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41046 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41047 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41048 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41049 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41050 | PORT_MODIFY("IN-17") | |
| 41051 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41052 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41053 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41054 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41055 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41056 | PORT_MODIFY("IN-18") | |
| 41057 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41058 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41059 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41060 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41061 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41062 | PORT_MODIFY("IN-19") | |
| 41063 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41064 | PORT_MODIFY("IN-20") | |
| 41065 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41066 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41067 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41068 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41069 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41003 | PORT_INCLUDE( sc4_base ) | |
| 41004 | PORT_MODIFY("IN-1") | |
| 41005 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41006 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41007 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41008 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41009 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 41010 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41011 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41012 | PORT_MODIFY("IN-2") | |
| 41013 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 41014 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchag") | |
| 41015 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 41016 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41017 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 41018 | PORT_MODIFY("IN-3") | |
| 41019 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41020 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41021 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41022 | PORT_MODIFY("IN-5") | |
| 41023 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41024 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41025 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41026 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41027 | PORT_MODIFY("IN-6") | |
| 41028 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41029 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41030 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41031 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41032 | PORT_MODIFY("IN-8") | |
| 41033 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("b leav") | |
| 41034 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b take") | |
| 41035 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk clu") | |
| 41036 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk bon") | |
| 41037 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("cs bus") | |
| 41038 | PORT_MODIFY("IN-9") | |
| 41039 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk str") | |
| 41040 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("leave") | |
| 41041 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("pl ctc") | |
| 41042 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("take") | |
| 41043 | PORT_MODIFY("IN-16") | |
| 41044 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41045 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41046 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41047 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41048 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41049 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41050 | PORT_MODIFY("IN-17") | |
| 41051 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41052 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41053 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41054 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41055 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41056 | PORT_MODIFY("IN-18") | |
| 41057 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41058 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41059 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41060 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41061 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41062 | PORT_MODIFY("IN-19") | |
| 41063 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41064 | PORT_MODIFY("IN-20") | |
| 41065 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41066 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41067 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41068 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41069 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41070 | 41070 | INPUT_PORTS_END |
| 41071 | 41071 | |
| 41072 | 41072 | // PR2407 AWP PINK PANTHER CRACK THE CODE SCORP4 PR2407 CRACK THE CODE SOUNDS11 CRACK THE CODE S.SITE |
| r31373 | r31374 | |
| 41081 | 41081 | |
| 41082 | 41082 | |
| 41083 | 41083 | INPUT_PORTS_START( sc4ppdym ) // this structure is generated |
| 41084 | PORT_INCLUDE( sc4_base ) | |
| 41085 | PORT_MODIFY("IN-1") | |
| 41086 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 41087 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41088 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41089 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41090 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("blank") | |
| 41091 | PORT_MODIFY("IN-2") | |
| 41092 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 41093 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41094 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill OR refill") | |
| 41095 | PORT_MODIFY("IN-3") | |
| 41096 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41097 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41098 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41099 | PORT_MODIFY("IN-4") | |
| 41100 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 41101 | PORT_MODIFY("IN-5") | |
| 41102 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41103 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41104 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41105 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41106 | PORT_MODIFY("IN-6") | |
| 41107 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41108 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41109 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41110 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41111 | PORT_MODIFY("IN-16") | |
| 41112 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41113 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41114 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41115 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41116 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41117 | PORT_MODIFY("IN-17") | |
| 41118 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41119 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41120 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41121 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41122 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 41123 | PORT_MODIFY("IN-18") | |
| 41124 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 41125 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 41126 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 41127 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 41128 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 41129 | PORT_MODIFY("IN-19") | |
| 41130 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 41131 | PORT_MODIFY("IN-20") | |
| 41132 | // 0x0001 - "test OR grnbut OR test" // standard input (motherboard) | |
| 41133 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 41134 | // 0x0004 - "cshdor" // standard input (expected here) | |
| 41135 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 41136 | // 0x0010 - "serdor" // standard input (expected here) | |
| 41084 | PORT_INCLUDE( sc4_base ) | |
| 41085 | PORT_MODIFY("IN-1") | |
| 41086 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 41087 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41088 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41089 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41090 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("blank") | |
| 41091 | PORT_MODIFY("IN-2") | |
| 41092 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 41093 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41094 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill OR refill") | |
| 41095 | PORT_MODIFY("IN-3") | |
| 41096 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41097 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41098 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41099 | PORT_MODIFY("IN-4") | |
| 41100 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 41101 | PORT_MODIFY("IN-5") | |
| 41102 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41103 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41104 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41105 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41106 | PORT_MODIFY("IN-6") | |
| 41107 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41108 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41109 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41110 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41111 | PORT_MODIFY("IN-16") | |
| 41112 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41113 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41114 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41115 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41116 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41117 | PORT_MODIFY("IN-17") | |
| 41118 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41119 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41120 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41121 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41122 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 41123 | PORT_MODIFY("IN-18") | |
| 41124 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 41125 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 41126 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 41127 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 41128 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 41129 | PORT_MODIFY("IN-19") | |
| 41130 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 41131 | PORT_MODIFY("IN-20") | |
| 41132 | // 0x0001 - "test OR grnbut OR test" // standard input (motherboard) | |
| 41133 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 41134 | // 0x0004 - "cshdor" // standard input (expected here) | |
| 41135 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 41136 | // 0x0010 - "serdor" // standard input (expected here) | |
| 41137 | 41137 | INPUT_PORTS_END |
| 41138 | 41138 | |
| 41139 | 41139 | // PR2330 PINK PANTHER DYM PINK PANTHER DYM QPS DYMT SOUNDS PINK PANTHER DYM - |
| r31373 | r31374 | |
| 41166 | 41166 | } |
| 41167 | 41167 | |
| 41168 | 41168 | INPUT_PORTS_START( sc4pony ) // this structure is generated |
| 41169 | PORT_INCLUDE( sc4_base ) | |
| 41170 | PORT_MODIFY("IN-1") | |
| 41171 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41172 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41173 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41174 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41175 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 41176 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41177 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41178 | PORT_MODIFY("IN-2") | |
| 41179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 41180 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41181 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41182 | PORT_MODIFY("IN-3") | |
| 41183 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41184 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 41185 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 41186 | PORT_MODIFY("IN-5") | |
| 41187 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41188 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41189 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41190 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41191 | PORT_MODIFY("IN-6") | |
| 41192 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41193 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41194 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41195 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41196 | PORT_MODIFY("IN-8") | |
| 41197 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 41198 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 41199 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 41200 | PORT_MODIFY("IN-16") | |
| 41201 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41202 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41203 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41204 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41205 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41206 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 41207 | PORT_MODIFY("IN-17") | |
| 41208 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41209 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41210 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41211 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41212 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41213 | PORT_MODIFY("IN-18") | |
| 41214 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41215 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41216 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41217 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41218 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41219 | PORT_MODIFY("IN-19") | |
| 41220 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41221 | PORT_MODIFY("IN-20") | |
| 41222 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41223 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41224 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41225 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41226 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41169 | PORT_INCLUDE( sc4_base ) | |
| 41170 | PORT_MODIFY("IN-1") | |
| 41171 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41172 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41173 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41174 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41175 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 41176 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41177 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41178 | PORT_MODIFY("IN-2") | |
| 41179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 41180 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41181 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41182 | PORT_MODIFY("IN-3") | |
| 41183 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41184 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 41185 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 41186 | PORT_MODIFY("IN-5") | |
| 41187 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41188 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41189 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41190 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41191 | PORT_MODIFY("IN-6") | |
| 41192 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41193 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41194 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41195 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41196 | PORT_MODIFY("IN-8") | |
| 41197 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 41198 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shoot") | |
| 41199 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spins") | |
| 41200 | PORT_MODIFY("IN-16") | |
| 41201 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41202 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41203 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41204 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41205 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41206 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 41207 | PORT_MODIFY("IN-17") | |
| 41208 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41209 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41210 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41211 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41212 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41213 | PORT_MODIFY("IN-18") | |
| 41214 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41215 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41216 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41217 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41218 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41219 | PORT_MODIFY("IN-19") | |
| 41220 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41221 | PORT_MODIFY("IN-20") | |
| 41222 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41223 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41224 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41225 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41226 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41227 | 41227 | INPUT_PORTS_END |
| 41228 | 41228 | |
| 41229 | 41229 | // PR1408 PONY EXPRESS PR1408 PONY EXPRESS SOUNDS11 PONY EXPRESS S.SITE |
| r31373 | r31374 | |
| 41251 | 41251 | } |
| 41252 | 41252 | |
| 41253 | 41253 | INPUT_PORTS_START( sc4popey ) // this structure is generated |
| 41254 | PORT_INCLUDE( sc4_base ) | |
| 41255 | PORT_MODIFY("IN-1") | |
| 41256 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 41257 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("ch stk") | |
| 41258 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 41259 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 41260 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 41261 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41262 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41263 | PORT_MODIFY("IN-2") | |
| 41264 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ply it") | |
| 41265 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 41266 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41267 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41268 | PORT_MODIFY("IN-3") | |
| 41269 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41270 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41271 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41272 | PORT_MODIFY("IN-5") | |
| 41273 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41274 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41275 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41276 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41277 | PORT_MODIFY("IN-6") | |
| 41278 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41279 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41280 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41281 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41282 | PORT_MODIFY("IN-8") | |
| 41283 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("streak") | |
| 41284 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("s or s") | |
| 41285 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 41286 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 41287 | PORT_MODIFY("IN-16") | |
| 41288 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41289 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41290 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41291 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41292 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41293 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41294 | PORT_MODIFY("IN-17") | |
| 41295 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41296 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41297 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41298 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41299 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41300 | PORT_MODIFY("IN-18") | |
| 41301 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41302 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41303 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41304 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41305 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41306 | PORT_MODIFY("IN-19") | |
| 41307 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41308 | PORT_MODIFY("IN-20") | |
| 41309 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41310 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41311 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41312 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41313 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41254 | PORT_INCLUDE( sc4_base ) | |
| 41255 | PORT_MODIFY("IN-1") | |
| 41256 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("can/co") | |
| 41257 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("ch stk") | |
| 41258 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 41259 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 41260 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 41261 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41262 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41263 | PORT_MODIFY("IN-2") | |
| 41264 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ply it") | |
| 41265 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 41266 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41267 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41268 | PORT_MODIFY("IN-3") | |
| 41269 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41270 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41271 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41272 | PORT_MODIFY("IN-5") | |
| 41273 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41274 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41275 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41276 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41277 | PORT_MODIFY("IN-6") | |
| 41278 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41279 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41280 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41281 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41282 | PORT_MODIFY("IN-8") | |
| 41283 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("streak") | |
| 41284 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("s or s") | |
| 41285 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("leave") | |
| 41286 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("take") | |
| 41287 | PORT_MODIFY("IN-16") | |
| 41288 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41289 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41290 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41291 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41292 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41293 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41294 | PORT_MODIFY("IN-17") | |
| 41295 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41296 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41297 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41298 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41299 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41300 | PORT_MODIFY("IN-18") | |
| 41301 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41302 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41303 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41304 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41305 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41306 | PORT_MODIFY("IN-19") | |
| 41307 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41308 | PORT_MODIFY("IN-20") | |
| 41309 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41310 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41311 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41312 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41313 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41314 | 41314 | INPUT_PORTS_END |
| 41315 | 41315 | |
| 41316 | 41316 | // PR2417 AWP POPEYE S4 PR2417 POPEYE SOUNDS11 POPEYE S.SITE |
| r31373 | r31374 | |
| 41339 | 41339 | } |
| 41340 | 41340 | |
| 41341 | 41341 | INPUT_PORTS_START( sc4pwrbl ) // this structure is generated |
| 41342 | PORT_INCLUDE( sc4_base ) | |
| 41343 | PORT_MODIFY("IN-1") | |
| 41344 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41345 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41346 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41347 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41348 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 41349 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41350 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41351 | PORT_MODIFY("IN-2") | |
| 41352 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 41353 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 41354 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41355 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41356 | PORT_MODIFY("IN-3") | |
| 41357 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41358 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 41359 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 41360 | PORT_MODIFY("IN-5") | |
| 41361 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41362 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41363 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41364 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41365 | PORT_MODIFY("IN-6") | |
| 41366 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41367 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41368 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41369 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41370 | PORT_MODIFY("IN-7") | |
| 41371 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("tilt") | |
| 41372 | PORT_MODIFY("IN-8") | |
| 41373 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("r ball") | |
| 41374 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lose") | |
| 41375 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hole 8") | |
| 41376 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hole 7") | |
| 41377 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hole 6") | |
| 41378 | PORT_MODIFY("IN-9") | |
| 41379 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hole 5") | |
| 41380 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hole 4") | |
| 41381 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hole 3") | |
| 41382 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("hole 2") | |
| 41383 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("hole 1") | |
| 41384 | PORT_MODIFY("IN-16") | |
| 41385 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41386 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41387 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41388 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41389 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41390 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 41391 | PORT_MODIFY("IN-17") | |
| 41392 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41393 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41394 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41395 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41396 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41397 | PORT_MODIFY("IN-18") | |
| 41398 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41399 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41400 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41401 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41402 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41403 | PORT_MODIFY("IN-19") | |
| 41404 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41405 | PORT_MODIFY("IN-20") | |
| 41406 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41407 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41408 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41409 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41410 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41342 | PORT_INCLUDE( sc4_base ) | |
| 41343 | PORT_MODIFY("IN-1") | |
| 41344 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41345 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41346 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41347 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41348 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 41349 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41350 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41351 | PORT_MODIFY("IN-2") | |
| 41352 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 41353 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 41354 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41355 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41356 | PORT_MODIFY("IN-3") | |
| 41357 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41358 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 41359 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 41360 | PORT_MODIFY("IN-5") | |
| 41361 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41362 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41363 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41364 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41365 | PORT_MODIFY("IN-6") | |
| 41366 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41367 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41368 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41369 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41370 | PORT_MODIFY("IN-7") | |
| 41371 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("tilt") | |
| 41372 | PORT_MODIFY("IN-8") | |
| 41373 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("r ball") | |
| 41374 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lose") | |
| 41375 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hole 8") | |
| 41376 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hole 7") | |
| 41377 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hole 6") | |
| 41378 | PORT_MODIFY("IN-9") | |
| 41379 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hole 5") | |
| 41380 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hole 4") | |
| 41381 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("hole 3") | |
| 41382 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("hole 2") | |
| 41383 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("hole 1") | |
| 41384 | PORT_MODIFY("IN-16") | |
| 41385 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41386 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41387 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41388 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41389 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41390 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 41391 | PORT_MODIFY("IN-17") | |
| 41392 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41393 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41394 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41395 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41396 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41397 | PORT_MODIFY("IN-18") | |
| 41398 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41399 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41400 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41401 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41402 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41403 | PORT_MODIFY("IN-19") | |
| 41404 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41405 | PORT_MODIFY("IN-20") | |
| 41406 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41407 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41408 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41409 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41410 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41411 | 41411 | INPUT_PORTS_END |
| 41412 | 41412 | |
| 41413 | 41413 | // sequel to gamball, mechanical? |
| r31373 | r31374 | |
| 41433 | 41433 | } |
| 41434 | 41434 | |
| 41435 | 41435 | INPUT_PORTS_START( sc4quidv ) // this structure is generated |
| 41436 | PORT_INCLUDE( sc4_base ) | |
| 41437 | PORT_MODIFY("IN-1") | |
| 41438 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 41439 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 41440 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 41441 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 41442 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 41443 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 41444 | PORT_MODIFY("IN-2") | |
| 41445 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 41446 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 41447 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 41448 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41449 | PORT_MODIFY("IN-3") | |
| 41450 | // 0x0004 - "stk3" // standard input (expected here) | |
| 41451 | // 0x0008 - "stk1" // standard input (expected here) | |
| 41452 | // 0x0010 - "stk2" // standard input (expected here) | |
| 41453 | PORT_MODIFY("IN-5") | |
| 41454 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 41455 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 41456 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 41457 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 41458 | PORT_MODIFY("IN-6") | |
| 41459 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 41460 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 41461 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 41462 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 41463 | PORT_MODIFY("IN-8") | |
| 41464 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bon") | |
| 41465 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 41466 | PORT_MODIFY("IN-16") | |
| 41467 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41468 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41469 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41470 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41471 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41472 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41473 | PORT_MODIFY("IN-17") | |
| 41474 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41475 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41476 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41477 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41478 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41479 | PORT_MODIFY("IN-18") | |
| 41480 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41481 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41482 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41483 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41484 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41485 | PORT_MODIFY("IN-19") | |
| 41486 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41487 | PORT_MODIFY("IN-20") | |
| 41488 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 41489 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 41490 | // 0x0004 - "topdr" // standard input (expected here) | |
| 41491 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 41492 | // 0x0010 - "dump" // standard input (expected here) | |
| 41436 | PORT_INCLUDE( sc4_base ) | |
| 41437 | PORT_MODIFY("IN-1") | |
| 41438 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 41439 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 41440 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 41441 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 41442 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 41443 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 41444 | PORT_MODIFY("IN-2") | |
| 41445 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 41446 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 41447 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 41448 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41449 | PORT_MODIFY("IN-3") | |
| 41450 | // 0x0004 - "stk3" // standard input (expected here) | |
| 41451 | // 0x0008 - "stk1" // standard input (expected here) | |
| 41452 | // 0x0010 - "stk2" // standard input (expected here) | |
| 41453 | PORT_MODIFY("IN-5") | |
| 41454 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 41455 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 41456 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 41457 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 41458 | PORT_MODIFY("IN-6") | |
| 41459 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 41460 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 41461 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 41462 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 41463 | PORT_MODIFY("IN-8") | |
| 41464 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bon") | |
| 41465 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 41466 | PORT_MODIFY("IN-16") | |
| 41467 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41468 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41469 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41470 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41471 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41472 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41473 | PORT_MODIFY("IN-17") | |
| 41474 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41475 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41476 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41477 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41478 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41479 | PORT_MODIFY("IN-18") | |
| 41480 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41481 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41482 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41483 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41484 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41485 | PORT_MODIFY("IN-19") | |
| 41486 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41487 | PORT_MODIFY("IN-20") | |
| 41488 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 41489 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 41490 | // 0x0004 - "topdr" // standard input (expected here) | |
| 41491 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 41492 | // 0x0010 - "dump" // standard input (expected here) | |
| 41493 | 41493 | INPUT_PORTS_END |
| 41494 | 41494 | |
| 41495 | 41495 | // PR2342 QUID VICIOUS QUIDV SOUNDS QUID VICIOUS |
| r31373 | r31374 | |
| 41515 | 41515 | } |
| 41516 | 41516 | |
| 41517 | 41517 | INPUT_PORTS_START( sc4rhxcs ) // this structure is generated |
| 41518 | PORT_INCLUDE( sc4_base ) | |
| 41519 | PORT_MODIFY("IN-1") | |
| 41520 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 41521 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41522 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41523 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41524 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 41525 | PORT_MODIFY("IN-2") | |
| 41526 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 41527 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 41528 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41529 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41530 | PORT_MODIFY("IN-3") | |
| 41531 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41532 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41533 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41534 | PORT_MODIFY("IN-4") | |
| 41535 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 41536 | PORT_MODIFY("IN-5") | |
| 41537 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41538 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41539 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41540 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41541 | PORT_MODIFY("IN-6") | |
| 41542 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41543 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41544 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41545 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41546 | PORT_MODIFY("IN-16") | |
| 41547 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41548 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41549 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41550 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41551 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41552 | PORT_MODIFY("IN-17") | |
| 41553 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41554 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41555 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41556 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41557 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 41558 | PORT_MODIFY("IN-18") | |
| 41559 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 41560 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 41561 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 41562 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 41563 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 41564 | PORT_MODIFY("IN-19") | |
| 41565 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 41566 | PORT_MODIFY("IN-20") | |
| 41567 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 41568 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 41569 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41570 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 41571 | // 0x0010 - "serdor" // standard input (expected here) | |
| 41518 | PORT_INCLUDE( sc4_base ) | |
| 41519 | PORT_MODIFY("IN-1") | |
| 41520 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR collec") | |
| 41521 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41522 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41523 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41524 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("transf") | |
| 41525 | PORT_MODIFY("IN-2") | |
| 41526 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("autopl") | |
| 41527 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 41528 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41529 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41530 | PORT_MODIFY("IN-3") | |
| 41531 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41532 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41533 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41534 | PORT_MODIFY("IN-4") | |
| 41535 | // 0x0008 - "top up OR top up" // known extended(?) input, sometimes 'hop top' | |
| 41536 | PORT_MODIFY("IN-5") | |
| 41537 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41538 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41539 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41540 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41541 | PORT_MODIFY("IN-6") | |
| 41542 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41543 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41544 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41545 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41546 | PORT_MODIFY("IN-16") | |
| 41547 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41548 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41549 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41550 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41551 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41552 | PORT_MODIFY("IN-17") | |
| 41553 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41554 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41555 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41556 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41557 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 41558 | PORT_MODIFY("IN-18") | |
| 41559 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 41560 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 41561 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 41562 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 41563 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 41564 | PORT_MODIFY("IN-19") | |
| 41565 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 41566 | PORT_MODIFY("IN-20") | |
| 41567 | // 0x0001 - "green OR test" // standard input (motherboard) | |
| 41568 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 41569 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41570 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 41571 | // 0x0010 - "serdor" // standard input (expected here) | |
| 41572 | 41572 | INPUT_PORTS_END |
| 41573 | 41573 | |
| 41574 | 41574 | // PR2364 CASINO RED HOT X RED HOT X CRHX SOUNDS RED HOT X |
| r31373 | r31374 | |
| 41598 | 41598 | } |
| 41599 | 41599 | |
| 41600 | 41600 | INPUT_PORTS_START( sc4redsq ) // this structure is generated |
| 41601 | PORT_INCLUDE( sc4_base ) | |
| 41602 | PORT_MODIFY("IN-1") | |
| 41603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cnccol") | |
| 41604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 41605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 41606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 41607 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exch") | |
| 41608 | PORT_MODIFY("IN-2") | |
| 41609 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 41610 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41611 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41612 | PORT_MODIFY("IN-8") | |
| 41613 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t nuds") | |
| 41614 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t cash") | |
| 41615 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("m rght") | |
| 41616 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("m down") | |
| 41617 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("m left") | |
| 41618 | PORT_MODIFY("IN-9") | |
| 41619 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("m up") | |
| 41620 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("t cpot") | |
| 41621 | PORT_MODIFY("IN-16") | |
| 41622 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41623 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41624 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41625 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41626 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41627 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41628 | PORT_MODIFY("IN-17") | |
| 41629 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41630 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41631 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41632 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41633 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41634 | PORT_MODIFY("IN-18") | |
| 41635 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41636 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41637 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41638 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41639 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41640 | PORT_MODIFY("IN-19") | |
| 41641 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41642 | PORT_MODIFY("IN-20") | |
| 41643 | // 0x0001 - "test" // standard input (motherboard) | |
| 41644 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 41645 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 41646 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 41647 | // 0x0010 - "deflt" // standard input (expected here) | |
| 41601 | PORT_INCLUDE( sc4_base ) | |
| 41602 | PORT_MODIFY("IN-1") | |
| 41603 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cnccol") | |
| 41604 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 41605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 41606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 41607 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exch") | |
| 41608 | PORT_MODIFY("IN-2") | |
| 41609 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 41610 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41611 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41612 | PORT_MODIFY("IN-8") | |
| 41613 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t nuds") | |
| 41614 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t cash") | |
| 41615 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("m rght") | |
| 41616 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("m down") | |
| 41617 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("m left") | |
| 41618 | PORT_MODIFY("IN-9") | |
| 41619 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("m up") | |
| 41620 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("t cpot") | |
| 41621 | PORT_MODIFY("IN-16") | |
| 41622 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41623 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41624 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41625 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41626 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41627 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41628 | PORT_MODIFY("IN-17") | |
| 41629 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41630 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41631 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41632 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41633 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41634 | PORT_MODIFY("IN-18") | |
| 41635 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41636 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41637 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41638 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41639 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41640 | PORT_MODIFY("IN-19") | |
| 41641 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41642 | PORT_MODIFY("IN-20") | |
| 41643 | // 0x0001 - "test" // standard input (motherboard) | |
| 41644 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 41645 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 41646 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 41647 | // 0x0010 - "deflt" // standard input (expected here) | |
| 41648 | 41648 | INPUT_PORTS_END |
| 41649 | 41649 | |
| 41650 | 41650 | |
| r31373 | r31374 | |
| 41672 | 41672 | } |
| 41673 | 41673 | |
| 41674 | 41674 | INPUT_PORTS_START( sc4rosts ) // this structure is generated |
| 41675 | PORT_INCLUDE( sc4_base ) | |
| 41676 | PORT_MODIFY("IN-1") | |
| 41677 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 41678 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 41679 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 41680 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 41681 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 41682 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 41683 | PORT_MODIFY("IN-2") | |
| 41684 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 41685 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ex/tra") | |
| 41686 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41687 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41688 | PORT_MODIFY("IN-3") | |
| 41689 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41690 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41691 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41692 | PORT_MODIFY("IN-4") | |
| 41693 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 41694 | PORT_MODIFY("IN-5") | |
| 41695 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41696 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41697 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41698 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41699 | PORT_MODIFY("IN-8") | |
| 41700 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk win") | |
| 41701 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 41702 | PORT_MODIFY("IN-16") | |
| 41703 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41704 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41705 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41706 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41707 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41708 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41709 | PORT_MODIFY("IN-17") | |
| 41710 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41711 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41712 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41713 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41714 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41715 | PORT_MODIFY("IN-18") | |
| 41716 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41717 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41718 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41719 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 41720 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 41721 | PORT_MODIFY("IN-19") | |
| 41722 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 41723 | PORT_MODIFY("IN-20") | |
| 41724 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41725 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41726 | // 0x0004 - "topdor" // standard input (expected here) | |
| 41727 | // 0x0008 - "botdor" // standard input (expected here) | |
| 41728 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41675 | PORT_INCLUDE( sc4_base ) | |
| 41676 | PORT_MODIFY("IN-1") | |
| 41677 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 41678 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 41679 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 41680 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 41681 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 41682 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 41683 | PORT_MODIFY("IN-2") | |
| 41684 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 41685 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ex/tra") | |
| 41686 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41687 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41688 | PORT_MODIFY("IN-3") | |
| 41689 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41690 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41691 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41692 | PORT_MODIFY("IN-4") | |
| 41693 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 41694 | PORT_MODIFY("IN-5") | |
| 41695 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41696 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41697 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41698 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41699 | PORT_MODIFY("IN-8") | |
| 41700 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk win") | |
| 41701 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 41702 | PORT_MODIFY("IN-16") | |
| 41703 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41704 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41705 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41706 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41707 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41708 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41709 | PORT_MODIFY("IN-17") | |
| 41710 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41711 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41712 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41713 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41714 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41715 | PORT_MODIFY("IN-18") | |
| 41716 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41717 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41718 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41719 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 41720 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 41721 | PORT_MODIFY("IN-19") | |
| 41722 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 41723 | PORT_MODIFY("IN-20") | |
| 41724 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41725 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41726 | // 0x0004 - "topdor" // standard input (expected here) | |
| 41727 | // 0x0008 - "botdor" // standard input (expected here) | |
| 41728 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41729 | 41729 | INPUT_PORTS_END |
| 41730 | 41730 | |
| 41731 | 41731 | // PR3256 CLUB RONNIE O SULLIVANS TOURNAMENT SCORP4 RONNIE OSULLIVAN CLUB PR3256 RONNIE O SOUNDS11 RONNIE SULLIVAN |
| r31373 | r31374 | |
| 41755 | 41755 | } |
| 41756 | 41756 | |
| 41757 | 41757 | INPUT_PORTS_START( sc4rovrt ) // this structure is generated |
| 41758 | PORT_INCLUDE( sc4_base ) | |
| 41759 | PORT_MODIFY("IN-1") | |
| 41760 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 41761 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 41762 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 41763 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 41764 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 41765 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 41766 | PORT_MODIFY("IN-2") | |
| 41767 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 41768 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 41769 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41770 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41771 | PORT_MODIFY("IN-3") | |
| 41772 | // 0x0004 - "stk3" // standard input (expected here) | |
| 41773 | // 0x0008 - "stk1" // standard input (expected here) | |
| 41774 | // 0x0010 - "stk2" // standard input (expected here) | |
| 41775 | PORT_MODIFY("IN-5") | |
| 41776 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 41777 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 41778 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 41779 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 41780 | PORT_MODIFY("IN-6") | |
| 41781 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 41782 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 41783 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 41784 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 41785 | PORT_MODIFY("IN-8") | |
| 41786 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 41787 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 41788 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 41789 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 41790 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 41791 | PORT_MODIFY("IN-9") | |
| 41792 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 41793 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 41794 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 41795 | PORT_MODIFY("IN-16") | |
| 41796 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41797 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41798 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41799 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41800 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41801 | // 0x0100 - "top up OR top up" // known extended input, usually 'top up' | |
| 41802 | PORT_MODIFY("IN-17") | |
| 41803 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41804 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41805 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41806 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41807 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 41808 | PORT_MODIFY("IN-18") | |
| 41809 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 41810 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 41811 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 41812 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 41813 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 41814 | PORT_MODIFY("IN-19") | |
| 41815 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 41816 | PORT_MODIFY("IN-20") | |
| 41817 | // 0x0001 - "test" // standard input (motherboard) | |
| 41818 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 41819 | // 0x0004 - "topdr" // standard input (expected here) | |
| 41820 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 41821 | // 0x0010 - "dump" // standard input (expected here) | |
| 41758 | PORT_INCLUDE( sc4_base ) | |
| 41759 | PORT_MODIFY("IN-1") | |
| 41760 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 41761 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 41762 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 41763 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 41764 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 41765 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 41766 | PORT_MODIFY("IN-2") | |
| 41767 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 41768 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 41769 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41770 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41771 | PORT_MODIFY("IN-3") | |
| 41772 | // 0x0004 - "stk3" // standard input (expected here) | |
| 41773 | // 0x0008 - "stk1" // standard input (expected here) | |
| 41774 | // 0x0010 - "stk2" // standard input (expected here) | |
| 41775 | PORT_MODIFY("IN-5") | |
| 41776 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 41777 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 41778 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 41779 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 41780 | PORT_MODIFY("IN-6") | |
| 41781 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 41782 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 41783 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 41784 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 41785 | PORT_MODIFY("IN-8") | |
| 41786 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 41787 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 41788 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 41789 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 41790 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 41791 | PORT_MODIFY("IN-9") | |
| 41792 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 41793 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 41794 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 41795 | PORT_MODIFY("IN-16") | |
| 41796 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 41797 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 41798 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 41799 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 41800 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 41801 | // 0x0100 - "top up OR top up" // known extended input, usually 'top up' | |
| 41802 | PORT_MODIFY("IN-17") | |
| 41803 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 41804 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 41805 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 41806 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 41807 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 41808 | PORT_MODIFY("IN-18") | |
| 41809 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 41810 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 41811 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 41812 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 41813 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 41814 | PORT_MODIFY("IN-19") | |
| 41815 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 41816 | PORT_MODIFY("IN-20") | |
| 41817 | // 0x0001 - "test" // standard input (motherboard) | |
| 41818 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 41819 | // 0x0004 - "topdr" // standard input (expected here) | |
| 41820 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 41821 | // 0x0010 - "dump" // standard input (expected here) | |
| 41822 | 41822 | INPUT_PORTS_END |
| 41823 | 41823 | |
| 41824 | 41824 | // PR2311 ROVERS RETURN ROVERS RETURN SOUNDS ROVERS RETURN |
| r31373 | r31374 | |
| 41846 | 41846 | } |
| 41847 | 41847 | |
| 41848 | 41848 | INPUT_PORTS_START( sc4showt ) // this structure is generated |
| 41849 | PORT_INCLUDE( sc4_base ) | |
| 41850 | PORT_MODIFY("IN-1") | |
| 41851 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41852 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41853 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41854 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41855 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 41856 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41857 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41858 | PORT_MODIFY("IN-2") | |
| 41859 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchan") | |
| 41860 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 41861 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 41862 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41863 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 41864 | PORT_MODIFY("IN-3") | |
| 41865 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41866 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41867 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41868 | PORT_MODIFY("IN-5") | |
| 41869 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41870 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41871 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41872 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41873 | PORT_MODIFY("IN-6") | |
| 41874 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41875 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41876 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41877 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41878 | PORT_MODIFY("IN-8") | |
| 41879 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 41880 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("p show") | |
| 41881 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("streak") | |
| 41882 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c cash") | |
| 41883 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("sh tim") | |
| 41884 | PORT_MODIFY("IN-16") | |
| 41885 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41886 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41887 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41888 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41889 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41890 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41891 | PORT_MODIFY("IN-17") | |
| 41892 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41893 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41894 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41895 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41896 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41897 | PORT_MODIFY("IN-18") | |
| 41898 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41899 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41900 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41901 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41902 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41903 | PORT_MODIFY("IN-19") | |
| 41904 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41905 | PORT_MODIFY("IN-20") | |
| 41906 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41907 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41908 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41909 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41910 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41849 | PORT_INCLUDE( sc4_base ) | |
| 41850 | PORT_MODIFY("IN-1") | |
| 41851 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41852 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41853 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41854 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41855 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 41856 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41857 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41858 | PORT_MODIFY("IN-2") | |
| 41859 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchan") | |
| 41860 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ch stk") | |
| 41861 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("transf") | |
| 41862 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41863 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 41864 | PORT_MODIFY("IN-3") | |
| 41865 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 41866 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 41867 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 41868 | PORT_MODIFY("IN-5") | |
| 41869 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41870 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41871 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41872 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41873 | PORT_MODIFY("IN-6") | |
| 41874 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41875 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41876 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41877 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41878 | PORT_MODIFY("IN-8") | |
| 41879 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 41880 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("p show") | |
| 41881 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("streak") | |
| 41882 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c cash") | |
| 41883 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("sh tim") | |
| 41884 | PORT_MODIFY("IN-16") | |
| 41885 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41886 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41887 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41888 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41889 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41890 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41891 | PORT_MODIFY("IN-17") | |
| 41892 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41893 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41894 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41895 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41896 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41897 | PORT_MODIFY("IN-18") | |
| 41898 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41899 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41900 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41901 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41902 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41903 | PORT_MODIFY("IN-19") | |
| 41904 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41905 | PORT_MODIFY("IN-20") | |
| 41906 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41907 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41908 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41909 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41910 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41911 | 41911 | INPUT_PORTS_END |
| 41912 | 41912 | |
| 41913 | 41913 | // PR3043 AWP SHOW TIME S4 PR3013 SHOWTIME SOUNDS11 SHOW TIME S.SITE |
| r31373 | r31374 | |
| 41937 | 41937 | } |
| 41938 | 41938 | |
| 41939 | 41939 | INPUT_PORTS_START( sc4spice ) // this structure is generated |
| 41940 | PORT_INCLUDE( sc4_base ) | |
| 41941 | PORT_MODIFY("IN-1") | |
| 41942 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41943 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41944 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41945 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41946 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 41947 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41948 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41949 | PORT_MODIFY("IN-2") | |
| 41950 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 41951 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trf/ex") | |
| 41952 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41953 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41954 | PORT_MODIFY("IN-5") | |
| 41955 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41956 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41957 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41958 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41959 | PORT_MODIFY("IN-6") | |
| 41960 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41961 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41962 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41963 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41964 | PORT_MODIFY("IN-16") | |
| 41965 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41966 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41967 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41968 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41969 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41970 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41971 | PORT_MODIFY("IN-17") | |
| 41972 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41973 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41974 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41975 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41976 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41977 | PORT_MODIFY("IN-18") | |
| 41978 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41979 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41980 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41981 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41982 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41983 | PORT_MODIFY("IN-19") | |
| 41984 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41985 | PORT_MODIFY("IN-20") | |
| 41986 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41987 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41988 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41989 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41990 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41940 | PORT_INCLUDE( sc4_base ) | |
| 41941 | PORT_MODIFY("IN-1") | |
| 41942 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 41943 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 41944 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 41945 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 41946 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 41947 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 41948 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 41949 | PORT_MODIFY("IN-2") | |
| 41950 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 41951 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trf/ex") | |
| 41952 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 41953 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 41954 | PORT_MODIFY("IN-5") | |
| 41955 | // 0x0001 - "priz4" // standard input (expected here) | |
| 41956 | // 0x0002 - "priz3" // standard input (expected here) | |
| 41957 | // 0x0004 - "priz2" // standard input (expected here) | |
| 41958 | // 0x0008 - "priz1" // standard input (expected here) | |
| 41959 | PORT_MODIFY("IN-6") | |
| 41960 | // 0x0001 - "perc1" // standard input (expected here) | |
| 41961 | // 0x0002 - "perc2" // standard input (expected here) | |
| 41962 | // 0x0004 - "perc3" // standard input (expected here) | |
| 41963 | // 0x0008 - "perc4" // standard input (expected here) | |
| 41964 | PORT_MODIFY("IN-16") | |
| 41965 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 41966 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 41967 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 41968 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 41969 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 41970 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 41971 | PORT_MODIFY("IN-17") | |
| 41972 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 41973 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 41974 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 41975 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 41976 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 41977 | PORT_MODIFY("IN-18") | |
| 41978 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 41979 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 41980 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 41981 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 41982 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 41983 | PORT_MODIFY("IN-19") | |
| 41984 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 41985 | PORT_MODIFY("IN-20") | |
| 41986 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 41987 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 41988 | // 0x0004 - "serdor" // standard input (expected here) | |
| 41989 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 41990 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 41991 | 41991 | INPUT_PORTS_END |
| 41992 | 41992 | |
| 41993 | 41993 | // PR1921 AWP SPICE IT UP SCORP4 PR1901 SPICE IT UP SOUNDS11 SPICE IT UP S.SITE |
| r31373 | r31374 | |
| 42013 | 42013 | } |
| 42014 | 42014 | |
| 42015 | 42015 | INPUT_PORTS_START( sc4sus ) // this structure is generated |
| 42016 | PORT_INCLUDE( sc4_base ) | |
| 42017 | PORT_MODIFY("IN-1") | |
| 42018 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 42019 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 42020 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 42021 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 42022 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 42023 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 42024 | PORT_MODIFY("IN-2") | |
| 42025 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42026 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 42027 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42028 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42029 | PORT_MODIFY("IN-3") | |
| 42030 | // 0x0004 - "stk3" // standard input (expected here) | |
| 42031 | // 0x0008 - "stk1" // standard input (expected here) | |
| 42032 | // 0x0010 - "stk2" // standard input (expected here) | |
| 42033 | PORT_MODIFY("IN-5") | |
| 42034 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 42035 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 42036 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 42037 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 42038 | PORT_MODIFY("IN-6") | |
| 42039 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 42040 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 42041 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 42042 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 42043 | PORT_MODIFY("IN-8") | |
| 42044 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 42045 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 42046 | PORT_MODIFY("IN-16") | |
| 42047 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42048 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42049 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42050 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42051 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42052 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42053 | PORT_MODIFY("IN-17") | |
| 42054 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42055 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42056 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42057 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42058 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42059 | PORT_MODIFY("IN-18") | |
| 42060 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42061 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42062 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42063 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42064 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42065 | PORT_MODIFY("IN-19") | |
| 42066 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42067 | PORT_MODIFY("IN-20") | |
| 42068 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 42069 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 42070 | // 0x0004 - "topdr" // standard input (expected here) | |
| 42071 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 42072 | // 0x0010 - "dump" // standard input (expected here) | |
| 42016 | PORT_INCLUDE( sc4_base ) | |
| 42017 | PORT_MODIFY("IN-1") | |
| 42018 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 42019 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 42020 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 42021 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 42022 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 42023 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 42024 | PORT_MODIFY("IN-2") | |
| 42025 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42026 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 42027 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42028 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42029 | PORT_MODIFY("IN-3") | |
| 42030 | // 0x0004 - "stk3" // standard input (expected here) | |
| 42031 | // 0x0008 - "stk1" // standard input (expected here) | |
| 42032 | // 0x0010 - "stk2" // standard input (expected here) | |
| 42033 | PORT_MODIFY("IN-5") | |
| 42034 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 42035 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 42036 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 42037 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 42038 | PORT_MODIFY("IN-6") | |
| 42039 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 42040 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 42041 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 42042 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 42043 | PORT_MODIFY("IN-8") | |
| 42044 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 42045 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 42046 | PORT_MODIFY("IN-16") | |
| 42047 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42048 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42049 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42050 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42051 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42052 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42053 | PORT_MODIFY("IN-17") | |
| 42054 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42055 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42056 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42057 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42058 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42059 | PORT_MODIFY("IN-18") | |
| 42060 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42061 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42062 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42063 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42064 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42065 | PORT_MODIFY("IN-19") | |
| 42066 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42067 | PORT_MODIFY("IN-20") | |
| 42068 | // 0x0001 - "test OR test" // standard input (motherboard) | |
| 42069 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 42070 | // 0x0004 - "topdr" // standard input (expected here) | |
| 42071 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 42072 | // 0x0010 - "dump" // standard input (expected here) | |
| 42073 | 42073 | INPUT_PORTS_END |
| 42074 | 42074 | |
| 42075 | 42075 | // PR2255 SUITUSIR SUIT SOUNDS SUITS U SIR |
| r31373 | r31374 | |
| 42099 | 42099 | } |
| 42100 | 42100 | |
| 42101 | 42101 | INPUT_PORTS_START( sc4sslam ) // this structure is generated |
| 42102 | PORT_INCLUDE( sc4_base ) | |
| 42103 | PORT_MODIFY("IN-1") | |
| 42104 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("colwin") | |
| 42105 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("payout") | |
| 42106 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("sprslm") | |
| 42107 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("selins") | |
| 42108 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("chgstk") | |
| 42109 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 42110 | PORT_MODIFY("IN-2") | |
| 42111 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("maxbet") | |
| 42112 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42113 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42114 | PORT_MODIFY("IN-3") | |
| 42115 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42116 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42117 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42118 | PORT_MODIFY("IN-4") | |
| 42119 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 42120 | PORT_MODIFY("IN-5") | |
| 42121 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42122 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42123 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42124 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42125 | PORT_MODIFY("IN-16") | |
| 42126 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42127 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42128 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42129 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42130 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42131 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42132 | PORT_MODIFY("IN-17") | |
| 42133 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42134 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42135 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42136 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42137 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42138 | PORT_MODIFY("IN-18") | |
| 42139 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42140 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42141 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42142 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42143 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42144 | PORT_MODIFY("IN-19") | |
| 42145 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42146 | PORT_MODIFY("IN-20") | |
| 42147 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42148 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42149 | // 0x0004 - "topdor" // standard input (expected here) | |
| 42150 | // 0x0008 - "botdor" // standard input (expected here) | |
| 42151 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42102 | PORT_INCLUDE( sc4_base ) | |
| 42103 | PORT_MODIFY("IN-1") | |
| 42104 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("colwin") | |
| 42105 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("payout") | |
| 42106 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("sprslm") | |
| 42107 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("selins") | |
| 42108 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("chgstk") | |
| 42109 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 42110 | PORT_MODIFY("IN-2") | |
| 42111 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("maxbet") | |
| 42112 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42113 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42114 | PORT_MODIFY("IN-3") | |
| 42115 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42116 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42117 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42118 | PORT_MODIFY("IN-4") | |
| 42119 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 42120 | PORT_MODIFY("IN-5") | |
| 42121 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42122 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42123 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42124 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42125 | PORT_MODIFY("IN-16") | |
| 42126 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42127 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42128 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42129 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42130 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42131 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42132 | PORT_MODIFY("IN-17") | |
| 42133 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42134 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42135 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42136 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42137 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42138 | PORT_MODIFY("IN-18") | |
| 42139 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42140 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42141 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42142 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42143 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42144 | PORT_MODIFY("IN-19") | |
| 42145 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42146 | PORT_MODIFY("IN-20") | |
| 42147 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42148 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42149 | // 0x0004 - "topdor" // standard input (expected here) | |
| 42150 | // 0x0008 - "botdor" // standard input (expected here) | |
| 42151 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42152 | 42152 | INPUT_PORTS_END |
| 42153 | 42153 | |
| 42154 | 42154 | // PR3081 CLUB SUPER SLAM SUPER SLAM CLUB PR3080 SUPER SLAM SOUNDS11 |
| r31373 | r31374 | |
| 42173 | 42173 | } |
| 42174 | 42174 | |
| 42175 | 42175 | INPUT_PORTS_START( sc4swbak ) // this structure is generated |
| 42176 | PORT_INCLUDE( sc4_base ) | |
| 42177 | PORT_MODIFY("IN-1") | |
| 42178 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 42179 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 42180 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 42181 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 42182 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42183 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 42184 | PORT_MODIFY("IN-2") | |
| 42185 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42186 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tk fea") | |
| 42187 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42188 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42189 | PORT_MODIFY("IN-3") | |
| 42190 | // 0x0004 - "stk3" // standard input (expected here) | |
| 42191 | // 0x0008 - "stk1" // standard input (expected here) | |
| 42192 | // 0x0010 - "stk2" // standard input (expected here) | |
| 42193 | PORT_MODIFY("IN-5") | |
| 42194 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 42195 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 42196 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 42197 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 42198 | PORT_MODIFY("IN-6") | |
| 42199 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 42200 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 42201 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 42202 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 42203 | PORT_MODIFY("IN-8") | |
| 42204 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("gamble") | |
| 42205 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 42206 | PORT_MODIFY("IN-16") | |
| 42207 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42208 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42209 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42210 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42211 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42212 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42213 | PORT_MODIFY("IN-17") | |
| 42214 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42215 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42216 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42217 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42218 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42219 | PORT_MODIFY("IN-18") | |
| 42220 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42221 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42222 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42223 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42224 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42225 | PORT_MODIFY("IN-19") | |
| 42226 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42227 | PORT_MODIFY("IN-20") | |
| 42228 | // 0x0001 - "test" // standard input (motherboard) | |
| 42229 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 42230 | // 0x0004 - "topdr" // standard input (expected here) | |
| 42231 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 42232 | // 0x0010 - "dump" // standard input (expected here) | |
| 42176 | PORT_INCLUDE( sc4_base ) | |
| 42177 | PORT_MODIFY("IN-1") | |
| 42178 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 42179 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 42180 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 42181 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 42182 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42183 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 42184 | PORT_MODIFY("IN-2") | |
| 42185 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42186 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tk fea") | |
| 42187 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42188 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42189 | PORT_MODIFY("IN-3") | |
| 42190 | // 0x0004 - "stk3" // standard input (expected here) | |
| 42191 | // 0x0008 - "stk1" // standard input (expected here) | |
| 42192 | // 0x0010 - "stk2" // standard input (expected here) | |
| 42193 | PORT_MODIFY("IN-5") | |
| 42194 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 42195 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 42196 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 42197 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 42198 | PORT_MODIFY("IN-6") | |
| 42199 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 42200 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 42201 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 42202 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 42203 | PORT_MODIFY("IN-8") | |
| 42204 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("gamble") | |
| 42205 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 42206 | PORT_MODIFY("IN-16") | |
| 42207 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42208 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42209 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42210 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42211 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42212 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42213 | PORT_MODIFY("IN-17") | |
| 42214 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42215 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42216 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42217 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42218 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42219 | PORT_MODIFY("IN-18") | |
| 42220 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42221 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42222 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42223 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42224 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42225 | PORT_MODIFY("IN-19") | |
| 42226 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42227 | PORT_MODIFY("IN-20") | |
| 42228 | // 0x0001 - "test" // standard input (motherboard) | |
| 42229 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 42230 | // 0x0004 - "topdr" // standard input (expected here) | |
| 42231 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 42232 | // 0x0010 - "dump" // standard input (expected here) | |
| 42233 | 42233 | INPUT_PORTS_END |
| 42234 | 42234 | |
| 42235 | 42235 | // PR2235 SWITCHBACK SWBK SOUNDS SWITCHBACK |
| r31373 | r31374 | |
| 42256 | 42256 | } |
| 42257 | 42257 | |
| 42258 | 42258 | INPUT_PORTS_START( sc4ttpie ) // this structure is generated |
| 42259 | PORT_INCLUDE( sc4_base ) | |
| 42260 | PORT_MODIFY("IN-1") | |
| 42261 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42262 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42263 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42264 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42265 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 42266 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42267 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42268 | PORT_MODIFY("IN-2") | |
| 42269 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 42270 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42271 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42272 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42273 | PORT_MODIFY("IN-3") | |
| 42274 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42275 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42276 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42277 | PORT_MODIFY("IN-5") | |
| 42278 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42279 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42280 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42281 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42282 | PORT_MODIFY("IN-6") | |
| 42283 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42284 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42285 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42286 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42287 | PORT_MODIFY("IN-8") | |
| 42288 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("checkm") | |
| 42289 | PORT_MODIFY("IN-16") | |
| 42290 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42291 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42292 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42293 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42294 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42295 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42296 | PORT_MODIFY("IN-17") | |
| 42297 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42298 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42299 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42300 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42301 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42302 | PORT_MODIFY("IN-18") | |
| 42303 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42304 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42305 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42306 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42307 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42308 | PORT_MODIFY("IN-19") | |
| 42309 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42310 | PORT_MODIFY("IN-20") | |
| 42311 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42312 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42313 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42314 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42315 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42259 | PORT_INCLUDE( sc4_base ) | |
| 42260 | PORT_MODIFY("IN-1") | |
| 42261 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42262 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42263 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42264 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42265 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 4") | |
| 42266 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42267 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42268 | PORT_MODIFY("IN-2") | |
| 42269 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("cstake") | |
| 42270 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42271 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42272 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42273 | PORT_MODIFY("IN-3") | |
| 42274 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42275 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42276 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42277 | PORT_MODIFY("IN-5") | |
| 42278 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42279 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42280 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42281 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42282 | PORT_MODIFY("IN-6") | |
| 42283 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42284 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42285 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42286 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42287 | PORT_MODIFY("IN-8") | |
| 42288 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("checkm") | |
| 42289 | PORT_MODIFY("IN-16") | |
| 42290 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42291 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42292 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42293 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42294 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42295 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42296 | PORT_MODIFY("IN-17") | |
| 42297 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42298 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42299 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42300 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42301 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42302 | PORT_MODIFY("IN-18") | |
| 42303 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42304 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42305 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42306 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42307 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42308 | PORT_MODIFY("IN-19") | |
| 42309 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42310 | PORT_MODIFY("IN-20") | |
| 42311 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42312 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42313 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42314 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42315 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42316 | 42316 | INPUT_PORTS_END |
| 42317 | 42317 | |
| 42318 | 42318 | // PR1714 AWP TAKE THE PIECE S4 PR1714 TAKE THE PIECE SOUNDS11 TAKETHEPIECE S.SITE |
| r31373 | r31374 | |
| 42344 | 42344 | } |
| 42345 | 42345 | |
| 42346 | 42346 | INPUT_PORTS_START( sc4typ ) // this structure is generated |
| 42347 | PORT_INCLUDE( sc4_base ) | |
| 42348 | PORT_MODIFY("IN-1") | |
| 42349 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42350 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42351 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42352 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42353 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("cstake") | |
| 42354 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42355 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42356 | PORT_MODIFY("IN-2") | |
| 42357 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("colect") | |
| 42358 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42359 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42360 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42361 | PORT_MODIFY("IN-3") | |
| 42362 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42363 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42364 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42365 | PORT_MODIFY("IN-5") | |
| 42366 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42367 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42368 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42369 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42370 | PORT_MODIFY("IN-6") | |
| 42371 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42372 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42373 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42374 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42375 | PORT_MODIFY("IN-8") | |
| 42376 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("open r") | |
| 42377 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("reject") | |
| 42378 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("accept") | |
| 42379 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("open l") | |
| 42380 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c or b") | |
| 42381 | PORT_MODIFY("IN-16") | |
| 42382 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42383 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42384 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42385 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42386 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42387 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42388 | PORT_MODIFY("IN-17") | |
| 42389 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42390 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42391 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42392 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42393 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42394 | PORT_MODIFY("IN-18") | |
| 42395 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42396 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42397 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42398 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42399 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42400 | PORT_MODIFY("IN-19") | |
| 42401 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42402 | PORT_MODIFY("IN-20") | |
| 42403 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42404 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42405 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42406 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42407 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42347 | PORT_INCLUDE( sc4_base ) | |
| 42348 | PORT_MODIFY("IN-1") | |
| 42349 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42350 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42351 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42352 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42353 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("cstake") | |
| 42354 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42355 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42356 | PORT_MODIFY("IN-2") | |
| 42357 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("colect") | |
| 42358 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42359 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42360 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42361 | PORT_MODIFY("IN-3") | |
| 42362 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42363 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42364 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42365 | PORT_MODIFY("IN-5") | |
| 42366 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42367 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42368 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42369 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42370 | PORT_MODIFY("IN-6") | |
| 42371 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42372 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42373 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42374 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42375 | PORT_MODIFY("IN-8") | |
| 42376 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("open r") | |
| 42377 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("reject") | |
| 42378 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("accept") | |
| 42379 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("open l") | |
| 42380 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c or b") | |
| 42381 | PORT_MODIFY("IN-16") | |
| 42382 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42383 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42384 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42385 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42386 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42387 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42388 | PORT_MODIFY("IN-17") | |
| 42389 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42390 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42391 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42392 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42393 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42394 | PORT_MODIFY("IN-18") | |
| 42395 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42396 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42397 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42398 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42399 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42400 | PORT_MODIFY("IN-19") | |
| 42401 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42402 | PORT_MODIFY("IN-20") | |
| 42403 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42404 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42405 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42406 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42407 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42408 | 42408 | INPUT_PORTS_END |
| 42409 | 42409 | |
| 42410 | 42410 | // PR3031 AWP TAKE YOUR PICK S4 PR3001 TAKE YOUR PICK SOUNDS11 TAKE YOUR PICK S.SITE |
| r31373 | r31374 | |
| 42430 | 42430 | } |
| 42431 | 42431 | |
| 42432 | 42432 | INPUT_PORTS_START( sc4trail ) // this structure is generated |
| 42433 | PORT_INCLUDE( sc4_base ) | |
| 42434 | PORT_MODIFY("IN-1") | |
| 42435 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 42436 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 42437 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 42438 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 42439 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 42440 | PORT_MODIFY("IN-2") | |
| 42441 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42442 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 42443 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42444 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42445 | PORT_MODIFY("IN-8") | |
| 42446 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step OR tke ft") | |
| 42447 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 42448 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 42449 | PORT_MODIFY("IN-16") | |
| 42450 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42451 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42452 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42453 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42454 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42455 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42456 | PORT_MODIFY("IN-17") | |
| 42457 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42458 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42459 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42460 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42461 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42462 | PORT_MODIFY("IN-18") | |
| 42463 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42464 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42465 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42466 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42467 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42468 | PORT_MODIFY("IN-19") | |
| 42469 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42470 | PORT_MODIFY("IN-20") | |
| 42471 | // 0x0001 - "test" // standard input (motherboard) | |
| 42472 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 42473 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 42474 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 42475 | // 0x0010 - "deflt" // standard input (expected here) | |
| 42433 | PORT_INCLUDE( sc4_base ) | |
| 42434 | PORT_MODIFY("IN-1") | |
| 42435 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 42436 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 42437 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 42438 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 42439 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 42440 | PORT_MODIFY("IN-2") | |
| 42441 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42442 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 42443 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42444 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42445 | PORT_MODIFY("IN-8") | |
| 42446 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("step OR tke ft") | |
| 42447 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 42448 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 42449 | PORT_MODIFY("IN-16") | |
| 42450 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42451 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42452 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42453 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42454 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42455 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42456 | PORT_MODIFY("IN-17") | |
| 42457 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42458 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42459 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42460 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42461 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42462 | PORT_MODIFY("IN-18") | |
| 42463 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42464 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42465 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42466 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42467 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42468 | PORT_MODIFY("IN-19") | |
| 42469 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42470 | PORT_MODIFY("IN-20") | |
| 42471 | // 0x0001 - "test" // standard input (motherboard) | |
| 42472 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 42473 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 42474 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 42475 | // 0x0010 - "deflt" // standard input (expected here) | |
| 42476 | 42476 | INPUT_PORTS_END |
| 42477 | 42477 | |
| 42478 | 42478 | // PR2170 TRAIL BLAZER TRAB SOUNDS TRAIL BLAZER |
| r31373 | r31374 | |
| 42500 | 42500 | } |
| 42501 | 42501 | |
| 42502 | 42502 | INPUT_PORTS_START( sc4bpb ) // this structure is generated |
| 42503 | PORT_INCLUDE( sc4_base ) | |
| 42504 | PORT_MODIFY("IN-1") | |
| 42505 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42506 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 42507 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 42508 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 42509 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42510 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42511 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42512 | PORT_MODIFY("IN-2") | |
| 42513 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 42514 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42515 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42516 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42517 | PORT_MODIFY("IN-3") | |
| 42518 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42519 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42520 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42521 | PORT_MODIFY("IN-5") | |
| 42522 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42523 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42524 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42525 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42526 | PORT_MODIFY("IN-6") | |
| 42527 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42528 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42529 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42530 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42531 | PORT_MODIFY("IN-8") | |
| 42532 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("gamble") | |
| 42533 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("throws") | |
| 42534 | PORT_MODIFY("IN-16") | |
| 42535 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42536 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42537 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42538 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42539 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42540 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42541 | PORT_MODIFY("IN-17") | |
| 42542 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42543 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42544 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42545 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42546 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42547 | PORT_MODIFY("IN-18") | |
| 42548 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42549 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42550 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42551 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42552 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42553 | PORT_MODIFY("IN-19") | |
| 42554 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42555 | PORT_MODIFY("IN-20") | |
| 42556 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42557 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42558 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42559 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42560 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42503 | PORT_INCLUDE( sc4_base ) | |
| 42504 | PORT_MODIFY("IN-1") | |
| 42505 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42506 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 42507 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 42508 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 42509 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42510 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42511 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42512 | PORT_MODIFY("IN-2") | |
| 42513 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 42514 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42515 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42516 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42517 | PORT_MODIFY("IN-3") | |
| 42518 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42519 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42520 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42521 | PORT_MODIFY("IN-5") | |
| 42522 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42523 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42524 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42525 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42526 | PORT_MODIFY("IN-6") | |
| 42527 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42528 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42529 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42530 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42531 | PORT_MODIFY("IN-8") | |
| 42532 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("gamble") | |
| 42533 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("throws") | |
| 42534 | PORT_MODIFY("IN-16") | |
| 42535 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42536 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42537 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42538 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42539 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42540 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42541 | PORT_MODIFY("IN-17") | |
| 42542 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42543 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42544 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42545 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42546 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42547 | PORT_MODIFY("IN-18") | |
| 42548 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42549 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42550 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42551 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42552 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42553 | PORT_MODIFY("IN-19") | |
| 42554 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42555 | PORT_MODIFY("IN-20") | |
| 42556 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42557 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42558 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42559 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42560 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42561 | 42561 | INPUT_PORTS_END |
| 42562 | 42562 | |
| 42563 | 42563 | // PR1728 AWP BULLY'S PRIZE BOARD PR1708 B PRIZE BOARD SOUNDS11 BULLYSPRIZEBOARD S.SITE |
| r31373 | r31374 | |
| 42587 | 42587 | } |
| 42588 | 42588 | |
| 42589 | 42589 | INPUT_PORTS_START( sc4bsp ) // this structure is generated |
| 42590 | PORT_INCLUDE( sc4_base ) | |
| 42591 | PORT_MODIFY("IN-1") | |
| 42592 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42593 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42594 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42595 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42596 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 42597 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42598 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42599 | PORT_MODIFY("IN-2") | |
| 42600 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 42601 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tra/ex") | |
| 42602 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("sta/ga") | |
| 42603 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42604 | PORT_MODIFY("IN-3") | |
| 42605 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42606 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42607 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42608 | PORT_MODIFY("IN-5") | |
| 42609 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42610 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42611 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42612 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42613 | PORT_MODIFY("IN-6") | |
| 42614 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42615 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42616 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42617 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42618 | PORT_MODIFY("IN-8") | |
| 42619 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 42620 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bns") | |
| 42621 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 42622 | PORT_MODIFY("IN-16") | |
| 42623 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42624 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42625 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42626 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42627 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42628 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42629 | PORT_MODIFY("IN-17") | |
| 42630 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42631 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42632 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42633 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42634 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42635 | PORT_MODIFY("IN-18") | |
| 42636 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42637 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42638 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42639 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42640 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42641 | PORT_MODIFY("IN-19") | |
| 42642 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42643 | PORT_MODIFY("IN-20") | |
| 42644 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42645 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42646 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42647 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42648 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42590 | PORT_INCLUDE( sc4_base ) | |
| 42591 | PORT_MODIFY("IN-1") | |
| 42592 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42593 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42594 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42595 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42596 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 42597 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42598 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42599 | PORT_MODIFY("IN-2") | |
| 42600 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 42601 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tra/ex") | |
| 42602 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("sta/ga") | |
| 42603 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42604 | PORT_MODIFY("IN-3") | |
| 42605 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42606 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42607 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42608 | PORT_MODIFY("IN-5") | |
| 42609 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42610 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42611 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42612 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42613 | PORT_MODIFY("IN-6") | |
| 42614 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42615 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42616 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42617 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42618 | PORT_MODIFY("IN-8") | |
| 42619 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bankit") | |
| 42620 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bns") | |
| 42621 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk csh") | |
| 42622 | PORT_MODIFY("IN-16") | |
| 42623 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42624 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42625 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42626 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42627 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42628 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42629 | PORT_MODIFY("IN-17") | |
| 42630 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42631 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42632 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42633 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42634 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42635 | PORT_MODIFY("IN-18") | |
| 42636 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42637 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42638 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42639 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42640 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42641 | PORT_MODIFY("IN-19") | |
| 42642 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42643 | PORT_MODIFY("IN-20") | |
| 42644 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42645 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42646 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42647 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42648 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42649 | 42649 | INPUT_PORTS_END |
| 42650 | 42650 | |
| 42651 | 42651 | // PR3040 AWP BULLYS STAR PRIZE SCORP4 PR3012 BULLYS STAR P SOUNDS11 BULLYS STARPRIZE S.SITE |
| r31373 | r31374 | |
| 42677 | 42677 | } |
| 42678 | 42678 | |
| 42679 | 42679 | INPUT_PORTS_START( sc4chain ) // this structure is generated |
| 42680 | PORT_INCLUDE( sc4_base ) | |
| 42681 | PORT_MODIFY("IN-1") | |
| 42682 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42683 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42684 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42685 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42686 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42687 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42688 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42689 | PORT_MODIFY("IN-2") | |
| 42690 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42691 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42692 | PORT_MODIFY("IN-3") | |
| 42693 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42694 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42695 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42696 | PORT_MODIFY("IN-5") | |
| 42697 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42698 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42699 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42700 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42701 | PORT_MODIFY("IN-6") | |
| 42702 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42703 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42704 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42705 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42706 | PORT_MODIFY("IN-8") | |
| 42707 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 42708 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cas lo") | |
| 42709 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ch stp") | |
| 42710 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("db gam") | |
| 42711 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ft stp") | |
| 42712 | PORT_MODIFY("IN-9") | |
| 42713 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("fet lo") | |
| 42714 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c feat") | |
| 42715 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("cas hi") | |
| 42716 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("c doub") | |
| 42717 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("fet hi") | |
| 42718 | PORT_MODIFY("IN-16") | |
| 42719 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42720 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42721 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42722 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42723 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42724 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 42725 | PORT_MODIFY("IN-17") | |
| 42726 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42727 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42728 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42729 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42730 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 42731 | PORT_MODIFY("IN-18") | |
| 42732 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 42733 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 42734 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 42735 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 42736 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 42737 | PORT_MODIFY("IN-19") | |
| 42738 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 42739 | PORT_MODIFY("IN-20") | |
| 42740 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42741 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42742 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42743 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42744 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42680 | PORT_INCLUDE( sc4_base ) | |
| 42681 | PORT_MODIFY("IN-1") | |
| 42682 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42683 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42684 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42685 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42686 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42687 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42688 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42689 | PORT_MODIFY("IN-2") | |
| 42690 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42691 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42692 | PORT_MODIFY("IN-3") | |
| 42693 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42694 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42695 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42696 | PORT_MODIFY("IN-5") | |
| 42697 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42698 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42699 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42700 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42701 | PORT_MODIFY("IN-6") | |
| 42702 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42703 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42704 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42705 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42706 | PORT_MODIFY("IN-8") | |
| 42707 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 42708 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cas lo") | |
| 42709 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ch stp") | |
| 42710 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("db gam") | |
| 42711 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ft stp") | |
| 42712 | PORT_MODIFY("IN-9") | |
| 42713 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("fet lo") | |
| 42714 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c feat") | |
| 42715 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("cas hi") | |
| 42716 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("c doub") | |
| 42717 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("fet hi") | |
| 42718 | PORT_MODIFY("IN-16") | |
| 42719 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42720 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42721 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42722 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42723 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42724 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 42725 | PORT_MODIFY("IN-17") | |
| 42726 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42727 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42728 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42729 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42730 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 42731 | PORT_MODIFY("IN-18") | |
| 42732 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 42733 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 42734 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 42735 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 42736 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 42737 | PORT_MODIFY("IN-19") | |
| 42738 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 42739 | PORT_MODIFY("IN-20") | |
| 42740 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42741 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42742 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42743 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42744 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42745 | 42745 | INPUT_PORTS_END |
| 42746 | 42746 | |
| 42747 | 42747 | // PR1316 AWP CHAIN REACTION PR1312 CHAIN REACT SOUNDS11 |
| r31373 | r31374 | |
| 42768 | 42768 | } |
| 42769 | 42769 | |
| 42770 | 42770 | INPUT_PORTS_START( sc4clown ) // this structure is generated |
| 42771 | PORT_INCLUDE( sc4_base ) | |
| 42772 | PORT_MODIFY("IN-1") | |
| 42773 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 42774 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42775 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42776 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42777 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 42778 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42779 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42780 | PORT_MODIFY("IN-2") | |
| 42781 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 42782 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 42783 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42784 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42785 | PORT_MODIFY("IN-3") | |
| 42786 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42787 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42788 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42789 | PORT_MODIFY("IN-5") | |
| 42790 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42791 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42792 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42793 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42794 | PORT_MODIFY("IN-6") | |
| 42795 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42796 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42797 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42798 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42799 | PORT_MODIFY("IN-8") | |
| 42800 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 42801 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 42802 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 42803 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 42804 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 42805 | PORT_MODIFY("IN-9") | |
| 42806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 42807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 42808 | PORT_MODIFY("IN-16") | |
| 42809 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42810 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42811 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42812 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42813 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42814 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42815 | PORT_MODIFY("IN-17") | |
| 42816 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42817 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42818 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42819 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42820 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42821 | PORT_MODIFY("IN-18") | |
| 42822 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42823 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42824 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42825 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42826 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42827 | PORT_MODIFY("IN-19") | |
| 42828 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42829 | PORT_MODIFY("IN-20") | |
| 42830 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42831 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42832 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42833 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42834 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42771 | PORT_INCLUDE( sc4_base ) | |
| 42772 | PORT_MODIFY("IN-1") | |
| 42773 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel OR coll") | |
| 42774 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42775 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42776 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42777 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("ch stk") | |
| 42778 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42779 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42780 | PORT_MODIFY("IN-2") | |
| 42781 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 42782 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 42783 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42784 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42785 | PORT_MODIFY("IN-3") | |
| 42786 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42787 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 42788 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 42789 | PORT_MODIFY("IN-5") | |
| 42790 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42791 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42792 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42793 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42794 | PORT_MODIFY("IN-6") | |
| 42795 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42796 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42797 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42798 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42799 | PORT_MODIFY("IN-8") | |
| 42800 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkstep") | |
| 42801 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lorght") | |
| 42802 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lomid") | |
| 42803 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("loleft") | |
| 42804 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hirght") | |
| 42805 | PORT_MODIFY("IN-9") | |
| 42806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("himid") | |
| 42807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("hileft") | |
| 42808 | PORT_MODIFY("IN-16") | |
| 42809 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42810 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42811 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42812 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42813 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42814 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42815 | PORT_MODIFY("IN-17") | |
| 42816 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42817 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42818 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42819 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42820 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42821 | PORT_MODIFY("IN-18") | |
| 42822 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42823 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42824 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42825 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42826 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42827 | PORT_MODIFY("IN-19") | |
| 42828 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42829 | PORT_MODIFY("IN-20") | |
| 42830 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42831 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42832 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42833 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42834 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42835 | 42835 | INPUT_PORTS_END |
| 42836 | 42836 | |
| 42837 | 42837 | // PR1727 AWP CLOWN AROUND SCORP4 PR1707 CLOWN AROUND SOUNDS11 CLOWN AROUND S.SITE |
| r31373 | r31374 | |
| 42845 | 42845 | GAMEL( 200?, sc4clowng ,sc4clown, sc4, sc4clown, sc4_state, sc4clown, ROT0, "BFM","Clown Around (Bellfruit) (Scorpion 4) (set 8)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 42846 | 42846 | |
| 42847 | 42847 | INPUT_PORTS_START( sc4mowow ) // this structure is generated |
| 42848 | PORT_INCLUDE( sc4_base ) | |
| 42849 | PORT_MODIFY("IN-1") | |
| 42850 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 42851 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 42852 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 42853 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 42854 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 42855 | PORT_MODIFY("IN-2") | |
| 42856 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42857 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 42858 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42859 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42860 | PORT_MODIFY("IN-8") | |
| 42861 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h cash") | |
| 42862 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("h nuds") | |
| 42863 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkspin") | |
| 42864 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tkcpot") | |
| 42865 | PORT_MODIFY("IN-16") | |
| 42866 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42867 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42868 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42869 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42870 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42871 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 42872 | PORT_MODIFY("IN-17") | |
| 42873 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42874 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42875 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42876 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42877 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42878 | PORT_MODIFY("IN-18") | |
| 42879 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42880 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42881 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42882 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42883 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42884 | PORT_MODIFY("IN-19") | |
| 42885 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42886 | PORT_MODIFY("IN-20") | |
| 42887 | // 0x0001 - "test" // standard input (motherboard) | |
| 42888 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 42889 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 42890 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 42891 | // 0x0010 - "deflt" // standard input (expected here) | |
| 42848 | PORT_INCLUDE( sc4_base ) | |
| 42849 | PORT_MODIFY("IN-1") | |
| 42850 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 42851 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 42852 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 42853 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 42854 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 42855 | PORT_MODIFY("IN-2") | |
| 42856 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 42857 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 42858 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42859 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42860 | PORT_MODIFY("IN-8") | |
| 42861 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h cash") | |
| 42862 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("h nuds") | |
| 42863 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkspin") | |
| 42864 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tkcpot") | |
| 42865 | PORT_MODIFY("IN-16") | |
| 42866 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 42867 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 42868 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 42869 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 42870 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 42871 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 42872 | PORT_MODIFY("IN-17") | |
| 42873 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 42874 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 42875 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 42876 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 42877 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42878 | PORT_MODIFY("IN-18") | |
| 42879 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42880 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42881 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42882 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42883 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42884 | PORT_MODIFY("IN-19") | |
| 42885 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42886 | PORT_MODIFY("IN-20") | |
| 42887 | // 0x0001 - "test" // standard input (motherboard) | |
| 42888 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 42889 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 42890 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 42891 | // 0x0010 - "deflt" // standard input (expected here) | |
| 42892 | 42892 | INPUT_PORTS_END |
| 42893 | 42893 | |
| 42894 | 42894 | /* wrong sound roms */ |
| r31373 | r31374 | |
| 42921 | 42921 | } |
| 42922 | 42922 | |
| 42923 | 42923 | INPUT_PORTS_START( sc4bwow ) // this structure is generated |
| 42924 | PORT_INCLUDE( sc4_base ) | |
| 42925 | PORT_MODIFY("IN-1") | |
| 42926 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42927 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42928 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42929 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42930 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42931 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42932 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42933 | PORT_MODIFY("IN-2") | |
| 42934 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 42935 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42936 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42937 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42938 | PORT_MODIFY("IN-3") | |
| 42939 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42940 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42941 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42942 | PORT_MODIFY("IN-5") | |
| 42943 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42944 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42945 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42946 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42947 | PORT_MODIFY("IN-6") | |
| 42948 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42949 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42950 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42951 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42952 | PORT_MODIFY("IN-8") | |
| 42953 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("r or d") | |
| 42954 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("w of w") | |
| 42955 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featur") | |
| 42956 | PORT_MODIFY("IN-16") | |
| 42957 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42958 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42959 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42960 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42961 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42962 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42963 | PORT_MODIFY("IN-17") | |
| 42964 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42965 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42966 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42967 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42968 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42969 | PORT_MODIFY("IN-18") | |
| 42970 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42971 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42972 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42973 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42974 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42975 | PORT_MODIFY("IN-19") | |
| 42976 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42977 | PORT_MODIFY("IN-20") | |
| 42978 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42979 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42980 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42981 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42982 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42924 | PORT_INCLUDE( sc4_base ) | |
| 42925 | PORT_MODIFY("IN-1") | |
| 42926 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 42927 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 42928 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 42929 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 42930 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 42931 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 42932 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 42933 | PORT_MODIFY("IN-2") | |
| 42934 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 42935 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 42936 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 42937 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 42938 | PORT_MODIFY("IN-3") | |
| 42939 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 42940 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 42941 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 42942 | PORT_MODIFY("IN-5") | |
| 42943 | // 0x0001 - "priz4" // standard input (expected here) | |
| 42944 | // 0x0002 - "priz3" // standard input (expected here) | |
| 42945 | // 0x0004 - "priz2" // standard input (expected here) | |
| 42946 | // 0x0008 - "priz1" // standard input (expected here) | |
| 42947 | PORT_MODIFY("IN-6") | |
| 42948 | // 0x0001 - "perc1" // standard input (expected here) | |
| 42949 | // 0x0002 - "perc2" // standard input (expected here) | |
| 42950 | // 0x0004 - "perc3" // standard input (expected here) | |
| 42951 | // 0x0008 - "perc4" // standard input (expected here) | |
| 42952 | PORT_MODIFY("IN-8") | |
| 42953 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("r or d") | |
| 42954 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("w of w") | |
| 42955 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featur") | |
| 42956 | PORT_MODIFY("IN-16") | |
| 42957 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 42958 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 42959 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 42960 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 42961 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 42962 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 42963 | PORT_MODIFY("IN-17") | |
| 42964 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 42965 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 42966 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 42967 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 42968 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 42969 | PORT_MODIFY("IN-18") | |
| 42970 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 42971 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 42972 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 42973 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 42974 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 42975 | PORT_MODIFY("IN-19") | |
| 42976 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 42977 | PORT_MODIFY("IN-20") | |
| 42978 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 42979 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 42980 | // 0x0004 - "serdor" // standard input (expected here) | |
| 42981 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 42982 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 42983 | 42983 | INPUT_PORTS_END |
| 42984 | 42984 | |
| 42985 | 42985 | GAMEL( 200?, sc4bwow ,0, sc4, sc4bwow, sc4_state, sc4bwow, ROT0, "BFM","Wheel Of Wealth (Bellfruit) (PR1726) (Scorpion 4) (WHEL013, set 1)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) // PR1726 AWP WHEEL OF WEALTH PR1706 WHEEL OF WEALTH SOUNDS11 WHEEL OF WEALTH S.SITE |
| r31373 | r31374 | |
| 43003 | 43003 | } |
| 43004 | 43004 | |
| 43005 | 43005 | INPUT_PORTS_START( sc4nunsm ) // this structure is generated |
| 43006 | PORT_INCLUDE( sc4_base ) | |
| 43007 | PORT_MODIFY("IN-1") | |
| 43008 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 43009 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 43010 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 43011 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 43012 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 43013 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 43014 | PORT_MODIFY("IN-2") | |
| 43015 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 43016 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 43017 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43018 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43019 | PORT_MODIFY("IN-8") | |
| 43020 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 43021 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 43022 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 43023 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 43024 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 43025 | PORT_MODIFY("IN-9") | |
| 43026 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 43027 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 43028 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 43029 | PORT_MODIFY("IN-16") | |
| 43030 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43031 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43032 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43033 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43034 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43035 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 43036 | PORT_MODIFY("IN-17") | |
| 43037 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43038 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43039 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43040 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43041 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43042 | PORT_MODIFY("IN-18") | |
| 43043 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43044 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43045 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43046 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43047 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43048 | PORT_MODIFY("IN-19") | |
| 43049 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43050 | PORT_MODIFY("IN-20") | |
| 43051 | // 0x0001 - "test" // standard input (motherboard) | |
| 43052 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 43053 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 43054 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 43055 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43006 | PORT_INCLUDE( sc4_base ) | |
| 43007 | PORT_MODIFY("IN-1") | |
| 43008 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 43009 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 43010 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 43011 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 43012 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 43013 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 43014 | PORT_MODIFY("IN-2") | |
| 43015 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 43016 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 43017 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43018 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43019 | PORT_MODIFY("IN-8") | |
| 43020 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 43021 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 43022 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 43023 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 43024 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 43025 | PORT_MODIFY("IN-9") | |
| 43026 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 43027 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 43028 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 43029 | PORT_MODIFY("IN-16") | |
| 43030 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43031 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43032 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43033 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43034 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43035 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 43036 | PORT_MODIFY("IN-17") | |
| 43037 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43038 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43039 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43040 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43041 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43042 | PORT_MODIFY("IN-18") | |
| 43043 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43044 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43045 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43046 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43047 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43048 | PORT_MODIFY("IN-19") | |
| 43049 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43050 | PORT_MODIFY("IN-20") | |
| 43051 | // 0x0001 - "test" // standard input (motherboard) | |
| 43052 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 43053 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 43054 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 43055 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43056 | 43056 | INPUT_PORTS_END |
| 43057 | 43057 | |
| 43058 | 43058 | // PR2166 NUN N ROSES NANR SOUNDS NUNS N ROSES |
| r31373 | r31374 | |
| 43085 | 43085 | } |
| 43086 | 43086 | |
| 43087 | 43087 | INPUT_PORTS_START( sc4acesh ) // this structure is generated |
| 43088 | PORT_INCLUDE( sc4_base ) | |
| 43089 | PORT_MODIFY("IN-1") | |
| 43090 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43091 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stop") | |
| 43092 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold a") | |
| 43093 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold b") | |
| 43094 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold c") | |
| 43095 | PORT_MODIFY("IN-2") | |
| 43096 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 43097 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43098 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43099 | PORT_MODIFY("IN-8") | |
| 43100 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take") | |
| 43101 | PORT_MODIFY("IN-16") | |
| 43102 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43103 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43104 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43105 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43106 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43107 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43108 | PORT_MODIFY("IN-17") | |
| 43109 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43110 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43111 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43112 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43113 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43114 | PORT_MODIFY("IN-18") | |
| 43115 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43116 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43117 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43118 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43119 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43120 | PORT_MODIFY("IN-19") | |
| 43121 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43122 | PORT_MODIFY("IN-20") | |
| 43123 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43124 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43125 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43126 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43127 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43088 | PORT_INCLUDE( sc4_base ) | |
| 43089 | PORT_MODIFY("IN-1") | |
| 43090 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43091 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stop") | |
| 43092 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold a") | |
| 43093 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold b") | |
| 43094 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold c") | |
| 43095 | PORT_MODIFY("IN-2") | |
| 43096 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 43097 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43098 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43099 | PORT_MODIFY("IN-8") | |
| 43100 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take") | |
| 43101 | PORT_MODIFY("IN-16") | |
| 43102 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43103 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43104 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43105 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43106 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43107 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43108 | PORT_MODIFY("IN-17") | |
| 43109 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43110 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43111 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43112 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43113 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43114 | PORT_MODIFY("IN-18") | |
| 43115 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43116 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43117 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43118 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43119 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43120 | PORT_MODIFY("IN-19") | |
| 43121 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43122 | PORT_MODIFY("IN-20") | |
| 43123 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43124 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43125 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43126 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43127 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43128 | 43128 | INPUT_PORTS_END |
| 43129 | 43129 | |
| 43130 | 43130 | // PR2070 ACES HIGH ACEHI SOUNDS ACES HIGH |
| r31373 | r31374 | |
| 43151 | 43151 | } |
| 43152 | 43152 | |
| 43153 | 43153 | INPUT_PORTS_START( sc4bed ) // this structure is generated |
| 43154 | PORT_INCLUDE( sc4_base ) | |
| 43155 | PORT_MODIFY("IN-1") | |
| 43156 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43157 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 43158 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 43159 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 43160 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 43161 | PORT_MODIFY("IN-2") | |
| 43162 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 43163 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43164 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43165 | PORT_MODIFY("IN-8") | |
| 43166 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 43167 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 43168 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk pic") | |
| 43169 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("move u") | |
| 43170 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 43171 | PORT_MODIFY("IN-9") | |
| 43172 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 43173 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 43174 | PORT_MODIFY("IN-16") | |
| 43175 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43176 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43177 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43178 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43179 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43180 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43181 | PORT_MODIFY("IN-17") | |
| 43182 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43183 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43184 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43185 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43186 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43187 | PORT_MODIFY("IN-18") | |
| 43188 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43189 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43190 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43191 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43192 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43193 | PORT_MODIFY("IN-19") | |
| 43194 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43195 | PORT_MODIFY("IN-20") | |
| 43196 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43197 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43198 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43199 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43200 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43154 | PORT_INCLUDE( sc4_base ) | |
| 43155 | PORT_MODIFY("IN-1") | |
| 43156 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43157 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 43158 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 43159 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 43160 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 43161 | PORT_MODIFY("IN-2") | |
| 43162 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 43163 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43164 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43165 | PORT_MODIFY("IN-8") | |
| 43166 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 43167 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 43168 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk pic") | |
| 43169 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("move u") | |
| 43170 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 43171 | PORT_MODIFY("IN-9") | |
| 43172 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 43173 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 43174 | PORT_MODIFY("IN-16") | |
| 43175 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43176 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43177 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43178 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43179 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43180 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43181 | PORT_MODIFY("IN-17") | |
| 43182 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43183 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43184 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43185 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43186 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43187 | PORT_MODIFY("IN-18") | |
| 43188 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43189 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43190 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43191 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43192 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43193 | PORT_MODIFY("IN-19") | |
| 43194 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43195 | PORT_MODIFY("IN-20") | |
| 43196 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43197 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43198 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43199 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43200 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43201 | 43201 | INPUT_PORTS_END |
| 43202 | 43202 | |
| 43203 | 43203 | // PR2094 BEDAZZLED BEDZ SOUNDS BEDAZZLED |
| r31373 | r31374 | |
| 43225 | 43225 | } |
| 43226 | 43226 | |
| 43227 | 43227 | INPUT_PORTS_START( sc4bedcl ) // this structure is generated |
| 43228 | PORT_INCLUDE( sc4_base ) | |
| 43229 | PORT_MODIFY("IN-1") | |
| 43230 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 43231 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43232 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43233 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43234 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 43235 | PORT_MODIFY("IN-2") | |
| 43236 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 43237 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 43238 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 43239 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43240 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 43241 | PORT_MODIFY("IN-3") | |
| 43242 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43243 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43244 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43245 | PORT_MODIFY("IN-4") | |
| 43246 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43247 | PORT_MODIFY("IN-5") | |
| 43248 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43249 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43250 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43251 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43252 | PORT_MODIFY("IN-8") | |
| 43253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 43254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("pick") | |
| 43255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mov up") | |
| 43256 | PORT_MODIFY("IN-16") | |
| 43257 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43258 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43259 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43260 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43261 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43262 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43263 | PORT_MODIFY("IN-17") | |
| 43264 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43265 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43266 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43267 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43268 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43269 | PORT_MODIFY("IN-18") | |
| 43270 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43271 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43272 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43273 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43274 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43275 | PORT_MODIFY("IN-19") | |
| 43276 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43277 | PORT_MODIFY("IN-20") | |
| 43278 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43279 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43280 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43281 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43282 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43228 | PORT_INCLUDE( sc4_base ) | |
| 43229 | PORT_MODIFY("IN-1") | |
| 43230 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 43231 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43232 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43233 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43234 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 43235 | PORT_MODIFY("IN-2") | |
| 43236 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 43237 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 43238 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 43239 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43240 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 43241 | PORT_MODIFY("IN-3") | |
| 43242 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43243 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43244 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43245 | PORT_MODIFY("IN-4") | |
| 43246 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43247 | PORT_MODIFY("IN-5") | |
| 43248 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43249 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43250 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43251 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43252 | PORT_MODIFY("IN-8") | |
| 43253 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 43254 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("pick") | |
| 43255 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mov up") | |
| 43256 | PORT_MODIFY("IN-16") | |
| 43257 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43258 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43259 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43260 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43261 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43262 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43263 | PORT_MODIFY("IN-17") | |
| 43264 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43265 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43266 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43267 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43268 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43269 | PORT_MODIFY("IN-18") | |
| 43270 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43271 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43272 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43273 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43274 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43275 | PORT_MODIFY("IN-19") | |
| 43276 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43277 | PORT_MODIFY("IN-20") | |
| 43278 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43279 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43280 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43281 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43282 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43283 | 43283 | INPUT_PORTS_END |
| 43284 | 43284 | |
| 43285 | 43285 | // PR2102 CLUB BEDAZZLED CBED SOUNDS CLUB BEDAZZLED |
| r31373 | r31374 | |
| 43313 | 43313 | } |
| 43314 | 43314 | |
| 43315 | 43315 | INPUT_PORTS_START( sc4bblas ) // this structure is generated |
| 43316 | PORT_INCLUDE( sc4_base ) | |
| 43317 | PORT_MODIFY("IN-1") | |
| 43318 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43319 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 43320 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 43321 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 43322 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 43323 | PORT_MODIFY("IN-2") | |
| 43324 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 43325 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43326 | PORT_MODIFY("IN-8") | |
| 43327 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 43328 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cas") | |
| 43329 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 43330 | PORT_MODIFY("IN-16") | |
| 43331 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43332 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43333 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43334 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43335 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43336 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43337 | PORT_MODIFY("IN-17") | |
| 43338 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43339 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43340 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43341 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43342 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43343 | PORT_MODIFY("IN-18") | |
| 43344 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43345 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43346 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43347 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43348 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43349 | PORT_MODIFY("IN-19") | |
| 43350 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43351 | PORT_MODIFY("IN-20") | |
| 43352 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43353 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43354 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43355 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43356 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43316 | PORT_INCLUDE( sc4_base ) | |
| 43317 | PORT_MODIFY("IN-1") | |
| 43318 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43319 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 43320 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 43321 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 43322 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 43323 | PORT_MODIFY("IN-2") | |
| 43324 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 43325 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43326 | PORT_MODIFY("IN-8") | |
| 43327 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 43328 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cas") | |
| 43329 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 43330 | PORT_MODIFY("IN-16") | |
| 43331 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43332 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43333 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43334 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43335 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43336 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43337 | PORT_MODIFY("IN-17") | |
| 43338 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43339 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43340 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43341 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43342 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43343 | PORT_MODIFY("IN-18") | |
| 43344 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43345 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43346 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43347 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43348 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43349 | PORT_MODIFY("IN-19") | |
| 43350 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43351 | PORT_MODIFY("IN-20") | |
| 43352 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43353 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43354 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43355 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43356 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43357 | 43357 | INPUT_PORTS_END |
| 43358 | 43358 | |
| 43359 | 43359 | // PR2083 BIG BLASTER BBST SOUNDS BIG BLASTER |
| r31373 | r31374 | |
| 43383 | 43383 | } |
| 43384 | 43384 | |
| 43385 | 43385 | INPUT_PORTS_START( sc4bankb ) // this structure is generated |
| 43386 | PORT_INCLUDE( sc4_base ) | |
| 43387 | PORT_MODIFY("IN-1") | |
| 43388 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43389 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43390 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43391 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43392 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 43393 | PORT_MODIFY("IN-2") | |
| 43394 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 43395 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43396 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43397 | PORT_MODIFY("IN-8") | |
| 43398 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 43399 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 43400 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 43401 | PORT_MODIFY("IN-16") | |
| 43402 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43403 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43404 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43405 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43406 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43407 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 43408 | PORT_MODIFY("IN-17") | |
| 43409 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43410 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43411 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43412 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43413 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43414 | PORT_MODIFY("IN-18") | |
| 43415 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43416 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43417 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43418 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43419 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43420 | PORT_MODIFY("IN-19") | |
| 43421 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43422 | PORT_MODIFY("IN-20") | |
| 43423 | // 0x0001 - "test" // standard input (motherboard) | |
| 43424 | // 0x0002 - "lock" // standard input (expected here) | |
| 43425 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43426 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43427 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43386 | PORT_INCLUDE( sc4_base ) | |
| 43387 | PORT_MODIFY("IN-1") | |
| 43388 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43389 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43390 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43391 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43392 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 43393 | PORT_MODIFY("IN-2") | |
| 43394 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 43395 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43396 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43397 | PORT_MODIFY("IN-8") | |
| 43398 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("shoot") | |
| 43399 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 43400 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("spin") | |
| 43401 | PORT_MODIFY("IN-16") | |
| 43402 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43403 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43404 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43405 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43406 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43407 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 43408 | PORT_MODIFY("IN-17") | |
| 43409 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43410 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43411 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43412 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43413 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43414 | PORT_MODIFY("IN-18") | |
| 43415 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43416 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43417 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43418 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43419 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43420 | PORT_MODIFY("IN-19") | |
| 43421 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43422 | PORT_MODIFY("IN-20") | |
| 43423 | // 0x0001 - "test" // standard input (motherboard) | |
| 43424 | // 0x0002 - "lock" // standard input (expected here) | |
| 43425 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43426 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43427 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43428 | 43428 | INPUT_PORTS_END |
| 43429 | 43429 | |
| 43430 | 43430 | // PR???? BANKETYBANK V1.0 BANKETYBANKSND BANKETY BANK |
| r31373 | r31374 | |
| 43451 | 43451 | } |
| 43452 | 43452 | |
| 43453 | 43453 | INPUT_PORTS_START( sc4bobcl ) // this structure is generated |
| 43454 | PORT_INCLUDE( sc4_base ) | |
| 43455 | PORT_MODIFY("IN-1") | |
| 43456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 43457 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43458 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43459 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43460 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 43461 | PORT_MODIFY("IN-2") | |
| 43462 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 43463 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 43464 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 43465 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43466 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 43467 | PORT_MODIFY("IN-3") | |
| 43468 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43469 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43470 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43471 | PORT_MODIFY("IN-4") | |
| 43472 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43473 | PORT_MODIFY("IN-5") | |
| 43474 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43475 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43476 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43477 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43478 | PORT_MODIFY("IN-8") | |
| 43479 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 43480 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 43481 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("level1") | |
| 43482 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("level2") | |
| 43483 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("level3") | |
| 43484 | PORT_MODIFY("IN-9") | |
| 43485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("level4") | |
| 43486 | PORT_MODIFY("IN-16") | |
| 43487 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43488 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43489 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43490 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43491 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43492 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43493 | PORT_MODIFY("IN-17") | |
| 43494 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43495 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43496 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43497 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43498 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43499 | PORT_MODIFY("IN-18") | |
| 43500 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43501 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43502 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43503 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43504 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43505 | PORT_MODIFY("IN-19") | |
| 43506 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43507 | PORT_MODIFY("IN-20") | |
| 43508 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43509 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43510 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43511 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43512 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43454 | PORT_INCLUDE( sc4_base ) | |
| 43455 | PORT_MODIFY("IN-1") | |
| 43456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 43457 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43458 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43459 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43460 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 43461 | PORT_MODIFY("IN-2") | |
| 43462 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 43463 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 43464 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 43465 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43466 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 43467 | PORT_MODIFY("IN-3") | |
| 43468 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43469 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43470 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43471 | PORT_MODIFY("IN-4") | |
| 43472 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43473 | PORT_MODIFY("IN-5") | |
| 43474 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43475 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43476 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43477 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43478 | PORT_MODIFY("IN-8") | |
| 43479 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 43480 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 43481 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("level1") | |
| 43482 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("level2") | |
| 43483 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("level3") | |
| 43484 | PORT_MODIFY("IN-9") | |
| 43485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("level4") | |
| 43486 | PORT_MODIFY("IN-16") | |
| 43487 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43488 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43489 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43490 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43491 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43492 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43493 | PORT_MODIFY("IN-17") | |
| 43494 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43495 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43496 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43497 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43498 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43499 | PORT_MODIFY("IN-18") | |
| 43500 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43501 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43502 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43503 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43504 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43505 | PORT_MODIFY("IN-19") | |
| 43506 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43507 | PORT_MODIFY("IN-20") | |
| 43508 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43509 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43510 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43511 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43512 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43513 | 43513 | INPUT_PORTS_END |
| 43514 | 43514 | |
| 43515 | 43515 | // PR2298 CLUB BOBBY DAZZLER CLUB BOB DAZZLER CLUB CLUBBOBD SOUNDS |
| r31373 | r31374 | |
| 43533 | 43533 | } |
| 43534 | 43534 | |
| 43535 | 43535 | INPUT_PORTS_START( sc4brksp ) // this structure is generated |
| 43536 | PORT_INCLUDE( sc4_base ) | |
| 43537 | PORT_MODIFY("IN-1") | |
| 43538 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43539 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 43540 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 43541 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 43542 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 43543 | PORT_MODIFY("IN-2") | |
| 43544 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excnge") | |
| 43545 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43546 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43547 | PORT_MODIFY("IN-8") | |
| 43548 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 43549 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("mv rht") | |
| 43550 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mv lft") | |
| 43551 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk stp") | |
| 43552 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 43553 | PORT_MODIFY("IN-16") | |
| 43554 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43555 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43556 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43557 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43558 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43559 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43560 | PORT_MODIFY("IN-17") | |
| 43561 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43562 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43563 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43564 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43565 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43566 | PORT_MODIFY("IN-18") | |
| 43567 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43568 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43569 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43570 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43571 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43572 | PORT_MODIFY("IN-19") | |
| 43573 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43574 | PORT_MODIFY("IN-20") | |
| 43575 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43576 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43577 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43578 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43579 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43536 | PORT_INCLUDE( sc4_base ) | |
| 43537 | PORT_MODIFY("IN-1") | |
| 43538 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43539 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 43540 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 43541 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 43542 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 43543 | PORT_MODIFY("IN-2") | |
| 43544 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("excnge") | |
| 43545 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43546 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43547 | PORT_MODIFY("IN-8") | |
| 43548 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 43549 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("mv rht") | |
| 43550 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("mv lft") | |
| 43551 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk stp") | |
| 43552 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 43553 | PORT_MODIFY("IN-16") | |
| 43554 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43555 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43556 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43557 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43558 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43559 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43560 | PORT_MODIFY("IN-17") | |
| 43561 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43562 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43563 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43564 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43565 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 43566 | PORT_MODIFY("IN-18") | |
| 43567 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 43568 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 43569 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 43570 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 43571 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 43572 | PORT_MODIFY("IN-19") | |
| 43573 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 43574 | PORT_MODIFY("IN-20") | |
| 43575 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 43576 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43577 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43578 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43579 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43580 | 43580 | INPUT_PORTS_END |
| 43581 | 43581 | |
| 43582 | 43582 | // PR2033 BREAK THE SPELL SPELL SOUNDS BREAK THE SPELL |
| r31373 | r31374 | |
| 43600 | 43600 | } |
| 43601 | 43601 | |
| 43602 | 43602 | INPUT_PORTS_START( sc4bulcl ) // this structure is generated |
| 43603 | PORT_INCLUDE( sc4_base ) | |
| 43604 | PORT_MODIFY("IN-1") | |
| 43605 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43606 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43607 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43608 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43609 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 43610 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 43611 | PORT_MODIFY("IN-2") | |
| 43612 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("st/col") | |
| 43613 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 43614 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 43615 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43616 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 43617 | PORT_MODIFY("IN-3") | |
| 43618 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43619 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43620 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43621 | PORT_MODIFY("IN-4") | |
| 43622 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43623 | PORT_MODIFY("IN-5") | |
| 43624 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43625 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43626 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43627 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43628 | PORT_MODIFY("IN-8") | |
| 43629 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk win") | |
| 43630 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 43631 | PORT_MODIFY("IN-16") | |
| 43632 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43633 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43634 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43635 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43636 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43637 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43638 | PORT_MODIFY("IN-17") | |
| 43639 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43640 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43641 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43642 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43643 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43644 | PORT_MODIFY("IN-18") | |
| 43645 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43646 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43647 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43648 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43649 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43650 | PORT_MODIFY("IN-19") | |
| 43651 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43652 | PORT_MODIFY("IN-20") | |
| 43653 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43654 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43655 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43656 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43657 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43603 | PORT_INCLUDE( sc4_base ) | |
| 43604 | PORT_MODIFY("IN-1") | |
| 43605 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43606 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43607 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43608 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 43609 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 43610 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 43611 | PORT_MODIFY("IN-2") | |
| 43612 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("st/col") | |
| 43613 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trnsfr") | |
| 43614 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 43615 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43616 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 43617 | PORT_MODIFY("IN-3") | |
| 43618 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43619 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43620 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43621 | PORT_MODIFY("IN-4") | |
| 43622 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43623 | PORT_MODIFY("IN-5") | |
| 43624 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43625 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43626 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43627 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43628 | PORT_MODIFY("IN-8") | |
| 43629 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk win") | |
| 43630 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 43631 | PORT_MODIFY("IN-16") | |
| 43632 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43633 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43634 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43635 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43636 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43637 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43638 | PORT_MODIFY("IN-17") | |
| 43639 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43640 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43641 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43642 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43643 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43644 | PORT_MODIFY("IN-18") | |
| 43645 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43646 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43647 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43648 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43649 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43650 | PORT_MODIFY("IN-19") | |
| 43651 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43652 | PORT_MODIFY("IN-20") | |
| 43653 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43654 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43655 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43656 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43657 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43658 | 43658 | INPUT_PORTS_END |
| 43659 | 43659 | |
| 43660 | 43660 | // PR1753 CLUB BULLSEYE BULLSEYE CLUB PR1751 BULLSEYE SOUNDS11 BULLSYE |
| r31373 | r31374 | |
| 43686 | 43686 | } |
| 43687 | 43687 | |
| 43688 | 43688 | INPUT_PORTS_START( sc4carry ) // this structure is generated |
| 43689 | PORT_INCLUDE( sc4_base ) | |
| 43690 | PORT_MODIFY("IN-1") | |
| 43691 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43692 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 43693 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1 OR high") | |
| 43694 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2 OR low") | |
| 43695 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 43696 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 43697 | PORT_MODIFY("IN-2") | |
| 43698 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("bonus") | |
| 43699 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43700 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43701 | PORT_MODIFY("IN-3") | |
| 43702 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43703 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43704 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43705 | PORT_MODIFY("IN-5") | |
| 43706 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43707 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43708 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43709 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43710 | PORT_MODIFY("IN-6") | |
| 43711 | // 0x0001 - "perc1" // standard input (expected here) | |
| 43712 | // 0x0002 - "perc2" // standard input (expected here) | |
| 43713 | // 0x0004 - "perc3" // standard input (expected here) | |
| 43714 | // 0x0008 - "perc4" // standard input (expected here) | |
| 43715 | PORT_MODIFY("IN-8") | |
| 43716 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkcash") | |
| 43717 | PORT_MODIFY("IN-16") | |
| 43718 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43719 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43720 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43721 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43722 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43723 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43724 | PORT_MODIFY("IN-17") | |
| 43725 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43726 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43727 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43728 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43729 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43730 | PORT_MODIFY("IN-18") | |
| 43731 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43732 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43733 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43734 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43735 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43736 | PORT_MODIFY("IN-19") | |
| 43737 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43738 | PORT_MODIFY("IN-20") | |
| 43739 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43740 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43741 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43742 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43743 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43689 | PORT_INCLUDE( sc4_base ) | |
| 43690 | PORT_MODIFY("IN-1") | |
| 43691 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43692 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 43693 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1 OR high") | |
| 43694 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2 OR low") | |
| 43695 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 43696 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 43697 | PORT_MODIFY("IN-2") | |
| 43698 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("bonus") | |
| 43699 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43700 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43701 | PORT_MODIFY("IN-3") | |
| 43702 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43703 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43704 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43705 | PORT_MODIFY("IN-5") | |
| 43706 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43707 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43708 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43709 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43710 | PORT_MODIFY("IN-6") | |
| 43711 | // 0x0001 - "perc1" // standard input (expected here) | |
| 43712 | // 0x0002 - "perc2" // standard input (expected here) | |
| 43713 | // 0x0004 - "perc3" // standard input (expected here) | |
| 43714 | // 0x0008 - "perc4" // standard input (expected here) | |
| 43715 | PORT_MODIFY("IN-8") | |
| 43716 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkcash") | |
| 43717 | PORT_MODIFY("IN-16") | |
| 43718 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43719 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43720 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43721 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43722 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43723 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43724 | PORT_MODIFY("IN-17") | |
| 43725 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43726 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43727 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43728 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43729 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43730 | PORT_MODIFY("IN-18") | |
| 43731 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43732 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43733 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43734 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43735 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43736 | PORT_MODIFY("IN-19") | |
| 43737 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43738 | PORT_MODIFY("IN-20") | |
| 43739 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43740 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43741 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43742 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43743 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43744 | 43744 | INPUT_PORTS_END |
| 43745 | 43745 | |
| 43746 | 43746 | // PR1113 CARRY ON WINNING PR1113 CARRY ON WINNING SOUNDS11 |
| r31373 | r31374 | |
| 43748 | 43748 | GAMEL( 200?, sc4carrya ,sc4carry, sc4, sc4carry, sc4_state, sc4carry, ROT0, "BFM","Carry On Winning (Bellfruit) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 43749 | 43749 | |
| 43750 | 43750 | INPUT_PORTS_START( sc4cbaz ) // this structure is generated |
| 43751 | PORT_INCLUDE( sc4_base ) | |
| 43752 | PORT_MODIFY("IN-1") | |
| 43753 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 43754 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43755 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43756 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR high") | |
| 43757 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4 OR low") | |
| 43758 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 43759 | PORT_MODIFY("IN-2") | |
| 43760 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 43761 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 43762 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43763 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43764 | PORT_MODIFY("IN-3") | |
| 43765 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43766 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43767 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43768 | PORT_MODIFY("IN-4") | |
| 43769 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43770 | PORT_MODIFY("IN-5") | |
| 43771 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43772 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43773 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43774 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43775 | PORT_MODIFY("IN-8") | |
| 43776 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 43777 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cml") | |
| 43778 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 43779 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 43780 | PORT_MODIFY("IN-16") | |
| 43781 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43782 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43783 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43784 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43785 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43786 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43787 | PORT_MODIFY("IN-17") | |
| 43788 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43789 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43790 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43791 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43792 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43793 | PORT_MODIFY("IN-18") | |
| 43794 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43795 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43796 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43797 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43798 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43799 | PORT_MODIFY("IN-19") | |
| 43800 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43801 | PORT_MODIFY("IN-20") | |
| 43802 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43803 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43804 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43805 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43806 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43751 | PORT_INCLUDE( sc4_base ) | |
| 43752 | PORT_MODIFY("IN-1") | |
| 43753 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 43754 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 43755 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 43756 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR high") | |
| 43757 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4 OR low") | |
| 43758 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 43759 | PORT_MODIFY("IN-2") | |
| 43760 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 43761 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 43762 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43763 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43764 | PORT_MODIFY("IN-3") | |
| 43765 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43766 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43767 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43768 | PORT_MODIFY("IN-4") | |
| 43769 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43770 | PORT_MODIFY("IN-5") | |
| 43771 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43772 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43773 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43774 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43775 | PORT_MODIFY("IN-8") | |
| 43776 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 43777 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk cml") | |
| 43778 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk bon") | |
| 43779 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 43780 | PORT_MODIFY("IN-16") | |
| 43781 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43782 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43783 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43784 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43785 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43786 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 43787 | PORT_MODIFY("IN-17") | |
| 43788 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43789 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43790 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43791 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43792 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43793 | PORT_MODIFY("IN-18") | |
| 43794 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43795 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43796 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43797 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 43798 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 43799 | PORT_MODIFY("IN-19") | |
| 43800 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 43801 | PORT_MODIFY("IN-20") | |
| 43802 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43803 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 43804 | // 0x0004 - "topdor" // standard input (expected here) | |
| 43805 | // 0x0008 - "botdor" // standard input (expected here) | |
| 43806 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43807 | 43807 | INPUT_PORTS_END |
| 43808 | 43808 | |
| 43809 | 43809 | // PR1349 CLUB CASH BAZAAR PR1349 CLUB CASH BAZAAR SOUNDS11 |
| r31373 | r31374 | |
| 43825 | 43825 | |
| 43826 | 43826 | |
| 43827 | 43827 | INPUT_PORTS_START( sc4clash ) // this structure is generated |
| 43828 | PORT_INCLUDE( sc4_base ) | |
| 43829 | PORT_MODIFY("IN-1") | |
| 43830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 43831 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 43832 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 43833 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 43834 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 43835 | PORT_MODIFY("IN-2") | |
| 43836 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 43837 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43838 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43839 | PORT_MODIFY("IN-8") | |
| 43840 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkcash") | |
| 43841 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("moveup") | |
| 43842 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkpick") | |
| 43843 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tknuds") | |
| 43844 | PORT_MODIFY("IN-16") | |
| 43845 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43846 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43847 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43848 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43849 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43850 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 43851 | PORT_MODIFY("IN-17") | |
| 43852 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43853 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43854 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43855 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43856 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43857 | PORT_MODIFY("IN-18") | |
| 43858 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43859 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43860 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43861 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43862 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43863 | PORT_MODIFY("IN-19") | |
| 43864 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43865 | PORT_MODIFY("IN-20") | |
| 43866 | // 0x0001 - "test" // standard input (motherboard) | |
| 43867 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43868 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43869 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43870 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43828 | PORT_INCLUDE( sc4_base ) | |
| 43829 | PORT_MODIFY("IN-1") | |
| 43830 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 43831 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 43832 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 43833 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 43834 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 43835 | PORT_MODIFY("IN-2") | |
| 43836 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 43837 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 43838 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43839 | PORT_MODIFY("IN-8") | |
| 43840 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkcash") | |
| 43841 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("moveup") | |
| 43842 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkpick") | |
| 43843 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tknuds") | |
| 43844 | PORT_MODIFY("IN-16") | |
| 43845 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43846 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43847 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43848 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43849 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43850 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 43851 | PORT_MODIFY("IN-17") | |
| 43852 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43853 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43854 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43855 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43856 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43857 | PORT_MODIFY("IN-18") | |
| 43858 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43859 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43860 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43861 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43862 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43863 | PORT_MODIFY("IN-19") | |
| 43864 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43865 | PORT_MODIFY("IN-20") | |
| 43866 | // 0x0001 - "test" // standard input (motherboard) | |
| 43867 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 43868 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 43869 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 43870 | // 0x0010 - "deflt" // standard input (expected here) | |
| 43871 | 43871 | INPUT_PORTS_END |
| 43872 | 43872 | |
| 43873 | 43873 | // PR2118 CASH ON THE LASH COTL SOUNDS CASH ON THE LASH |
| r31373 | r31374 | |
| 43882 | 43882 | |
| 43883 | 43883 | |
| 43884 | 43884 | INPUT_PORTS_START( sc4cckey ) // this structure is generated |
| 43885 | PORT_INCLUDE( sc4_base ) | |
| 43886 | PORT_MODIFY("IN-1") | |
| 43887 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43888 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 43889 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 43890 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 43891 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 43892 | PORT_MODIFY("IN-2") | |
| 43893 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 43894 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 43895 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43896 | PORT_MODIFY("IN-3") | |
| 43897 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43898 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43899 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43900 | PORT_MODIFY("IN-4") | |
| 43901 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 43902 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 43903 | PORT_MODIFY("IN-5") | |
| 43904 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43905 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43906 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43907 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43908 | PORT_MODIFY("IN-6") | |
| 43909 | // 0x0001 - "perc1" // standard input (expected here) | |
| 43910 | // 0x0002 - "perc2" // standard input (expected here) | |
| 43911 | // 0x0004 - "perc3" // standard input (expected here) | |
| 43912 | // 0x0008 - "perc4" // standard input (expected here) | |
| 43913 | PORT_MODIFY("IN-16") | |
| 43914 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43915 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43916 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43917 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43918 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43919 | PORT_MODIFY("IN-17") | |
| 43920 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43921 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43922 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43923 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43924 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43925 | PORT_MODIFY("IN-18") | |
| 43926 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43927 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43928 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43929 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43930 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43931 | PORT_MODIFY("IN-19") | |
| 43932 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43933 | PORT_MODIFY("IN-20") | |
| 43934 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43935 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 43936 | // 0x0004 - "serdor" // standard input (expected here) | |
| 43937 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 43885 | PORT_INCLUDE( sc4_base ) | |
| 43886 | PORT_MODIFY("IN-1") | |
| 43887 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 43888 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 43889 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 43890 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 43891 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 43892 | PORT_MODIFY("IN-2") | |
| 43893 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 43894 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 43895 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43896 | PORT_MODIFY("IN-3") | |
| 43897 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43898 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43899 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43900 | PORT_MODIFY("IN-4") | |
| 43901 | // 0x0002 - "hop hi" // known extended(?) input, sometimes 'hop hi' | |
| 43902 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 43903 | PORT_MODIFY("IN-5") | |
| 43904 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43905 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43906 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43907 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43908 | PORT_MODIFY("IN-6") | |
| 43909 | // 0x0001 - "perc1" // standard input (expected here) | |
| 43910 | // 0x0002 - "perc2" // standard input (expected here) | |
| 43911 | // 0x0004 - "perc3" // standard input (expected here) | |
| 43912 | // 0x0008 - "perc4" // standard input (expected here) | |
| 43913 | PORT_MODIFY("IN-16") | |
| 43914 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 43915 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 43916 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 43917 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 43918 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 43919 | PORT_MODIFY("IN-17") | |
| 43920 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 43921 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 43922 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 43923 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 43924 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 43925 | PORT_MODIFY("IN-18") | |
| 43926 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 43927 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 43928 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 43929 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 43930 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 43931 | PORT_MODIFY("IN-19") | |
| 43932 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 43933 | PORT_MODIFY("IN-20") | |
| 43934 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 43935 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 43936 | // 0x0004 - "serdor" // standard input (expected here) | |
| 43937 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 43938 | 43938 | INPUT_PORTS_END |
| 43939 | 43939 | |
| 43940 | 43940 | // PR1426 CASINO CRAZY FRUITS GOLD PR1426 CRAZY F GOLD SOUNDS11 CRAZY FRUIT GOLD S.SITE (set was marked as Casino Crazy Keys) |
| r31373 | r31374 | |
| 43972 | 43972 | } |
| 43973 | 43973 | |
| 43974 | 43974 | INPUT_PORTS_START( sc4clclo ) // this structure is generated |
| 43975 | PORT_INCLUDE( sc4_base ) | |
| 43976 | PORT_MODIFY("IN-1") | |
| 43977 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 43978 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 43979 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 43980 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 43981 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 43982 | PORT_MODIFY("IN-2") | |
| 43983 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 43984 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 43985 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 43986 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43987 | PORT_MODIFY("IN-3") | |
| 43988 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43989 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43990 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43991 | PORT_MODIFY("IN-4") | |
| 43992 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43993 | PORT_MODIFY("IN-5") | |
| 43994 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43995 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43996 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43997 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43998 | PORT_MODIFY("IN-8") | |
| 43999 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("level1") | |
| 44000 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("level3") | |
| 44001 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("level2") | |
| 44002 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk csh") | |
| 44003 | PORT_MODIFY("IN-16") | |
| 44004 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44005 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44006 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44007 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44008 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44009 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44010 | PORT_MODIFY("IN-17") | |
| 44011 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44012 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44013 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44014 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44015 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44016 | PORT_MODIFY("IN-18") | |
| 44017 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44018 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44019 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44020 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44021 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44022 | PORT_MODIFY("IN-19") | |
| 44023 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44024 | PORT_MODIFY("IN-20") | |
| 44025 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44026 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44027 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44028 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44029 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 43975 | PORT_INCLUDE( sc4_base ) | |
| 43976 | PORT_MODIFY("IN-1") | |
| 43977 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("lh1") | |
| 43978 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("lh2") | |
| 43979 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("lh3") | |
| 43980 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("lh4") | |
| 43981 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("rh4") | |
| 43982 | PORT_MODIFY("IN-2") | |
| 43983 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("rh3") | |
| 43984 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("rh2") | |
| 43985 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("rh1") | |
| 43986 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 43987 | PORT_MODIFY("IN-3") | |
| 43988 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 43989 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 43990 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 43991 | PORT_MODIFY("IN-4") | |
| 43992 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 43993 | PORT_MODIFY("IN-5") | |
| 43994 | // 0x0001 - "priz4" // standard input (expected here) | |
| 43995 | // 0x0002 - "priz3" // standard input (expected here) | |
| 43996 | // 0x0004 - "priz2" // standard input (expected here) | |
| 43997 | // 0x0008 - "priz1" // standard input (expected here) | |
| 43998 | PORT_MODIFY("IN-8") | |
| 43999 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("level1") | |
| 44000 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("level3") | |
| 44001 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("level2") | |
| 44002 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk csh") | |
| 44003 | PORT_MODIFY("IN-16") | |
| 44004 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44005 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44006 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44007 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44008 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44009 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44010 | PORT_MODIFY("IN-17") | |
| 44011 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44012 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44013 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44014 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44015 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44016 | PORT_MODIFY("IN-18") | |
| 44017 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44018 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44019 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44020 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44021 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44022 | PORT_MODIFY("IN-19") | |
| 44023 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44024 | PORT_MODIFY("IN-20") | |
| 44025 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44026 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44027 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44028 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44029 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44030 | 44030 | INPUT_PORTS_END |
| 44031 | 44031 | |
| 44032 | 44032 | // PR2383 CLUBCLOUSEAU CLUBCLOUSEAU CLUB CCLOU SOUNDS CLUB CLOSEAU |
| r31373 | r31374 | |
| 44049 | 44049 | } |
| 44050 | 44050 | |
| 44051 | 44051 | INPUT_PORTS_START( sc4cjcl ) // this structure is generated |
| 44052 | PORT_INCLUDE( sc4_base ) | |
| 44053 | PORT_MODIFY("IN-1") | |
| 44054 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44055 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44056 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44057 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44058 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44059 | PORT_MODIFY("IN-2") | |
| 44060 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44061 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 44062 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 44063 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44064 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 44065 | PORT_MODIFY("IN-3") | |
| 44066 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44067 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44068 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44069 | PORT_MODIFY("IN-4") | |
| 44070 | // 0x0001 - "hop2lo" // unexpected here | |
| 44071 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 44072 | PORT_MODIFY("IN-5") | |
| 44073 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44074 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44075 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44076 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44077 | PORT_MODIFY("IN-8") | |
| 44078 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudges") | |
| 44079 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 44080 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 44081 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spr mt") | |
| 44082 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("bell") | |
| 44083 | PORT_MODIFY("IN-16") | |
| 44084 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44085 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44086 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44087 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44088 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44089 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44090 | PORT_MODIFY("IN-17") | |
| 44091 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44092 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44093 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44094 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44095 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44096 | PORT_MODIFY("IN-18") | |
| 44097 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44098 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44099 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44100 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44101 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44102 | PORT_MODIFY("IN-19") | |
| 44103 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44104 | PORT_MODIFY("IN-20") | |
| 44105 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44106 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44107 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44108 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44109 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44052 | PORT_INCLUDE( sc4_base ) | |
| 44053 | PORT_MODIFY("IN-1") | |
| 44054 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44055 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44056 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44057 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44058 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44059 | PORT_MODIFY("IN-2") | |
| 44060 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44061 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 44062 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 44063 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44064 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 44065 | PORT_MODIFY("IN-3") | |
| 44066 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44067 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44068 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44069 | PORT_MODIFY("IN-4") | |
| 44070 | // 0x0001 - "hop2lo" // unexpected here | |
| 44071 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 44072 | PORT_MODIFY("IN-5") | |
| 44073 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44074 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44075 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44076 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44077 | PORT_MODIFY("IN-8") | |
| 44078 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudges") | |
| 44079 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 44080 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 44081 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spr mt") | |
| 44082 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("bell") | |
| 44083 | PORT_MODIFY("IN-16") | |
| 44084 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44085 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44086 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44087 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44088 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44089 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44090 | PORT_MODIFY("IN-17") | |
| 44091 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44092 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44093 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44094 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44095 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44096 | PORT_MODIFY("IN-18") | |
| 44097 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44098 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44099 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44100 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44101 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44102 | PORT_MODIFY("IN-19") | |
| 44103 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44104 | PORT_MODIFY("IN-20") | |
| 44105 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44106 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44107 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44108 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44109 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44110 | 44110 | INPUT_PORTS_END |
| 44111 | 44111 | |
| 44112 | 44112 | // PR1621 CLUB COOL JEWELS PR1621 COOL SOUNDS11 CLUB COOL JEWELS CLUB |
| r31373 | r31374 | |
| 44120 | 44120 | |
| 44121 | 44121 | |
| 44122 | 44122 | INPUT_PORTS_START( sc4crcp ) // this structure is generated |
| 44123 | PORT_INCLUDE( sc4_base ) | |
| 44124 | PORT_MODIFY("IN-1") | |
| 44125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44127 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44128 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44129 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44130 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 44131 | PORT_MODIFY("IN-2") | |
| 44132 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44133 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ex/tra") | |
| 44134 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44135 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44136 | PORT_MODIFY("IN-3") | |
| 44137 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44138 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44139 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44140 | PORT_MODIFY("IN-4") | |
| 44141 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 44142 | PORT_MODIFY("IN-5") | |
| 44143 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44144 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44145 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44146 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44147 | PORT_MODIFY("IN-8") | |
| 44148 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 44149 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk swg") | |
| 44150 | PORT_MODIFY("IN-16") | |
| 44151 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44152 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44153 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44154 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44155 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44156 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44157 | PORT_MODIFY("IN-17") | |
| 44158 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44159 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44160 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44161 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44162 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44163 | PORT_MODIFY("IN-18") | |
| 44164 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44165 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44166 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44167 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44168 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44169 | PORT_MODIFY("IN-19") | |
| 44170 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44171 | PORT_MODIFY("IN-20") | |
| 44172 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44173 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44174 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44175 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44176 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44123 | PORT_INCLUDE( sc4_base ) | |
| 44124 | PORT_MODIFY("IN-1") | |
| 44125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44127 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44128 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44129 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44130 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 44131 | PORT_MODIFY("IN-2") | |
| 44132 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44133 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("ex/tra") | |
| 44134 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44135 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44136 | PORT_MODIFY("IN-3") | |
| 44137 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44138 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44139 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44140 | PORT_MODIFY("IN-4") | |
| 44141 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 44142 | PORT_MODIFY("IN-5") | |
| 44143 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44144 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44145 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44146 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44147 | PORT_MODIFY("IN-8") | |
| 44148 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 44149 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk swg") | |
| 44150 | PORT_MODIFY("IN-16") | |
| 44151 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44152 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44153 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44154 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44155 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44156 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44157 | PORT_MODIFY("IN-17") | |
| 44158 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44159 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44160 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44161 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44162 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44163 | PORT_MODIFY("IN-18") | |
| 44164 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44165 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44166 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44167 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44168 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44169 | PORT_MODIFY("IN-19") | |
| 44170 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44171 | PORT_MODIFY("IN-20") | |
| 44172 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44173 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44174 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44175 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44176 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44177 | 44177 | INPUT_PORTS_END |
| 44178 | 44178 | |
| 44179 | 44179 | // PR3241 CLUB COPS AND ROBBERS PLATINUM SCORP4 COPS & ROBRS PLT CLUB PR3241 C N R PLATINUM SOUNDS11 COPS AND ROBBERS |
| r31373 | r31374 | |
| 44189 | 44189 | GAMEL( 200?, sc4crcpj ,sc4crcp, sc4, sc4crcp, sc4_state, sc4mbus, ROT0, "BFM","Cops 'n' Robbers Club Platinum (Bellfruit) (Scorpion 4) (set 10)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 44190 | 44190 | |
| 44191 | 44191 | INPUT_PORTS_START( sc4crgc ) // this structure is generated |
| 44192 | PORT_INCLUDE( sc4_base ) | |
| 44193 | PORT_MODIFY("IN-1") | |
| 44194 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44195 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44196 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44197 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44198 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44199 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 44200 | PORT_MODIFY("IN-2") | |
| 44201 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44202 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 44203 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44204 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44205 | PORT_MODIFY("IN-3") | |
| 44206 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44207 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44208 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44209 | PORT_MODIFY("IN-4") | |
| 44210 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 44211 | PORT_MODIFY("IN-5") | |
| 44212 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44213 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44214 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44215 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44216 | PORT_MODIFY("IN-8") | |
| 44217 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 44218 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk swg") | |
| 44219 | PORT_MODIFY("IN-16") | |
| 44220 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44221 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44222 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44223 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44224 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44225 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44226 | PORT_MODIFY("IN-17") | |
| 44227 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44228 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44229 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44230 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44231 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44232 | PORT_MODIFY("IN-18") | |
| 44233 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44234 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44235 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44236 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44237 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44238 | PORT_MODIFY("IN-19") | |
| 44239 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44240 | PORT_MODIFY("IN-20") | |
| 44241 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44242 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44243 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44244 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44245 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44192 | PORT_INCLUDE( sc4_base ) | |
| 44193 | PORT_MODIFY("IN-1") | |
| 44194 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44195 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44196 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44197 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44198 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44199 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 44200 | PORT_MODIFY("IN-2") | |
| 44201 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44202 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 44203 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44204 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44205 | PORT_MODIFY("IN-3") | |
| 44206 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44207 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44208 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44209 | PORT_MODIFY("IN-4") | |
| 44210 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 44211 | PORT_MODIFY("IN-5") | |
| 44212 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44213 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44214 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44215 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44216 | PORT_MODIFY("IN-8") | |
| 44217 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 44218 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk swg") | |
| 44219 | PORT_MODIFY("IN-16") | |
| 44220 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44221 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44222 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44223 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44224 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44225 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44226 | PORT_MODIFY("IN-17") | |
| 44227 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44228 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44229 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44230 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44231 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44232 | PORT_MODIFY("IN-18") | |
| 44233 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44234 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44235 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44236 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44237 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44238 | PORT_MODIFY("IN-19") | |
| 44239 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44240 | PORT_MODIFY("IN-20") | |
| 44241 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44242 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44243 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44244 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44245 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44246 | 44246 | INPUT_PORTS_END |
| 44247 | 44247 | |
| 44248 | 44248 | // PR1348 CLUB COPS AND ROBBERS GOLD PR1348 CCRG SOUNDS11 COPS AND ROBBERS |
| r31373 | r31374 | |
| 44293 | 44293 | } |
| 44294 | 44294 | |
| 44295 | 44295 | INPUT_PORTS_START( sc4cfcla ) // this structure is generated |
| 44296 | PORT_INCLUDE( sc4_base ) | |
| 44297 | PORT_MODIFY("IN-1") | |
| 44298 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44299 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44300 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44301 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44302 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 44303 | // 0x0100 - "pndlow" // known extended input, usually 'hopper fit' | |
| 44304 | PORT_MODIFY("IN-2") | |
| 44305 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44306 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44307 | // 0x0100 - "10plow" // unexpected here | |
| 44308 | PORT_MODIFY("IN-3") | |
| 44309 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44310 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44311 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44312 | PORT_MODIFY("IN-5") | |
| 44313 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44314 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44315 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44316 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44317 | PORT_MODIFY("IN-6") | |
| 44318 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44319 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44320 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44321 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44322 | PORT_MODIFY("IN-16") | |
| 44323 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44324 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44325 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44326 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44327 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44328 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 44329 | PORT_MODIFY("IN-17") | |
| 44330 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44331 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44332 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44333 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44334 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44335 | PORT_MODIFY("IN-18") | |
| 44336 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44337 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44338 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44339 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44340 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44341 | PORT_MODIFY("IN-19") | |
| 44342 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 44343 | PORT_MODIFY("IN-20") | |
| 44344 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44345 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44346 | // 0x0004 - "serdor" // standard input (expected here) | |
| 44347 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 44348 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44296 | PORT_INCLUDE( sc4_base ) | |
| 44297 | PORT_MODIFY("IN-1") | |
| 44298 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44299 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44300 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44301 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44302 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 44303 | // 0x0100 - "pndlow" // known extended input, usually 'hopper fit' | |
| 44304 | PORT_MODIFY("IN-2") | |
| 44305 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44306 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44307 | // 0x0100 - "10plow" // unexpected here | |
| 44308 | PORT_MODIFY("IN-3") | |
| 44309 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44310 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44311 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44312 | PORT_MODIFY("IN-5") | |
| 44313 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44314 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44315 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44316 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44317 | PORT_MODIFY("IN-6") | |
| 44318 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44319 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44320 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44321 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44322 | PORT_MODIFY("IN-16") | |
| 44323 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44324 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44325 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44326 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44327 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44328 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 44329 | PORT_MODIFY("IN-17") | |
| 44330 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44331 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44332 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44333 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44334 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44335 | PORT_MODIFY("IN-18") | |
| 44336 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44337 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44338 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44339 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44340 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44341 | PORT_MODIFY("IN-19") | |
| 44342 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 44343 | PORT_MODIFY("IN-20") | |
| 44344 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44345 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44346 | // 0x0004 - "serdor" // standard input (expected here) | |
| 44347 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 44348 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44349 | 44349 | INPUT_PORTS_END |
| 44350 | 44350 | |
| 44351 | 44351 | // PR1396 CLASSIC CRAZY FRUITS PR1396 CLSIC CRAZY FRUITS SND11 |
| r31373 | r31374 | |
| 44373 | 44373 | } |
| 44374 | 44374 | |
| 44375 | 44375 | INPUT_PORTS_START( sc4cfdu ) // this structure is generated |
| 44376 | PORT_INCLUDE( sc4_base ) | |
| 44377 | PORT_MODIFY("IN-1") | |
| 44378 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44379 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44380 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44381 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44382 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 44383 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 44384 | PORT_MODIFY("IN-2") | |
| 44385 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44386 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44387 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44388 | PORT_MODIFY("IN-3") | |
| 44389 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44390 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44391 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44392 | PORT_MODIFY("IN-5") | |
| 44393 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44394 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44395 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44396 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44397 | PORT_MODIFY("IN-6") | |
| 44398 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44399 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44400 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44401 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44402 | PORT_MODIFY("IN-16") | |
| 44403 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44404 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44405 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44406 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44407 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44408 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44409 | PORT_MODIFY("IN-17") | |
| 44410 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44411 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44412 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44413 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44414 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44415 | PORT_MODIFY("IN-18") | |
| 44416 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44417 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44418 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44419 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44420 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44421 | PORT_MODIFY("IN-19") | |
| 44422 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44423 | PORT_MODIFY("IN-20") | |
| 44424 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44425 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44426 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44427 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44428 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44376 | PORT_INCLUDE( sc4_base ) | |
| 44377 | PORT_MODIFY("IN-1") | |
| 44378 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44379 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44380 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44381 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44382 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 44383 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 44384 | PORT_MODIFY("IN-2") | |
| 44385 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44386 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44387 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44388 | PORT_MODIFY("IN-3") | |
| 44389 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44390 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44391 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44392 | PORT_MODIFY("IN-5") | |
| 44393 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44394 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44395 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44396 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44397 | PORT_MODIFY("IN-6") | |
| 44398 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44399 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44400 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44401 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44402 | PORT_MODIFY("IN-16") | |
| 44403 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44404 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44405 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44406 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44407 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44408 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44409 | PORT_MODIFY("IN-17") | |
| 44410 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44411 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44412 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44413 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44414 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44415 | PORT_MODIFY("IN-18") | |
| 44416 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44417 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44418 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44419 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44420 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44421 | PORT_MODIFY("IN-19") | |
| 44422 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44423 | PORT_MODIFY("IN-20") | |
| 44424 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44425 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44426 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44427 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44428 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44429 | 44429 | INPUT_PORTS_END |
| 44430 | 44430 | |
| 44431 | 44431 | // PR1107 CRAZY FRUITS DOWNUNDER PR1107 DOWN UNDER SOUNDS11 |
| r31373 | r31374 | |
| 44452 | 44452 | } |
| 44453 | 44453 | |
| 44454 | 44454 | INPUT_PORTS_START( sc4cfgcl ) // this structure is generated |
| 44455 | PORT_INCLUDE( sc4_base ) | |
| 44456 | PORT_MODIFY("IN-1") | |
| 44457 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44458 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44459 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44460 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44461 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44462 | PORT_MODIFY("IN-2") | |
| 44463 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44464 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 44465 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 44466 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44467 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 44468 | PORT_MODIFY("IN-3") | |
| 44469 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44470 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44471 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44472 | PORT_MODIFY("IN-4") | |
| 44473 | // 0x0001 - "hop2lo" // unexpected here | |
| 44474 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 44475 | PORT_MODIFY("IN-5") | |
| 44476 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44477 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44478 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44479 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44480 | PORT_MODIFY("IN-8") | |
| 44481 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudges") | |
| 44482 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 44483 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 44484 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spr mt") | |
| 44485 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("bell") | |
| 44486 | PORT_MODIFY("IN-16") | |
| 44487 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44488 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44489 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44490 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44491 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44492 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44493 | PORT_MODIFY("IN-17") | |
| 44494 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44495 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44496 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44497 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44498 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44499 | PORT_MODIFY("IN-18") | |
| 44500 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44501 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44502 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44503 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44504 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44505 | PORT_MODIFY("IN-19") | |
| 44506 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44507 | PORT_MODIFY("IN-20") | |
| 44508 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44509 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44510 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44511 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44512 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44455 | PORT_INCLUDE( sc4_base ) | |
| 44456 | PORT_MODIFY("IN-1") | |
| 44457 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 44458 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44459 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44460 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44461 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 44462 | PORT_MODIFY("IN-2") | |
| 44463 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 44464 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 44465 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 44466 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44467 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 44468 | PORT_MODIFY("IN-3") | |
| 44469 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44470 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44471 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44472 | PORT_MODIFY("IN-4") | |
| 44473 | // 0x0001 - "hop2lo" // unexpected here | |
| 44474 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 44475 | PORT_MODIFY("IN-5") | |
| 44476 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44477 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44478 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44479 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44480 | PORT_MODIFY("IN-8") | |
| 44481 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudges") | |
| 44482 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shots") | |
| 44483 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 44484 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spr mt") | |
| 44485 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("bell") | |
| 44486 | PORT_MODIFY("IN-16") | |
| 44487 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44488 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44489 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44490 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44491 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44492 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44493 | PORT_MODIFY("IN-17") | |
| 44494 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44495 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44496 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44497 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44498 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44499 | PORT_MODIFY("IN-18") | |
| 44500 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44501 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44502 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44503 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 44504 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 44505 | PORT_MODIFY("IN-19") | |
| 44506 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 44507 | PORT_MODIFY("IN-20") | |
| 44508 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44509 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44510 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44511 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44512 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44513 | 44513 | INPUT_PORTS_END |
| 44514 | 44514 | |
| 44515 | 44515 | // PR1620 CLUB CRAZY FRUITS GOLD PR1620 CRAZY SOUNDS11 CRAZY FRUITS CLUB |
| r31373 | r31374 | |
| 44536 | 44536 | } |
| 44537 | 44537 | |
| 44538 | 44538 | INPUT_PORTS_START( sc4derby ) // this structure is generated |
| 44539 | PORT_INCLUDE( sc4_base ) | |
| 44540 | PORT_MODIFY("IN-1") | |
| 44541 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44542 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44543 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44544 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44545 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 44546 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 44547 | PORT_MODIFY("IN-2") | |
| 44548 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44549 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44550 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44551 | PORT_MODIFY("IN-3") | |
| 44552 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44553 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44554 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44555 | PORT_MODIFY("IN-5") | |
| 44556 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44557 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44558 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44559 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44560 | PORT_MODIFY("IN-6") | |
| 44561 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44562 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44563 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44564 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44565 | PORT_MODIFY("IN-8") | |
| 44566 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk prz") | |
| 44567 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 44568 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mat") | |
| 44569 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fea") | |
| 44570 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 44571 | PORT_MODIFY("IN-16") | |
| 44572 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44573 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44574 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44575 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44576 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44577 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44578 | PORT_MODIFY("IN-17") | |
| 44579 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44580 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44581 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44582 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44583 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44584 | PORT_MODIFY("IN-18") | |
| 44585 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44586 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44587 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44588 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44589 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44590 | PORT_MODIFY("IN-19") | |
| 44591 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44592 | PORT_MODIFY("IN-20") | |
| 44593 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44594 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44595 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44596 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44597 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44539 | PORT_INCLUDE( sc4_base ) | |
| 44540 | PORT_MODIFY("IN-1") | |
| 44541 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44542 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 44543 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 44544 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 44545 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 44546 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 44547 | PORT_MODIFY("IN-2") | |
| 44548 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44549 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44550 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44551 | PORT_MODIFY("IN-3") | |
| 44552 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44553 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44554 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44555 | PORT_MODIFY("IN-5") | |
| 44556 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44557 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44558 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44559 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44560 | PORT_MODIFY("IN-6") | |
| 44561 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44562 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44563 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44564 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44565 | PORT_MODIFY("IN-8") | |
| 44566 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk prz") | |
| 44567 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 44568 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk mat") | |
| 44569 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fea") | |
| 44570 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 44571 | PORT_MODIFY("IN-16") | |
| 44572 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44573 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44574 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44575 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44576 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44577 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44578 | PORT_MODIFY("IN-17") | |
| 44579 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44580 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44581 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44582 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44583 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44584 | PORT_MODIFY("IN-18") | |
| 44585 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44586 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44587 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44588 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44589 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44590 | PORT_MODIFY("IN-19") | |
| 44591 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44592 | PORT_MODIFY("IN-20") | |
| 44593 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44594 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44595 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44596 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44597 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44598 | 44598 | INPUT_PORTS_END |
| 44599 | 44599 | |
| 44600 | 44600 | // PR1006 DEMOLITION DERBY PR1006 DEMDERBY SOUNDS11 |
| r31373 | r31374 | |
| 44606 | 44606 | GAMEL( 200?, sc4derbye ,sc4derby, sc4, sc4derby, sc4_state, sc4derby, ROT0, "BFM","Demolition Derby (Bellfruit) (Scorpion 4) (set 6)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 44607 | 44607 | |
| 44608 | 44608 | INPUT_PORTS_START( sc4dbldm ) // this structure is generated |
| 44609 | PORT_INCLUDE( sc4_base ) | |
| 44610 | PORT_MODIFY("IN-1") | |
| 44611 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44612 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("btn 2") | |
| 44613 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("btn 3") | |
| 44614 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("btn 4") | |
| 44615 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("btn 5") | |
| 44616 | PORT_MODIFY("IN-2") | |
| 44617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("max") | |
| 44618 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44619 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44620 | PORT_MODIFY("IN-8") | |
| 44621 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bet2") | |
| 44622 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("bet1") | |
| 44623 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bet3") | |
| 44624 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("bet5") | |
| 44625 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("bet4") | |
| 44626 | PORT_MODIFY("IN-9") | |
| 44627 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("bet6") | |
| 44628 | PORT_MODIFY("IN-16") | |
| 44629 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44630 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44631 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44632 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44633 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44634 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 44635 | PORT_MODIFY("IN-17") | |
| 44636 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44637 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44638 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44639 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44640 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44641 | PORT_MODIFY("IN-18") | |
| 44642 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44643 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44644 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44645 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44646 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44647 | PORT_MODIFY("IN-19") | |
| 44648 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 44649 | PORT_MODIFY("IN-20") | |
| 44650 | // 0x0001 - "test" // standard input (motherboard) | |
| 44651 | // 0x0002 - "lock" // standard input (expected here) | |
| 44652 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44653 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44654 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44609 | PORT_INCLUDE( sc4_base ) | |
| 44610 | PORT_MODIFY("IN-1") | |
| 44611 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44612 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("btn 2") | |
| 44613 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("btn 3") | |
| 44614 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("btn 4") | |
| 44615 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("btn 5") | |
| 44616 | PORT_MODIFY("IN-2") | |
| 44617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("max") | |
| 44618 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44619 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44620 | PORT_MODIFY("IN-8") | |
| 44621 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bet2") | |
| 44622 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("bet1") | |
| 44623 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bet3") | |
| 44624 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("bet5") | |
| 44625 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("bet4") | |
| 44626 | PORT_MODIFY("IN-9") | |
| 44627 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("bet6") | |
| 44628 | PORT_MODIFY("IN-16") | |
| 44629 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44630 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44631 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44632 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44633 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44634 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 44635 | PORT_MODIFY("IN-17") | |
| 44636 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44637 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44638 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44639 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44640 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44641 | PORT_MODIFY("IN-18") | |
| 44642 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44643 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44644 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44645 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44646 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44647 | PORT_MODIFY("IN-19") | |
| 44648 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 44649 | PORT_MODIFY("IN-20") | |
| 44650 | // 0x0001 - "test" // standard input (motherboard) | |
| 44651 | // 0x0002 - "lock" // standard input (expected here) | |
| 44652 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44653 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44654 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44655 | 44655 | INPUT_PORTS_END |
| 44656 | 44656 | |
| 44657 | 44657 | // PR2558 DOUBLE DIAMOND 011 DOUBLEDIAMONDSND DOUBLE DIAMOND |
| 44658 | 44658 | GAMEL( 200?, sc4dbldm ,0, sc4, sc4dbldm, sc4_state, sc4, ROT0, "Qps","Double Diamond (Qps) (Scorpion 4)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 44659 | 44659 | |
| 44660 | 44660 | INPUT_PORTS_START( sc4dyna ) // this structure is generated |
| 44661 | PORT_INCLUDE( sc4_base ) | |
| 44662 | PORT_MODIFY("IN-1") | |
| 44663 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44664 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44665 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44666 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44667 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 44668 | PORT_MODIFY("IN-2") | |
| 44669 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44671 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44672 | PORT_MODIFY("IN-8") | |
| 44673 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 44674 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 44675 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 44676 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk skl") | |
| 44677 | PORT_MODIFY("IN-16") | |
| 44678 | // 0x0001 - "dils 1" // standard input (motherboard) | |
| 44679 | // 0x0002 - "dils 2" // standard input (motherboard) | |
| 44680 | // 0x0004 - "dils 3" // standard input (motherboard) | |
| 44681 | // 0x0008 - "dils 4" // standard input (motherboard) | |
| 44682 | // 0x0010 - "dils 5" // standard input (motherboard) | |
| 44683 | PORT_MODIFY("IN-17") | |
| 44684 | // 0x0001 - "dils 6" // standard input (motherboard) | |
| 44685 | // 0x0002 - "dils 7" // standard input (motherboard) | |
| 44686 | // 0x0004 - "dils 8" // standard input (motherboard) | |
| 44687 | // 0x0008 - "dils 9" // standard input (motherboard) | |
| 44688 | // 0x0010 - "dils10" // standard input (motherboard) | |
| 44689 | PORT_MODIFY("IN-18") | |
| 44690 | // 0x0001 - "dils11" // standard input (motherboard) | |
| 44691 | // 0x0002 - "dils12" // standard input (motherboard) | |
| 44692 | // 0x0004 - "dils13" // standard input (motherboard) | |
| 44693 | // 0x0008 - "dils14" // standard input (motherboard) | |
| 44694 | // 0x0010 - "dils15" // standard input (motherboard) | |
| 44695 | PORT_MODIFY("IN-19") | |
| 44696 | // 0x0001 - "dils16" // standard input (motherboard) | |
| 44697 | PORT_MODIFY("IN-20") | |
| 44698 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44699 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44700 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44701 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44661 | PORT_INCLUDE( sc4_base ) | |
| 44662 | PORT_MODIFY("IN-1") | |
| 44663 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44664 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44665 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44666 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44667 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 44668 | PORT_MODIFY("IN-2") | |
| 44669 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44671 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44672 | PORT_MODIFY("IN-8") | |
| 44673 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 44674 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk bon") | |
| 44675 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("blast") | |
| 44676 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk skl") | |
| 44677 | PORT_MODIFY("IN-16") | |
| 44678 | // 0x0001 - "dils 1" // standard input (motherboard) | |
| 44679 | // 0x0002 - "dils 2" // standard input (motherboard) | |
| 44680 | // 0x0004 - "dils 3" // standard input (motherboard) | |
| 44681 | // 0x0008 - "dils 4" // standard input (motherboard) | |
| 44682 | // 0x0010 - "dils 5" // standard input (motherboard) | |
| 44683 | PORT_MODIFY("IN-17") | |
| 44684 | // 0x0001 - "dils 6" // standard input (motherboard) | |
| 44685 | // 0x0002 - "dils 7" // standard input (motherboard) | |
| 44686 | // 0x0004 - "dils 8" // standard input (motherboard) | |
| 44687 | // 0x0008 - "dils 9" // standard input (motherboard) | |
| 44688 | // 0x0010 - "dils10" // standard input (motherboard) | |
| 44689 | PORT_MODIFY("IN-18") | |
| 44690 | // 0x0001 - "dils11" // standard input (motherboard) | |
| 44691 | // 0x0002 - "dils12" // standard input (motherboard) | |
| 44692 | // 0x0004 - "dils13" // standard input (motherboard) | |
| 44693 | // 0x0008 - "dils14" // standard input (motherboard) | |
| 44694 | // 0x0010 - "dils15" // standard input (motherboard) | |
| 44695 | PORT_MODIFY("IN-19") | |
| 44696 | // 0x0001 - "dils16" // standard input (motherboard) | |
| 44697 | PORT_MODIFY("IN-20") | |
| 44698 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44699 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44700 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44701 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44702 | 44702 | INPUT_PORTS_END |
| 44703 | 44703 | |
| 44704 | 44704 | // PR1104 DYNAMITE PR1104 DYNAMITE SOUNDS11 |
| r31373 | r31374 | |
| 44706 | 44706 | GAMEL( 200?, sc4dynaa ,sc4dyna, sc4, sc4dyna, sc4_state, sc4, ROT0, "BFM","Dynamite (Bellfruit) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 44707 | 44707 | |
| 44708 | 44708 | INPUT_PORTS_START( sc4easy ) // this structure is generated |
| 44709 | PORT_INCLUDE( sc4_base ) | |
| 44710 | PORT_MODIFY("IN-1") | |
| 44711 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44712 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44713 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44714 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44715 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 44716 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 44717 | PORT_MODIFY("IN-2") | |
| 44718 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44719 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44720 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44721 | PORT_MODIFY("IN-3") | |
| 44722 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44723 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44724 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44725 | PORT_MODIFY("IN-4") | |
| 44726 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 44727 | PORT_MODIFY("IN-5") | |
| 44728 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44729 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44730 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44731 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44732 | PORT_MODIFY("IN-6") | |
| 44733 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44734 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44735 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44736 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44737 | PORT_MODIFY("IN-8") | |
| 44738 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 44739 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 44740 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 44741 | PORT_MODIFY("IN-16") | |
| 44742 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44743 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44744 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44745 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44746 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44747 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 44748 | PORT_MODIFY("IN-17") | |
| 44749 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44750 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44751 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44752 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44753 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44754 | PORT_MODIFY("IN-18") | |
| 44755 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44756 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44757 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44758 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44759 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44760 | PORT_MODIFY("IN-19") | |
| 44761 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 44762 | PORT_MODIFY("IN-20") | |
| 44763 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44764 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44765 | // 0x0004 - "serdor" // standard input (expected here) | |
| 44766 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 44767 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44709 | PORT_INCLUDE( sc4_base ) | |
| 44710 | PORT_MODIFY("IN-1") | |
| 44711 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44712 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44713 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44714 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44715 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 44716 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 44717 | PORT_MODIFY("IN-2") | |
| 44718 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44719 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44720 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44721 | PORT_MODIFY("IN-3") | |
| 44722 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44723 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44724 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44725 | PORT_MODIFY("IN-4") | |
| 44726 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 44727 | PORT_MODIFY("IN-5") | |
| 44728 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44729 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44730 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44731 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44732 | PORT_MODIFY("IN-6") | |
| 44733 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44734 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44735 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44736 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44737 | PORT_MODIFY("IN-8") | |
| 44738 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk csh") | |
| 44739 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("step") | |
| 44740 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("shoot") | |
| 44741 | PORT_MODIFY("IN-16") | |
| 44742 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44743 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44744 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44745 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44746 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44747 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 44748 | PORT_MODIFY("IN-17") | |
| 44749 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44750 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44751 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44752 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44753 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44754 | PORT_MODIFY("IN-18") | |
| 44755 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44756 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44757 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44758 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44759 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44760 | PORT_MODIFY("IN-19") | |
| 44761 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 44762 | PORT_MODIFY("IN-20") | |
| 44763 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44764 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44765 | // 0x0004 - "serdor" // standard input (expected here) | |
| 44766 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 44767 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44768 | 44768 | INPUT_PORTS_END |
| 44769 | 44769 | |
| 44770 | 44770 | // PR1017 EASY STREAK PR1017 EASY STREAK SOUNDS11 EASY STREAK |
| r31373 | r31374 | |
| 44777 | 44777 | GAMEL( 200?, sc4easyf ,sc4easy, sc4, sc4easy, sc4_state, sc4, ROT0, "BFM","Easy Streak (Bellfruit) (Scorpion 4) (set 11)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 44778 | 44778 | |
| 44779 | 44779 | INPUT_PORTS_START( sc4clbmn ) // this structure is generated |
| 44780 | PORT_INCLUDE( sc4_base ) | |
| 44781 | PORT_MODIFY("IN-1") | |
| 44782 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44783 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 44784 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 44785 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 44786 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 44787 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 44788 | PORT_MODIFY("IN-2") | |
| 44789 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 44790 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("takfet") | |
| 44791 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 44792 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44793 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 44794 | PORT_MODIFY("IN-3") | |
| 44795 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44796 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44797 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44798 | PORT_MODIFY("IN-4") | |
| 44799 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 44800 | PORT_MODIFY("IN-5") | |
| 44801 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44802 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44803 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44804 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44805 | PORT_MODIFY("IN-8") | |
| 44806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("sneakp") | |
| 44807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("gamfet") | |
| 44808 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("gambon") | |
| 44809 | PORT_MODIFY("IN-16") | |
| 44810 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44811 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44812 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44813 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44814 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44815 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44816 | PORT_MODIFY("IN-17") | |
| 44817 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44818 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44819 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44820 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44821 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44822 | PORT_MODIFY("IN-18") | |
| 44823 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44824 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44825 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44826 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44827 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44828 | PORT_MODIFY("IN-19") | |
| 44829 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44830 | PORT_MODIFY("IN-20") | |
| 44831 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44832 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44833 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44834 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44835 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44780 | PORT_INCLUDE( sc4_base ) | |
| 44781 | PORT_MODIFY("IN-1") | |
| 44782 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44783 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 44784 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 44785 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 44786 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 44787 | // 0x0100 - "hopfit" // known extended input, usually 'hopper fit' | |
| 44788 | PORT_MODIFY("IN-2") | |
| 44789 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 44790 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("takfet") | |
| 44791 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 44792 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44793 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 44794 | PORT_MODIFY("IN-3") | |
| 44795 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44796 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44797 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44798 | PORT_MODIFY("IN-4") | |
| 44799 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 44800 | PORT_MODIFY("IN-5") | |
| 44801 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44802 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44803 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44804 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44805 | PORT_MODIFY("IN-8") | |
| 44806 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("sneakp") | |
| 44807 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("gamfet") | |
| 44808 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("gambon") | |
| 44809 | PORT_MODIFY("IN-16") | |
| 44810 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44811 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44812 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44813 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44814 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44815 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44816 | PORT_MODIFY("IN-17") | |
| 44817 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44818 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44819 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44820 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44821 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44822 | PORT_MODIFY("IN-18") | |
| 44823 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44824 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44825 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44826 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44827 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44828 | PORT_MODIFY("IN-19") | |
| 44829 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44830 | PORT_MODIFY("IN-20") | |
| 44831 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44832 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44833 | // 0x0004 - "topdor" // standard input (expected here) | |
| 44834 | // 0x0008 - "botdor" // standard input (expected here) | |
| 44835 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44836 | 44836 | INPUT_PORTS_END |
| 44837 | 44837 | |
| 44838 | 44838 | //PROJECT NUMBER PR1955 CLUB MONEYBAGS MONEY BAGS CLUB PR1955 C M MONEYBAGS SOUNDS11 DEAL OR NO DEAL 5-10-20 10-20-30 20-30-50 30-50-100 |
| r31373 | r31374 | |
| 44859 | 44859 | } |
| 44860 | 44860 | |
| 44861 | 44861 | INPUT_PORTS_START( sc4boomb ) // this structure is generated |
| 44862 | PORT_INCLUDE( sc4_base ) | |
| 44863 | PORT_MODIFY("IN-1") | |
| 44864 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44865 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 44866 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 44867 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 44868 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 44869 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 44870 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 44871 | PORT_MODIFY("IN-2") | |
| 44872 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 44873 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 44874 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44875 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44876 | PORT_MODIFY("IN-3") | |
| 44877 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44878 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44879 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44880 | PORT_MODIFY("IN-5") | |
| 44881 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44882 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44883 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44884 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44885 | PORT_MODIFY("IN-6") | |
| 44886 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44887 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44888 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44889 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44890 | PORT_MODIFY("IN-8") | |
| 44891 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auctio") | |
| 44892 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("leave") | |
| 44893 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take") | |
| 44894 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c or b") | |
| 44895 | PORT_MODIFY("IN-16") | |
| 44896 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 44897 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 44898 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 44899 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 44900 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 44901 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44902 | PORT_MODIFY("IN-17") | |
| 44903 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 44904 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 44905 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 44906 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 44907 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44908 | PORT_MODIFY("IN-18") | |
| 44909 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44910 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44911 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44912 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44913 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44914 | PORT_MODIFY("IN-19") | |
| 44915 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44916 | PORT_MODIFY("IN-20") | |
| 44917 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44918 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44919 | // 0x0004 - "serdor" // standard input (expected here) | |
| 44920 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 44921 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44862 | PORT_INCLUDE( sc4_base ) | |
| 44863 | PORT_MODIFY("IN-1") | |
| 44864 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44865 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 44866 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 44867 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 44868 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 44869 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 44870 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 44871 | PORT_MODIFY("IN-2") | |
| 44872 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 44873 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 44874 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44875 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44876 | PORT_MODIFY("IN-3") | |
| 44877 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44878 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44879 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44880 | PORT_MODIFY("IN-5") | |
| 44881 | // 0x0001 - "priz4" // standard input (expected here) | |
| 44882 | // 0x0002 - "priz3" // standard input (expected here) | |
| 44883 | // 0x0004 - "priz2" // standard input (expected here) | |
| 44884 | // 0x0008 - "priz1" // standard input (expected here) | |
| 44885 | PORT_MODIFY("IN-6") | |
| 44886 | // 0x0001 - "perc1" // standard input (expected here) | |
| 44887 | // 0x0002 - "perc2" // standard input (expected here) | |
| 44888 | // 0x0004 - "perc3" // standard input (expected here) | |
| 44889 | // 0x0008 - "perc4" // standard input (expected here) | |
| 44890 | PORT_MODIFY("IN-8") | |
| 44891 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("auctio") | |
| 44892 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("leave") | |
| 44893 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take") | |
| 44894 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("c or b") | |
| 44895 | PORT_MODIFY("IN-16") | |
| 44896 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 44897 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 44898 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 44899 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 44900 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 44901 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 44902 | PORT_MODIFY("IN-17") | |
| 44903 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 44904 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 44905 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 44906 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 44907 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 44908 | PORT_MODIFY("IN-18") | |
| 44909 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 44910 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 44911 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 44912 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 44913 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 44914 | PORT_MODIFY("IN-19") | |
| 44915 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 44916 | PORT_MODIFY("IN-20") | |
| 44917 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 44918 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 44919 | // 0x0004 - "serdor" // standard input (expected here) | |
| 44920 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 44921 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44922 | 44922 | INPUT_PORTS_END |
| 44923 | 44923 | |
| 44924 | 44924 | //PROJECT NUMBER PR3332 AWP MONOPOLY BOOM OR BUST S4 PR3307 MPOLY BOOM OR B SOUNDS11 BOOM OR BUST S.SITE |
| r31373 | r31374 | |
| 44944 | 44944 | } |
| 44945 | 44945 | |
| 44946 | 44946 | INPUT_PORTS_START( sc4fever ) // this structure is generated |
| 44947 | PORT_INCLUDE( sc4_base ) | |
| 44948 | PORT_MODIFY("IN-1") | |
| 44949 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44950 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44951 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44952 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44953 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 44954 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 44955 | PORT_MODIFY("IN-2") | |
| 44956 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44957 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44958 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44959 | PORT_MODIFY("IN-3") | |
| 44960 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44961 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44962 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44963 | PORT_MODIFY("IN-4") | |
| 44964 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 44965 | PORT_MODIFY("IN-5") | |
| 44966 | // 0x0001 - "pzkey1" // standard input (expected here) | |
| 44967 | // 0x0002 - "pzkey2" // standard input (expected here) | |
| 44968 | // 0x0004 - "pzkey3" // standard input (expected here) | |
| 44969 | // 0x0008 - "pzkey4" // standard input (expected here) | |
| 44970 | PORT_MODIFY("IN-6") | |
| 44971 | // 0x0001 - "pckey1" // standard input (expected here) | |
| 44972 | // 0x0002 - "pckey2" // standard input (expected here) | |
| 44973 | // 0x0004 - "pckey3" // standard input (expected here) | |
| 44974 | // 0x0008 - "pckey4" // standard input (expected here) | |
| 44975 | PORT_MODIFY("IN-8") | |
| 44976 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t blts") | |
| 44977 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t feat") | |
| 44978 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("t nuds") | |
| 44979 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("t ko") | |
| 44980 | PORT_MODIFY("IN-16") | |
| 44981 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44982 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44983 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44984 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44985 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44986 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 44987 | PORT_MODIFY("IN-17") | |
| 44988 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44989 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44990 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44991 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44992 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44993 | PORT_MODIFY("IN-18") | |
| 44994 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44995 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44996 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44997 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44998 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44999 | PORT_MODIFY("IN-19") | |
| 45000 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 45001 | PORT_MODIFY("IN-20") | |
| 45002 | // 0x0001 - "green" // standard input (motherboard) | |
| 45003 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 45004 | // 0x0004 - "serdor" // standard input (expected here) | |
| 45005 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 45006 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 44947 | PORT_INCLUDE( sc4_base ) | |
| 44948 | PORT_MODIFY("IN-1") | |
| 44949 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 44950 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 44951 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 44952 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 44953 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 44954 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 44955 | PORT_MODIFY("IN-2") | |
| 44956 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 44957 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 44958 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 44959 | PORT_MODIFY("IN-3") | |
| 44960 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 44961 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 44962 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 44963 | PORT_MODIFY("IN-4") | |
| 44964 | // 0x0002 - "hoplow" // known extended(?) input, sometimes 'hop hi' | |
| 44965 | PORT_MODIFY("IN-5") | |
| 44966 | // 0x0001 - "pzkey1" // standard input (expected here) | |
| 44967 | // 0x0002 - "pzkey2" // standard input (expected here) | |
| 44968 | // 0x0004 - "pzkey3" // standard input (expected here) | |
| 44969 | // 0x0008 - "pzkey4" // standard input (expected here) | |
| 44970 | PORT_MODIFY("IN-6") | |
| 44971 | // 0x0001 - "pckey1" // standard input (expected here) | |
| 44972 | // 0x0002 - "pckey2" // standard input (expected here) | |
| 44973 | // 0x0004 - "pckey3" // standard input (expected here) | |
| 44974 | // 0x0008 - "pckey4" // standard input (expected here) | |
| 44975 | PORT_MODIFY("IN-8") | |
| 44976 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t blts") | |
| 44977 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t feat") | |
| 44978 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("t nuds") | |
| 44979 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("t ko") | |
| 44980 | PORT_MODIFY("IN-16") | |
| 44981 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 44982 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 44983 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 44984 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 44985 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 44986 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 44987 | PORT_MODIFY("IN-17") | |
| 44988 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 44989 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 44990 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 44991 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 44992 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 44993 | PORT_MODIFY("IN-18") | |
| 44994 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 44995 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 44996 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 44997 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 44998 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 44999 | PORT_MODIFY("IN-19") | |
| 45000 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 45001 | PORT_MODIFY("IN-20") | |
| 45002 | // 0x0001 - "green" // standard input (motherboard) | |
| 45003 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 45004 | // 0x0004 - "serdor" // standard input (expected here) | |
| 45005 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 45006 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 45007 | 45007 | INPUT_PORTS_END |
| 45008 | 45008 | |
| 45009 | 45009 | // we have FEVER SOUNDS12 but it accepts those? |
| r31373 | r31374 | |
| 45043 | 45043 | } |
| 45044 | 45044 | |
| 45045 | 45045 | INPUT_PORTS_START( sc4aztec ) // this structure is generated |
| 45046 | PORT_INCLUDE( sc4_base ) | |
| 45047 | PORT_MODIFY("IN-1") | |
| 45048 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45049 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45050 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45051 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45052 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45053 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 45054 | PORT_MODIFY("IN-2") | |
| 45055 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45056 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 45057 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45058 | PORT_MODIFY("IN-3") | |
| 45059 | // 0x0001 - "uitbet" // unexpected here | |
| 45060 | // 0x0002 - "n club" // unexpected here | |
| 45061 | // 0x0010 - "roep" // standard input (expected here) | |
| 45062 | PORT_MODIFY("IN-4") | |
| 45063 | // 0x0001 - "l hop" // unexpected here | |
| 45064 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45065 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45066 | PORT_MODIFY("IN-5") | |
| 45067 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45068 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45069 | PORT_MODIFY("IN-16") | |
| 45070 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45071 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45072 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45073 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45074 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45075 | PORT_MODIFY("IN-17") | |
| 45076 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45077 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45078 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45079 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45080 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45081 | PORT_MODIFY("IN-18") | |
| 45082 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45083 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45084 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45085 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45086 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45087 | PORT_MODIFY("IN-19") | |
| 45088 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45089 | PORT_MODIFY("IN-20") | |
| 45090 | // 0x0001 - "green" // standard input (motherboard) | |
| 45091 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45092 | // 0x0008 - "dump" // standard input (expected here) | |
| 45093 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45046 | PORT_INCLUDE( sc4_base ) | |
| 45047 | PORT_MODIFY("IN-1") | |
| 45048 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45049 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45050 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45051 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45052 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45053 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 45054 | PORT_MODIFY("IN-2") | |
| 45055 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45056 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 45057 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45058 | PORT_MODIFY("IN-3") | |
| 45059 | // 0x0001 - "uitbet" // unexpected here | |
| 45060 | // 0x0002 - "n club" // unexpected here | |
| 45061 | // 0x0010 - "roep" // standard input (expected here) | |
| 45062 | PORT_MODIFY("IN-4") | |
| 45063 | // 0x0001 - "l hop" // unexpected here | |
| 45064 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45065 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45066 | PORT_MODIFY("IN-5") | |
| 45067 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45068 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45069 | PORT_MODIFY("IN-16") | |
| 45070 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45071 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45072 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45073 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45074 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45075 | PORT_MODIFY("IN-17") | |
| 45076 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45077 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45078 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45079 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45080 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45081 | PORT_MODIFY("IN-18") | |
| 45082 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45083 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45084 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45085 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45086 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45087 | PORT_MODIFY("IN-19") | |
| 45088 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45089 | PORT_MODIFY("IN-20") | |
| 45090 | // 0x0001 - "green" // standard input (motherboard) | |
| 45091 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45092 | // 0x0008 - "dump" // standard input (expected here) | |
| 45093 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45094 | 45094 | INPUT_PORTS_END |
| 45095 | 45095 | |
| 45096 | 45096 | GAMEL( 200?, sc4aztec ,0, sc4, sc4aztec, sc4_state, sc4aztec, ROT0, "BFG / Eurocoin","Aztec Casino (Dutch) (Bellfruit) (Scorpion 4)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 )// PR1225 AZTEC CASINO |
| r31373 | r31374 | |
| 45114 | 45114 | } |
| 45115 | 45115 | |
| 45116 | 45116 | INPUT_PORTS_START( sc4helrd ) // this structure is generated |
| 45117 | PORT_INCLUDE( sc4_base ) | |
| 45118 | PORT_MODIFY("IN-1") | |
| 45119 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45120 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45121 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45122 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45123 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 45124 | PORT_MODIFY("IN-2") | |
| 45125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kop") | |
| 45126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("munt") | |
| 45127 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45128 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45129 | PORT_MODIFY("IN-3") | |
| 45130 | // 0x0001 - "uitbet" // unexpected here | |
| 45131 | // 0x0002 - "n club" // unexpected here | |
| 45132 | // 0x0010 - "player" // standard input (expected here) | |
| 45133 | PORT_MODIFY("IN-4") | |
| 45134 | // 0x0001 - "l hop" // unexpected here | |
| 45135 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45136 | // 0x0004 - "l hop" // unexpected here | |
| 45137 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45138 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45139 | PORT_MODIFY("IN-5") | |
| 45140 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45141 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45142 | // 0x0004 - "dump" // standard input (expected here) | |
| 45143 | PORT_MODIFY("IN-16") | |
| 45144 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45145 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45146 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45147 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45148 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45149 | PORT_MODIFY("IN-17") | |
| 45150 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45151 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45152 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45153 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45154 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45155 | PORT_MODIFY("IN-18") | |
| 45156 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45157 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45158 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45159 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45160 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45161 | PORT_MODIFY("IN-19") | |
| 45162 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45163 | PORT_MODIFY("IN-20") | |
| 45164 | // 0x0001 - "green" // standard input (motherboard) | |
| 45165 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45166 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45167 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45117 | PORT_INCLUDE( sc4_base ) | |
| 45118 | PORT_MODIFY("IN-1") | |
| 45119 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45120 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45121 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45122 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45123 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 45124 | PORT_MODIFY("IN-2") | |
| 45125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kop") | |
| 45126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("munt") | |
| 45127 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45128 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45129 | PORT_MODIFY("IN-3") | |
| 45130 | // 0x0001 - "uitbet" // unexpected here | |
| 45131 | // 0x0002 - "n club" // unexpected here | |
| 45132 | // 0x0010 - "player" // standard input (expected here) | |
| 45133 | PORT_MODIFY("IN-4") | |
| 45134 | // 0x0001 - "l hop" // unexpected here | |
| 45135 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45136 | // 0x0004 - "l hop" // unexpected here | |
| 45137 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45138 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45139 | PORT_MODIFY("IN-5") | |
| 45140 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45141 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45142 | // 0x0004 - "dump" // standard input (expected here) | |
| 45143 | PORT_MODIFY("IN-16") | |
| 45144 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45145 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45146 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45147 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45148 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45149 | PORT_MODIFY("IN-17") | |
| 45150 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45151 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45152 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45153 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45154 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45155 | PORT_MODIFY("IN-18") | |
| 45156 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45157 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45158 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45159 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45160 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45161 | PORT_MODIFY("IN-19") | |
| 45162 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45163 | PORT_MODIFY("IN-20") | |
| 45164 | // 0x0001 - "green" // standard input (motherboard) | |
| 45165 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45166 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45167 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45168 | 45168 | INPUT_PORTS_END |
| 45169 | 45169 | |
| 45170 | 45170 | // PR1254 HELLRAISER ART12 95004326 HELLRAISER PR1254 |
| r31373 | r31374 | |
| 45189 | 45189 | } |
| 45190 | 45190 | |
| 45191 | 45191 | INPUT_PORTS_START( sc4heatw ) // this structure is generated |
| 45192 | PORT_INCLUDE( sc4_base ) | |
| 45193 | PORT_MODIFY("IN-1") | |
| 45194 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45195 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45196 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45197 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45198 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45199 | PORT_MODIFY("IN-2") | |
| 45200 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45201 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45202 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45203 | PORT_MODIFY("IN-3") | |
| 45204 | // 0x0001 - "uitbet" // unexpected here | |
| 45205 | // 0x0002 - "n club" // unexpected here | |
| 45206 | // 0x0010 - "player" // standard input (expected here) | |
| 45207 | PORT_MODIFY("IN-4") | |
| 45208 | // 0x0001 - "l hop" // unexpected here | |
| 45209 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45210 | // 0x0004 - "l hop" // unexpected here | |
| 45211 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45212 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45213 | PORT_MODIFY("IN-5") | |
| 45214 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45215 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45216 | // 0x0004 - "dump" // standard input (expected here) | |
| 45217 | PORT_MODIFY("IN-16") | |
| 45218 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45219 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45220 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45221 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45222 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45223 | PORT_MODIFY("IN-17") | |
| 45224 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45225 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45226 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45227 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45228 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45229 | PORT_MODIFY("IN-18") | |
| 45230 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45231 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45232 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45233 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45234 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45235 | PORT_MODIFY("IN-19") | |
| 45236 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45237 | PORT_MODIFY("IN-20") | |
| 45238 | // 0x0001 - "green" // standard input (motherboard) | |
| 45239 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45240 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45241 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45192 | PORT_INCLUDE( sc4_base ) | |
| 45193 | PORT_MODIFY("IN-1") | |
| 45194 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45195 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45196 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45197 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45198 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45199 | PORT_MODIFY("IN-2") | |
| 45200 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45201 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45202 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45203 | PORT_MODIFY("IN-3") | |
| 45204 | // 0x0001 - "uitbet" // unexpected here | |
| 45205 | // 0x0002 - "n club" // unexpected here | |
| 45206 | // 0x0010 - "player" // standard input (expected here) | |
| 45207 | PORT_MODIFY("IN-4") | |
| 45208 | // 0x0001 - "l hop" // unexpected here | |
| 45209 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45210 | // 0x0004 - "l hop" // unexpected here | |
| 45211 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45212 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45213 | PORT_MODIFY("IN-5") | |
| 45214 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45215 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45216 | // 0x0004 - "dump" // standard input (expected here) | |
| 45217 | PORT_MODIFY("IN-16") | |
| 45218 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45219 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45220 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45221 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45222 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45223 | PORT_MODIFY("IN-17") | |
| 45224 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45225 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45226 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45227 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45228 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45229 | PORT_MODIFY("IN-18") | |
| 45230 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45231 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45232 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45233 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45234 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45235 | PORT_MODIFY("IN-19") | |
| 45236 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45237 | PORT_MODIFY("IN-20") | |
| 45238 | // 0x0001 - "green" // standard input (motherboard) | |
| 45239 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45240 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45241 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45242 | 45242 | INPUT_PORTS_END |
| 45243 | 45243 | |
| 45244 | 45244 | // PR1216 HEATWAVE ART 12 95004287 HEATWAVE PR1156 |
| r31373 | r31374 | |
| 45262 | 45262 | } |
| 45263 | 45263 | |
| 45264 | 45264 | INPUT_PORTS_START( sc4colos ) // this structure is generated |
| 45265 | PORT_INCLUDE( sc4_base ) | |
| 45266 | PORT_MODIFY("IN-1") | |
| 45267 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45268 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45269 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45270 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45271 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies m") | |
| 45272 | PORT_MODIFY("IN-2") | |
| 45273 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies b") | |
| 45274 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies c") | |
| 45275 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45276 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45277 | PORT_MODIFY("IN-3") | |
| 45278 | // 0x0001 - "uitbet" // unexpected here | |
| 45279 | // 0x0002 - "neem m" // unexpected here | |
| 45280 | // 0x0004 - "neem w" // standard input (expected here) | |
| 45281 | // 0x0010 - "roep" // standard input (expected here) | |
| 45282 | PORT_MODIFY("IN-4") | |
| 45283 | // 0x0001 - "l hop" // unexpected here | |
| 45284 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45285 | // 0x0004 - "l hop" // unexpected here | |
| 45286 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45287 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45288 | PORT_MODIFY("IN-5") | |
| 45289 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45290 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45291 | // 0x0004 - "dump" // standard input (expected here) | |
| 45292 | PORT_MODIFY("IN-16") | |
| 45293 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45294 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45295 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45296 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45297 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45298 | PORT_MODIFY("IN-17") | |
| 45299 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45300 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45301 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45302 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45303 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45304 | PORT_MODIFY("IN-18") | |
| 45305 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45306 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45307 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45308 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45309 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45310 | PORT_MODIFY("IN-19") | |
| 45311 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45312 | PORT_MODIFY("IN-20") | |
| 45313 | // 0x0001 - "green" // standard input (motherboard) | |
| 45314 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45315 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45316 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45265 | PORT_INCLUDE( sc4_base ) | |
| 45266 | PORT_MODIFY("IN-1") | |
| 45267 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45268 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45269 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45270 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45271 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies m") | |
| 45272 | PORT_MODIFY("IN-2") | |
| 45273 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies b") | |
| 45274 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies c") | |
| 45275 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45276 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45277 | PORT_MODIFY("IN-3") | |
| 45278 | // 0x0001 - "uitbet" // unexpected here | |
| 45279 | // 0x0002 - "neem m" // unexpected here | |
| 45280 | // 0x0004 - "neem w" // standard input (expected here) | |
| 45281 | // 0x0010 - "roep" // standard input (expected here) | |
| 45282 | PORT_MODIFY("IN-4") | |
| 45283 | // 0x0001 - "l hop" // unexpected here | |
| 45284 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45285 | // 0x0004 - "l hop" // unexpected here | |
| 45286 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45287 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45288 | PORT_MODIFY("IN-5") | |
| 45289 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45290 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45291 | // 0x0004 - "dump" // standard input (expected here) | |
| 45292 | PORT_MODIFY("IN-16") | |
| 45293 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45294 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45295 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45296 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45297 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45298 | PORT_MODIFY("IN-17") | |
| 45299 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45300 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45301 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45302 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45303 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45304 | PORT_MODIFY("IN-18") | |
| 45305 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45306 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45307 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45308 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45309 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45310 | PORT_MODIFY("IN-19") | |
| 45311 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45312 | PORT_MODIFY("IN-20") | |
| 45313 | // 0x0001 - "green" // standard input (motherboard) | |
| 45314 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45315 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45316 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45317 | 45317 | INPUT_PORTS_END |
| 45318 | 45318 | |
| 45319 | 45319 | // PR1208 COLOSSUS 95004235 COLOSSUS PR7155 COLOSSUS |
| r31373 | r31374 | |
| 45336 | 45336 | } |
| 45337 | 45337 | |
| 45338 | 45338 | INPUT_PORTS_START( sc4fevdt ) // this structure is generated |
| 45339 | PORT_INCLUDE( sc4_base ) | |
| 45340 | PORT_MODIFY("IN-1") | |
| 45341 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45342 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45343 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45344 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45345 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 45346 | PORT_MODIFY("IN-2") | |
| 45347 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 45348 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45349 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45350 | PORT_MODIFY("IN-3") | |
| 45351 | // 0x0001 - "uitbet" // unexpected here | |
| 45352 | // 0x0002 - "n hoog" // unexpected here | |
| 45353 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45354 | PORT_MODIFY("IN-4") | |
| 45355 | // 0x0001 - "l hop" // unexpected here | |
| 45356 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45357 | // 0x0004 - "l hop" // unexpected here | |
| 45358 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45359 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45360 | PORT_MODIFY("IN-5") | |
| 45361 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45362 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45363 | // 0x0004 - "dump" // standard input (expected here) | |
| 45364 | PORT_MODIFY("IN-16") | |
| 45365 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45366 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45367 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45368 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45369 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45370 | PORT_MODIFY("IN-17") | |
| 45371 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45372 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45373 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45374 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45375 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45376 | PORT_MODIFY("IN-18") | |
| 45377 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45378 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45379 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45380 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45381 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45382 | PORT_MODIFY("IN-19") | |
| 45383 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45384 | PORT_MODIFY("IN-20") | |
| 45385 | // 0x0001 - "green" // standard input (motherboard) | |
| 45386 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45387 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45388 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45339 | PORT_INCLUDE( sc4_base ) | |
| 45340 | PORT_MODIFY("IN-1") | |
| 45341 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45342 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45343 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45344 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45345 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 45346 | PORT_MODIFY("IN-2") | |
| 45347 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 45348 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45349 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45350 | PORT_MODIFY("IN-3") | |
| 45351 | // 0x0001 - "uitbet" // unexpected here | |
| 45352 | // 0x0002 - "n hoog" // unexpected here | |
| 45353 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45354 | PORT_MODIFY("IN-4") | |
| 45355 | // 0x0001 - "l hop" // unexpected here | |
| 45356 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45357 | // 0x0004 - "l hop" // unexpected here | |
| 45358 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45359 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45360 | PORT_MODIFY("IN-5") | |
| 45361 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45362 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45363 | // 0x0004 - "dump" // standard input (expected here) | |
| 45364 | PORT_MODIFY("IN-16") | |
| 45365 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45366 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45367 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45368 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45369 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45370 | PORT_MODIFY("IN-17") | |
| 45371 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45372 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45373 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45374 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45375 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45376 | PORT_MODIFY("IN-18") | |
| 45377 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45378 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45379 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45380 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45381 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45382 | PORT_MODIFY("IN-19") | |
| 45383 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45384 | PORT_MODIFY("IN-20") | |
| 45385 | // 0x0001 - "green" // standard input (motherboard) | |
| 45386 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45387 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45388 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45389 | 45389 | INPUT_PORTS_END |
| 45390 | 45390 | |
| 45391 | 45391 | // PR1202 FEVER 95004239 FEVER PR7157 |
| r31373 | r31374 | |
| 45410 | 45410 | } |
| 45411 | 45411 | |
| 45412 | 45412 | INPUT_PORTS_START( sc4fevnx ) // this structure is generated |
| 45413 | PORT_INCLUDE( sc4_base ) | |
| 45414 | PORT_MODIFY("IN-1") | |
| 45415 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45416 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45417 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45418 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45419 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45420 | PORT_MODIFY("IN-2") | |
| 45421 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k spel") | |
| 45422 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("key/go") | |
| 45423 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45424 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45425 | PORT_MODIFY("IN-3") | |
| 45426 | // 0x0001 - "uitbet" // unexpected here | |
| 45427 | // 0x0002 - "n club" // unexpected here | |
| 45428 | // 0x0010 - "player" // standard input (expected here) | |
| 45429 | PORT_MODIFY("IN-4") | |
| 45430 | // 0x0001 - "l hop" // unexpected here | |
| 45431 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45432 | // 0x0004 - "l hop" // unexpected here | |
| 45433 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45434 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45435 | PORT_MODIFY("IN-5") | |
| 45436 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45437 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45438 | // 0x0004 - "dump" // standard input (expected here) | |
| 45439 | PORT_MODIFY("IN-16") | |
| 45440 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45441 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45442 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45443 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45444 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45445 | PORT_MODIFY("IN-17") | |
| 45446 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45447 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45448 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45449 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45450 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45451 | PORT_MODIFY("IN-18") | |
| 45452 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45453 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45454 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45455 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45456 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45457 | PORT_MODIFY("IN-19") | |
| 45458 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45459 | PORT_MODIFY("IN-20") | |
| 45460 | // 0x0001 - "green" // standard input (motherboard) | |
| 45461 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45462 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45463 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45413 | PORT_INCLUDE( sc4_base ) | |
| 45414 | PORT_MODIFY("IN-1") | |
| 45415 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45416 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45417 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45418 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45419 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45420 | PORT_MODIFY("IN-2") | |
| 45421 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k spel") | |
| 45422 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("key/go") | |
| 45423 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45424 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45425 | PORT_MODIFY("IN-3") | |
| 45426 | // 0x0001 - "uitbet" // unexpected here | |
| 45427 | // 0x0002 - "n club" // unexpected here | |
| 45428 | // 0x0010 - "player" // standard input (expected here) | |
| 45429 | PORT_MODIFY("IN-4") | |
| 45430 | // 0x0001 - "l hop" // unexpected here | |
| 45431 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45432 | // 0x0004 - "l hop" // unexpected here | |
| 45433 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45434 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45435 | PORT_MODIFY("IN-5") | |
| 45436 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45437 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45438 | // 0x0004 - "dump" // standard input (expected here) | |
| 45439 | PORT_MODIFY("IN-16") | |
| 45440 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45441 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45442 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45443 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45444 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45445 | PORT_MODIFY("IN-17") | |
| 45446 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45447 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45448 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45449 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45450 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45451 | PORT_MODIFY("IN-18") | |
| 45452 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45453 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45454 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45455 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45456 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45457 | PORT_MODIFY("IN-19") | |
| 45458 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45459 | PORT_MODIFY("IN-20") | |
| 45460 | // 0x0001 - "green" // standard input (motherboard) | |
| 45461 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45462 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45463 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45464 | 45464 | INPUT_PORTS_END |
| 45465 | 45465 | |
| 45466 | 45466 | // PR1216 FEVER ART12 95004318 FEVER T N PR1251 |
| r31373 | r31374 | |
| 45484 | 45484 | } |
| 45485 | 45485 | |
| 45486 | 45486 | INPUT_PORTS_START( sc4gamcs ) // this structure is generated |
| 45487 | PORT_INCLUDE( sc4_base ) | |
| 45488 | PORT_MODIFY("IN-1") | |
| 45489 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45490 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45491 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45492 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45493 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45494 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 45495 | PORT_MODIFY("IN-2") | |
| 45496 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45497 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 45498 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45499 | PORT_MODIFY("IN-3") | |
| 45500 | // 0x0001 - "uitbet" // unexpected here | |
| 45501 | // 0x0002 - "n club" // unexpected here | |
| 45502 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45503 | // 0x0010 - "roep" // standard input (expected here) | |
| 45504 | PORT_MODIFY("IN-4") | |
| 45505 | // 0x0001 - "l hop" // unexpected here | |
| 45506 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45507 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45508 | PORT_MODIFY("IN-16") | |
| 45509 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45510 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45511 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45512 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45513 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45514 | PORT_MODIFY("IN-17") | |
| 45515 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45516 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45517 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45518 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45519 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45520 | PORT_MODIFY("IN-18") | |
| 45521 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45522 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45523 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45524 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45525 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45526 | PORT_MODIFY("IN-19") | |
| 45527 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45528 | PORT_MODIFY("IN-20") | |
| 45529 | // 0x0001 - "green" // standard input (motherboard) | |
| 45530 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45531 | // 0x0008 - "dump" // standard input (expected here) | |
| 45532 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45487 | PORT_INCLUDE( sc4_base ) | |
| 45488 | PORT_MODIFY("IN-1") | |
| 45489 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45490 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45491 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45492 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45493 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45494 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 45495 | PORT_MODIFY("IN-2") | |
| 45496 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45497 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 45498 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45499 | PORT_MODIFY("IN-3") | |
| 45500 | // 0x0001 - "uitbet" // unexpected here | |
| 45501 | // 0x0002 - "n club" // unexpected here | |
| 45502 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45503 | // 0x0010 - "roep" // standard input (expected here) | |
| 45504 | PORT_MODIFY("IN-4") | |
| 45505 | // 0x0001 - "l hop" // unexpected here | |
| 45506 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45507 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45508 | PORT_MODIFY("IN-16") | |
| 45509 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45510 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45511 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45512 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45513 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45514 | PORT_MODIFY("IN-17") | |
| 45515 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45516 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45517 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45518 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45519 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45520 | PORT_MODIFY("IN-18") | |
| 45521 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45522 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45523 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45524 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45525 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45526 | PORT_MODIFY("IN-19") | |
| 45527 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45528 | PORT_MODIFY("IN-20") | |
| 45529 | // 0x0001 - "green" // standard input (motherboard) | |
| 45530 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45531 | // 0x0008 - "dump" // standard input (expected here) | |
| 45532 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45533 | 45533 | INPUT_PORTS_END |
| 45534 | 45534 | |
| 45535 | 45535 | INPUT_PORTS_START( sc4game ) // this structure is generated |
| 45536 | PORT_INCLUDE( sc4_base ) | |
| 45537 | PORT_MODIFY("IN-1") | |
| 45538 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45539 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45540 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45541 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45542 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45543 | PORT_MODIFY("IN-2") | |
| 45544 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45545 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45546 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45547 | PORT_MODIFY("IN-3") | |
| 45548 | // 0x0001 - "uitbet" // unexpected here | |
| 45549 | // 0x0002 - "neem c" // unexpected here | |
| 45550 | // 0x0004 - "neem w" // standard input (expected here) | |
| 45551 | // 0x0010 - "info/l" // standard input (expected here) | |
| 45552 | PORT_MODIFY("IN-4") | |
| 45553 | // 0x0001 - "l hop" // unexpected here | |
| 45554 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45555 | // 0x0004 - "l hop" // unexpected here | |
| 45556 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45557 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45558 | PORT_MODIFY("IN-5") | |
| 45559 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45560 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45561 | // 0x0004 - "dump" // standard input (expected here) | |
| 45562 | PORT_MODIFY("IN-16") | |
| 45563 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45564 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45565 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45566 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45567 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45568 | PORT_MODIFY("IN-17") | |
| 45569 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45570 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45571 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45572 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45573 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45574 | PORT_MODIFY("IN-18") | |
| 45575 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45576 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45577 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45578 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45579 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45580 | PORT_MODIFY("IN-19") | |
| 45581 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45582 | PORT_MODIFY("IN-20") | |
| 45583 | // 0x0001 - "green" // standard input (motherboard) | |
| 45584 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45585 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45586 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45536 | PORT_INCLUDE( sc4_base ) | |
| 45537 | PORT_MODIFY("IN-1") | |
| 45538 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45539 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45540 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45541 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45542 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45543 | PORT_MODIFY("IN-2") | |
| 45544 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45545 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45546 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45547 | PORT_MODIFY("IN-3") | |
| 45548 | // 0x0001 - "uitbet" // unexpected here | |
| 45549 | // 0x0002 - "neem c" // unexpected here | |
| 45550 | // 0x0004 - "neem w" // standard input (expected here) | |
| 45551 | // 0x0010 - "info/l" // standard input (expected here) | |
| 45552 | PORT_MODIFY("IN-4") | |
| 45553 | // 0x0001 - "l hop" // unexpected here | |
| 45554 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45555 | // 0x0004 - "l hop" // unexpected here | |
| 45556 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45557 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45558 | PORT_MODIFY("IN-5") | |
| 45559 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45560 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45561 | // 0x0004 - "dump" // standard input (expected here) | |
| 45562 | PORT_MODIFY("IN-16") | |
| 45563 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45564 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45565 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45566 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45567 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45568 | PORT_MODIFY("IN-17") | |
| 45569 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45570 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45571 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45572 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45573 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45574 | PORT_MODIFY("IN-18") | |
| 45575 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45576 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45577 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45578 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45579 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45580 | PORT_MODIFY("IN-19") | |
| 45581 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45582 | PORT_MODIFY("IN-20") | |
| 45583 | // 0x0001 - "green" // standard input (motherboard) | |
| 45584 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45585 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45586 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45587 | 45587 | INPUT_PORTS_END |
| 45588 | 45588 | |
| 45589 | 45589 | GAMEL( 200?, sc4gamcs ,0, sc4, sc4gamcs, sc4_state, sc4game, ROT0, "BFM","The Game Casino (Dutch) (Bellfruit) (Scorpion 4)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) // PR1224 THE GAME CASINO 95004285 THEGAME PR1153 |
| r31373 | r31374 | |
| 45606 | 45606 | } |
| 45607 | 45607 | |
| 45608 | 45608 | INPUT_PORTS_START( sc4goud ) // this structure is generated |
| 45609 | PORT_INCLUDE( sc4_base ) | |
| 45610 | PORT_MODIFY("IN-1") | |
| 45611 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 45612 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 45613 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 45614 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 45615 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herste") | |
| 45616 | PORT_MODIFY("IN-2") | |
| 45617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("neem p") | |
| 45618 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop OR wissel") | |
| 45619 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45620 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45621 | PORT_MODIFY("IN-4") | |
| 45622 | // 0x0001 - "l hop" // unexpected here | |
| 45623 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45624 | // 0x0004 - "l hop" // unexpected here | |
| 45625 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45626 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45627 | PORT_MODIFY("IN-5") | |
| 45628 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45629 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45630 | // 0x0004 - "dump" // standard input (expected here) | |
| 45631 | PORT_MODIFY("IN-8") | |
| 45632 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("uitbet") | |
| 45633 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("player") | |
| 45634 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi lef") | |
| 45635 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi mid") | |
| 45636 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi rig") | |
| 45637 | PORT_MODIFY("IN-9") | |
| 45638 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("neem g") | |
| 45639 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo lef") | |
| 45640 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("lo mid") | |
| 45641 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("lo rig") | |
| 45642 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("neem s") | |
| 45643 | PORT_MODIFY("IN-16") | |
| 45644 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45645 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45646 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45647 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45648 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45649 | PORT_MODIFY("IN-17") | |
| 45650 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45651 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45652 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45653 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45654 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45655 | PORT_MODIFY("IN-18") | |
| 45656 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45657 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45658 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45659 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45660 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45661 | PORT_MODIFY("IN-19") | |
| 45662 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45663 | PORT_MODIFY("IN-20") | |
| 45664 | // 0x0001 - "green" // standard input (motherboard) | |
| 45665 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45666 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45667 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45609 | PORT_INCLUDE( sc4_base ) | |
| 45610 | PORT_MODIFY("IN-1") | |
| 45611 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 45612 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 45613 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 45614 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 45615 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herste") | |
| 45616 | PORT_MODIFY("IN-2") | |
| 45617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("neem p") | |
| 45618 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("stop OR wissel") | |
| 45619 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45620 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45621 | PORT_MODIFY("IN-4") | |
| 45622 | // 0x0001 - "l hop" // unexpected here | |
| 45623 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45624 | // 0x0004 - "l hop" // unexpected here | |
| 45625 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45626 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45627 | PORT_MODIFY("IN-5") | |
| 45628 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45629 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45630 | // 0x0004 - "dump" // standard input (expected here) | |
| 45631 | PORT_MODIFY("IN-8") | |
| 45632 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("uitbet") | |
| 45633 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("player") | |
| 45634 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("hi lef") | |
| 45635 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi mid") | |
| 45636 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi rig") | |
| 45637 | PORT_MODIFY("IN-9") | |
| 45638 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("neem g") | |
| 45639 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("lo lef") | |
| 45640 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("lo mid") | |
| 45641 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("lo rig") | |
| 45642 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_4 ) PORT_NAME("neem s") | |
| 45643 | PORT_MODIFY("IN-16") | |
| 45644 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45645 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45646 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45647 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45648 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45649 | PORT_MODIFY("IN-17") | |
| 45650 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45651 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45652 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45653 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45654 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45655 | PORT_MODIFY("IN-18") | |
| 45656 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45657 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45658 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45659 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45660 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45661 | PORT_MODIFY("IN-19") | |
| 45662 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45663 | PORT_MODIFY("IN-20") | |
| 45664 | // 0x0001 - "green" // standard input (motherboard) | |
| 45665 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45666 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45667 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45668 | 45668 | INPUT_PORTS_END |
| 45669 | 45669 | |
| 45670 | 45670 | |
| r31373 | r31374 | |
| 45689 | 45689 | } |
| 45690 | 45690 | |
| 45691 | 45691 | INPUT_PORTS_START( sc4lasv ) // this structure is generated |
| 45692 | PORT_INCLUDE( sc4_base ) | |
| 45693 | PORT_MODIFY("IN-1") | |
| 45694 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45695 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45696 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45697 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45698 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45699 | PORT_MODIFY("IN-2") | |
| 45700 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k spel") | |
| 45701 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45702 | PORT_MODIFY("IN-3") | |
| 45703 | // 0x0001 - "uitbet" // unexpected here | |
| 45704 | // 0x0002 - "n hoog" // unexpected here | |
| 45705 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45706 | // 0x0008 - "vegas" // standard input (expected here) | |
| 45707 | // 0x0010 - "call a" // standard input (expected here) | |
| 45708 | PORT_MODIFY("IN-5") | |
| 45709 | // 0x0004 - "black" // standard input (expected here) | |
| 45710 | PORT_MODIFY("IN-16") | |
| 45711 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45712 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45713 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45714 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45715 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45716 | PORT_MODIFY("IN-17") | |
| 45717 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45718 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45719 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45720 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45721 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45722 | PORT_MODIFY("IN-18") | |
| 45723 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45724 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45725 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45726 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45727 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45728 | PORT_MODIFY("IN-19") | |
| 45729 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45730 | PORT_MODIFY("IN-20") | |
| 45731 | // 0x0001 - "green" // standard input (motherboard) | |
| 45732 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45692 | PORT_INCLUDE( sc4_base ) | |
| 45693 | PORT_MODIFY("IN-1") | |
| 45694 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45695 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45696 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45697 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45698 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45699 | PORT_MODIFY("IN-2") | |
| 45700 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k spel") | |
| 45701 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45702 | PORT_MODIFY("IN-3") | |
| 45703 | // 0x0001 - "uitbet" // unexpected here | |
| 45704 | // 0x0002 - "n hoog" // unexpected here | |
| 45705 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45706 | // 0x0008 - "vegas" // standard input (expected here) | |
| 45707 | // 0x0010 - "call a" // standard input (expected here) | |
| 45708 | PORT_MODIFY("IN-5") | |
| 45709 | // 0x0004 - "black" // standard input (expected here) | |
| 45710 | PORT_MODIFY("IN-16") | |
| 45711 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45712 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45713 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45714 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45715 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45716 | PORT_MODIFY("IN-17") | |
| 45717 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45718 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45719 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45720 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45721 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45722 | PORT_MODIFY("IN-18") | |
| 45723 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45724 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45725 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45726 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45727 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45728 | PORT_MODIFY("IN-19") | |
| 45729 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45730 | PORT_MODIFY("IN-20") | |
| 45731 | // 0x0001 - "green" // standard input (motherboard) | |
| 45732 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45733 | 45733 | INPUT_PORTS_END |
| 45734 | 45734 | |
| 45735 | 45735 | // PR1209 LAS VEGAS 95004261 LASVEGAS PR7159 |
| r31373 | r31374 | |
| 45753 | 45753 | } |
| 45754 | 45754 | |
| 45755 | 45755 | INPUT_PORTS_START( sc4miljo ) // this structure is generated |
| 45756 | PORT_INCLUDE( sc4_base ) | |
| 45757 | PORT_MODIFY("IN-1") | |
| 45758 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45759 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45760 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45763 | PORT_MODIFY("IN-2") | |
| 45764 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45765 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45766 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45767 | PORT_MODIFY("IN-3") | |
| 45768 | // 0x0001 - "uitbet" // unexpected here | |
| 45769 | // 0x0002 - "n club" // unexpected here | |
| 45770 | // 0x0010 - "player" // standard input (expected here) | |
| 45771 | PORT_MODIFY("IN-4") | |
| 45772 | // 0x0001 - "l hop" // unexpected here | |
| 45773 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45774 | // 0x0004 - "l hop" // unexpected here | |
| 45775 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45776 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45777 | PORT_MODIFY("IN-5") | |
| 45778 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45779 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45780 | // 0x0004 - "dump" // standard input (expected here) | |
| 45781 | PORT_MODIFY("IN-16") | |
| 45782 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45783 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45784 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45785 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45786 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45787 | PORT_MODIFY("IN-17") | |
| 45788 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45789 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45790 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45791 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45792 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45793 | PORT_MODIFY("IN-18") | |
| 45794 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45795 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45796 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45797 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45798 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45799 | PORT_MODIFY("IN-19") | |
| 45800 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45801 | PORT_MODIFY("IN-20") | |
| 45802 | // 0x0001 - "green" // standard input (motherboard) | |
| 45803 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45804 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45805 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45756 | PORT_INCLUDE( sc4_base ) | |
| 45757 | PORT_MODIFY("IN-1") | |
| 45758 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45759 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45760 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45763 | PORT_MODIFY("IN-2") | |
| 45764 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45765 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45766 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45767 | PORT_MODIFY("IN-3") | |
| 45768 | // 0x0001 - "uitbet" // unexpected here | |
| 45769 | // 0x0002 - "n club" // unexpected here | |
| 45770 | // 0x0010 - "player" // standard input (expected here) | |
| 45771 | PORT_MODIFY("IN-4") | |
| 45772 | // 0x0001 - "l hop" // unexpected here | |
| 45773 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45774 | // 0x0004 - "l hop" // unexpected here | |
| 45775 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45776 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45777 | PORT_MODIFY("IN-5") | |
| 45778 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45779 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45780 | // 0x0004 - "dump" // standard input (expected here) | |
| 45781 | PORT_MODIFY("IN-16") | |
| 45782 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45783 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45784 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45785 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45786 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45787 | PORT_MODIFY("IN-17") | |
| 45788 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45789 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45790 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45791 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45792 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45793 | PORT_MODIFY("IN-18") | |
| 45794 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45795 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45796 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45797 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45798 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45799 | PORT_MODIFY("IN-19") | |
| 45800 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45801 | PORT_MODIFY("IN-20") | |
| 45802 | // 0x0001 - "green" // standard input (motherboard) | |
| 45803 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45804 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45805 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45806 | 45806 | INPUT_PORTS_END |
| 45807 | 45807 | |
| 45808 | 45808 | INPUT_PORTS_START( sc4milja ) // this structure is generated |
| 45809 | PORT_INCLUDE( sc4_base ) | |
| 45810 | PORT_MODIFY("IN-1") | |
| 45811 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45812 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45813 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45814 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45815 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45816 | PORT_MODIFY("IN-2") | |
| 45817 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k spel") | |
| 45818 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45819 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45820 | PORT_MODIFY("IN-3") | |
| 45821 | // 0x0001 - "uitbet" // unexpected here | |
| 45822 | // 0x0002 - "n hoog" // unexpected here | |
| 45823 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45824 | // 0x0010 - "roep b" // standard input (expected here) | |
| 45825 | PORT_MODIFY("IN-4") | |
| 45826 | // 0x0001 - "l hop" // unexpected here | |
| 45827 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45828 | // 0x0004 - "l hop" // unexpected here | |
| 45829 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45830 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45831 | PORT_MODIFY("IN-5") | |
| 45832 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45833 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45834 | // 0x0004 - "dump" // standard input (expected here) | |
| 45835 | PORT_MODIFY("IN-16") | |
| 45836 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45837 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45838 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45839 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45840 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45841 | PORT_MODIFY("IN-17") | |
| 45842 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45843 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45844 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45845 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45846 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45847 | PORT_MODIFY("IN-18") | |
| 45848 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45849 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45850 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45851 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45852 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45853 | PORT_MODIFY("IN-19") | |
| 45854 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45855 | PORT_MODIFY("IN-20") | |
| 45856 | // 0x0001 - "green" // standard input (motherboard) | |
| 45857 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45858 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45859 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45809 | PORT_INCLUDE( sc4_base ) | |
| 45810 | PORT_MODIFY("IN-1") | |
| 45811 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45812 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45813 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45814 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45815 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("k inze") | |
| 45816 | PORT_MODIFY("IN-2") | |
| 45817 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k spel") | |
| 45818 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45819 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45820 | PORT_MODIFY("IN-3") | |
| 45821 | // 0x0001 - "uitbet" // unexpected here | |
| 45822 | // 0x0002 - "n hoog" // unexpected here | |
| 45823 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45824 | // 0x0010 - "roep b" // standard input (expected here) | |
| 45825 | PORT_MODIFY("IN-4") | |
| 45826 | // 0x0001 - "l hop" // unexpected here | |
| 45827 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45828 | // 0x0004 - "l hop" // unexpected here | |
| 45829 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45830 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45831 | PORT_MODIFY("IN-5") | |
| 45832 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45833 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45834 | // 0x0004 - "dump" // standard input (expected here) | |
| 45835 | PORT_MODIFY("IN-16") | |
| 45836 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45837 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45838 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45839 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45840 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45841 | PORT_MODIFY("IN-17") | |
| 45842 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45843 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45844 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45845 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45846 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45847 | PORT_MODIFY("IN-18") | |
| 45848 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45849 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45850 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45851 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45852 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45853 | PORT_MODIFY("IN-19") | |
| 45854 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45855 | PORT_MODIFY("IN-20") | |
| 45856 | // 0x0001 - "green" // standard input (motherboard) | |
| 45857 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45858 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45859 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45860 | 45860 | INPUT_PORTS_END |
| 45861 | 45861 | |
| 45862 | 45862 | GAMEL( 200?, sc4miljo ,0, sc4, sc4miljo, sc4_state, sc4miljo, ROT0, "BFM","Miljonairs (Dutch) (Bellfruit) (Scorpion 4) (set 1)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) // PR1217 MILJONAIRSART12 95004305 MILJONAIRE PR1157 |
| r31373 | r31374 | |
| 45879 | 45879 | } |
| 45880 | 45880 | |
| 45881 | 45881 | INPUT_PORTS_START( sc4paytm ) // this structure is generated |
| 45882 | PORT_INCLUDE( sc4_base ) | |
| 45883 | PORT_MODIFY("IN-1") | |
| 45884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45888 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 45889 | PORT_MODIFY("IN-2") | |
| 45890 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 45891 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45892 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45893 | PORT_MODIFY("IN-3") | |
| 45894 | // 0x0001 - "uitbet" // unexpected here | |
| 45895 | // 0x0002 - "n hoog" // unexpected here | |
| 45896 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45897 | // 0x0010 - "roep b" // standard input (expected here) | |
| 45898 | PORT_MODIFY("IN-4") | |
| 45899 | // 0x0001 - "l hop" // unexpected here | |
| 45900 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45901 | // 0x0004 - "l hop" // unexpected here | |
| 45902 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45903 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45904 | PORT_MODIFY("IN-5") | |
| 45905 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45906 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45907 | // 0x0004 - "dump" // standard input (expected here) | |
| 45908 | PORT_MODIFY("IN-16") | |
| 45909 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45910 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45911 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45912 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45913 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45914 | PORT_MODIFY("IN-17") | |
| 45915 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45916 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45917 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45918 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45919 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45920 | PORT_MODIFY("IN-18") | |
| 45921 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45922 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45923 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45924 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45925 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45926 | PORT_MODIFY("IN-19") | |
| 45927 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45928 | PORT_MODIFY("IN-20") | |
| 45929 | // 0x0001 - "green" // standard input (motherboard) | |
| 45930 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45931 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45932 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45882 | PORT_INCLUDE( sc4_base ) | |
| 45883 | PORT_MODIFY("IN-1") | |
| 45884 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 45885 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45886 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45887 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45888 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 45889 | PORT_MODIFY("IN-2") | |
| 45890 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 45891 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 45892 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45893 | PORT_MODIFY("IN-3") | |
| 45894 | // 0x0001 - "uitbet" // unexpected here | |
| 45895 | // 0x0002 - "n hoog" // unexpected here | |
| 45896 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45897 | // 0x0010 - "roep b" // standard input (expected here) | |
| 45898 | PORT_MODIFY("IN-4") | |
| 45899 | // 0x0001 - "l hop" // unexpected here | |
| 45900 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45901 | // 0x0004 - "l hop" // unexpected here | |
| 45902 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 45903 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45904 | PORT_MODIFY("IN-5") | |
| 45905 | // 0x0001 - "l lege" // standard input (expected here) | |
| 45906 | // 0x0002 - "r lege" // standard input (expected here) | |
| 45907 | // 0x0004 - "dump" // standard input (expected here) | |
| 45908 | PORT_MODIFY("IN-16") | |
| 45909 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45910 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45911 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45912 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45913 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45914 | PORT_MODIFY("IN-17") | |
| 45915 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45916 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45917 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45918 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45919 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45920 | PORT_MODIFY("IN-18") | |
| 45921 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45922 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45923 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45924 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45925 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45926 | PORT_MODIFY("IN-19") | |
| 45927 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45928 | PORT_MODIFY("IN-20") | |
| 45929 | // 0x0001 - "green" // standard input (motherboard) | |
| 45930 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 45931 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 45932 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45933 | 45933 | INPUT_PORTS_END |
| 45934 | 45934 | |
| 45935 | 45935 | // PR1205 PAY TIME 95004224 PAYTIME PR7156 PAY TIME |
| r31373 | r31374 | |
| 45953 | 45953 | } |
| 45954 | 45954 | |
| 45955 | 45955 | INPUT_PORTS_START( sc4pglcs ) // this structure is generated |
| 45956 | PORT_INCLUDE( sc4_base ) | |
| 45957 | PORT_MODIFY("IN-1") | |
| 45958 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45959 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45960 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45961 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45962 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45963 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 45964 | PORT_MODIFY("IN-2") | |
| 45965 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45966 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 45967 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45968 | PORT_MODIFY("IN-3") | |
| 45969 | // 0x0001 - "uitbet" // unexpected here | |
| 45970 | // 0x0002 - "n hgst" // unexpected here | |
| 45971 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45972 | // 0x0010 - "roep" // standard input (expected here) | |
| 45973 | PORT_MODIFY("IN-4") | |
| 45974 | // 0x0001 - "l hop" // unexpected here | |
| 45975 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45976 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45977 | PORT_MODIFY("IN-16") | |
| 45978 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45979 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45980 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45981 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45982 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45983 | PORT_MODIFY("IN-17") | |
| 45984 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45985 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45986 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45987 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45988 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45989 | PORT_MODIFY("IN-18") | |
| 45990 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45991 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45992 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45993 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45994 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45995 | PORT_MODIFY("IN-19") | |
| 45996 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45997 | PORT_MODIFY("IN-20") | |
| 45998 | // 0x0001 - "green" // standard input (motherboard) | |
| 45999 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46000 | // 0x0008 - "dump" // standard input (expected here) | |
| 46001 | // 0x0010 - "boekho" // standard input (expected here) | |
| 45956 | PORT_INCLUDE( sc4_base ) | |
| 45957 | PORT_MODIFY("IN-1") | |
| 45958 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 45959 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 45960 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 45961 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 45962 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kop") | |
| 45963 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 45964 | PORT_MODIFY("IN-2") | |
| 45965 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("munt") | |
| 45966 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 45967 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 45968 | PORT_MODIFY("IN-3") | |
| 45969 | // 0x0001 - "uitbet" // unexpected here | |
| 45970 | // 0x0002 - "n hgst" // unexpected here | |
| 45971 | // 0x0004 - "n winb" // standard input (expected here) | |
| 45972 | // 0x0010 - "roep" // standard input (expected here) | |
| 45973 | PORT_MODIFY("IN-4") | |
| 45974 | // 0x0001 - "l hop" // unexpected here | |
| 45975 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 45976 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 45977 | PORT_MODIFY("IN-16") | |
| 45978 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45979 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45980 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45981 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45982 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45983 | PORT_MODIFY("IN-17") | |
| 45984 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45985 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45986 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45987 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45988 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45989 | PORT_MODIFY("IN-18") | |
| 45990 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45991 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 45992 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 45993 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 45994 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 45995 | PORT_MODIFY("IN-19") | |
| 45996 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 45997 | PORT_MODIFY("IN-20") | |
| 45998 | // 0x0001 - "green" // standard input (motherboard) | |
| 45999 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46000 | // 0x0008 - "dump" // standard input (expected here) | |
| 46001 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46002 | 46002 | INPUT_PORTS_END |
| 46003 | 46003 | |
| 46004 | 46004 | // PR1261 PHARAOH'S GOLD 95004316 CAS PHAR GOLD PR1261 |
| r31373 | r31374 | |
| 46023 | 46023 | } |
| 46024 | 46024 | |
| 46025 | 46025 | INPUT_PORTS_START( sc4redad ) // this structure is generated |
| 46026 | PORT_INCLUDE( sc4_base ) | |
| 46027 | PORT_MODIFY("IN-1") | |
| 46028 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46029 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46030 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46031 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46032 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 46033 | PORT_MODIFY("IN-2") | |
| 46034 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 46035 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46036 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46037 | PORT_MODIFY("IN-3") | |
| 46038 | // 0x0001 - "uitbet" // unexpected here | |
| 46039 | // 0x0002 - "naar c" // unexpected here | |
| 46040 | // 0x0004 - "neem w" // standard input (expected here) | |
| 46041 | // 0x0010 - "roep" // standard input (expected here) | |
| 46042 | PORT_MODIFY("IN-4") | |
| 46043 | // 0x0001 - "l hop" // unexpected here | |
| 46044 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46045 | // 0x0004 - "l hop" // unexpected here | |
| 46046 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46047 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46048 | PORT_MODIFY("IN-5") | |
| 46049 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46050 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46051 | // 0x0004 - "dump" // standard input (expected here) | |
| 46052 | PORT_MODIFY("IN-16") | |
| 46053 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46054 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46055 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46056 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46057 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46058 | PORT_MODIFY("IN-17") | |
| 46059 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46060 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46061 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46062 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46063 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46064 | PORT_MODIFY("IN-18") | |
| 46065 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46066 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46067 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46068 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46069 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46070 | PORT_MODIFY("IN-19") | |
| 46071 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46072 | PORT_MODIFY("IN-20") | |
| 46073 | // 0x0001 - "green" // standard input (motherboard) | |
| 46074 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46075 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46076 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46026 | PORT_INCLUDE( sc4_base ) | |
| 46027 | PORT_MODIFY("IN-1") | |
| 46028 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46029 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46030 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46031 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46032 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 46033 | PORT_MODIFY("IN-2") | |
| 46034 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 46035 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46036 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46037 | PORT_MODIFY("IN-3") | |
| 46038 | // 0x0001 - "uitbet" // unexpected here | |
| 46039 | // 0x0002 - "naar c" // unexpected here | |
| 46040 | // 0x0004 - "neem w" // standard input (expected here) | |
| 46041 | // 0x0010 - "roep" // standard input (expected here) | |
| 46042 | PORT_MODIFY("IN-4") | |
| 46043 | // 0x0001 - "l hop" // unexpected here | |
| 46044 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46045 | // 0x0004 - "l hop" // unexpected here | |
| 46046 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46047 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46048 | PORT_MODIFY("IN-5") | |
| 46049 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46050 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46051 | // 0x0004 - "dump" // standard input (expected here) | |
| 46052 | PORT_MODIFY("IN-16") | |
| 46053 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46054 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46055 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46056 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46057 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46058 | PORT_MODIFY("IN-17") | |
| 46059 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46060 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46061 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46062 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46063 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46064 | PORT_MODIFY("IN-18") | |
| 46065 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46066 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46067 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46068 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46069 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46070 | PORT_MODIFY("IN-19") | |
| 46071 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46072 | PORT_MODIFY("IN-20") | |
| 46073 | // 0x0001 - "green" // standard input (motherboard) | |
| 46074 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46075 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46076 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46077 | 46077 | INPUT_PORTS_END |
| 46078 | 46078 | |
| 46079 | 46079 | // PR1206 RED ALERT 95004266 REDALERT PR1051 |
| r31373 | r31374 | |
| 46098 | 46098 | } |
| 46099 | 46099 | |
| 46100 | 46100 | INPUT_PORTS_START( sc4rvlnx ) // this structure is generated |
| 46101 | PORT_INCLUDE( sc4_base ) | |
| 46102 | PORT_MODIFY("IN-1") | |
| 46103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 46104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 46105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 46106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 46107 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herste") | |
| 46108 | PORT_MODIFY("IN-2") | |
| 46109 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46110 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46111 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46112 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46113 | PORT_MODIFY("IN-3") | |
| 46114 | // 0x0001 - "uitbet" // unexpected here | |
| 46115 | // 0x0002 - "neem c" // unexpected here | |
| 46116 | // 0x0010 - "info/l" // standard input (expected here) | |
| 46117 | PORT_MODIFY("IN-4") | |
| 46118 | // 0x0001 - "l hop" // unexpected here | |
| 46119 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46120 | // 0x0004 - "l hop" // unexpected here | |
| 46121 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46122 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46123 | PORT_MODIFY("IN-5") | |
| 46124 | // 0x0004 - "dump" // standard input (expected here) | |
| 46125 | PORT_MODIFY("IN-16") | |
| 46126 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46127 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46128 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46129 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46130 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46131 | PORT_MODIFY("IN-17") | |
| 46132 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46133 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46134 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46135 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46136 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46137 | PORT_MODIFY("IN-18") | |
| 46138 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46139 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46140 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46141 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46142 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46143 | PORT_MODIFY("IN-19") | |
| 46144 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46145 | PORT_MODIFY("IN-20") | |
| 46146 | // 0x0001 - "green" // standard input (motherboard) | |
| 46147 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46148 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46149 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46101 | PORT_INCLUDE( sc4_base ) | |
| 46102 | PORT_MODIFY("IN-1") | |
| 46103 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 46104 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 46105 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 46106 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 46107 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herste") | |
| 46108 | PORT_MODIFY("IN-2") | |
| 46109 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46110 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46111 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46112 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46113 | PORT_MODIFY("IN-3") | |
| 46114 | // 0x0001 - "uitbet" // unexpected here | |
| 46115 | // 0x0002 - "neem c" // unexpected here | |
| 46116 | // 0x0010 - "info/l" // standard input (expected here) | |
| 46117 | PORT_MODIFY("IN-4") | |
| 46118 | // 0x0001 - "l hop" // unexpected here | |
| 46119 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46120 | // 0x0004 - "l hop" // unexpected here | |
| 46121 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46122 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46123 | PORT_MODIFY("IN-5") | |
| 46124 | // 0x0004 - "dump" // standard input (expected here) | |
| 46125 | PORT_MODIFY("IN-16") | |
| 46126 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46127 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46128 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46129 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46130 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46131 | PORT_MODIFY("IN-17") | |
| 46132 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46133 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46134 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46135 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46136 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46137 | PORT_MODIFY("IN-18") | |
| 46138 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46139 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46140 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46141 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46142 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46143 | PORT_MODIFY("IN-19") | |
| 46144 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46145 | PORT_MODIFY("IN-20") | |
| 46146 | // 0x0001 - "green" // standard input (motherboard) | |
| 46147 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46148 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46149 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46150 | 46150 | INPUT_PORTS_END |
| 46151 | 46151 | |
| 46152 | 46152 | // PR1252 REVOLUTION NEXT 95004320 REVOLUTIONTN PR1252 |
| r31373 | r31374 | |
| 46169 | 46169 | } |
| 46170 | 46170 | |
| 46171 | 46171 | INPUT_PORTS_START( sc4rvl ) // this structure is generated |
| 46172 | PORT_INCLUDE( sc4_base ) | |
| 46173 | PORT_MODIFY("IN-1") | |
| 46174 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 46175 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 46176 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 46177 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 46178 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herste") | |
| 46179 | PORT_MODIFY("IN-2") | |
| 46180 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46181 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46182 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46183 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46184 | PORT_MODIFY("IN-3") | |
| 46185 | // 0x0001 - "uitbet" // unexpected here | |
| 46186 | // 0x0002 - "n hoog" // unexpected here | |
| 46187 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46188 | // 0x0010 - "r behe" // standard input (expected here) | |
| 46189 | PORT_MODIFY("IN-4") | |
| 46190 | // 0x0001 - "l hop" // unexpected here | |
| 46191 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46192 | // 0x0004 - "l hop" // unexpected here | |
| 46193 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46194 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46195 | PORT_MODIFY("IN-5") | |
| 46196 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46197 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46198 | // 0x0004 - "dump" // standard input (expected here) | |
| 46199 | PORT_MODIFY("IN-16") | |
| 46200 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46201 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46202 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46203 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46204 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46205 | PORT_MODIFY("IN-17") | |
| 46206 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46207 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46208 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46209 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46210 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46211 | PORT_MODIFY("IN-18") | |
| 46212 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46213 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46214 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46215 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46216 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46217 | PORT_MODIFY("IN-19") | |
| 46218 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46219 | PORT_MODIFY("IN-20") | |
| 46220 | // 0x0001 - "green" // standard input (motherboard) | |
| 46221 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46222 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46223 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46172 | PORT_INCLUDE( sc4_base ) | |
| 46173 | PORT_MODIFY("IN-1") | |
| 46174 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 46175 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 46176 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 46177 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 46178 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herste") | |
| 46179 | PORT_MODIFY("IN-2") | |
| 46180 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46181 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46182 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46183 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46184 | PORT_MODIFY("IN-3") | |
| 46185 | // 0x0001 - "uitbet" // unexpected here | |
| 46186 | // 0x0002 - "n hoog" // unexpected here | |
| 46187 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46188 | // 0x0010 - "r behe" // standard input (expected here) | |
| 46189 | PORT_MODIFY("IN-4") | |
| 46190 | // 0x0001 - "l hop" // unexpected here | |
| 46191 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46192 | // 0x0004 - "l hop" // unexpected here | |
| 46193 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46194 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46195 | PORT_MODIFY("IN-5") | |
| 46196 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46197 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46198 | // 0x0004 - "dump" // standard input (expected here) | |
| 46199 | PORT_MODIFY("IN-16") | |
| 46200 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46201 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46202 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46203 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46204 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46205 | PORT_MODIFY("IN-17") | |
| 46206 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46207 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46208 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46209 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46210 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46211 | PORT_MODIFY("IN-18") | |
| 46212 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46213 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46214 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46215 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46216 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46217 | PORT_MODIFY("IN-19") | |
| 46218 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46219 | PORT_MODIFY("IN-20") | |
| 46220 | // 0x0001 - "green" // standard input (motherboard) | |
| 46221 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46222 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46223 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46224 | 46224 | INPUT_PORTS_END |
| 46225 | 46225 | |
| 46226 | 46226 | // PR1203 REVOLUTION 95004259 REVOLUTION PR7158 |
| r31373 | r31374 | |
| 46243 | 46243 | } |
| 46244 | 46244 | |
| 46245 | 46245 | INPUT_PORTS_START( sc4rio ) // this structure is generated |
| 46246 | PORT_INCLUDE( sc4_base ) | |
| 46247 | PORT_MODIFY("IN-1") | |
| 46248 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46249 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46250 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46251 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46252 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 46253 | PORT_MODIFY("IN-2") | |
| 46254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 46255 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46256 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46257 | PORT_MODIFY("IN-3") | |
| 46258 | // 0x0001 - "neem w" // unexpected here | |
| 46259 | // 0x0002 - "neem h" // unexpected here | |
| 46260 | // 0x0004 - "uitbet" // standard input (expected here) | |
| 46261 | // 0x0010 - "roep" // standard input (expected here) | |
| 46262 | PORT_MODIFY("IN-4") | |
| 46263 | // 0x0001 - "l hop" // unexpected here | |
| 46264 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46265 | // 0x0004 - "l hop" // unexpected here | |
| 46266 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46267 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46268 | PORT_MODIFY("IN-5") | |
| 46269 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46270 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46271 | // 0x0004 - "black" // standard input (expected here) | |
| 46272 | PORT_MODIFY("IN-16") | |
| 46273 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46274 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46275 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46276 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46277 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46278 | PORT_MODIFY("IN-17") | |
| 46279 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46280 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46281 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46282 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46283 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46284 | PORT_MODIFY("IN-18") | |
| 46285 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46286 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46287 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46288 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46289 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46290 | PORT_MODIFY("IN-19") | |
| 46291 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46292 | PORT_MODIFY("IN-20") | |
| 46293 | // 0x0001 - "green" // standard input (motherboard) | |
| 46294 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46295 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46296 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46246 | PORT_INCLUDE( sc4_base ) | |
| 46247 | PORT_MODIFY("IN-1") | |
| 46248 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46249 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46250 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46251 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46252 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 46253 | PORT_MODIFY("IN-2") | |
| 46254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 46255 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46256 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46257 | PORT_MODIFY("IN-3") | |
| 46258 | // 0x0001 - "neem w" // unexpected here | |
| 46259 | // 0x0002 - "neem h" // unexpected here | |
| 46260 | // 0x0004 - "uitbet" // standard input (expected here) | |
| 46261 | // 0x0010 - "roep" // standard input (expected here) | |
| 46262 | PORT_MODIFY("IN-4") | |
| 46263 | // 0x0001 - "l hop" // unexpected here | |
| 46264 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46265 | // 0x0004 - "l hop" // unexpected here | |
| 46266 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46267 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46268 | PORT_MODIFY("IN-5") | |
| 46269 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46270 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46271 | // 0x0004 - "black" // standard input (expected here) | |
| 46272 | PORT_MODIFY("IN-16") | |
| 46273 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46274 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46275 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46276 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46277 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46278 | PORT_MODIFY("IN-17") | |
| 46279 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46280 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46281 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46282 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46283 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46284 | PORT_MODIFY("IN-18") | |
| 46285 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46286 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46287 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46288 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46289 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46290 | PORT_MODIFY("IN-19") | |
| 46291 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46292 | PORT_MODIFY("IN-20") | |
| 46293 | // 0x0001 - "green" // standard input (motherboard) | |
| 46294 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46295 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46296 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46297 | 46297 | INPUT_PORTS_END |
| 46298 | 46298 | |
| 46299 | 46299 | // PR1222 RIO GRANDE 95004309 RIO GRANDE SOUNDS11 |
| r31373 | r31374 | |
| 46317 | 46317 | } |
| 46318 | 46318 | |
| 46319 | 46319 | INPUT_PORTS_START( sc4strbr ) // this structure is generated |
| 46320 | PORT_INCLUDE( sc4_base ) | |
| 46321 | PORT_MODIFY("IN-1") | |
| 46322 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46323 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46324 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46325 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46326 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 46327 | PORT_MODIFY("IN-2") | |
| 46328 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 46329 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46330 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46331 | PORT_MODIFY("IN-3") | |
| 46332 | // 0x0001 - "uitbet" // unexpected here | |
| 46333 | // 0x0002 - "neem c" // unexpected here | |
| 46334 | // 0x0004 - "neem s" // standard input (expected here) | |
| 46335 | // 0x0010 - "info/l" // standard input (expected here) | |
| 46336 | PORT_MODIFY("IN-4") | |
| 46337 | // 0x0001 - "l hop" // unexpected here | |
| 46338 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46339 | // 0x0004 - "l hop" // unexpected here | |
| 46340 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46341 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46342 | PORT_MODIFY("IN-5") | |
| 46343 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46344 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46345 | // 0x0004 - "dump" // standard input (expected here) | |
| 46346 | PORT_MODIFY("IN-16") | |
| 46347 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46348 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46349 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46350 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46351 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46352 | PORT_MODIFY("IN-17") | |
| 46353 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46354 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46355 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46356 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46357 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46358 | PORT_MODIFY("IN-18") | |
| 46359 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46360 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46361 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46362 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46363 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46364 | PORT_MODIFY("IN-19") | |
| 46365 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46366 | PORT_MODIFY("IN-20") | |
| 46367 | // 0x0001 - "green" // standard input (motherboard) | |
| 46368 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46369 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46370 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46320 | PORT_INCLUDE( sc4_base ) | |
| 46321 | PORT_MODIFY("IN-1") | |
| 46322 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46323 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46324 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46325 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46326 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies i") | |
| 46327 | PORT_MODIFY("IN-2") | |
| 46328 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies s") | |
| 46329 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46330 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46331 | PORT_MODIFY("IN-3") | |
| 46332 | // 0x0001 - "uitbet" // unexpected here | |
| 46333 | // 0x0002 - "neem c" // unexpected here | |
| 46334 | // 0x0004 - "neem s" // standard input (expected here) | |
| 46335 | // 0x0010 - "info/l" // standard input (expected here) | |
| 46336 | PORT_MODIFY("IN-4") | |
| 46337 | // 0x0001 - "l hop" // unexpected here | |
| 46338 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46339 | // 0x0004 - "l hop" // unexpected here | |
| 46340 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46341 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46342 | PORT_MODIFY("IN-5") | |
| 46343 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46344 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46345 | // 0x0004 - "dump" // standard input (expected here) | |
| 46346 | PORT_MODIFY("IN-16") | |
| 46347 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46348 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46349 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46350 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46351 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46352 | PORT_MODIFY("IN-17") | |
| 46353 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46354 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46355 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46356 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46357 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46358 | PORT_MODIFY("IN-18") | |
| 46359 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46360 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46361 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46362 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46363 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46364 | PORT_MODIFY("IN-19") | |
| 46365 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46366 | PORT_MODIFY("IN-20") | |
| 46367 | // 0x0001 - "green" // standard input (motherboard) | |
| 46368 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46369 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46370 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46371 | 46371 | INPUT_PORTS_END |
| 46372 | 46372 | |
| 46373 | 46373 | INPUT_PORTS_START( sc4strbra ) // this structure is generated |
| 46374 | PORT_INCLUDE( sc4_base ) | |
| 46375 | PORT_MODIFY("IN-1") | |
| 46376 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46377 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46378 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46379 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46380 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("neem s") | |
| 46381 | PORT_MODIFY("IN-2") | |
| 46382 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46383 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46384 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46385 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46386 | PORT_MODIFY("IN-3") | |
| 46387 | // 0x0001 - "uitbet" // unexpected here | |
| 46388 | // 0x0002 - "neem h" // unexpected here | |
| 46389 | // 0x0004 - "neem w" // standard input (expected here) | |
| 46390 | // 0x0010 - "roep" // standard input (expected here) | |
| 46391 | PORT_MODIFY("IN-4") | |
| 46392 | // 0x0001 - "l hop" // unexpected here | |
| 46393 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46394 | // 0x0004 - "l hop" // unexpected here | |
| 46395 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46396 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46397 | PORT_MODIFY("IN-5") | |
| 46398 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46399 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46400 | // 0x0004 - "dump" // standard input (expected here) | |
| 46401 | PORT_MODIFY("IN-16") | |
| 46402 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46403 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46404 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46405 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46406 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46407 | PORT_MODIFY("IN-17") | |
| 46408 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46409 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46410 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46411 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46412 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46413 | PORT_MODIFY("IN-18") | |
| 46414 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46415 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46416 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46417 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46418 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46419 | PORT_MODIFY("IN-19") | |
| 46420 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46421 | PORT_MODIFY("IN-20") | |
| 46422 | // 0x0001 - "green" // standard input (motherboard) | |
| 46423 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46424 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46425 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46374 | PORT_INCLUDE( sc4_base ) | |
| 46375 | PORT_MODIFY("IN-1") | |
| 46376 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46377 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46378 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46379 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46380 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("neem s") | |
| 46381 | PORT_MODIFY("IN-2") | |
| 46382 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46383 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46384 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46385 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46386 | PORT_MODIFY("IN-3") | |
| 46387 | // 0x0001 - "uitbet" // unexpected here | |
| 46388 | // 0x0002 - "neem h" // unexpected here | |
| 46389 | // 0x0004 - "neem w" // standard input (expected here) | |
| 46390 | // 0x0010 - "roep" // standard input (expected here) | |
| 46391 | PORT_MODIFY("IN-4") | |
| 46392 | // 0x0001 - "l hop" // unexpected here | |
| 46393 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46394 | // 0x0004 - "l hop" // unexpected here | |
| 46395 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46396 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46397 | PORT_MODIFY("IN-5") | |
| 46398 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46399 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46400 | // 0x0004 - "dump" // standard input (expected here) | |
| 46401 | PORT_MODIFY("IN-16") | |
| 46402 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46403 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46404 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46405 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46406 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46407 | PORT_MODIFY("IN-17") | |
| 46408 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46409 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46410 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46411 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46412 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46413 | PORT_MODIFY("IN-18") | |
| 46414 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46415 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46416 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46417 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46418 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46419 | PORT_MODIFY("IN-19") | |
| 46420 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46421 | PORT_MODIFY("IN-20") | |
| 46422 | // 0x0001 - "green" // standard input (motherboard) | |
| 46423 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46424 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46425 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46426 | 46426 | INPUT_PORTS_END |
| 46427 | 46427 | |
| 46428 | 46428 | // PR1219 STARS 'N BARS 95004290 STARSNBARS PR1159 |
| r31373 | r31374 | |
| 46451 | 46451 | |
| 46452 | 46452 | |
| 46453 | 46453 | INPUT_PORTS_START( sc4twilt ) // this structure is generated |
| 46454 | PORT_INCLUDE( sc4_base ) | |
| 46455 | PORT_MODIFY("IN-1") | |
| 46456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46457 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46458 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46459 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46460 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46461 | PORT_MODIFY("IN-2") | |
| 46462 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46463 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46464 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46465 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46466 | PORT_MODIFY("IN-3") | |
| 46467 | // 0x0001 - "uitbet" // unexpected here | |
| 46468 | // 0x0002 - "neem c" // unexpected here | |
| 46469 | // 0x0010 - "info/l" // standard input (expected here) | |
| 46470 | PORT_MODIFY("IN-4") | |
| 46471 | // 0x0001 - "l hop" // unexpected here | |
| 46472 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46473 | // 0x0004 - "l hop" // unexpected here | |
| 46474 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46475 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46476 | PORT_MODIFY("IN-5") | |
| 46477 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46478 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46479 | // 0x0004 - "dump" // standard input (expected here) | |
| 46480 | PORT_MODIFY("IN-16") | |
| 46481 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46482 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46483 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46484 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46485 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46486 | PORT_MODIFY("IN-17") | |
| 46487 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46488 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46489 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46490 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46491 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46492 | PORT_MODIFY("IN-18") | |
| 46493 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46494 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46495 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46496 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46497 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46498 | PORT_MODIFY("IN-19") | |
| 46499 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46500 | PORT_MODIFY("IN-20") | |
| 46501 | // 0x0001 - "green" // standard input (motherboard) | |
| 46502 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46503 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46504 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46454 | PORT_INCLUDE( sc4_base ) | |
| 46455 | PORT_MODIFY("IN-1") | |
| 46456 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46457 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46458 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46459 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46460 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46461 | PORT_MODIFY("IN-2") | |
| 46462 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46463 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46464 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46465 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46466 | PORT_MODIFY("IN-3") | |
| 46467 | // 0x0001 - "uitbet" // unexpected here | |
| 46468 | // 0x0002 - "neem c" // unexpected here | |
| 46469 | // 0x0010 - "info/l" // standard input (expected here) | |
| 46470 | PORT_MODIFY("IN-4") | |
| 46471 | // 0x0001 - "l hop" // unexpected here | |
| 46472 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46473 | // 0x0004 - "l hop" // unexpected here | |
| 46474 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46475 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46476 | PORT_MODIFY("IN-5") | |
| 46477 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46478 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46479 | // 0x0004 - "dump" // standard input (expected here) | |
| 46480 | PORT_MODIFY("IN-16") | |
| 46481 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46482 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46483 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46484 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46485 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46486 | PORT_MODIFY("IN-17") | |
| 46487 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46488 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46489 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46490 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46491 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46492 | PORT_MODIFY("IN-18") | |
| 46493 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46494 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46495 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46496 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46497 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46498 | PORT_MODIFY("IN-19") | |
| 46499 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46500 | PORT_MODIFY("IN-20") | |
| 46501 | // 0x0001 - "green" // standard input (motherboard) | |
| 46502 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46503 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46504 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46505 | 46505 | INPUT_PORTS_END |
| 46506 | 46506 | |
| 46507 | 46507 | // PR1214 TWILIGHT 95004299 TWILIGHT PR1154 |
| r31373 | r31374 | |
| 46525 | 46525 | } |
| 46526 | 46526 | |
| 46527 | 46527 | INPUT_PORTS_START( sc4monsp ) // this structure is generated |
| 46528 | PORT_INCLUDE( sc4_base ) | |
| 46529 | PORT_MODIFY("IN-1") | |
| 46530 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 46531 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 46532 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 46533 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 46534 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herst") | |
| 46535 | PORT_MODIFY("IN-2") | |
| 46536 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kop") | |
| 46537 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("munt") | |
| 46538 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46539 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46540 | PORT_MODIFY("IN-3") | |
| 46541 | // 0x0001 - "uitbet" // unexpected here | |
| 46542 | // 0x0002 - "n club" // unexpected here | |
| 46543 | // 0x0010 - "player" // standard input (expected here) | |
| 46544 | PORT_MODIFY("IN-4") | |
| 46545 | // 0x0001 - "l hop" // unexpected here | |
| 46546 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46547 | // 0x0004 - "l hop" // unexpected here | |
| 46548 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46549 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46550 | PORT_MODIFY("IN-5") | |
| 46551 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46552 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46553 | // 0x0004 - "dump" // standard input (expected here) | |
| 46554 | PORT_MODIFY("IN-16") | |
| 46555 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46556 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46557 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46558 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46559 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46560 | PORT_MODIFY("IN-17") | |
| 46561 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46562 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46563 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46564 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46565 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46566 | PORT_MODIFY("IN-18") | |
| 46567 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46568 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46569 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46570 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46571 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46572 | PORT_MODIFY("IN-19") | |
| 46573 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46574 | PORT_MODIFY("IN-20") | |
| 46575 | // 0x0001 - "green" // standard input (motherboard) | |
| 46576 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46577 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46578 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46528 | PORT_INCLUDE( sc4_base ) | |
| 46529 | PORT_MODIFY("IN-1") | |
| 46530 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 46531 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 46532 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 46533 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 4") | |
| 46534 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("herst") | |
| 46535 | PORT_MODIFY("IN-2") | |
| 46536 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kop") | |
| 46537 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("munt") | |
| 46538 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46539 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46540 | PORT_MODIFY("IN-3") | |
| 46541 | // 0x0001 - "uitbet" // unexpected here | |
| 46542 | // 0x0002 - "n club" // unexpected here | |
| 46543 | // 0x0010 - "player" // standard input (expected here) | |
| 46544 | PORT_MODIFY("IN-4") | |
| 46545 | // 0x0001 - "l hop" // unexpected here | |
| 46546 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46547 | // 0x0004 - "l hop" // unexpected here | |
| 46548 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46549 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46550 | PORT_MODIFY("IN-5") | |
| 46551 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46552 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46553 | // 0x0004 - "dump" // standard input (expected here) | |
| 46554 | PORT_MODIFY("IN-16") | |
| 46555 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46556 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46557 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46558 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46559 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46560 | PORT_MODIFY("IN-17") | |
| 46561 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46562 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46563 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46564 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46565 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46566 | PORT_MODIFY("IN-18") | |
| 46567 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46568 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46569 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46570 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46571 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46572 | PORT_MODIFY("IN-19") | |
| 46573 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46574 | PORT_MODIFY("IN-20") | |
| 46575 | // 0x0001 - "green" // standard input (motherboard) | |
| 46576 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46577 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46578 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46579 | 46579 | INPUT_PORTS_END |
| 46580 | 46580 | |
| 46581 | 46581 | // PR1218 MONEY SPINNER ART12 95004291 MONEYSPINNER PR1158 |
| r31373 | r31374 | |
| 46599 | 46599 | } |
| 46600 | 46600 | |
| 46601 | 46601 | INPUT_PORTS_START( sc4ivply ) // this structure is generated |
| 46602 | PORT_INCLUDE( sc4_base ) | |
| 46603 | PORT_MODIFY("IN-1") | |
| 46604 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46605 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46606 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46607 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46608 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46609 | PORT_MODIFY("IN-2") | |
| 46610 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46611 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46612 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46613 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46614 | PORT_MODIFY("IN-3") | |
| 46615 | // 0x0001 - "uitbet" // unexpected here | |
| 46616 | // 0x0002 - "n hoog" // unexpected here | |
| 46617 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46618 | // 0x0010 - "roep" // standard input (expected here) | |
| 46619 | PORT_MODIFY("IN-4") | |
| 46620 | // 0x0001 - "l hop" // unexpected here | |
| 46621 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46622 | // 0x0004 - "l hop" // unexpected here | |
| 46623 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46624 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46625 | PORT_MODIFY("IN-5") | |
| 46626 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46627 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46628 | // 0x0004 - "dump" // standard input (expected here) | |
| 46629 | PORT_MODIFY("IN-16") | |
| 46630 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46631 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46632 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46633 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46634 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46635 | PORT_MODIFY("IN-17") | |
| 46636 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46637 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46638 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46639 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46640 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46641 | PORT_MODIFY("IN-18") | |
| 46642 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46643 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46644 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46645 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46646 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46647 | PORT_MODIFY("IN-19") | |
| 46648 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46649 | PORT_MODIFY("IN-20") | |
| 46650 | // 0x0001 - "green" // standard input (motherboard) | |
| 46651 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46652 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46653 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46602 | PORT_INCLUDE( sc4_base ) | |
| 46603 | PORT_MODIFY("IN-1") | |
| 46604 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46605 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46606 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46607 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46608 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46609 | PORT_MODIFY("IN-2") | |
| 46610 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46611 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46612 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46613 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46614 | PORT_MODIFY("IN-3") | |
| 46615 | // 0x0001 - "uitbet" // unexpected here | |
| 46616 | // 0x0002 - "n hoog" // unexpected here | |
| 46617 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46618 | // 0x0010 - "roep" // standard input (expected here) | |
| 46619 | PORT_MODIFY("IN-4") | |
| 46620 | // 0x0001 - "l hop" // unexpected here | |
| 46621 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46622 | // 0x0004 - "l hop" // unexpected here | |
| 46623 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46624 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46625 | PORT_MODIFY("IN-5") | |
| 46626 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46627 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46628 | // 0x0004 - "dump" // standard input (expected here) | |
| 46629 | PORT_MODIFY("IN-16") | |
| 46630 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46631 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46632 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46633 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46634 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46635 | PORT_MODIFY("IN-17") | |
| 46636 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46637 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46638 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46639 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46640 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46641 | PORT_MODIFY("IN-18") | |
| 46642 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46643 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46644 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46645 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46646 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46647 | PORT_MODIFY("IN-19") | |
| 46648 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46649 | PORT_MODIFY("IN-20") | |
| 46650 | // 0x0001 - "green" // standard input (motherboard) | |
| 46651 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46652 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46653 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46654 | 46654 | INPUT_PORTS_END |
| 46655 | 46655 | |
| 46656 | 46656 | |
| r31373 | r31374 | |
| 46675 | 46675 | |
| 46676 | 46676 | |
| 46677 | 46677 | INPUT_PORTS_START( sc4ccc ) // this structure is generated |
| 46678 | PORT_INCLUDE( sc4_base ) | |
| 46679 | PORT_MODIFY("IN-1") | |
| 46680 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46681 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46682 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46683 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46684 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46685 | PORT_MODIFY("IN-2") | |
| 46686 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46687 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46688 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46689 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46690 | PORT_MODIFY("IN-3") | |
| 46691 | // 0x0001 - "uitbet" // unexpected here | |
| 46692 | // 0x0002 - "n hoog" // unexpected here | |
| 46693 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46694 | // 0x0010 - "roep" // standard input (expected here) | |
| 46695 | PORT_MODIFY("IN-4") | |
| 46696 | // 0x0001 - "l hop" // unexpected here | |
| 46697 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46698 | // 0x0004 - "l hop" // unexpected here | |
| 46699 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46700 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46701 | PORT_MODIFY("IN-5") | |
| 46702 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46703 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46704 | // 0x0004 - "dump" // standard input (expected here) | |
| 46705 | PORT_MODIFY("IN-16") | |
| 46706 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46707 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46708 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46709 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46710 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46711 | PORT_MODIFY("IN-17") | |
| 46712 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46713 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46714 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46715 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46716 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46717 | PORT_MODIFY("IN-18") | |
| 46718 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46719 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46720 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46721 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46722 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46723 | PORT_MODIFY("IN-19") | |
| 46724 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46725 | PORT_MODIFY("IN-20") | |
| 46726 | // 0x0001 - "green" // standard input (motherboard) | |
| 46727 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46728 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46729 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46678 | PORT_INCLUDE( sc4_base ) | |
| 46679 | PORT_MODIFY("IN-1") | |
| 46680 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46681 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46682 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46683 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46684 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46685 | PORT_MODIFY("IN-2") | |
| 46686 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46687 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46688 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46689 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46690 | PORT_MODIFY("IN-3") | |
| 46691 | // 0x0001 - "uitbet" // unexpected here | |
| 46692 | // 0x0002 - "n hoog" // unexpected here | |
| 46693 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46694 | // 0x0010 - "roep" // standard input (expected here) | |
| 46695 | PORT_MODIFY("IN-4") | |
| 46696 | // 0x0001 - "l hop" // unexpected here | |
| 46697 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46698 | // 0x0004 - "l hop" // unexpected here | |
| 46699 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46700 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46701 | PORT_MODIFY("IN-5") | |
| 46702 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46703 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46704 | // 0x0004 - "dump" // standard input (expected here) | |
| 46705 | PORT_MODIFY("IN-16") | |
| 46706 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46707 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46708 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46709 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46710 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46711 | PORT_MODIFY("IN-17") | |
| 46712 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46713 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46714 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46715 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46716 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46717 | PORT_MODIFY("IN-18") | |
| 46718 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46719 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46720 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46721 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46722 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46723 | PORT_MODIFY("IN-19") | |
| 46724 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46725 | PORT_MODIFY("IN-20") | |
| 46726 | // 0x0001 - "green" // standard input (motherboard) | |
| 46727 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46728 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46729 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46730 | 46730 | INPUT_PORTS_END |
| 46731 | 46731 | |
| 46732 | 46732 | // PR1221 CRISSCROSSCRAZY ART13 95004282 CRISSCROSS PR1161 |
| r31373 | r31374 | |
| 46749 | 46749 | } |
| 46750 | 46750 | |
| 46751 | 46751 | INPUT_PORTS_START( sc4valqp ) // this structure is generated |
| 46752 | PORT_INCLUDE( sc4_base ) | |
| 46753 | PORT_MODIFY("IN-1") | |
| 46754 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 46755 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46756 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46757 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46758 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("spel") | |
| 46759 | PORT_MODIFY("IN-2") | |
| 46760 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("inzet") | |
| 46761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46763 | PORT_MODIFY("IN-3") | |
| 46764 | // 0x0001 - "uitbet" // unexpected here | |
| 46765 | // 0x0002 - "n club" // unexpected here | |
| 46766 | // 0x0010 - "player" // standard input (expected here) | |
| 46767 | PORT_MODIFY("IN-4") | |
| 46768 | // 0x0001 - "l hop" // unexpected here | |
| 46769 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46770 | // 0x0004 - "l hop" // unexpected here | |
| 46771 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46772 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46773 | PORT_MODIFY("IN-5") | |
| 46774 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46775 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46776 | // 0x0004 - "dump" // standard input (expected here) | |
| 46777 | PORT_MODIFY("IN-16") | |
| 46778 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46779 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46780 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46781 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46782 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46783 | PORT_MODIFY("IN-17") | |
| 46784 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46785 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46786 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46787 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46788 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46789 | PORT_MODIFY("IN-18") | |
| 46790 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46791 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46792 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46793 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46794 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46795 | PORT_MODIFY("IN-19") | |
| 46796 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46797 | PORT_MODIFY("IN-20") | |
| 46798 | // 0x0001 - "green" // standard input (motherboard) | |
| 46799 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46800 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46801 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46752 | PORT_INCLUDE( sc4_base ) | |
| 46753 | PORT_MODIFY("IN-1") | |
| 46754 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 46755 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46756 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46757 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46758 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("spel") | |
| 46759 | PORT_MODIFY("IN-2") | |
| 46760 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("inzet") | |
| 46761 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46762 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46763 | PORT_MODIFY("IN-3") | |
| 46764 | // 0x0001 - "uitbet" // unexpected here | |
| 46765 | // 0x0002 - "n club" // unexpected here | |
| 46766 | // 0x0010 - "player" // standard input (expected here) | |
| 46767 | PORT_MODIFY("IN-4") | |
| 46768 | // 0x0001 - "l hop" // unexpected here | |
| 46769 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46770 | // 0x0004 - "l hop" // unexpected here | |
| 46771 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46772 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46773 | PORT_MODIFY("IN-5") | |
| 46774 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46775 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46776 | // 0x0004 - "dump" // standard input (expected here) | |
| 46777 | PORT_MODIFY("IN-16") | |
| 46778 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46779 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46780 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46781 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46782 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46783 | PORT_MODIFY("IN-17") | |
| 46784 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46785 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46786 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46787 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46788 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46789 | PORT_MODIFY("IN-18") | |
| 46790 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46791 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46792 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46793 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46794 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46795 | PORT_MODIFY("IN-19") | |
| 46796 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46797 | PORT_MODIFY("IN-20") | |
| 46798 | // 0x0001 - "green" // standard input (motherboard) | |
| 46799 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46800 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46801 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46802 | 46802 | INPUT_PORTS_END |
| 46803 | 46803 | |
| 46804 | 46804 | // PR2040E VALHALLA...PR2040 SOUNDS V1.... (non-standard header) |
| r31373 | r31374 | |
| 46822 | 46822 | } |
| 46823 | 46823 | |
| 46824 | 46824 | INPUT_PORTS_START( sc4winxp ) // this structure is generated |
| 46825 | PORT_INCLUDE( sc4_base ) | |
| 46826 | PORT_MODIFY("IN-1") | |
| 46827 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46828 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46829 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46830 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46831 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46832 | PORT_MODIFY("IN-2") | |
| 46833 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46834 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46835 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46836 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46837 | PORT_MODIFY("IN-3") | |
| 46838 | // 0x0001 - "uitbet" // unexpected here | |
| 46839 | // 0x0002 - "n hoog" // unexpected here | |
| 46840 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46841 | PORT_MODIFY("IN-4") | |
| 46842 | // 0x0001 - "l hop" // unexpected here | |
| 46843 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46844 | // 0x0004 - "l hop" // unexpected here | |
| 46845 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46846 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46847 | PORT_MODIFY("IN-5") | |
| 46848 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46849 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46850 | // 0x0004 - "dump" // standard input (expected here) | |
| 46851 | PORT_MODIFY("IN-16") | |
| 46852 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46853 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46854 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46855 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46856 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46857 | PORT_MODIFY("IN-17") | |
| 46858 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46859 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46860 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46861 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46862 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46863 | PORT_MODIFY("IN-18") | |
| 46864 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46865 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46866 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46867 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46868 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46869 | PORT_MODIFY("IN-19") | |
| 46870 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46871 | PORT_MODIFY("IN-20") | |
| 46872 | // 0x0001 - "green" // standard input (motherboard) | |
| 46873 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46874 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46875 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46825 | PORT_INCLUDE( sc4_base ) | |
| 46826 | PORT_MODIFY("IN-1") | |
| 46827 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46828 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46829 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46830 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46831 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("vast 4") | |
| 46832 | PORT_MODIFY("IN-2") | |
| 46833 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("kies i") | |
| 46834 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("kies s") | |
| 46835 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46836 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46837 | PORT_MODIFY("IN-3") | |
| 46838 | // 0x0001 - "uitbet" // unexpected here | |
| 46839 | // 0x0002 - "n hoog" // unexpected here | |
| 46840 | // 0x0004 - "n winb" // standard input (expected here) | |
| 46841 | PORT_MODIFY("IN-4") | |
| 46842 | // 0x0001 - "l hop" // unexpected here | |
| 46843 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46844 | // 0x0004 - "l hop" // unexpected here | |
| 46845 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46846 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46847 | PORT_MODIFY("IN-5") | |
| 46848 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46849 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46850 | // 0x0004 - "dump" // standard input (expected here) | |
| 46851 | PORT_MODIFY("IN-16") | |
| 46852 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46853 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46854 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46855 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46856 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46857 | PORT_MODIFY("IN-17") | |
| 46858 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46859 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46860 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46861 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46862 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46863 | PORT_MODIFY("IN-18") | |
| 46864 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46865 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46866 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46867 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46868 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46869 | PORT_MODIFY("IN-19") | |
| 46870 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46871 | PORT_MODIFY("IN-20") | |
| 46872 | // 0x0001 - "green" // standard input (motherboard) | |
| 46873 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46874 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 46875 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46876 | 46876 | INPUT_PORTS_END |
| 46877 | 46877 | |
| 46878 | 46878 | // PR1207 WIN XPLOSION 95004265 WINXPLOSION PR1053 |
| r31373 | r31374 | |
| 46896 | 46896 | } |
| 46897 | 46897 | |
| 46898 | 46898 | INPUT_PORTS_START( sc4xcash ) // this structure is generated |
| 46899 | PORT_INCLUDE( sc4_base ) | |
| 46900 | PORT_MODIFY("IN-1") | |
| 46901 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("uitbet") | |
| 46902 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("test s") | |
| 46903 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("test s") | |
| 46904 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("test s") | |
| 46905 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("test s") | |
| 46906 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 46907 | PORT_MODIFY("IN-2") | |
| 46908 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("test s") | |
| 46909 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 46910 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46911 | PORT_MODIFY("IN-3") | |
| 46912 | // 0x0010 - "roep b" // standard input (expected here) | |
| 46913 | PORT_MODIFY("IN-4") | |
| 46914 | // 0x0001 - "l hop" // unexpected here | |
| 46915 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46916 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46917 | PORT_MODIFY("IN-5") | |
| 46918 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46919 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46920 | PORT_MODIFY("IN-16") | |
| 46921 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46922 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46923 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46924 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46925 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46926 | PORT_MODIFY("IN-17") | |
| 46927 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46928 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46929 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46930 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46931 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46932 | PORT_MODIFY("IN-18") | |
| 46933 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46934 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46935 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46936 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46937 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46938 | PORT_MODIFY("IN-19") | |
| 46939 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46940 | PORT_MODIFY("IN-20") | |
| 46941 | // 0x0001 - "green" // standard input (motherboard) | |
| 46942 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46943 | // 0x0008 - "dump" // standard input (expected here) | |
| 46944 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46899 | PORT_INCLUDE( sc4_base ) | |
| 46900 | PORT_MODIFY("IN-1") | |
| 46901 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("uitbet") | |
| 46902 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("test s") | |
| 46903 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("test s") | |
| 46904 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("test s") | |
| 46905 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("test s") | |
| 46906 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("zijdeu OR l hop OR r hop") | |
| 46907 | PORT_MODIFY("IN-2") | |
| 46908 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("test s") | |
| 46909 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 46910 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46911 | PORT_MODIFY("IN-3") | |
| 46912 | // 0x0010 - "roep b" // standard input (expected here) | |
| 46913 | PORT_MODIFY("IN-4") | |
| 46914 | // 0x0001 - "l hop" // unexpected here | |
| 46915 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46916 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46917 | PORT_MODIFY("IN-5") | |
| 46918 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46919 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46920 | PORT_MODIFY("IN-16") | |
| 46921 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46922 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46923 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46924 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46925 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46926 | PORT_MODIFY("IN-17") | |
| 46927 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46928 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46929 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46930 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46931 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46932 | PORT_MODIFY("IN-18") | |
| 46933 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46934 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46935 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46936 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46937 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46938 | PORT_MODIFY("IN-19") | |
| 46939 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46940 | PORT_MODIFY("IN-20") | |
| 46941 | // 0x0001 - "green" // standard input (motherboard) | |
| 46942 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 46943 | // 0x0008 - "dump" // standard input (expected here) | |
| 46944 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46945 | 46945 | INPUT_PORTS_END |
| 46946 | 46946 | |
| 46947 | 46947 | // PR1264 XTRA CASH ART13 XTRA CASH CASINO (LOTECH) - ART13 95004321 XTRACASH PR1264 |
| r31373 | r31374 | |
| 46964 | 46964 | } |
| 46965 | 46965 | |
| 46966 | 46966 | INPUT_PORTS_START( sc4helld ) // this structure is generated |
| 46967 | PORT_INCLUDE( sc4_base ) | |
| 46968 | PORT_MODIFY("IN-1") | |
| 46969 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46970 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46971 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46972 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46973 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies m") | |
| 46974 | PORT_MODIFY("IN-2") | |
| 46975 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k basi") | |
| 46976 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("k club") | |
| 46977 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46978 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46979 | PORT_MODIFY("IN-3") | |
| 46980 | // 0x0001 - "uitbet" // unexpected here | |
| 46981 | // 0x0002 - "neem m" // unexpected here | |
| 46982 | // 0x0004 - "neem w" // standard input (expected here) | |
| 46983 | PORT_MODIFY("IN-4") | |
| 46984 | // 0x0001 - "l hop" // unexpected here | |
| 46985 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46986 | // 0x0004 - "l hop" // unexpected here | |
| 46987 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46988 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46989 | PORT_MODIFY("IN-5") | |
| 46990 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46991 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46992 | // 0x0004 - "dump" // standard input (expected here) | |
| 46993 | PORT_MODIFY("IN-16") | |
| 46994 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46995 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46996 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46997 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46998 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46999 | PORT_MODIFY("IN-17") | |
| 47000 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47001 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47002 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47003 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47004 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47005 | PORT_MODIFY("IN-18") | |
| 47006 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47007 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47008 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47009 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47010 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47011 | PORT_MODIFY("IN-19") | |
| 47012 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47013 | PORT_MODIFY("IN-20") | |
| 47014 | // 0x0001 - "green" // standard input (motherboard) | |
| 47015 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 47016 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 47017 | // 0x0010 - "boekho" // standard input (expected here) | |
| 46967 | PORT_INCLUDE( sc4_base ) | |
| 46968 | PORT_MODIFY("IN-1") | |
| 46969 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herste") | |
| 46970 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 46971 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 46972 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 46973 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("kies m") | |
| 46974 | PORT_MODIFY("IN-2") | |
| 46975 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("k basi") | |
| 46976 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("k club") | |
| 46977 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 46978 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 46979 | PORT_MODIFY("IN-3") | |
| 46980 | // 0x0001 - "uitbet" // unexpected here | |
| 46981 | // 0x0002 - "neem m" // unexpected here | |
| 46982 | // 0x0004 - "neem w" // standard input (expected here) | |
| 46983 | PORT_MODIFY("IN-4") | |
| 46984 | // 0x0001 - "l hop" // unexpected here | |
| 46985 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 46986 | // 0x0004 - "l hop" // unexpected here | |
| 46987 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 46988 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 46989 | PORT_MODIFY("IN-5") | |
| 46990 | // 0x0001 - "l lege" // standard input (expected here) | |
| 46991 | // 0x0002 - "r lege" // standard input (expected here) | |
| 46992 | // 0x0004 - "dump" // standard input (expected here) | |
| 46993 | PORT_MODIFY("IN-16") | |
| 46994 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 46995 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 46996 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 46997 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 46998 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 46999 | PORT_MODIFY("IN-17") | |
| 47000 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47001 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47002 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47003 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47004 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47005 | PORT_MODIFY("IN-18") | |
| 47006 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47007 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47008 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47009 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47010 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47011 | PORT_MODIFY("IN-19") | |
| 47012 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47013 | PORT_MODIFY("IN-20") | |
| 47014 | // 0x0001 - "green" // standard input (motherboard) | |
| 47015 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 47016 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 47017 | // 0x0010 - "boekho" // standard input (expected here) | |
| 47018 | 47018 | INPUT_PORTS_END |
| 47019 | 47019 | |
| 47020 | 47020 | // PR1201 HELLS BELLS 95004211 HELLS BELLS PR6945 HELLS BELLS (non english?) |
| r31373 | r31374 | |
| 47037 | 47037 | } |
| 47038 | 47038 | |
| 47039 | 47039 | INPUT_PORTS_START( sc4cashn ) // this structure is generated |
| 47040 | PORT_INCLUDE( sc4_base ) | |
| 47041 | PORT_MODIFY("IN-1") | |
| 47042 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 47043 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 47044 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 47045 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 47046 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("inzet") | |
| 47047 | PORT_MODIFY("IN-2") | |
| 47048 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 47049 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 47050 | PORT_MODIFY("IN-3") | |
| 47051 | // 0x0001 - "uitbet" // unexpected here | |
| 47052 | // 0x0002 - "n club" // unexpected here | |
| 47053 | // 0x0010 - "player" // standard input (expected here) | |
| 47054 | PORT_MODIFY("IN-4") | |
| 47055 | // 0x0001 - "l hop" // unexpected here | |
| 47056 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 47057 | // 0x0004 - "l hop" // unexpected here | |
| 47058 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 47059 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 47060 | PORT_MODIFY("IN-5") | |
| 47061 | // 0x0001 - "l lege" // standard input (expected here) | |
| 47062 | // 0x0002 - "r lege" // standard input (expected here) | |
| 47063 | // 0x0004 - "dump" // standard input (expected here) | |
| 47064 | PORT_MODIFY("IN-16") | |
| 47065 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47066 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47067 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47068 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47069 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47070 | PORT_MODIFY("IN-17") | |
| 47071 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47072 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47073 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47074 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47075 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47076 | PORT_MODIFY("IN-18") | |
| 47077 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47078 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47079 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47080 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47081 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47082 | PORT_MODIFY("IN-19") | |
| 47083 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47084 | PORT_MODIFY("IN-20") | |
| 47085 | // 0x0001 - "green" // standard input (motherboard) | |
| 47086 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 47087 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 47088 | // 0x0010 - "boekho" // standard input (expected here) | |
| 47040 | PORT_INCLUDE( sc4_base ) | |
| 47041 | PORT_MODIFY("IN-1") | |
| 47042 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("herst") | |
| 47043 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 1") | |
| 47044 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 2") | |
| 47045 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("vast 3") | |
| 47046 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("inzet") | |
| 47047 | PORT_MODIFY("IN-2") | |
| 47048 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 47049 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 47050 | PORT_MODIFY("IN-3") | |
| 47051 | // 0x0001 - "uitbet" // unexpected here | |
| 47052 | // 0x0002 - "n club" // unexpected here | |
| 47053 | // 0x0010 - "player" // standard input (expected here) | |
| 47054 | PORT_MODIFY("IN-4") | |
| 47055 | // 0x0001 - "l hop" // unexpected here | |
| 47056 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 47057 | // 0x0004 - "l hop" // unexpected here | |
| 47058 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 47059 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 47060 | PORT_MODIFY("IN-5") | |
| 47061 | // 0x0001 - "l lege" // standard input (expected here) | |
| 47062 | // 0x0002 - "r lege" // standard input (expected here) | |
| 47063 | // 0x0004 - "dump" // standard input (expected here) | |
| 47064 | PORT_MODIFY("IN-16") | |
| 47065 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47066 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47067 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47068 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47069 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47070 | PORT_MODIFY("IN-17") | |
| 47071 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47072 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47073 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47074 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47075 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47076 | PORT_MODIFY("IN-18") | |
| 47077 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47078 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47079 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47080 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47081 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47082 | PORT_MODIFY("IN-19") | |
| 47083 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47084 | PORT_MODIFY("IN-20") | |
| 47085 | // 0x0001 - "green" // standard input (motherboard) | |
| 47086 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 47087 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 47088 | // 0x0010 - "boekho" // standard input (expected here) | |
| 47089 | 47089 | INPUT_PORTS_END |
| 47090 | 47090 | |
| 47091 | 47091 | |
| r31373 | r31374 | |
| 47110 | 47110 | } |
| 47111 | 47111 | |
| 47112 | 47112 | INPUT_PORTS_START( sc4czfra ) // this structure is generated |
| 47113 | PORT_INCLUDE( sc4_base ) | |
| 47114 | PORT_MODIFY("IN-1") | |
| 47115 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 47116 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 47117 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 47118 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("herste") | |
| 47119 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 47120 | PORT_MODIFY("IN-2") | |
| 47121 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ruilen") | |
| 47122 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 47123 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 47124 | PORT_MODIFY("IN-3") | |
| 47125 | // 0x0001 - "uitbet" // unexpected here | |
| 47126 | // 0x0002 - "neem w" // unexpected here | |
| 47127 | // 0x0004 - "neem l" // standard input (expected here) | |
| 47128 | // 0x0008 - "neem s" // standard input (expected here) | |
| 47129 | // 0x0010 - "info/l" // standard input (expected here) | |
| 47130 | PORT_MODIFY("IN-4") | |
| 47131 | // 0x0001 - "l hop" // unexpected here | |
| 47132 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 47133 | // 0x0004 - "l hop" // unexpected here | |
| 47134 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 47135 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 47136 | PORT_MODIFY("IN-5") | |
| 47137 | // 0x0001 - "l lege" // standard input (expected here) | |
| 47138 | // 0x0002 - "r lege" // standard input (expected here) | |
| 47139 | // 0x0004 - "dump" // standard input (expected here) | |
| 47140 | PORT_MODIFY("IN-16") | |
| 47141 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47142 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47143 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47144 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47145 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47146 | PORT_MODIFY("IN-17") | |
| 47147 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47148 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47149 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47150 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47151 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47152 | PORT_MODIFY("IN-18") | |
| 47153 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47154 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47155 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47156 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47157 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47158 | PORT_MODIFY("IN-19") | |
| 47159 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47160 | PORT_MODIFY("IN-20") | |
| 47161 | // 0x0001 - "green" // standard input (motherboard) | |
| 47162 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 47163 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 47164 | // 0x0010 - "boekho" // standard input (expected here) | |
| 47113 | PORT_INCLUDE( sc4_base ) | |
| 47114 | PORT_MODIFY("IN-1") | |
| 47115 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("vast 1") | |
| 47116 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("vast 2") | |
| 47117 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("vast 3") | |
| 47118 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("herste") | |
| 47119 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 47120 | PORT_MODIFY("IN-2") | |
| 47121 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ruilen") | |
| 47122 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("start") | |
| 47123 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("bijvul") | |
| 47124 | PORT_MODIFY("IN-3") | |
| 47125 | // 0x0001 - "uitbet" // unexpected here | |
| 47126 | // 0x0002 - "neem w" // unexpected here | |
| 47127 | // 0x0004 - "neem l" // standard input (expected here) | |
| 47128 | // 0x0008 - "neem s" // standard input (expected here) | |
| 47129 | // 0x0010 - "info/l" // standard input (expected here) | |
| 47130 | PORT_MODIFY("IN-4") | |
| 47131 | // 0x0001 - "l hop" // unexpected here | |
| 47132 | // 0x0002 - "r hop" // known extended(?) input, sometimes 'hop hi' | |
| 47133 | // 0x0004 - "l hop" // unexpected here | |
| 47134 | // 0x0008 - "r hop" // known extended(?) input, sometimes 'hop top' | |
| 47135 | // 0x0010 - "hopper" // known extended(?) input, sometimes 'top up' | |
| 47136 | PORT_MODIFY("IN-5") | |
| 47137 | // 0x0001 - "l lege" // standard input (expected here) | |
| 47138 | // 0x0002 - "r lege" // standard input (expected here) | |
| 47139 | // 0x0004 - "dump" // standard input (expected here) | |
| 47140 | PORT_MODIFY("IN-16") | |
| 47141 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47142 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47143 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47144 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47145 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47146 | PORT_MODIFY("IN-17") | |
| 47147 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47148 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47149 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47150 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47151 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47152 | PORT_MODIFY("IN-18") | |
| 47153 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47154 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47155 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47156 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47157 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47158 | PORT_MODIFY("IN-19") | |
| 47159 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47160 | PORT_MODIFY("IN-20") | |
| 47161 | // 0x0001 - "green" // standard input (motherboard) | |
| 47162 | // 0x0002 - "cashbo" // standard input (expected here) | |
| 47163 | // 0x0008 - "zijdeu" // standard input (expected here) | |
| 47164 | // 0x0010 - "boekho" // standard input (expected here) | |
| 47165 | 47165 | INPUT_PORTS_END |
| 47166 | 47166 | |
| 47167 | 47167 | // PR1212 CRAZY FRUITS PR1152 CRAZY FRUITS SOUNDS11 |
| r31373 | r31374 | |
| 47174 | 47174 | /**********************************************************************************************************************************/ |
| 47175 | 47175 | |
| 47176 | 47176 | INPUT_PORTS_START( sc4adsnt ) // this structure is generated |
| 47177 | PORT_INCLUDE( sc4_base ) | |
| 47178 | PORT_MODIFY("IN-1") | |
| 47179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47180 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47181 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47182 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47183 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47184 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47185 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47186 | PORT_MODIFY("IN-2") | |
| 47187 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47188 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47189 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47190 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47191 | PORT_MODIFY("IN-3") | |
| 47192 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47193 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 47194 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 47195 | PORT_MODIFY("IN-4") | |
| 47196 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 47197 | PORT_MODIFY("IN-5") | |
| 47198 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47199 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47200 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47201 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47202 | PORT_MODIFY("IN-6") | |
| 47203 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47204 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47205 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47206 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47207 | PORT_MODIFY("IN-8") | |
| 47208 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("gamble") | |
| 47209 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("grabs") | |
| 47210 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featur") | |
| 47211 | PORT_MODIFY("IN-16") | |
| 47212 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47213 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47214 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47215 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47216 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47217 | PORT_MODIFY("IN-17") | |
| 47218 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47219 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47220 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47221 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47222 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47223 | PORT_MODIFY("IN-18") | |
| 47224 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47225 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47226 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47227 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47228 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47229 | PORT_MODIFY("IN-19") | |
| 47230 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47231 | PORT_MODIFY("IN-20") | |
| 47232 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47233 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47234 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47235 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47236 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47177 | PORT_INCLUDE( sc4_base ) | |
| 47178 | PORT_MODIFY("IN-1") | |
| 47179 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47180 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47181 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47182 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47183 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47184 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47185 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47186 | PORT_MODIFY("IN-2") | |
| 47187 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47188 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47189 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47190 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47191 | PORT_MODIFY("IN-3") | |
| 47192 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47193 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 47194 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 47195 | PORT_MODIFY("IN-4") | |
| 47196 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 47197 | PORT_MODIFY("IN-5") | |
| 47198 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47199 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47200 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47201 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47202 | PORT_MODIFY("IN-6") | |
| 47203 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47204 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47205 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47206 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47207 | PORT_MODIFY("IN-8") | |
| 47208 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("gamble") | |
| 47209 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("grabs") | |
| 47210 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("featur") | |
| 47211 | PORT_MODIFY("IN-16") | |
| 47212 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47213 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47214 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47215 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47216 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47217 | PORT_MODIFY("IN-17") | |
| 47218 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47219 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47220 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47221 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47222 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47223 | PORT_MODIFY("IN-18") | |
| 47224 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47225 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47226 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47227 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47228 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47229 | PORT_MODIFY("IN-19") | |
| 47230 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47231 | PORT_MODIFY("IN-20") | |
| 47232 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47233 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47234 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47235 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47236 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47237 | 47237 | INPUT_PORTS_END |
| 47238 | 47238 | |
| 47239 | 47239 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47242 | 47242 | GAMEL( 200?, sc4adsnta ,sc4adsnt, sc4, sc4adsnt, sc4_state, sc4, ROT0, "BFM","Ant & Dec's Saturday Night Takeaway (Bellfruit) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 47243 | 47243 | |
| 47244 | 47244 | INPUT_PORTS_START( sc4slad ) // this structure is generated |
| 47245 | PORT_INCLUDE( sc4_base ) | |
| 47246 | PORT_MODIFY("IN-1") | |
| 47247 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47248 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 47249 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 47250 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 47251 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 47252 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47253 | PORT_MODIFY("IN-2") | |
| 47254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47255 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47256 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47257 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47258 | PORT_MODIFY("IN-3") | |
| 47259 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47260 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47261 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47262 | PORT_MODIFY("IN-5") | |
| 47263 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47264 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47265 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47266 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47267 | PORT_MODIFY("IN-6") | |
| 47268 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47269 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47270 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47271 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47272 | PORT_MODIFY("IN-16") | |
| 47273 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47274 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47275 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47276 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47277 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47278 | PORT_MODIFY("IN-17") | |
| 47279 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47280 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47281 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47282 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47283 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47284 | PORT_MODIFY("IN-18") | |
| 47285 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47286 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47287 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47288 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47289 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47290 | PORT_MODIFY("IN-19") | |
| 47291 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47292 | PORT_MODIFY("IN-20") | |
| 47293 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47294 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47295 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47296 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47297 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47245 | PORT_INCLUDE( sc4_base ) | |
| 47246 | PORT_MODIFY("IN-1") | |
| 47247 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47248 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 47249 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 47250 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 47251 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 47252 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47253 | PORT_MODIFY("IN-2") | |
| 47254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47255 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47256 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47257 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47258 | PORT_MODIFY("IN-3") | |
| 47259 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47260 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47261 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47262 | PORT_MODIFY("IN-5") | |
| 47263 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47264 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47265 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47266 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47267 | PORT_MODIFY("IN-6") | |
| 47268 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47269 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47270 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47271 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47272 | PORT_MODIFY("IN-16") | |
| 47273 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47274 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47275 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47276 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47277 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47278 | PORT_MODIFY("IN-17") | |
| 47279 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47280 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47281 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47282 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47283 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47284 | PORT_MODIFY("IN-18") | |
| 47285 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47286 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47287 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47288 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47289 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47290 | PORT_MODIFY("IN-19") | |
| 47291 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47292 | PORT_MODIFY("IN-20") | |
| 47293 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47294 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47295 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47296 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47297 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47298 | 47298 | INPUT_PORTS_END |
| 47299 | 47299 | |
| 47300 | 47300 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47310 | 47310 | GAMEL( 200?, sc4sladh ,sc4slad, sc4, sc4slad, sc4_state, sc4, ROT0, "BFM","Snakes & Ladders (Bellfruit) (Scorpion 4) (set 9)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 47311 | 47311 | |
| 47312 | 47312 | INPUT_PORTS_START( sc4magci ) // this structure is generated |
| 47313 | PORT_INCLUDE( sc4_base ) | |
| 47314 | PORT_MODIFY("IN-1") | |
| 47315 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47316 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47317 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47318 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47319 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("magic") | |
| 47320 | PORT_MODIFY("IN-2") | |
| 47321 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 47322 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47323 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47324 | PORT_MODIFY("IN-4") | |
| 47325 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 47326 | PORT_MODIFY("IN-16") | |
| 47327 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47328 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47329 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47330 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47331 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47332 | PORT_MODIFY("IN-17") | |
| 47333 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47334 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47335 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47336 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47337 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47338 | PORT_MODIFY("IN-18") | |
| 47339 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47340 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47341 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47342 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47343 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47344 | PORT_MODIFY("IN-19") | |
| 47345 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47346 | PORT_MODIFY("IN-20") | |
| 47347 | // 0x0001 - "test" // standard input (motherboard) | |
| 47348 | // 0x0002 - "botdor" // standard input (expected here) | |
| 47349 | // 0x0004 - "topdor" // standard input (expected here) | |
| 47350 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47313 | PORT_INCLUDE( sc4_base ) | |
| 47314 | PORT_MODIFY("IN-1") | |
| 47315 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47316 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47317 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47318 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47319 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("magic") | |
| 47320 | PORT_MODIFY("IN-2") | |
| 47321 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 47322 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47323 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47324 | PORT_MODIFY("IN-4") | |
| 47325 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 47326 | PORT_MODIFY("IN-16") | |
| 47327 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47328 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47329 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47330 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47331 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47332 | PORT_MODIFY("IN-17") | |
| 47333 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47334 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47335 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47336 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47337 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47338 | PORT_MODIFY("IN-18") | |
| 47339 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47340 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47341 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47342 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47343 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47344 | PORT_MODIFY("IN-19") | |
| 47345 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47346 | PORT_MODIFY("IN-20") | |
| 47347 | // 0x0001 - "test" // standard input (motherboard) | |
| 47348 | // 0x0002 - "botdor" // standard input (expected here) | |
| 47349 | // 0x0004 - "topdor" // standard input (expected here) | |
| 47350 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47351 | 47351 | INPUT_PORTS_END |
| 47352 | 47352 | |
| 47353 | 47353 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47385 | 47385 | GAMEL( 200?, sc4magciu ,sc4magci, sc4, sc4magci, sc4_state, sc4, ROT0, "Qps","Magic Circle (034) (Qps) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 47386 | 47386 | |
| 47387 | 47387 | INPUT_PORTS_START( sc4dcrls ) // this structure is generated |
| 47388 | PORT_INCLUDE( sc4_base ) | |
| 47389 | PORT_MODIFY("IN-1") | |
| 47390 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47391 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47392 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47393 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47394 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("streak") | |
| 47395 | PORT_MODIFY("IN-2") | |
| 47396 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 47397 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47398 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47399 | PORT_MODIFY("IN-4") | |
| 47400 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 47401 | PORT_MODIFY("IN-16") | |
| 47402 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47403 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47404 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47405 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47406 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47407 | PORT_MODIFY("IN-17") | |
| 47408 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47409 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47410 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47411 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47412 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47413 | PORT_MODIFY("IN-18") | |
| 47414 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47415 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47416 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47417 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47418 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47419 | PORT_MODIFY("IN-19") | |
| 47420 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47421 | PORT_MODIFY("IN-20") | |
| 47422 | // 0x0001 - "test" // standard input (motherboard) | |
| 47423 | // 0x0002 - "botdor" // standard input (expected here) | |
| 47424 | // 0x0004 - "topdor" // standard input (expected here) | |
| 47425 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47388 | PORT_INCLUDE( sc4_base ) | |
| 47389 | PORT_MODIFY("IN-1") | |
| 47390 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47391 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47392 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47393 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47394 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("streak") | |
| 47395 | PORT_MODIFY("IN-2") | |
| 47396 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 47397 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47398 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47399 | PORT_MODIFY("IN-4") | |
| 47400 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 47401 | PORT_MODIFY("IN-16") | |
| 47402 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47403 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47404 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47405 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47406 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47407 | PORT_MODIFY("IN-17") | |
| 47408 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47409 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47410 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47411 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47412 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47413 | PORT_MODIFY("IN-18") | |
| 47414 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47415 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 47416 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 47417 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 47418 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 47419 | PORT_MODIFY("IN-19") | |
| 47420 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 47421 | PORT_MODIFY("IN-20") | |
| 47422 | // 0x0001 - "test" // standard input (motherboard) | |
| 47423 | // 0x0002 - "botdor" // standard input (expected here) | |
| 47424 | // 0x0004 - "topdor" // standard input (expected here) | |
| 47425 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47426 | 47426 | INPUT_PORTS_END |
| 47427 | 47427 | |
| 47428 | 47428 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47446 | 47446 | GAMEL( 200?, sc4dcrlsk ,sc4dcrls, sc4, sc4dcrls, sc4_state, sc4, ROT0, "Mazooma","Double Crazy Reels (033) (Mazooma) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 47447 | 47447 | |
| 47448 | 47448 | INPUT_PORTS_START( sc4gshot ) // this structure is generated |
| 47449 | PORT_INCLUDE( sc4_base ) | |
| 47450 | PORT_MODIFY("IN-1") | |
| 47451 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47452 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 47453 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 47454 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 47455 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 47456 | PORT_MODIFY("IN-2") | |
| 47457 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 47458 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47459 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47460 | PORT_MODIFY("IN-4") | |
| 47461 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 47462 | PORT_MODIFY("IN-16") | |
| 47463 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47464 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47465 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47466 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47467 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47468 | PORT_MODIFY("IN-17") | |
| 47469 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47470 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47471 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47472 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47473 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47474 | PORT_MODIFY("IN-18") | |
| 47475 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47476 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47477 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47478 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47479 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47480 | PORT_MODIFY("IN-19") | |
| 47481 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47482 | PORT_MODIFY("IN-20") | |
| 47483 | // 0x0001 - "test" // standard input (motherboard) | |
| 47484 | // 0x0002 - "botdor" // standard input (expected here) | |
| 47485 | // 0x0004 - "topdor" // standard input (expected here) | |
| 47486 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47449 | PORT_INCLUDE( sc4_base ) | |
| 47450 | PORT_MODIFY("IN-1") | |
| 47451 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47452 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 47453 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 47454 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 47455 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("auto") | |
| 47456 | PORT_MODIFY("IN-2") | |
| 47457 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 47458 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47459 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47460 | PORT_MODIFY("IN-4") | |
| 47461 | // 0x0008 - "topup" // known extended(?) input, sometimes 'hop top' | |
| 47462 | PORT_MODIFY("IN-16") | |
| 47463 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47464 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47465 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47466 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47467 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47468 | PORT_MODIFY("IN-17") | |
| 47469 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47470 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47471 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47472 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47473 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47474 | PORT_MODIFY("IN-18") | |
| 47475 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47476 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47477 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47478 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47479 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47480 | PORT_MODIFY("IN-19") | |
| 47481 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47482 | PORT_MODIFY("IN-20") | |
| 47483 | // 0x0001 - "test" // standard input (motherboard) | |
| 47484 | // 0x0002 - "botdor" // standard input (expected here) | |
| 47485 | // 0x0004 - "topdor" // standard input (expected here) | |
| 47486 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47487 | 47487 | INPUT_PORTS_END |
| 47488 | 47488 | |
| 47489 | 47489 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47495 | 47495 | GAMEL( 200?, sc4gshotc ,sc4gshot, sc4, sc4gshot, sc4_state, sc4, ROT0, "Qps","Golden Shot Arcade (Qps) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 47496 | 47496 | |
| 47497 | 47497 | INPUT_PORTS_START( sc4cj ) // this structure is generated |
| 47498 | PORT_INCLUDE( sc4_base ) | |
| 47499 | PORT_MODIFY("IN-1") | |
| 47500 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47501 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47502 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47503 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47504 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47505 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47506 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47507 | PORT_MODIFY("IN-2") | |
| 47508 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47509 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47510 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47511 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47512 | PORT_MODIFY("IN-3") | |
| 47513 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47514 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47515 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47516 | PORT_MODIFY("IN-4") | |
| 47517 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 47518 | PORT_MODIFY("IN-5") | |
| 47519 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47520 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47521 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47522 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47523 | PORT_MODIFY("IN-6") | |
| 47524 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47525 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47526 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47527 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47528 | PORT_MODIFY("IN-8") | |
| 47529 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 47530 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c feat") | |
| 47531 | PORT_MODIFY("IN-16") | |
| 47532 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47533 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47534 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47535 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47536 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47537 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 47538 | PORT_MODIFY("IN-17") | |
| 47539 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47540 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47541 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47542 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47543 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47544 | PORT_MODIFY("IN-18") | |
| 47545 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47546 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47547 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47548 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47549 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47550 | PORT_MODIFY("IN-19") | |
| 47551 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47552 | PORT_MODIFY("IN-20") | |
| 47553 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47554 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47555 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47556 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47557 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47498 | PORT_INCLUDE( sc4_base ) | |
| 47499 | PORT_MODIFY("IN-1") | |
| 47500 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47501 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47502 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47503 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47504 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47505 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47506 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47507 | PORT_MODIFY("IN-2") | |
| 47508 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47509 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47510 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47511 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47512 | PORT_MODIFY("IN-3") | |
| 47513 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47514 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47515 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47516 | PORT_MODIFY("IN-4") | |
| 47517 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 47518 | PORT_MODIFY("IN-5") | |
| 47519 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47520 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47521 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47522 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47523 | PORT_MODIFY("IN-6") | |
| 47524 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47525 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47526 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47527 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47528 | PORT_MODIFY("IN-8") | |
| 47529 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c cash") | |
| 47530 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c feat") | |
| 47531 | PORT_MODIFY("IN-16") | |
| 47532 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47533 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47534 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47535 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47536 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47537 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 47538 | PORT_MODIFY("IN-17") | |
| 47539 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47540 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47541 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47542 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47543 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47544 | PORT_MODIFY("IN-18") | |
| 47545 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47546 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47547 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47548 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47549 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47550 | PORT_MODIFY("IN-19") | |
| 47551 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47552 | PORT_MODIFY("IN-20") | |
| 47553 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47554 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47555 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47556 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47557 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47558 | 47558 | INPUT_PORTS_END |
| 47559 | 47559 | |
| 47560 | 47560 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47566 | 47566 | GAMEL( 200?, sc4cjd ,sc4cj, sc4, sc4cj, sc4_state, sc4, ROT0, "BFM","Cool Jewels (Bellfruit) (Scorpion 4) (set 5)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) // incomplete pairing |
| 47567 | 47567 | |
| 47568 | 47568 | INPUT_PORTS_START( sc4crnjw ) // this structure is generated |
| 47569 | PORT_INCLUDE( sc4_base ) | |
| 47570 | PORT_MODIFY("IN-1") | |
| 47571 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47572 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47573 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47574 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47575 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47576 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47577 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47578 | PORT_MODIFY("IN-2") | |
| 47579 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47580 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47581 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47582 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47583 | PORT_MODIFY("IN-3") | |
| 47584 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47585 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 47586 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 47587 | PORT_MODIFY("IN-4") | |
| 47588 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 47589 | PORT_MODIFY("IN-5") | |
| 47590 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47591 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47592 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47593 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47594 | PORT_MODIFY("IN-6") | |
| 47595 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47596 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47597 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47598 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47599 | PORT_MODIFY("IN-8") | |
| 47600 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("red b") | |
| 47601 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("oran b") | |
| 47602 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bonus") | |
| 47603 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("blue b") | |
| 47604 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("gren b") | |
| 47605 | PORT_MODIFY("IN-16") | |
| 47606 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47607 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47608 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47609 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47610 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47611 | PORT_MODIFY("IN-17") | |
| 47612 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47613 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47614 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47615 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47616 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47617 | PORT_MODIFY("IN-18") | |
| 47618 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47619 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47620 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47621 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47622 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47623 | PORT_MODIFY("IN-19") | |
| 47624 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47625 | PORT_MODIFY("IN-20") | |
| 47626 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47627 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47628 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47629 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47630 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47569 | PORT_INCLUDE( sc4_base ) | |
| 47570 | PORT_MODIFY("IN-1") | |
| 47571 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47572 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47573 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47574 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47575 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47576 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47577 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47578 | PORT_MODIFY("IN-2") | |
| 47579 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47580 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47581 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47582 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47583 | PORT_MODIFY("IN-3") | |
| 47584 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47585 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 47586 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 47587 | PORT_MODIFY("IN-4") | |
| 47588 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 47589 | PORT_MODIFY("IN-5") | |
| 47590 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47591 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47592 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47593 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47594 | PORT_MODIFY("IN-6") | |
| 47595 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47596 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47597 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47598 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47599 | PORT_MODIFY("IN-8") | |
| 47600 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("red b") | |
| 47601 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("oran b") | |
| 47602 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bonus") | |
| 47603 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("blue b") | |
| 47604 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("gren b") | |
| 47605 | PORT_MODIFY("IN-16") | |
| 47606 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47607 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47608 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47609 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47610 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47611 | PORT_MODIFY("IN-17") | |
| 47612 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47613 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47614 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47615 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47616 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47617 | PORT_MODIFY("IN-18") | |
| 47618 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47619 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47620 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47621 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47622 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47623 | PORT_MODIFY("IN-19") | |
| 47624 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47625 | PORT_MODIFY("IN-20") | |
| 47626 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47627 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47628 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47629 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47630 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47631 | 47631 | INPUT_PORTS_END |
| 47632 | 47632 | |
| 47633 | 47633 | // PAY UNIT ERROR 17 |
| r31373 | r31374 | |
| 47636 | 47636 | GAMEL( 200?, sc4crnjwa ,sc4crnjw, sc4, sc4crnjw, sc4_state, sc4, ROT0, "BFM","Crown Jewels (Bellfruit) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 47637 | 47637 | |
| 47638 | 47638 | INPUT_PORTS_START( sc4jjok ) // this structure is generated |
| 47639 | PORT_INCLUDE( sc4_base ) | |
| 47640 | PORT_MODIFY("IN-1") | |
| 47641 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47642 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47643 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47644 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47645 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47646 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47647 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47648 | PORT_MODIFY("IN-2") | |
| 47649 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47650 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47651 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47652 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47653 | PORT_MODIFY("IN-3") | |
| 47654 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47655 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 47656 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 47657 | PORT_MODIFY("IN-5") | |
| 47658 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47659 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47660 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47661 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47662 | PORT_MODIFY("IN-6") | |
| 47663 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47664 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47665 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47666 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47667 | PORT_MODIFY("IN-8") | |
| 47668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo nud") | |
| 47669 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo csh") | |
| 47670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo fet") | |
| 47671 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi nud") | |
| 47672 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi csh") | |
| 47673 | PORT_MODIFY("IN-9") | |
| 47674 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fet") | |
| 47675 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("bonus") | |
| 47676 | PORT_MODIFY("IN-16") | |
| 47677 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47678 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47679 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47680 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47681 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47682 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 47683 | PORT_MODIFY("IN-17") | |
| 47684 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47685 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47686 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47687 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47688 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47689 | PORT_MODIFY("IN-18") | |
| 47690 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47691 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47692 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47693 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47694 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47695 | PORT_MODIFY("IN-19") | |
| 47696 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47697 | PORT_MODIFY("IN-20") | |
| 47698 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47699 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47700 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47701 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47702 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47639 | PORT_INCLUDE( sc4_base ) | |
| 47640 | PORT_MODIFY("IN-1") | |
| 47641 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47642 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47643 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47644 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47645 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 47646 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47647 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 47648 | PORT_MODIFY("IN-2") | |
| 47649 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47650 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47651 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47652 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47653 | PORT_MODIFY("IN-3") | |
| 47654 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47655 | // 0x0008 - "stk 2" // standard input (expected here) | |
| 47656 | // 0x0010 - "stk 3" // standard input (expected here) | |
| 47657 | PORT_MODIFY("IN-5") | |
| 47658 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47659 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47660 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47661 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47662 | PORT_MODIFY("IN-6") | |
| 47663 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47664 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47665 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47666 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47667 | PORT_MODIFY("IN-8") | |
| 47668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo nud") | |
| 47669 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("lo csh") | |
| 47670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo fet") | |
| 47671 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("hi nud") | |
| 47672 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi csh") | |
| 47673 | PORT_MODIFY("IN-9") | |
| 47674 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("hi fet") | |
| 47675 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("bonus") | |
| 47676 | PORT_MODIFY("IN-16") | |
| 47677 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 47678 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 47679 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 47680 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 47681 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 47682 | // 0x0100 - "htopup" // known extended input, usually 'top up' | |
| 47683 | PORT_MODIFY("IN-17") | |
| 47684 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 47685 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 47686 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 47687 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 47688 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47689 | PORT_MODIFY("IN-18") | |
| 47690 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47691 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47692 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47693 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47694 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47695 | PORT_MODIFY("IN-19") | |
| 47696 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47697 | PORT_MODIFY("IN-20") | |
| 47698 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47699 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47700 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47701 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47702 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47703 | 47703 | INPUT_PORTS_END |
| 47704 | 47704 | |
| 47705 | 47705 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47709 | 47709 | |
| 47710 | 47710 | |
| 47711 | 47711 | INPUT_PORTS_START( sc4copsr ) // this structure is generated |
| 47712 | PORT_INCLUDE( sc4_base ) | |
| 47713 | PORT_MODIFY("IN-1") | |
| 47714 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47715 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 47716 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 47717 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 47718 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 47719 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47720 | PORT_MODIFY("IN-2") | |
| 47721 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47722 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47723 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47724 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47725 | PORT_MODIFY("IN-3") | |
| 47726 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47727 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47728 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47729 | PORT_MODIFY("IN-5") | |
| 47730 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47731 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47732 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47733 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47734 | PORT_MODIFY("IN-6") | |
| 47735 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47736 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47737 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47738 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47739 | PORT_MODIFY("IN-16") | |
| 47740 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47741 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47742 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47743 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47744 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47745 | PORT_MODIFY("IN-17") | |
| 47746 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47747 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47748 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47749 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47750 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47751 | PORT_MODIFY("IN-18") | |
| 47752 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47753 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47754 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47755 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47756 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47757 | PORT_MODIFY("IN-19") | |
| 47758 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47759 | PORT_MODIFY("IN-20") | |
| 47760 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47761 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47762 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47763 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47764 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47712 | PORT_INCLUDE( sc4_base ) | |
| 47713 | PORT_MODIFY("IN-1") | |
| 47714 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47715 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 47716 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 47717 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 47718 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 47719 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 47720 | PORT_MODIFY("IN-2") | |
| 47721 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 47722 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 47723 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47724 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47725 | PORT_MODIFY("IN-3") | |
| 47726 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47727 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47728 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47729 | PORT_MODIFY("IN-5") | |
| 47730 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47731 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47732 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47733 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47734 | PORT_MODIFY("IN-6") | |
| 47735 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47736 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47737 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47738 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47739 | PORT_MODIFY("IN-16") | |
| 47740 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47741 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47742 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47743 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47744 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47745 | PORT_MODIFY("IN-17") | |
| 47746 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47747 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47748 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47749 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47750 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47751 | PORT_MODIFY("IN-18") | |
| 47752 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47753 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47754 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47755 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47756 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47757 | PORT_MODIFY("IN-19") | |
| 47758 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47759 | PORT_MODIFY("IN-20") | |
| 47760 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47761 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 47762 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47763 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 47764 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47765 | 47765 | INPUT_PORTS_END |
| 47766 | 47766 | |
| 47767 | 47767 | // PAY UNIT ERR 17 |
| r31373 | r31374 | |
| 47778 | 47778 | GAMEL( 200?, sc4copsri ,sc4copsr, sc4, sc4copsr, sc4_state, sc4, ROT0, "BFM","Cops 'n' Robbers (Bellfruit) (Scorpion 4) (set 10)", GAME_NOT_WORKING | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 47779 | 47779 | |
| 47780 | 47780 | INPUT_PORTS_START( sc4druby ) // this structure is generated |
| 47781 | PORT_INCLUDE( sc4_base ) | |
| 47782 | PORT_MODIFY("IN-1") | |
| 47783 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 47784 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47785 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47786 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47787 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 47788 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("pndlow OR 10plow") | |
| 47789 | PORT_MODIFY("IN-2") | |
| 47790 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 47791 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47792 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47793 | PORT_MODIFY("IN-3") | |
| 47794 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47795 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47796 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47797 | PORT_MODIFY("IN-4") | |
| 47798 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 47799 | PORT_MODIFY("IN-5") | |
| 47800 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47801 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47802 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47803 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47804 | PORT_MODIFY("IN-6") | |
| 47805 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47806 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47807 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47808 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47809 | PORT_MODIFY("IN-16") | |
| 47810 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47811 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47812 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47813 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47814 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47815 | PORT_MODIFY("IN-17") | |
| 47816 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47817 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47818 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47819 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47820 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47821 | PORT_MODIFY("IN-18") | |
| 47822 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47823 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47824 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47825 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47826 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47827 | PORT_MODIFY("IN-19") | |
| 47828 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47829 | PORT_MODIFY("IN-20") | |
| 47830 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47831 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 47832 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47833 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47781 | PORT_INCLUDE( sc4_base ) | |
| 47782 | PORT_MODIFY("IN-1") | |
| 47783 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 47784 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 47785 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 47786 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 47787 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("autopl") | |
| 47788 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("pndlow OR 10plow") | |
| 47789 | PORT_MODIFY("IN-2") | |
| 47790 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("transf") | |
| 47791 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("start") | |
| 47792 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 47793 | PORT_MODIFY("IN-3") | |
| 47794 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 47795 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 47796 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 47797 | PORT_MODIFY("IN-4") | |
| 47798 | // 0x0008 - "htopup" // known extended(?) input, sometimes 'hop top' | |
| 47799 | PORT_MODIFY("IN-5") | |
| 47800 | // 0x0001 - "priz4" // standard input (expected here) | |
| 47801 | // 0x0002 - "priz3" // standard input (expected here) | |
| 47802 | // 0x0004 - "priz2" // standard input (expected here) | |
| 47803 | // 0x0008 - "priz1" // standard input (expected here) | |
| 47804 | PORT_MODIFY("IN-6") | |
| 47805 | // 0x0001 - "perc1" // standard input (expected here) | |
| 47806 | // 0x0002 - "perc2" // standard input (expected here) | |
| 47807 | // 0x0004 - "perc3" // standard input (expected here) | |
| 47808 | // 0x0008 - "perc4" // standard input (expected here) | |
| 47809 | PORT_MODIFY("IN-16") | |
| 47810 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47811 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47812 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47813 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47814 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47815 | PORT_MODIFY("IN-17") | |
| 47816 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47817 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47818 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47819 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47820 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47821 | PORT_MODIFY("IN-18") | |
| 47822 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47823 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47824 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47825 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47826 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47827 | PORT_MODIFY("IN-19") | |
| 47828 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47829 | PORT_MODIFY("IN-20") | |
| 47830 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 47831 | // 0x0002 - "cshdor" // standard input (expected here) | |
| 47832 | // 0x0004 - "serdor" // standard input (expected here) | |
| 47833 | // 0x0008 - "hopdmp" // standard input (expected here) | |
| 47834 | 47834 | INPUT_PORTS_END |
| 47835 | 47835 | |
| 47836 | 47836 | // gives an 'init comms' countdown |
| r31373 | r31374 | |
| 47870 | 47870 | } |
| 47871 | 47871 | |
| 47872 | 47872 | INPUT_PORTS_START( sc4abra ) // this structure is generated |
| 47873 | PORT_INCLUDE( sc4_base ) | |
| 47874 | PORT_MODIFY("IN-1") | |
| 47875 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 47876 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 47877 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 47878 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 47879 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake") | |
| 47880 | PORT_MODIFY("IN-2") | |
| 47881 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 47882 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 47883 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47884 | PORT_MODIFY("IN-8") | |
| 47885 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 47886 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 47887 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 47888 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 47889 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 47890 | PORT_MODIFY("IN-9") | |
| 47891 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 47892 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 47893 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 47894 | PORT_MODIFY("IN-16") | |
| 47895 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47896 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47897 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47898 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47899 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47900 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 47901 | PORT_MODIFY("IN-17") | |
| 47902 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47903 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47904 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47905 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47906 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47907 | PORT_MODIFY("IN-18") | |
| 47908 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47909 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47910 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47911 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47912 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47913 | PORT_MODIFY("IN-19") | |
| 47914 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47915 | PORT_MODIFY("IN-20") | |
| 47916 | // 0x0001 - "test" // standard input (motherboard) | |
| 47917 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 47918 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 47919 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 47920 | // 0x0010 - "deflt" // standard input (expected here) | |
| 47873 | PORT_INCLUDE( sc4_base ) | |
| 47874 | PORT_MODIFY("IN-1") | |
| 47875 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 47876 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 47877 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 47878 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 47879 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake") | |
| 47880 | PORT_MODIFY("IN-2") | |
| 47881 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 47882 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 47883 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47884 | PORT_MODIFY("IN-8") | |
| 47885 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 47886 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 47887 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 47888 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 47889 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 47890 | PORT_MODIFY("IN-9") | |
| 47891 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 47892 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 47893 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 47894 | PORT_MODIFY("IN-16") | |
| 47895 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47896 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47897 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47898 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47899 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47900 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 47901 | PORT_MODIFY("IN-17") | |
| 47902 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47903 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47904 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47905 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47906 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 47907 | PORT_MODIFY("IN-18") | |
| 47908 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 47909 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 47910 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 47911 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 47912 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 47913 | PORT_MODIFY("IN-19") | |
| 47914 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 47915 | PORT_MODIFY("IN-20") | |
| 47916 | // 0x0001 - "test" // standard input (motherboard) | |
| 47917 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 47918 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 47919 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 47920 | // 0x0010 - "deflt" // standard input (expected here) | |
| 47921 | 47921 | INPUT_PORTS_END |
| 47922 | 47922 | |
| 47923 | 47923 | // missing sound roms |
| r31373 | r31374 | |
| 47931 | 47931 | |
| 47932 | 47932 | |
| 47933 | 47933 | INPUT_PORTS_START( sc4alad ) // this structure is generated |
| 47934 | PORT_INCLUDE( sc4_base ) | |
| 47935 | PORT_MODIFY("IN-1") | |
| 47936 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47937 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 47938 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 47939 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 47940 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("take") | |
| 47941 | PORT_MODIFY("IN-2") | |
| 47942 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 47943 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47944 | PORT_MODIFY("IN-8") | |
| 47945 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("ko") | |
| 47946 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blast") | |
| 47947 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 47948 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("winspn") | |
| 47949 | PORT_MODIFY("IN-16") | |
| 47950 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47951 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47952 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47953 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47954 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47955 | PORT_MODIFY("IN-17") | |
| 47956 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47957 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47958 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47959 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47960 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47961 | PORT_MODIFY("IN-18") | |
| 47962 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47963 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47964 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47965 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47966 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47967 | PORT_MODIFY("IN-19") | |
| 47968 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47969 | PORT_MODIFY("IN-20") | |
| 47970 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 47934 | PORT_INCLUDE( sc4_base ) | |
| 47935 | PORT_MODIFY("IN-1") | |
| 47936 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 47937 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 47938 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 47939 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 47940 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("take") | |
| 47941 | PORT_MODIFY("IN-2") | |
| 47942 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 47943 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 47944 | PORT_MODIFY("IN-8") | |
| 47945 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("ko") | |
| 47946 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("blast") | |
| 47947 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("cash") | |
| 47948 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("winspn") | |
| 47949 | PORT_MODIFY("IN-16") | |
| 47950 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 47951 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 47952 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 47953 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 47954 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 47955 | PORT_MODIFY("IN-17") | |
| 47956 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 47957 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 47958 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 47959 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 47960 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 47961 | PORT_MODIFY("IN-18") | |
| 47962 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 47963 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 47964 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 47965 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 47966 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 47967 | PORT_MODIFY("IN-19") | |
| 47968 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 47969 | PORT_MODIFY("IN-20") | |
| 47970 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 47971 | 47971 | INPUT_PORTS_END |
| 47972 | 47972 | |
| 47973 | 47973 | // bad / missing sound roms |
| r31373 | r31374 | |
| 47995 | 47995 | } |
| 47996 | 47996 | |
| 47997 | 47997 | INPUT_PORTS_START( sc4bigdl ) // this structure is generated |
| 47998 | PORT_INCLUDE( sc4_base ) | |
| 47999 | PORT_MODIFY("IN-1") | |
| 48000 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48001 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48002 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48003 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48004 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 48005 | PORT_MODIFY("IN-2") | |
| 48006 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 48007 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48008 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48009 | PORT_MODIFY("IN-8") | |
| 48010 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudges") | |
| 48011 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("feats") | |
| 48012 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("knock") | |
| 48013 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("cash") | |
| 48014 | PORT_MODIFY("IN-16") | |
| 48015 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48016 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48017 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48018 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48019 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48020 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48021 | PORT_MODIFY("IN-17") | |
| 48022 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48023 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48024 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48025 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48026 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48027 | PORT_MODIFY("IN-18") | |
| 48028 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48029 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48030 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48031 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48032 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48033 | PORT_MODIFY("IN-19") | |
| 48034 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48035 | PORT_MODIFY("IN-20") | |
| 48036 | // 0x0001 - "test" // standard input (motherboard) | |
| 48037 | // 0x0002 - "lock" // standard input (expected here) | |
| 48038 | // 0x0004 - "topdor" // standard input (expected here) | |
| 48039 | // 0x0008 - "botdor" // standard input (expected here) | |
| 48040 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 47998 | PORT_INCLUDE( sc4_base ) | |
| 47999 | PORT_MODIFY("IN-1") | |
| 48000 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48001 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48002 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48003 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48004 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collet") | |
| 48005 | PORT_MODIFY("IN-2") | |
| 48006 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 48007 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48008 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48009 | PORT_MODIFY("IN-8") | |
| 48010 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nudges") | |
| 48011 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("feats") | |
| 48012 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("knock") | |
| 48013 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("cash") | |
| 48014 | PORT_MODIFY("IN-16") | |
| 48015 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48016 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48017 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48018 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48019 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48020 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48021 | PORT_MODIFY("IN-17") | |
| 48022 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48023 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48024 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48025 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48026 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48027 | PORT_MODIFY("IN-18") | |
| 48028 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48029 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48030 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48031 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48032 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48033 | PORT_MODIFY("IN-19") | |
| 48034 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48035 | PORT_MODIFY("IN-20") | |
| 48036 | // 0x0001 - "test" // standard input (motherboard) | |
| 48037 | // 0x0002 - "lock" // standard input (expected here) | |
| 48038 | // 0x0004 - "topdor" // standard input (expected here) | |
| 48039 | // 0x0008 - "botdor" // standard input (expected here) | |
| 48040 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 48041 | 48041 | INPUT_PORTS_END |
| 48042 | 48042 | |
| 48043 | 48043 | // missing sound roms, doesn't play |
| r31373 | r31374 | |
| 48101 | 48101 | } |
| 48102 | 48102 | |
| 48103 | 48103 | INPUT_PORTS_START( sc4cconxd ) // this structure is generated |
| 48104 | PORT_INCLUDE( sc4_base ) | |
| 48105 | PORT_MODIFY("IN-1") | |
| 48106 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48107 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48108 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48109 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48110 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("take") | |
| 48111 | PORT_MODIFY("IN-2") | |
| 48112 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 48113 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchge") | |
| 48114 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48115 | PORT_MODIFY("IN-8") | |
| 48116 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonusn") | |
| 48117 | PORT_MODIFY("IN-16") | |
| 48118 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48119 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48120 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48121 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48122 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48123 | PORT_MODIFY("IN-17") | |
| 48124 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48125 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48126 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48127 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48128 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48129 | PORT_MODIFY("IN-18") | |
| 48130 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48131 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48132 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48133 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48134 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48135 | PORT_MODIFY("IN-19") | |
| 48136 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48137 | PORT_MODIFY("IN-20") | |
| 48138 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48104 | PORT_INCLUDE( sc4_base ) | |
| 48105 | PORT_MODIFY("IN-1") | |
| 48106 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48107 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48108 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48109 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48110 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("take") | |
| 48111 | PORT_MODIFY("IN-2") | |
| 48112 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto") | |
| 48113 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchge") | |
| 48114 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48115 | PORT_MODIFY("IN-8") | |
| 48116 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonusn") | |
| 48117 | PORT_MODIFY("IN-16") | |
| 48118 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48119 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48120 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48121 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48122 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48123 | PORT_MODIFY("IN-17") | |
| 48124 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48125 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48126 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48127 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48128 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48129 | PORT_MODIFY("IN-18") | |
| 48130 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48131 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48132 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48133 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48134 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48135 | PORT_MODIFY("IN-19") | |
| 48136 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48137 | PORT_MODIFY("IN-20") | |
| 48138 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48139 | 48139 | INPUT_PORTS_END |
| 48140 | 48140 | |
| 48141 | 48141 | // no sound roms |
| r31373 | r31374 | |
| 48163 | 48163 | } |
| 48164 | 48164 | |
| 48165 | 48165 | INPUT_PORTS_START( sc4ccrus ) // this structure is generated |
| 48166 | PORT_INCLUDE( sc4_base ) | |
| 48167 | PORT_MODIFY("IN-1") | |
| 48168 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48169 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("excnge") | |
| 48170 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 48171 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 48172 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 48173 | PORT_MODIFY("IN-2") | |
| 48174 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("higher") | |
| 48175 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("lower") | |
| 48176 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48177 | PORT_MODIFY("IN-4") | |
| 48178 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 48179 | PORT_MODIFY("IN-8") | |
| 48180 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 48181 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 48182 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk zpb") | |
| 48183 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk zpr") | |
| 48184 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk p r") | |
| 48185 | PORT_MODIFY("IN-9") | |
| 48186 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk p b") | |
| 48187 | PORT_MODIFY("IN-16") | |
| 48188 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48189 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48190 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48191 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48192 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48193 | PORT_MODIFY("IN-17") | |
| 48194 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48195 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48196 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48197 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48198 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48199 | PORT_MODIFY("IN-18") | |
| 48200 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48201 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48202 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48203 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48204 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48205 | PORT_MODIFY("IN-19") | |
| 48206 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48207 | PORT_MODIFY("IN-20") | |
| 48208 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48209 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48210 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48211 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48212 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48166 | PORT_INCLUDE( sc4_base ) | |
| 48167 | PORT_MODIFY("IN-1") | |
| 48168 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48169 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("excnge") | |
| 48170 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 48171 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 48172 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 48173 | PORT_MODIFY("IN-2") | |
| 48174 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("higher") | |
| 48175 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("lower") | |
| 48176 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48177 | PORT_MODIFY("IN-4") | |
| 48178 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 48179 | PORT_MODIFY("IN-8") | |
| 48180 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fet") | |
| 48181 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 48182 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk zpb") | |
| 48183 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk zpr") | |
| 48184 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk p r") | |
| 48185 | PORT_MODIFY("IN-9") | |
| 48186 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("tk p b") | |
| 48187 | PORT_MODIFY("IN-16") | |
| 48188 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48189 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48190 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48191 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48192 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48193 | PORT_MODIFY("IN-17") | |
| 48194 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48195 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48196 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48197 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48198 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48199 | PORT_MODIFY("IN-18") | |
| 48200 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48201 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48202 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48203 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48204 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48205 | PORT_MODIFY("IN-19") | |
| 48206 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48207 | PORT_MODIFY("IN-20") | |
| 48208 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48209 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48210 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48211 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48212 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48213 | 48213 | INPUT_PORTS_END |
| 48214 | 48214 | |
| 48215 | 48215 | |
| r31373 | r31374 | |
| 48239 | 48239 | } |
| 48240 | 48240 | |
| 48241 | 48241 | INPUT_PORTS_START( sc4jjc ) // this structure is generated |
| 48242 | PORT_INCLUDE( sc4_base ) | |
| 48243 | PORT_MODIFY("IN-1") | |
| 48244 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 48245 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 48246 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 48247 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 48248 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 48249 | PORT_MODIFY("IN-2") | |
| 48250 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 48251 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 48252 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48253 | PORT_MODIFY("IN-8") | |
| 48254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 48255 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 48256 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 48257 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 48258 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 48259 | PORT_MODIFY("IN-9") | |
| 48260 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 48261 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 48262 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 48263 | PORT_MODIFY("IN-16") | |
| 48264 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48265 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48266 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48267 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48268 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48269 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48270 | PORT_MODIFY("IN-17") | |
| 48271 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48272 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48273 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48274 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48275 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48276 | PORT_MODIFY("IN-18") | |
| 48277 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48278 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48279 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48280 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 48281 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 48282 | PORT_MODIFY("IN-19") | |
| 48283 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48284 | PORT_MODIFY("IN-20") | |
| 48285 | // 0x0001 - "test" // standard input (motherboard) | |
| 48286 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 48287 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 48288 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 48289 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48242 | PORT_INCLUDE( sc4_base ) | |
| 48243 | PORT_MODIFY("IN-1") | |
| 48244 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 48245 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 48246 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 48247 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 48248 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 48249 | PORT_MODIFY("IN-2") | |
| 48250 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 48251 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 48252 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48253 | PORT_MODIFY("IN-8") | |
| 48254 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 48255 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 48256 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 48257 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 48258 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 48259 | PORT_MODIFY("IN-9") | |
| 48260 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 48261 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 48262 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 48263 | PORT_MODIFY("IN-16") | |
| 48264 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48265 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48266 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48267 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48268 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48269 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48270 | PORT_MODIFY("IN-17") | |
| 48271 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48272 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48273 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48274 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48275 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48276 | PORT_MODIFY("IN-18") | |
| 48277 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48278 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48279 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48280 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 48281 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 48282 | PORT_MODIFY("IN-19") | |
| 48283 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48284 | PORT_MODIFY("IN-20") | |
| 48285 | // 0x0001 - "test" // standard input (motherboard) | |
| 48286 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 48287 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 48288 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 48289 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48290 | 48290 | INPUT_PORTS_END |
| 48291 | 48291 | |
| 48292 | 48292 | // PR2152 JUMPIN JACK CASH JACK SOUNDS JUMPIN JACK CASH |
| r31373 | r31374 | |
| 48303 | 48303 | |
| 48304 | 48304 | |
| 48305 | 48305 | INPUT_PORTS_START( sc4kkong ) // this structure is generated |
| 48306 | PORT_INCLUDE( sc4_base ) | |
| 48307 | PORT_MODIFY("IN-1") | |
| 48308 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48309 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48310 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48311 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48312 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 48313 | PORT_MODIFY("IN-2") | |
| 48314 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 48315 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 48316 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48317 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48318 | PORT_MODIFY("IN-8") | |
| 48319 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 48320 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 48321 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("dice") | |
| 48322 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 48323 | PORT_MODIFY("IN-16") | |
| 48324 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48325 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48326 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48327 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48328 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48329 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48330 | PORT_MODIFY("IN-17") | |
| 48331 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48332 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48333 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48334 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48335 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48336 | PORT_MODIFY("IN-18") | |
| 48337 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48338 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48339 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48340 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48341 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48342 | PORT_MODIFY("IN-19") | |
| 48343 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48344 | PORT_MODIFY("IN-20") | |
| 48345 | // 0x0001 - "test" // standard input (motherboard) | |
| 48346 | // 0x0002 - "lock" // standard input (expected here) | |
| 48347 | // 0x0004 - "topdor" // standard input (expected here) | |
| 48348 | // 0x0008 - "botdor" // standard input (expected here) | |
| 48349 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 48306 | PORT_INCLUDE( sc4_base ) | |
| 48307 | PORT_MODIFY("IN-1") | |
| 48308 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48309 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48310 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48311 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48312 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 48313 | PORT_MODIFY("IN-2") | |
| 48314 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 48315 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("transf") | |
| 48316 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48317 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48318 | PORT_MODIFY("IN-8") | |
| 48319 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 48320 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("c pot") | |
| 48321 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("dice") | |
| 48322 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nudge") | |
| 48323 | PORT_MODIFY("IN-16") | |
| 48324 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48325 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48326 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48327 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48328 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48329 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48330 | PORT_MODIFY("IN-17") | |
| 48331 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48332 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48333 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48334 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48335 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48336 | PORT_MODIFY("IN-18") | |
| 48337 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48338 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48339 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48340 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48341 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48342 | PORT_MODIFY("IN-19") | |
| 48343 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48344 | PORT_MODIFY("IN-20") | |
| 48345 | // 0x0001 - "test" // standard input (motherboard) | |
| 48346 | // 0x0002 - "lock" // standard input (expected here) | |
| 48347 | // 0x0004 - "topdor" // standard input (expected here) | |
| 48348 | // 0x0008 - "botdor" // standard input (expected here) | |
| 48349 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 48350 | 48350 | INPUT_PORTS_END |
| 48351 | 48351 | |
| 48352 | 48352 | // PR2161 KING KONG CASH 000 KKCSH SOUNDS KING KONG CASH |
| r31373 | r31374 | |
| 48396 | 48396 | } |
| 48397 | 48397 | |
| 48398 | 48398 | INPUT_PORTS_START( sc4knok ) // this structure is generated |
| 48399 | PORT_INCLUDE( sc4_base ) | |
| 48400 | PORT_MODIFY("IN-1") | |
| 48401 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48402 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48403 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48404 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48405 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 48406 | PORT_MODIFY("IN-2") | |
| 48407 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto n") | |
| 48408 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("take f") | |
| 48409 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48410 | PORT_MODIFY("IN-8") | |
| 48411 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("ko") | |
| 48412 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi c") | |
| 48413 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo c") | |
| 48414 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo n") | |
| 48415 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi n") | |
| 48416 | PORT_MODIFY("IN-16") | |
| 48417 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48418 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48419 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48420 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48421 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48422 | PORT_MODIFY("IN-17") | |
| 48423 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48424 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48425 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48426 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48427 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48428 | PORT_MODIFY("IN-18") | |
| 48429 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48430 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48431 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48432 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48433 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48434 | PORT_MODIFY("IN-19") | |
| 48435 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48436 | PORT_MODIFY("IN-20") | |
| 48437 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48399 | PORT_INCLUDE( sc4_base ) | |
| 48400 | PORT_MODIFY("IN-1") | |
| 48401 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48402 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48403 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48404 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48405 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 48406 | PORT_MODIFY("IN-2") | |
| 48407 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("auto n") | |
| 48408 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("take f") | |
| 48409 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48410 | PORT_MODIFY("IN-8") | |
| 48411 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("ko") | |
| 48412 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi c") | |
| 48413 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lo c") | |
| 48414 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lo n") | |
| 48415 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("hi n") | |
| 48416 | PORT_MODIFY("IN-16") | |
| 48417 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48418 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48419 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48420 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48421 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48422 | PORT_MODIFY("IN-17") | |
| 48423 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48424 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48425 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48426 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48427 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48428 | PORT_MODIFY("IN-18") | |
| 48429 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48430 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48431 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48432 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48433 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48434 | PORT_MODIFY("IN-19") | |
| 48435 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48436 | PORT_MODIFY("IN-20") | |
| 48437 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48438 | 48438 | INPUT_PORTS_END |
| 48439 | 48439 | |
| 48440 | 48440 | |
| r31373 | r31374 | |
| 48444 | 48444 | |
| 48445 | 48445 | |
| 48446 | 48446 | INPUT_PORTS_START( sc4knokb ) // this structure is generated |
| 48447 | PORT_INCLUDE( sc4_base ) | |
| 48448 | PORT_MODIFY("IN-1") | |
| 48449 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48450 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold a") | |
| 48451 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold b") | |
| 48452 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold c") | |
| 48453 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 48454 | PORT_MODIFY("IN-2") | |
| 48455 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 48456 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48457 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48458 | PORT_MODIFY("IN-8") | |
| 48459 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take") | |
| 48460 | PORT_MODIFY("IN-16") | |
| 48461 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48462 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48463 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48464 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48465 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48466 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48467 | PORT_MODIFY("IN-17") | |
| 48468 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48469 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48470 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48471 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48472 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48473 | PORT_MODIFY("IN-18") | |
| 48474 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48475 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48476 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48477 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48478 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48479 | PORT_MODIFY("IN-19") | |
| 48480 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48481 | PORT_MODIFY("IN-20") | |
| 48482 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48483 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48484 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48485 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48486 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48447 | PORT_INCLUDE( sc4_base ) | |
| 48448 | PORT_MODIFY("IN-1") | |
| 48449 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48450 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold a") | |
| 48451 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold b") | |
| 48452 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold c") | |
| 48453 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 48454 | PORT_MODIFY("IN-2") | |
| 48455 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 48456 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48457 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48458 | PORT_MODIFY("IN-8") | |
| 48459 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("take") | |
| 48460 | PORT_MODIFY("IN-16") | |
| 48461 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48462 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48463 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48464 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48465 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48466 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48467 | PORT_MODIFY("IN-17") | |
| 48468 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48469 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48470 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48471 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48472 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48473 | PORT_MODIFY("IN-18") | |
| 48474 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48475 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48476 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48477 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48478 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48479 | PORT_MODIFY("IN-19") | |
| 48480 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48481 | PORT_MODIFY("IN-20") | |
| 48482 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48483 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48484 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48485 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48486 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48487 | 48487 | INPUT_PORTS_END |
| 48488 | 48488 | |
| 48489 | 48489 | // This is a different game |
| r31373 | r31374 | |
| 48510 | 48510 | } |
| 48511 | 48511 | |
| 48512 | 48512 | INPUT_PORTS_START( sc4maxcc ) // this structure is generated |
| 48513 | PORT_INCLUDE( sc4_base ) | |
| 48514 | PORT_MODIFY("IN-1") | |
| 48515 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 48516 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48517 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48518 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48519 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 48520 | PORT_MODIFY("IN-2") | |
| 48521 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 48522 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 48523 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48524 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48525 | PORT_MODIFY("IN-3") | |
| 48526 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 48527 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 48528 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 48529 | PORT_MODIFY("IN-4") | |
| 48530 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 48531 | PORT_MODIFY("IN-5") | |
| 48532 | // 0x0001 - "priz4" // standard input (expected here) | |
| 48533 | // 0x0002 - "priz3" // standard input (expected here) | |
| 48534 | // 0x0004 - "priz2" // standard input (expected here) | |
| 48535 | // 0x0008 - "priz1" // standard input (expected here) | |
| 48536 | PORT_MODIFY("IN-8") | |
| 48537 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nud lo") | |
| 48538 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("fet lo") | |
| 48539 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("knk lo") | |
| 48540 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("knk hi") | |
| 48541 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet hi") | |
| 48542 | PORT_MODIFY("IN-9") | |
| 48543 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nud hi") | |
| 48544 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk nud") | |
| 48545 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("tk fet") | |
| 48546 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("tk knk") | |
| 48547 | PORT_MODIFY("IN-16") | |
| 48548 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48549 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48550 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48551 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48552 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48553 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48554 | PORT_MODIFY("IN-17") | |
| 48555 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48556 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48557 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48558 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48559 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48560 | PORT_MODIFY("IN-18") | |
| 48561 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48562 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48563 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48564 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 48565 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 48566 | PORT_MODIFY("IN-19") | |
| 48567 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 48568 | PORT_MODIFY("IN-20") | |
| 48569 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 48570 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 48571 | // 0x0004 - "topdor" // standard input (expected here) | |
| 48572 | // 0x0008 - "botdor" // standard input (expected here) | |
| 48573 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 48513 | PORT_INCLUDE( sc4_base ) | |
| 48514 | PORT_MODIFY("IN-1") | |
| 48515 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 48516 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48517 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48518 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48519 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 48520 | PORT_MODIFY("IN-2") | |
| 48521 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 48522 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 48523 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48524 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48525 | PORT_MODIFY("IN-3") | |
| 48526 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 48527 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 48528 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 48529 | PORT_MODIFY("IN-4") | |
| 48530 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 48531 | PORT_MODIFY("IN-5") | |
| 48532 | // 0x0001 - "priz4" // standard input (expected here) | |
| 48533 | // 0x0002 - "priz3" // standard input (expected here) | |
| 48534 | // 0x0004 - "priz2" // standard input (expected here) | |
| 48535 | // 0x0008 - "priz1" // standard input (expected here) | |
| 48536 | PORT_MODIFY("IN-8") | |
| 48537 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nud lo") | |
| 48538 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("fet lo") | |
| 48539 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("knk lo") | |
| 48540 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("knk hi") | |
| 48541 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet hi") | |
| 48542 | PORT_MODIFY("IN-9") | |
| 48543 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nud hi") | |
| 48544 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk nud") | |
| 48545 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("tk fet") | |
| 48546 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("tk knk") | |
| 48547 | PORT_MODIFY("IN-16") | |
| 48548 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48549 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48550 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48551 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48552 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48553 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48554 | PORT_MODIFY("IN-17") | |
| 48555 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48556 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48557 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48558 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48559 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48560 | PORT_MODIFY("IN-18") | |
| 48561 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48562 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48563 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48564 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 48565 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 48566 | PORT_MODIFY("IN-19") | |
| 48567 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 48568 | PORT_MODIFY("IN-20") | |
| 48569 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 48570 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 48571 | // 0x0004 - "topdor" // standard input (expected here) | |
| 48572 | // 0x0008 - "botdor" // standard input (expected here) | |
| 48573 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 48574 | 48574 | INPUT_PORTS_END |
| 48575 | 48575 | |
| 48576 | 48576 | // PR2130 CLUB MAXIMUS CASH MAXIMUS CASH CLUB CMAX SOUNDS MAXIMUS CASH |
| r31373 | r31374 | |
| 48596 | 48596 | } |
| 48597 | 48597 | |
| 48598 | 48598 | INPUT_PORTS_START( sc4wadzl ) // this structure is generated |
| 48599 | PORT_INCLUDE( sc4_base ) | |
| 48600 | PORT_MODIFY("IN-1") | |
| 48601 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48602 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 48603 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 48604 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 48605 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 48606 | PORT_MODIFY("IN-2") | |
| 48607 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 48608 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48609 | PORT_MODIFY("IN-8") | |
| 48610 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("yel lo") | |
| 48611 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("csh lo") | |
| 48612 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("fet lo") | |
| 48613 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("fet hi") | |
| 48614 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("csh hi") | |
| 48615 | PORT_MODIFY("IN-9") | |
| 48616 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("yel hi") | |
| 48617 | PORT_MODIFY("IN-16") | |
| 48618 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48619 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48620 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48621 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48622 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48623 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48624 | PORT_MODIFY("IN-17") | |
| 48625 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48626 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48627 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48628 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48629 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48630 | PORT_MODIFY("IN-18") | |
| 48631 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48632 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48633 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48634 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48635 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48636 | PORT_MODIFY("IN-19") | |
| 48637 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48638 | PORT_MODIFY("IN-20") | |
| 48639 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48640 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48641 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48642 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48643 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48599 | PORT_INCLUDE( sc4_base ) | |
| 48600 | PORT_MODIFY("IN-1") | |
| 48601 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48602 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colect") | |
| 48603 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 48604 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 48605 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 48606 | PORT_MODIFY("IN-2") | |
| 48607 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 48608 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48609 | PORT_MODIFY("IN-8") | |
| 48610 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("yel lo") | |
| 48611 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("csh lo") | |
| 48612 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("fet lo") | |
| 48613 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("fet hi") | |
| 48614 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("csh hi") | |
| 48615 | PORT_MODIFY("IN-9") | |
| 48616 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("yel hi") | |
| 48617 | PORT_MODIFY("IN-16") | |
| 48618 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48619 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48620 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48621 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48622 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48623 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48624 | PORT_MODIFY("IN-17") | |
| 48625 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48626 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48627 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48628 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48629 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48630 | PORT_MODIFY("IN-18") | |
| 48631 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48632 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48633 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48634 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48635 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48636 | PORT_MODIFY("IN-19") | |
| 48637 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48638 | PORT_MODIFY("IN-20") | |
| 48639 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 48640 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48641 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48642 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48643 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48644 | 48644 | INPUT_PORTS_END |
| 48645 | 48645 | |
| 48646 | 48646 | // PR2052 WADZILLA WADZ SOUNDS WADZILLA |
| r31373 | r31374 | |
| 48649 | 48649 | |
| 48650 | 48650 | |
| 48651 | 48651 | INPUT_PORTS_START( sc4s16 ) // this structure is generated |
| 48652 | PORT_INCLUDE( sc4_base ) | |
| 48653 | PORT_MODIFY("IN-1") | |
| 48654 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("coll") | |
| 48655 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 48656 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("blnk1") | |
| 48657 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("blnk2") | |
| 48658 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("blnk3") | |
| 48659 | PORT_MODIFY("IN-2") | |
| 48660 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("max be") | |
| 48661 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48662 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48663 | PORT_MODIFY("IN-8") | |
| 48664 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("stake3") | |
| 48665 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("stake1") | |
| 48666 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("stake2") | |
| 48667 | PORT_MODIFY("IN-16") | |
| 48668 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48669 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48670 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48671 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48672 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48673 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48674 | PORT_MODIFY("IN-17") | |
| 48675 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48676 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48677 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48678 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48679 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48680 | PORT_MODIFY("IN-18") | |
| 48681 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48682 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48683 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48684 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48685 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48686 | PORT_MODIFY("IN-19") | |
| 48687 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48688 | PORT_MODIFY("IN-20") | |
| 48689 | // 0x0001 - "test" // standard input (motherboard) | |
| 48690 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48691 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48692 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48693 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48652 | PORT_INCLUDE( sc4_base ) | |
| 48653 | PORT_MODIFY("IN-1") | |
| 48654 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("coll") | |
| 48655 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 48656 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("blnk1") | |
| 48657 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("blnk2") | |
| 48658 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("blnk3") | |
| 48659 | PORT_MODIFY("IN-2") | |
| 48660 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("max be") | |
| 48661 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48662 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48663 | PORT_MODIFY("IN-8") | |
| 48664 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("stake3") | |
| 48665 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("stake1") | |
| 48666 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("stake2") | |
| 48667 | PORT_MODIFY("IN-16") | |
| 48668 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48669 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48670 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48671 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48672 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48673 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48674 | PORT_MODIFY("IN-17") | |
| 48675 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48676 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48677 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48678 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48679 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48680 | PORT_MODIFY("IN-18") | |
| 48681 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48682 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48683 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48684 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48685 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48686 | PORT_MODIFY("IN-19") | |
| 48687 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48688 | PORT_MODIFY("IN-20") | |
| 48689 | // 0x0001 - "test" // standard input (motherboard) | |
| 48690 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48691 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48692 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48693 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48694 | 48694 | INPUT_PORTS_END |
| 48695 | 48695 | |
| 48696 | 48696 | // RNG ERR 99 |
| r31373 | r31374 | |
| 48700 | 48700 | |
| 48701 | 48701 | |
| 48702 | 48702 | INPUT_PORTS_START( sc4bob ) // this structure is generated |
| 48703 | PORT_INCLUDE( sc4_base ) | |
| 48704 | PORT_MODIFY("IN-1") | |
| 48705 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 48706 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 48707 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 48708 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 48709 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 48710 | PORT_MODIFY("IN-2") | |
| 48711 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48712 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 48713 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48714 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48715 | PORT_MODIFY("IN-8") | |
| 48716 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash OR tke ft") | |
| 48717 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 48718 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 48719 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("levl1") | |
| 48720 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("levl2") | |
| 48721 | PORT_MODIFY("IN-9") | |
| 48722 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("levl3") | |
| 48723 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("levl4") | |
| 48724 | PORT_MODIFY("IN-16") | |
| 48725 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48726 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48727 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48728 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48729 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48730 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48731 | PORT_MODIFY("IN-17") | |
| 48732 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48733 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48734 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48735 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48736 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48737 | PORT_MODIFY("IN-18") | |
| 48738 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48739 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48740 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48741 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 48742 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 48743 | PORT_MODIFY("IN-19") | |
| 48744 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48745 | PORT_MODIFY("IN-20") | |
| 48746 | // 0x0001 - "test" // standard input (motherboard) | |
| 48747 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48748 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48749 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48750 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48703 | PORT_INCLUDE( sc4_base ) | |
| 48704 | PORT_MODIFY("IN-1") | |
| 48705 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 48706 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 48707 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 48708 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 48709 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 48710 | PORT_MODIFY("IN-2") | |
| 48711 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48712 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 48713 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48714 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48715 | PORT_MODIFY("IN-8") | |
| 48716 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash OR tke ft") | |
| 48717 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 48718 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 48719 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("levl1") | |
| 48720 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("levl2") | |
| 48721 | PORT_MODIFY("IN-9") | |
| 48722 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("levl3") | |
| 48723 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("levl4") | |
| 48724 | PORT_MODIFY("IN-16") | |
| 48725 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48726 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48727 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48728 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48729 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48730 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48731 | PORT_MODIFY("IN-17") | |
| 48732 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48733 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48734 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48735 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48736 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48737 | PORT_MODIFY("IN-18") | |
| 48738 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48739 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48740 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48741 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 48742 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 48743 | PORT_MODIFY("IN-19") | |
| 48744 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48745 | PORT_MODIFY("IN-20") | |
| 48746 | // 0x0001 - "test" // standard input (motherboard) | |
| 48747 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48748 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48749 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48750 | // 0x0010 - "deflt" // standard input (expected here) | |
| 48751 | 48751 | INPUT_PORTS_END |
| 48752 | 48752 | |
| 48753 | 48753 | // PR2170 BOBBY DAZZLER BOBD SOUNDS BOBBY DAZZLER |
| r31373 | r31374 | |
| 48763 | 48763 | GAMEL( 200?, sc4bobi ,sc4bob, sc4, sc4bob, sc4_state, sc4, ROT0, "Mazooma","Bobby Dazzler (Mazooma) (Scorpion 4) (set 10)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 48764 | 48764 | |
| 48765 | 48765 | INPUT_PORTS_START( sc4clue ) // this structure is generated |
| 48766 | PORT_INCLUDE( sc4_base ) | |
| 48767 | PORT_MODIFY("IN-1") | |
| 48768 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 48769 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48770 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48771 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48772 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 48773 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 48774 | PORT_MODIFY("IN-2") | |
| 48775 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48776 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 48777 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48778 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48779 | PORT_MODIFY("IN-3") | |
| 48780 | // 0x0004 - "stk3" // standard input (expected here) | |
| 48781 | // 0x0008 - "stk1" // standard input (expected here) | |
| 48782 | // 0x0010 - "stk2" // standard input (expected here) | |
| 48783 | PORT_MODIFY("IN-5") | |
| 48784 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 48785 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 48786 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 48787 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 48788 | PORT_MODIFY("IN-6") | |
| 48789 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 48790 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 48791 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 48792 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 48793 | PORT_MODIFY("IN-8") | |
| 48794 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h cash") | |
| 48795 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("h nuds") | |
| 48796 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkcpot") | |
| 48797 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tkspin") | |
| 48798 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fastpy") | |
| 48799 | PORT_MODIFY("IN-16") | |
| 48800 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48801 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48802 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48803 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48804 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48805 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48806 | PORT_MODIFY("IN-17") | |
| 48807 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48808 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48809 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48810 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48811 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48812 | PORT_MODIFY("IN-18") | |
| 48813 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48814 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48815 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48816 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48817 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48818 | PORT_MODIFY("IN-19") | |
| 48819 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48820 | PORT_MODIFY("IN-20") | |
| 48821 | // 0x0001 - "test" // standard input (motherboard) | |
| 48822 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 48823 | // 0x0004 - "topdr" // standard input (expected here) | |
| 48824 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 48825 | // 0x0010 - "dump" // standard input (expected here) | |
| 48766 | PORT_INCLUDE( sc4_base ) | |
| 48767 | PORT_MODIFY("IN-1") | |
| 48768 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 48769 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48770 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48771 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48772 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 48773 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 48774 | PORT_MODIFY("IN-2") | |
| 48775 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48776 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 48777 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48778 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48779 | PORT_MODIFY("IN-3") | |
| 48780 | // 0x0004 - "stk3" // standard input (expected here) | |
| 48781 | // 0x0008 - "stk1" // standard input (expected here) | |
| 48782 | // 0x0010 - "stk2" // standard input (expected here) | |
| 48783 | PORT_MODIFY("IN-5") | |
| 48784 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 48785 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 48786 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 48787 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 48788 | PORT_MODIFY("IN-6") | |
| 48789 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 48790 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 48791 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 48792 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 48793 | PORT_MODIFY("IN-8") | |
| 48794 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("h cash") | |
| 48795 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("h nuds") | |
| 48796 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkcpot") | |
| 48797 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tkspin") | |
| 48798 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fastpy") | |
| 48799 | PORT_MODIFY("IN-16") | |
| 48800 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48801 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48802 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48803 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48804 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48805 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 48806 | PORT_MODIFY("IN-17") | |
| 48807 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48808 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48809 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48810 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48811 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 48812 | PORT_MODIFY("IN-18") | |
| 48813 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 48814 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 48815 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 48816 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 48817 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 48818 | PORT_MODIFY("IN-19") | |
| 48819 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 48820 | PORT_MODIFY("IN-20") | |
| 48821 | // 0x0001 - "test" // standard input (motherboard) | |
| 48822 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 48823 | // 0x0004 - "topdr" // standard input (expected here) | |
| 48824 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 48825 | // 0x0010 - "dump" // standard input (expected here) | |
| 48826 | 48826 | INPUT_PORTS_END |
| 48827 | 48827 | |
| 48828 | 48828 | // PR2230 CLUEDO CLUE SOUNDS CLUEDO |
| r31373 | r31374 | |
| 48836 | 48836 | GAMEL( 200?, sc4clueg ,sc4clue, sc4, sc4clue, sc4_state, sc4, ROT0, "Mazooma","Cluedo (Mazooma) (Scorpion 4) (set 8)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 48837 | 48837 | |
| 48838 | 48838 | INPUT_PORTS_START( sc4ducks ) // this structure is generated |
| 48839 | PORT_INCLUDE( sc4_base ) | |
| 48840 | PORT_MODIFY("IN-1") | |
| 48841 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc OR coll") | |
| 48842 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48843 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48844 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48845 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exch") | |
| 48846 | PORT_MODIFY("IN-2") | |
| 48847 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48848 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("turbo") | |
| 48849 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48850 | PORT_MODIFY("IN-8") | |
| 48851 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkcpot") | |
| 48852 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("carry") | |
| 48853 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkwins") | |
| 48854 | PORT_MODIFY("IN-16") | |
| 48855 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48856 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48857 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48858 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48859 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48860 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48861 | PORT_MODIFY("IN-17") | |
| 48862 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48863 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48864 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48865 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48866 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48867 | PORT_MODIFY("IN-18") | |
| 48868 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48869 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48870 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48871 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 48872 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 48873 | PORT_MODIFY("IN-19") | |
| 48874 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48875 | PORT_MODIFY("IN-20") | |
| 48876 | // 0x0001 - "test" // standard input (motherboard) | |
| 48877 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48878 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48879 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48880 | // 0x0010 - "hp dmp" // standard input (expected here) | |
| 48839 | PORT_INCLUDE( sc4_base ) | |
| 48840 | PORT_MODIFY("IN-1") | |
| 48841 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc OR coll") | |
| 48842 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48843 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48844 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48845 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("exch") | |
| 48846 | PORT_MODIFY("IN-2") | |
| 48847 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48848 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("turbo") | |
| 48849 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48850 | PORT_MODIFY("IN-8") | |
| 48851 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tkcpot") | |
| 48852 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("carry") | |
| 48853 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkwins") | |
| 48854 | PORT_MODIFY("IN-16") | |
| 48855 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48856 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48857 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48858 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48859 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48860 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 48861 | PORT_MODIFY("IN-17") | |
| 48862 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48863 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48864 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48865 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48866 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48867 | PORT_MODIFY("IN-18") | |
| 48868 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48869 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 48870 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 48871 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 48872 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 48873 | PORT_MODIFY("IN-19") | |
| 48874 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48875 | PORT_MODIFY("IN-20") | |
| 48876 | // 0x0001 - "test" // standard input (motherboard) | |
| 48877 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 48878 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 48879 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 48880 | // 0x0010 - "hp dmp" // standard input (expected here) | |
| 48881 | 48881 | INPUT_PORTS_END |
| 48882 | 48882 | |
| 48883 | 48883 | // PR2118 DUCKS OF HAZZARD DUCKSOFHAZZARDSND DUCKS OF HAZZARD |
| r31373 | r31374 | |
| 48903 | 48903 | } |
| 48904 | 48904 | |
| 48905 | 48905 | INPUT_PORTS_START( sc4glad ) // this structure is generated |
| 48906 | PORT_INCLUDE( sc4_base ) | |
| 48907 | PORT_MODIFY("IN-1") | |
| 48908 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 48909 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48910 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48911 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48912 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 48913 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 48914 | PORT_MODIFY("IN-2") | |
| 48915 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48916 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 48917 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48918 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 48919 | PORT_MODIFY("IN-3") | |
| 48920 | // 0x0004 - "stk3" // standard input (expected here) | |
| 48921 | // 0x0008 - "stk1" // standard input (expected here) | |
| 48922 | // 0x0010 - "stk2" // standard input (expected here) | |
| 48923 | PORT_MODIFY("IN-4") | |
| 48924 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 48925 | PORT_MODIFY("IN-5") | |
| 48926 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 48927 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 48928 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 48929 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 48930 | PORT_MODIFY("IN-6") | |
| 48931 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 48932 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 48933 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 48934 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 48935 | PORT_MODIFY("IN-8") | |
| 48936 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 48937 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 48938 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 48939 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 48940 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 48941 | PORT_MODIFY("IN-9") | |
| 48942 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 48943 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 48944 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 48945 | PORT_MODIFY("IN-16") | |
| 48946 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48947 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48948 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48949 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48950 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48951 | PORT_MODIFY("IN-17") | |
| 48952 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48953 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48954 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48955 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48956 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48957 | PORT_MODIFY("IN-18") | |
| 48958 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48959 | // 0x0002 - "dil12 OR dorlk" // standard input (motherboard) | |
| 48960 | // 0x0004 - "dil13 OR topdr" // standard input (motherboard) | |
| 48961 | // 0x0008 - "dil14 OR cshbx" // standard input (motherboard) | |
| 48962 | // 0x0010 - "dil15 OR dump" // standard input (motherboard) | |
| 48963 | PORT_MODIFY("IN-19") | |
| 48964 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48965 | PORT_MODIFY("IN-20") | |
| 48966 | // 0x0001 - "test" // standard input (motherboard) | |
| 48906 | PORT_INCLUDE( sc4_base ) | |
| 48907 | PORT_MODIFY("IN-1") | |
| 48908 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 48909 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 48910 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 48911 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 48912 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 48913 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 48914 | PORT_MODIFY("IN-2") | |
| 48915 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 48916 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 48917 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48918 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 48919 | PORT_MODIFY("IN-3") | |
| 48920 | // 0x0004 - "stk3" // standard input (expected here) | |
| 48921 | // 0x0008 - "stk1" // standard input (expected here) | |
| 48922 | // 0x0010 - "stk2" // standard input (expected here) | |
| 48923 | PORT_MODIFY("IN-4") | |
| 48924 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 48925 | PORT_MODIFY("IN-5") | |
| 48926 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 48927 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 48928 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 48929 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 48930 | PORT_MODIFY("IN-6") | |
| 48931 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 48932 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 48933 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 48934 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 48935 | PORT_MODIFY("IN-8") | |
| 48936 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 48937 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 48938 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 48939 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 48940 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 48941 | PORT_MODIFY("IN-9") | |
| 48942 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 48943 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 48944 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 48945 | PORT_MODIFY("IN-16") | |
| 48946 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 48947 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 48948 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 48949 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 48950 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 48951 | PORT_MODIFY("IN-17") | |
| 48952 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 48953 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 48954 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 48955 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 48956 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 48957 | PORT_MODIFY("IN-18") | |
| 48958 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 48959 | // 0x0002 - "dil12 OR dorlk" // standard input (motherboard) | |
| 48960 | // 0x0004 - "dil13 OR topdr" // standard input (motherboard) | |
| 48961 | // 0x0008 - "dil14 OR cshbx" // standard input (motherboard) | |
| 48962 | // 0x0010 - "dil15 OR dump" // standard input (motherboard) | |
| 48963 | PORT_MODIFY("IN-19") | |
| 48964 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 48965 | PORT_MODIFY("IN-20") | |
| 48966 | // 0x0001 - "test" // standard input (motherboard) | |
| 48967 | 48967 | INPUT_PORTS_END |
| 48968 | 48968 | |
| 48969 | 48969 | // PR2255 GLADIATOR GLAD SOUNDS GLADIATOR |
| r31373 | r31374 | |
| 48978 | 48978 | |
| 48979 | 48979 | |
| 48980 | 48980 | INPUT_PORTS_START( sc4hotdg ) // this structure is generated |
| 48981 | PORT_INCLUDE( sc4_base ) | |
| 48982 | PORT_MODIFY("IN-1") | |
| 48983 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48984 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 48985 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 48986 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 48987 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 48988 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 48989 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 48990 | PORT_MODIFY("IN-2") | |
| 48991 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 48992 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trf/ex") | |
| 48993 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48994 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48995 | PORT_MODIFY("IN-3") | |
| 48996 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 48997 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 48998 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 48999 | PORT_MODIFY("IN-5") | |
| 49000 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49001 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49002 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49003 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49004 | PORT_MODIFY("IN-6") | |
| 49005 | // 0x0001 - "perc1" // standard input (expected here) | |
| 49006 | // 0x0002 - "perc2" // standard input (expected here) | |
| 49007 | // 0x0004 - "perc3" // standard input (expected here) | |
| 49008 | // 0x0008 - "perc4" // standard input (expected here) | |
| 49009 | PORT_MODIFY("IN-16") | |
| 49010 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 49011 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 49012 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 49013 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 49014 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 49015 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49016 | PORT_MODIFY("IN-17") | |
| 49017 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 49018 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 49019 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 49020 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 49021 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49022 | PORT_MODIFY("IN-18") | |
| 49023 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49024 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49025 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49026 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49027 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49028 | PORT_MODIFY("IN-19") | |
| 49029 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49030 | PORT_MODIFY("IN-20") | |
| 49031 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49032 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49033 | // 0x0004 - "serdor" // standard input (expected here) | |
| 49034 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 49035 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 48981 | PORT_INCLUDE( sc4_base ) | |
| 48982 | PORT_MODIFY("IN-1") | |
| 48983 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 48984 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 48985 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 48986 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 48987 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 48988 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 48989 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 48990 | PORT_MODIFY("IN-2") | |
| 48991 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 48992 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trf/ex") | |
| 48993 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 48994 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 48995 | PORT_MODIFY("IN-3") | |
| 48996 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 48997 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 48998 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 48999 | PORT_MODIFY("IN-5") | |
| 49000 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49001 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49002 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49003 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49004 | PORT_MODIFY("IN-6") | |
| 49005 | // 0x0001 - "perc1" // standard input (expected here) | |
| 49006 | // 0x0002 - "perc2" // standard input (expected here) | |
| 49007 | // 0x0004 - "perc3" // standard input (expected here) | |
| 49008 | // 0x0008 - "perc4" // standard input (expected here) | |
| 49009 | PORT_MODIFY("IN-16") | |
| 49010 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 49011 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 49012 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 49013 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 49014 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 49015 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49016 | PORT_MODIFY("IN-17") | |
| 49017 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 49018 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 49019 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 49020 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 49021 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49022 | PORT_MODIFY("IN-18") | |
| 49023 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49024 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49025 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49026 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49027 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49028 | PORT_MODIFY("IN-19") | |
| 49029 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49030 | PORT_MODIFY("IN-20") | |
| 49031 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49032 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49033 | // 0x0004 - "serdor" // standard input (expected here) | |
| 49034 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 49035 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49036 | 49036 | INPUT_PORTS_END |
| 49037 | 49037 | |
| 49038 | 49038 | // PR1936 AWP HOT DOG SCORP4 PR1916 HOT DOG SOUNDS11 HOT DOG S.SITE |
| r31373 | r31374 | |
| 49059 | 49059 | } |
| 49060 | 49060 | |
| 49061 | 49061 | INPUT_PORTS_START( sc4pp ) // this structure is generated |
| 49062 | PORT_INCLUDE( sc4_base ) | |
| 49063 | PORT_MODIFY("IN-1") | |
| 49064 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 49065 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 49066 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49067 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49068 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49069 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 49070 | PORT_MODIFY("IN-2") | |
| 49071 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49072 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49073 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49074 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49075 | PORT_MODIFY("IN-3") | |
| 49076 | // 0x0004 - "stk3" // standard input (expected here) | |
| 49077 | // 0x0008 - "stk1" // standard input (expected here) | |
| 49078 | // 0x0010 - "stk2" // standard input (expected here) | |
| 49079 | PORT_MODIFY("IN-5") | |
| 49080 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 49081 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 49082 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 49083 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 49084 | PORT_MODIFY("IN-6") | |
| 49085 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 49086 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 49087 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 49088 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 49089 | PORT_MODIFY("IN-8") | |
| 49090 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 49091 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 49092 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 49093 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 49094 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 49095 | PORT_MODIFY("IN-9") | |
| 49096 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 49097 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 49098 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 49099 | PORT_MODIFY("IN-16") | |
| 49100 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49101 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49102 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49103 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49104 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49105 | // 0x0100 - "top up OR top up" // known extended input, usually 'top up' | |
| 49106 | PORT_MODIFY("IN-17") | |
| 49107 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49108 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49109 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49110 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49111 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 49112 | PORT_MODIFY("IN-18") | |
| 49113 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 49114 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 49115 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 49116 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 49117 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 49118 | PORT_MODIFY("IN-19") | |
| 49119 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 49120 | PORT_MODIFY("IN-20") | |
| 49121 | // 0x0001 - "test" // standard input (motherboard) | |
| 49122 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49123 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49124 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49125 | // 0x0010 - "dump" // standard input (expected here) | |
| 49062 | PORT_INCLUDE( sc4_base ) | |
| 49063 | PORT_MODIFY("IN-1") | |
| 49064 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 49065 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 49066 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49067 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49068 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49069 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 49070 | PORT_MODIFY("IN-2") | |
| 49071 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49072 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49073 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49074 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49075 | PORT_MODIFY("IN-3") | |
| 49076 | // 0x0004 - "stk3" // standard input (expected here) | |
| 49077 | // 0x0008 - "stk1" // standard input (expected here) | |
| 49078 | // 0x0010 - "stk2" // standard input (expected here) | |
| 49079 | PORT_MODIFY("IN-5") | |
| 49080 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 49081 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 49082 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 49083 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 49084 | PORT_MODIFY("IN-6") | |
| 49085 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 49086 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 49087 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 49088 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 49089 | PORT_MODIFY("IN-8") | |
| 49090 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("f lo") | |
| 49091 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 49092 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("c lo") | |
| 49093 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("shoot") | |
| 49094 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("c hi") | |
| 49095 | PORT_MODIFY("IN-9") | |
| 49096 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 49097 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("f hi") | |
| 49098 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("step") | |
| 49099 | PORT_MODIFY("IN-16") | |
| 49100 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49101 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49102 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49103 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49104 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49105 | // 0x0100 - "top up OR top up" // known extended input, usually 'top up' | |
| 49106 | PORT_MODIFY("IN-17") | |
| 49107 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49108 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49109 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49110 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49111 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 49112 | PORT_MODIFY("IN-18") | |
| 49113 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 49114 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 49115 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 49116 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 49117 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 49118 | PORT_MODIFY("IN-19") | |
| 49119 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 49120 | PORT_MODIFY("IN-20") | |
| 49121 | // 0x0001 - "test" // standard input (motherboard) | |
| 49122 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49123 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49124 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49125 | // 0x0010 - "dump" // standard input (expected here) | |
| 49126 | 49126 | INPUT_PORTS_END |
| 49127 | 49127 | |
| 49128 | 49128 | // doesn't like any of the sound roms we have |
| r31373 | r31374 | |
| 49135 | 49135 | |
| 49136 | 49136 | |
| 49137 | 49137 | INPUT_PORTS_START( sc4ppsag ) // this structure is generated |
| 49138 | PORT_INCLUDE( sc4_base ) | |
| 49139 | PORT_MODIFY("IN-1") | |
| 49140 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 49141 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 49142 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49143 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49144 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49145 | PORT_MODIFY("IN-2") | |
| 49146 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49147 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49148 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49149 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 49150 | PORT_MODIFY("IN-8") | |
| 49151 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("game") | |
| 49152 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 49153 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nuds") | |
| 49154 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 49155 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("levl1") | |
| 49156 | PORT_MODIFY("IN-9") | |
| 49157 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("levl2") | |
| 49158 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("levl3") | |
| 49159 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("levl4") | |
| 49160 | PORT_MODIFY("IN-16") | |
| 49161 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49162 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49163 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49164 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49165 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49166 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49167 | PORT_MODIFY("IN-17") | |
| 49168 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49169 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49170 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49171 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49172 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49173 | PORT_MODIFY("IN-18") | |
| 49174 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49175 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49176 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49177 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49178 | // 0x0010 - "dil15 OR deflt" // standard input (motherboard) | |
| 49179 | PORT_MODIFY("IN-19") | |
| 49180 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49181 | PORT_MODIFY("IN-20") | |
| 49182 | // 0x0001 - "test" // standard input (motherboard) | |
| 49183 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49184 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49185 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49186 | // 0x0010 - "hoplo" // standard input (expected here) | |
| 49138 | PORT_INCLUDE( sc4_base ) | |
| 49139 | PORT_MODIFY("IN-1") | |
| 49140 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 49141 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 49142 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49143 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49144 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49145 | PORT_MODIFY("IN-2") | |
| 49146 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49147 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49148 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49149 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 49150 | PORT_MODIFY("IN-8") | |
| 49151 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("game") | |
| 49152 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("cash") | |
| 49153 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nuds") | |
| 49154 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 49155 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("levl1") | |
| 49156 | PORT_MODIFY("IN-9") | |
| 49157 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("levl2") | |
| 49158 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("levl3") | |
| 49159 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("levl4") | |
| 49160 | PORT_MODIFY("IN-16") | |
| 49161 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49162 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49163 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49164 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49165 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49166 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49167 | PORT_MODIFY("IN-17") | |
| 49168 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49169 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49170 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49171 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49172 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49173 | PORT_MODIFY("IN-18") | |
| 49174 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49175 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49176 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49177 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49178 | // 0x0010 - "dil15 OR deflt" // standard input (motherboard) | |
| 49179 | PORT_MODIFY("IN-19") | |
| 49180 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49181 | PORT_MODIFY("IN-20") | |
| 49182 | // 0x0001 - "test" // standard input (motherboard) | |
| 49183 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49184 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49185 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49186 | // 0x0010 - "hoplo" // standard input (expected here) | |
| 49187 | 49187 | INPUT_PORTS_END |
| 49188 | 49188 | |
| 49189 | 49189 | // PR2303 STRIKES AGAIN PPSA SOUNDS STRIKES AGAIN |
| r31373 | r31374 | |
| 49199 | 49199 | GAMEL( 200?, sc4ppsagi ,sc4ppsag, sc4, sc4ppsag, sc4_state, sc4, ROT0, "Mazooma","Pink Panther Strikes Again (Mazooma) (Scorpion 4) (set 10)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49200 | 49200 | |
| 49201 | 49201 | INPUT_PORTS_START( sc4pog ) // this structure is generated |
| 49202 | PORT_INCLUDE( sc4_base ) | |
| 49203 | PORT_MODIFY("IN-1") | |
| 49204 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49205 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 49206 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 49207 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 49208 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 49209 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 49210 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 49211 | PORT_MODIFY("IN-2") | |
| 49212 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 49213 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 49214 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 49215 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49216 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 49217 | PORT_MODIFY("IN-3") | |
| 49218 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49219 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49220 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49221 | PORT_MODIFY("IN-5") | |
| 49222 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49223 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49224 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49225 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49226 | PORT_MODIFY("IN-6") | |
| 49227 | // 0x0001 - "perc1" // standard input (expected here) | |
| 49228 | // 0x0002 - "perc2" // standard input (expected here) | |
| 49229 | // 0x0004 - "perc3" // standard input (expected here) | |
| 49230 | // 0x0008 - "perc4" // standard input (expected here) | |
| 49231 | PORT_MODIFY("IN-8") | |
| 49232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bns") | |
| 49233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 49234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bronze") | |
| 49235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("silver") | |
| 49236 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("gold") | |
| 49237 | PORT_MODIFY("IN-16") | |
| 49238 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 49239 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 49240 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 49241 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 49242 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 49243 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49244 | PORT_MODIFY("IN-17") | |
| 49245 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 49246 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 49247 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 49248 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 49249 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49250 | PORT_MODIFY("IN-18") | |
| 49251 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49252 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49253 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49254 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49255 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49256 | PORT_MODIFY("IN-19") | |
| 49257 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49258 | PORT_MODIFY("IN-20") | |
| 49259 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49260 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49261 | // 0x0004 - "serdor" // standard input (expected here) | |
| 49262 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 49263 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49202 | PORT_INCLUDE( sc4_base ) | |
| 49203 | PORT_MODIFY("IN-1") | |
| 49204 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49205 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 49206 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 49207 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 49208 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collct") | |
| 49209 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_5 ) PORT_NAME("hpunit") | |
| 49210 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 49211 | PORT_MODIFY("IN-2") | |
| 49212 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("ch stk") | |
| 49213 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 49214 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("trnsfr") | |
| 49215 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49216 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 49217 | PORT_MODIFY("IN-3") | |
| 49218 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49219 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49220 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49221 | PORT_MODIFY("IN-5") | |
| 49222 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49223 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49224 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49225 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49226 | PORT_MODIFY("IN-6") | |
| 49227 | // 0x0001 - "perc1" // standard input (expected here) | |
| 49228 | // 0x0002 - "perc2" // standard input (expected here) | |
| 49229 | // 0x0004 - "perc3" // standard input (expected here) | |
| 49230 | // 0x0008 - "perc4" // standard input (expected here) | |
| 49231 | PORT_MODIFY("IN-8") | |
| 49232 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk bns") | |
| 49233 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk csh") | |
| 49234 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("bronze") | |
| 49235 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("silver") | |
| 49236 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("gold") | |
| 49237 | PORT_MODIFY("IN-16") | |
| 49238 | // 0x0001 - "dil1" // standard input (motherboard) | |
| 49239 | // 0x0002 - "dil2" // standard input (motherboard) | |
| 49240 | // 0x0004 - "dil3" // standard input (motherboard) | |
| 49241 | // 0x0008 - "dil4" // standard input (motherboard) | |
| 49242 | // 0x0010 - "dil5" // standard input (motherboard) | |
| 49243 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49244 | PORT_MODIFY("IN-17") | |
| 49245 | // 0x0001 - "dil6" // standard input (motherboard) | |
| 49246 | // 0x0002 - "dil7" // standard input (motherboard) | |
| 49247 | // 0x0004 - "dil8" // standard input (motherboard) | |
| 49248 | // 0x0008 - "dil9" // standard input (motherboard) | |
| 49249 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49250 | PORT_MODIFY("IN-18") | |
| 49251 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49252 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49253 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49254 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49255 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49256 | PORT_MODIFY("IN-19") | |
| 49257 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49258 | PORT_MODIFY("IN-20") | |
| 49259 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49260 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49261 | // 0x0004 - "serdor" // standard input (expected here) | |
| 49262 | // 0x0008 - "cshdor" // standard input (expected here) | |
| 49263 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49264 | 49264 | INPUT_PORTS_END |
| 49265 | 49265 | |
| 49266 | 49266 | // PR1938 AWP POTS OF GOLD SCORP4 PR1918 POTS OF GOLD SOUNDS11 POTS OF GOLD S.SITE |
| r31373 | r31374 | |
| 49276 | 49276 | GAMEL( 200?, sc4pogi ,sc4pog, sc4, sc4pog, sc4_state, sc4mbus, ROT0, "BFM","Pots Of Gold (Bellfruit) (Scorpion 4) (set 10)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49277 | 49277 | |
| 49278 | 49278 | INPUT_PORTS_START( sc4pwrpl ) // this structure is generated |
| 49279 | PORT_INCLUDE( sc4_base ) | |
| 49280 | PORT_MODIFY("IN-1") | |
| 49281 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49282 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("power") | |
| 49283 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49284 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49285 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49286 | // 0x0100 - "hoplw" // known extended input, usually 'hopper fit' | |
| 49287 | PORT_MODIFY("IN-2") | |
| 49288 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49289 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("suph") | |
| 49290 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49291 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 49292 | PORT_MODIFY("IN-8") | |
| 49293 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 49294 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 49295 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 49296 | PORT_MODIFY("IN-16") | |
| 49297 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49298 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49299 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49300 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49301 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49302 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49303 | PORT_MODIFY("IN-17") | |
| 49304 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49305 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49306 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49307 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49308 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49309 | PORT_MODIFY("IN-18") | |
| 49310 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49311 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49312 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49313 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49314 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49315 | PORT_MODIFY("IN-19") | |
| 49316 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49317 | PORT_MODIFY("IN-20") | |
| 49318 | // 0x0001 - "test" // standard input (motherboard) | |
| 49319 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49320 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49321 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49322 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49279 | PORT_INCLUDE( sc4_base ) | |
| 49280 | PORT_MODIFY("IN-1") | |
| 49281 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49282 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("power") | |
| 49283 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49284 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49285 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49286 | // 0x0100 - "hoplw" // known extended input, usually 'hopper fit' | |
| 49287 | PORT_MODIFY("IN-2") | |
| 49288 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49289 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("suph") | |
| 49290 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49291 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 49292 | PORT_MODIFY("IN-8") | |
| 49293 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash") | |
| 49294 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("nuds") | |
| 49295 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 49296 | PORT_MODIFY("IN-16") | |
| 49297 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49298 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49299 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49300 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49301 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49302 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49303 | PORT_MODIFY("IN-17") | |
| 49304 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49305 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49306 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49307 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49308 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49309 | PORT_MODIFY("IN-18") | |
| 49310 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49311 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49312 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49313 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49314 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49315 | PORT_MODIFY("IN-19") | |
| 49316 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49317 | PORT_MODIFY("IN-20") | |
| 49318 | // 0x0001 - "test" // standard input (motherboard) | |
| 49319 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49320 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49321 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49322 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49323 | 49323 | INPUT_PORTS_END |
| 49324 | 49324 | |
| 49325 | 49325 | // PR2272 POWER PLAY PPLY SOUNDS |
| r31373 | r31374 | |
| 49346 | 49346 | } |
| 49347 | 49347 | |
| 49348 | 49348 | INPUT_PORTS_START( sc4swywm ) // this structure is generated |
| 49349 | PORT_INCLUDE( sc4_base ) | |
| 49350 | PORT_MODIFY("IN-1") | |
| 49351 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49352 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 49353 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49354 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49355 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49356 | PORT_MODIFY("IN-2") | |
| 49357 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49358 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49359 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49360 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49361 | PORT_MODIFY("IN-8") | |
| 49362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash OR tke ft") | |
| 49363 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("feat") | |
| 49364 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("move") | |
| 49365 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 49366 | PORT_MODIFY("IN-16") | |
| 49367 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49368 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49369 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49370 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49371 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49372 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49373 | PORT_MODIFY("IN-17") | |
| 49374 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49375 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49376 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49377 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49378 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49379 | PORT_MODIFY("IN-18") | |
| 49380 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49381 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49382 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49383 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49384 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49385 | PORT_MODIFY("IN-19") | |
| 49386 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49387 | PORT_MODIFY("IN-20") | |
| 49388 | // 0x0001 - "test" // standard input (motherboard) | |
| 49389 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49390 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49391 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49392 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49349 | PORT_INCLUDE( sc4_base ) | |
| 49350 | PORT_MODIFY("IN-1") | |
| 49351 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49352 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 49353 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49354 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49355 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49356 | PORT_MODIFY("IN-2") | |
| 49357 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49358 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49359 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49360 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49361 | PORT_MODIFY("IN-8") | |
| 49362 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("cash OR tke ft") | |
| 49363 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("feat") | |
| 49364 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("move") | |
| 49365 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 49366 | PORT_MODIFY("IN-16") | |
| 49367 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49368 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49369 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49370 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49371 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49372 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49373 | PORT_MODIFY("IN-17") | |
| 49374 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49375 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49376 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49377 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49378 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49379 | PORT_MODIFY("IN-18") | |
| 49380 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49381 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49382 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49383 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49384 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49385 | PORT_MODIFY("IN-19") | |
| 49386 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49387 | PORT_MODIFY("IN-20") | |
| 49388 | // 0x0001 - "test" // standard input (motherboard) | |
| 49389 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49390 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49391 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49392 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49393 | 49393 | INPUT_PORTS_END |
| 49394 | 49394 | |
| 49395 | 49395 | |
| r31373 | r31374 | |
| 49420 | 49420 | } |
| 49421 | 49421 | |
| 49422 | 49422 | INPUT_PORTS_START( sc4sumit ) // this structure is generated |
| 49423 | PORT_INCLUDE( sc4_base ) | |
| 49424 | PORT_MODIFY("IN-1") | |
| 49425 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 49426 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49427 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49428 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49429 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake") | |
| 49430 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 49431 | PORT_MODIFY("IN-2") | |
| 49432 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49433 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49434 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49435 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49436 | PORT_MODIFY("IN-3") | |
| 49437 | // 0x0004 - "stk3" // standard input (expected here) | |
| 49438 | // 0x0008 - "stk1" // standard input (expected here) | |
| 49439 | // 0x0010 - "stk2" // standard input (expected here) | |
| 49440 | PORT_MODIFY("IN-5") | |
| 49441 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 49442 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 49443 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 49444 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 49445 | PORT_MODIFY("IN-6") | |
| 49446 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 49447 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 49448 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 49449 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 49450 | PORT_MODIFY("IN-8") | |
| 49451 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 49452 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 49453 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 49454 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 49455 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 49456 | PORT_MODIFY("IN-9") | |
| 49457 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 49458 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 49459 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 49460 | PORT_MODIFY("IN-16") | |
| 49461 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49462 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49463 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49464 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49465 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49466 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49467 | PORT_MODIFY("IN-17") | |
| 49468 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49469 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49470 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49471 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49472 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49473 | PORT_MODIFY("IN-18") | |
| 49474 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49475 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49476 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49477 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49478 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49479 | PORT_MODIFY("IN-19") | |
| 49480 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49481 | PORT_MODIFY("IN-20") | |
| 49482 | // 0x0001 - "test" // standard input (motherboard) | |
| 49483 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49484 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49485 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49486 | // 0x0010 - "dump" // standard input (expected here) | |
| 49423 | PORT_INCLUDE( sc4_base ) | |
| 49424 | PORT_MODIFY("IN-1") | |
| 49425 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 49426 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49427 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49428 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49429 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stake") | |
| 49430 | // 0x0100 - "hoplo" // known extended input, usually 'hopper fit' | |
| 49431 | PORT_MODIFY("IN-2") | |
| 49432 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49433 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49434 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49435 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49436 | PORT_MODIFY("IN-3") | |
| 49437 | // 0x0004 - "stk3" // standard input (expected here) | |
| 49438 | // 0x0008 - "stk1" // standard input (expected here) | |
| 49439 | // 0x0010 - "stk2" // standard input (expected here) | |
| 49440 | PORT_MODIFY("IN-5") | |
| 49441 | // 0x0001 - "jp 1" // standard input (expected here) | |
| 49442 | // 0x0002 - "jp 2" // standard input (expected here) | |
| 49443 | // 0x0004 - "jp 3" // standard input (expected here) | |
| 49444 | // 0x0008 - "jp 4" // standard input (expected here) | |
| 49445 | PORT_MODIFY("IN-6") | |
| 49446 | // 0x0001 - "pc 1" // standard input (expected here) | |
| 49447 | // 0x0002 - "pc 2" // standard input (expected here) | |
| 49448 | // 0x0004 - "pc 3" // standard input (expected here) | |
| 49449 | // 0x0008 - "pc 4" // standard input (expected here) | |
| 49450 | PORT_MODIFY("IN-8") | |
| 49451 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 49452 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 49453 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 49454 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 49455 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 49456 | PORT_MODIFY("IN-9") | |
| 49457 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 49458 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 49459 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 49460 | PORT_MODIFY("IN-16") | |
| 49461 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49462 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49463 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49464 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49465 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49466 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49467 | PORT_MODIFY("IN-17") | |
| 49468 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49469 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49470 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49471 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49472 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49473 | PORT_MODIFY("IN-18") | |
| 49474 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49475 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49476 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49477 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49478 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49479 | PORT_MODIFY("IN-19") | |
| 49480 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49481 | PORT_MODIFY("IN-20") | |
| 49482 | // 0x0001 - "test" // standard input (motherboard) | |
| 49483 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 49484 | // 0x0004 - "topdr" // standard input (expected here) | |
| 49485 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 49486 | // 0x0010 - "dump" // standard input (expected here) | |
| 49487 | 49487 | INPUT_PORTS_END |
| 49488 | 49488 | |
| 49489 | 49489 | // PR2176 SUMMIT UP SUMMIT SOUNDS SUMMIT UP (was in the Suits U Sir set) |
| r31373 | r31374 | |
| 49493 | 49493 | GAMEL( 200?, sc4sumitc ,sc4sus, sc4, sc4sumit, sc4_state, sc4sumit, ROT0, "Mazooma","Summit Up (Mazooma) (Scorpion 4) (set 4)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49494 | 49494 | |
| 49495 | 49495 | INPUT_PORTS_START( sc4tpsht ) // this structure is generated |
| 49496 | PORT_INCLUDE( sc4_base ) | |
| 49497 | PORT_MODIFY("IN-1") | |
| 49498 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49499 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 49500 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49501 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49502 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49503 | PORT_MODIFY("IN-2") | |
| 49504 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49505 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49506 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49507 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 49508 | PORT_MODIFY("IN-8") | |
| 49509 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo") | |
| 49510 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi") | |
| 49511 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 49512 | PORT_MODIFY("IN-16") | |
| 49513 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49514 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49515 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49516 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49517 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49518 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49519 | PORT_MODIFY("IN-17") | |
| 49520 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49521 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49522 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49523 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49524 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49525 | PORT_MODIFY("IN-18") | |
| 49526 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49527 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49528 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49529 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49530 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49531 | PORT_MODIFY("IN-19") | |
| 49532 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49533 | PORT_MODIFY("IN-20") | |
| 49534 | // 0x0001 - "test" // standard input (motherboard) | |
| 49535 | // 0x0002 - "lock" // standard input (expected here) | |
| 49536 | // 0x0004 - "topdor" // standard input (expected here) | |
| 49537 | // 0x0008 - "botdor" // standard input (expected here) | |
| 49538 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49496 | PORT_INCLUDE( sc4_base ) | |
| 49497 | PORT_MODIFY("IN-1") | |
| 49498 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49499 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 49500 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49501 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49502 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49503 | PORT_MODIFY("IN-2") | |
| 49504 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49505 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49506 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49507 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 49508 | PORT_MODIFY("IN-8") | |
| 49509 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("lo") | |
| 49510 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("hi") | |
| 49511 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("step") | |
| 49512 | PORT_MODIFY("IN-16") | |
| 49513 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49514 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49515 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49516 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49517 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49518 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49519 | PORT_MODIFY("IN-17") | |
| 49520 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49521 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49522 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49523 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49524 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49525 | PORT_MODIFY("IN-18") | |
| 49526 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49527 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49528 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49529 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49530 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49531 | PORT_MODIFY("IN-19") | |
| 49532 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49533 | PORT_MODIFY("IN-20") | |
| 49534 | // 0x0001 - "test" // standard input (motherboard) | |
| 49535 | // 0x0002 - "lock" // standard input (expected here) | |
| 49536 | // 0x0004 - "topdor" // standard input (expected here) | |
| 49537 | // 0x0008 - "botdor" // standard input (expected here) | |
| 49538 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49539 | 49539 | INPUT_PORTS_END |
| 49540 | 49540 | |
| 49541 | 49541 | // PR2211 TOP OF THE SHOTS TOTS SOUNDS TOP OF THE SHOTS |
| r31373 | r31374 | |
| 49550 | 49550 | |
| 49551 | 49551 | |
| 49552 | 49552 | INPUT_PORTS_START( sc4adren ) // this structure is generated |
| 49553 | PORT_INCLUDE( sc4_base ) | |
| 49554 | PORT_MODIFY("IN-1") | |
| 49555 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49556 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 49557 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49558 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49559 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49560 | PORT_MODIFY("IN-2") | |
| 49561 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49562 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49563 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49564 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49565 | PORT_MODIFY("IN-8") | |
| 49566 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("usebon") | |
| 49567 | PORT_MODIFY("IN-16") | |
| 49568 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49569 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49570 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49571 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49572 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49573 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49574 | PORT_MODIFY("IN-17") | |
| 49575 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49576 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49577 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49578 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49579 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49580 | PORT_MODIFY("IN-18") | |
| 49581 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49582 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49583 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49584 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49585 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49586 | PORT_MODIFY("IN-19") | |
| 49587 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49588 | PORT_MODIFY("IN-20") | |
| 49589 | // 0x0001 - "test" // standard input (motherboard) | |
| 49590 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49591 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49592 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49593 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49553 | PORT_INCLUDE( sc4_base ) | |
| 49554 | PORT_MODIFY("IN-1") | |
| 49555 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 49556 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("coll") | |
| 49557 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 49558 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 49559 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 49560 | PORT_MODIFY("IN-2") | |
| 49561 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("trans") | |
| 49562 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 49563 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49564 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49565 | PORT_MODIFY("IN-8") | |
| 49566 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("usebon") | |
| 49567 | PORT_MODIFY("IN-16") | |
| 49568 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49569 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49570 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49571 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49572 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49573 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49574 | PORT_MODIFY("IN-17") | |
| 49575 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49576 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49577 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49578 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49579 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49580 | PORT_MODIFY("IN-18") | |
| 49581 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49582 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49583 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49584 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49585 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49586 | PORT_MODIFY("IN-19") | |
| 49587 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49588 | PORT_MODIFY("IN-20") | |
| 49589 | // 0x0001 - "test" // standard input (motherboard) | |
| 49590 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49591 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49592 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49593 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49594 | 49594 | INPUT_PORTS_END |
| 49595 | 49595 | |
| 49596 | 49596 | // does not want the 'COTL SOUNDS' from Cash On The Lash |
| r31373 | r31374 | |
| 49602 | 49602 | |
| 49603 | 49603 | |
| 49604 | 49604 | INPUT_PORTS_START( sc4bingb ) // this structure is generated |
| 49605 | PORT_INCLUDE( sc4_base ) | |
| 49606 | PORT_MODIFY("IN-1") | |
| 49607 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("coll") | |
| 49608 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 49609 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49610 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49611 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("maxbet") | |
| 49612 | PORT_MODIFY("IN-2") | |
| 49613 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("fast") | |
| 49614 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49615 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49616 | PORT_MODIFY("IN-8") | |
| 49617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("stake6") | |
| 49618 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("stake3") | |
| 49619 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("stake2") | |
| 49620 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("stake5") | |
| 49621 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("stake4") | |
| 49622 | PORT_MODIFY("IN-9") | |
| 49623 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("stake1") | |
| 49624 | PORT_MODIFY("IN-16") | |
| 49625 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49626 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49627 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49628 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49629 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49630 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49631 | PORT_MODIFY("IN-17") | |
| 49632 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49633 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49634 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49635 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49636 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49637 | PORT_MODIFY("IN-18") | |
| 49638 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49639 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49640 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49641 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49642 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49643 | PORT_MODIFY("IN-19") | |
| 49644 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49645 | PORT_MODIFY("IN-20") | |
| 49646 | // 0x0001 - "test" // standard input (motherboard) | |
| 49647 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49648 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49649 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49650 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49605 | PORT_INCLUDE( sc4_base ) | |
| 49606 | PORT_MODIFY("IN-1") | |
| 49607 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("coll") | |
| 49608 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 49609 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49610 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49611 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("maxbet") | |
| 49612 | PORT_MODIFY("IN-2") | |
| 49613 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("fast") | |
| 49614 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49615 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49616 | PORT_MODIFY("IN-8") | |
| 49617 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("stake6") | |
| 49618 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("stake3") | |
| 49619 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("stake2") | |
| 49620 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("stake5") | |
| 49621 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("stake4") | |
| 49622 | PORT_MODIFY("IN-9") | |
| 49623 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("stake1") | |
| 49624 | PORT_MODIFY("IN-16") | |
| 49625 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49626 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49627 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49628 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49629 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49630 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 49631 | PORT_MODIFY("IN-17") | |
| 49632 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49633 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49634 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49635 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49636 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49637 | PORT_MODIFY("IN-18") | |
| 49638 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49639 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49640 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49641 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49642 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49643 | PORT_MODIFY("IN-19") | |
| 49644 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49645 | PORT_MODIFY("IN-20") | |
| 49646 | // 0x0001 - "test" // standard input (motherboard) | |
| 49647 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49648 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49649 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49650 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49651 | 49651 | INPUT_PORTS_END |
| 49652 | 49652 | |
| 49653 | 49653 | // check if Side Splitter sound is correct |
| r31373 | r31374 | |
| 49657 | 49657 | GAMEL( 200?, sc4bingba ,sc4bingb, sc4, sc4bingb, sc4_state, sc4, ROT0, "Mazooma","Bingo Belle (Mazooma) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49658 | 49658 | |
| 49659 | 49659 | INPUT_PORTS_START( sc4cerup ) // this structure is generated |
| 49660 | PORT_INCLUDE( sc4_base ) | |
| 49661 | PORT_MODIFY("IN-1") | |
| 49662 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49663 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 49664 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 49665 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 49666 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 49667 | PORT_MODIFY("IN-2") | |
| 49668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("a ndge") | |
| 49669 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tk ftr") | |
| 49670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49671 | PORT_MODIFY("IN-8") | |
| 49672 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh hi") | |
| 49673 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("ndg hi") | |
| 49674 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ndg lo") | |
| 49675 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("csh lo") | |
| 49676 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 49677 | PORT_MODIFY("IN-16") | |
| 49678 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49679 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49680 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49681 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49682 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49683 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49684 | PORT_MODIFY("IN-17") | |
| 49685 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49686 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49687 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49688 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49689 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 49690 | PORT_MODIFY("IN-18") | |
| 49691 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 49692 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 49693 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 49694 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 49695 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 49696 | PORT_MODIFY("IN-19") | |
| 49697 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 49698 | PORT_MODIFY("IN-20") | |
| 49699 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 49700 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49701 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49702 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49703 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49660 | PORT_INCLUDE( sc4_base ) | |
| 49661 | PORT_MODIFY("IN-1") | |
| 49662 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49663 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 49664 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 49665 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 49666 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("coll") | |
| 49667 | PORT_MODIFY("IN-2") | |
| 49668 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("a ndge") | |
| 49669 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("tk ftr") | |
| 49670 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49671 | PORT_MODIFY("IN-8") | |
| 49672 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("csh hi") | |
| 49673 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("ndg hi") | |
| 49674 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ndg lo") | |
| 49675 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("csh lo") | |
| 49676 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 49677 | PORT_MODIFY("IN-16") | |
| 49678 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49679 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49680 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49681 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49682 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49683 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49684 | PORT_MODIFY("IN-17") | |
| 49685 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49686 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49687 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49688 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49689 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 49690 | PORT_MODIFY("IN-18") | |
| 49691 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 49692 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 49693 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 49694 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 49695 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 49696 | PORT_MODIFY("IN-19") | |
| 49697 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 49698 | PORT_MODIFY("IN-20") | |
| 49699 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 49700 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49701 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49702 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49703 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49704 | 49704 | INPUT_PORTS_END |
| 49705 | 49705 | |
| 49706 | 49706 | |
| r31373 | r31374 | |
| 49708 | 49708 | GAMEL( 200?, sc4cerup ,0, sc4, sc4cerup, sc4_state, sc4, ROT0, "Mazooma","Cash Eruption (Mazooma) (Scorpion 4)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49709 | 49709 | |
| 49710 | 49710 | INPUT_PORTS_START( sc4cexpl ) // this structure is generated |
| 49711 | PORT_INCLUDE( sc4_base ) | |
| 49712 | PORT_MODIFY("IN-1") | |
| 49713 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49714 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 49715 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 49716 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 49717 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 49718 | PORT_MODIFY("IN-2") | |
| 49719 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 49720 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49721 | PORT_MODIFY("IN-8") | |
| 49722 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 49723 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 49724 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk pic") | |
| 49725 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("move u") | |
| 49726 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 49727 | PORT_MODIFY("IN-9") | |
| 49728 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 49729 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 49730 | PORT_MODIFY("IN-16") | |
| 49731 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49732 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49733 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49734 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49735 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49736 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49737 | PORT_MODIFY("IN-17") | |
| 49738 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49739 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49740 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49741 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49742 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 49743 | PORT_MODIFY("IN-18") | |
| 49744 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 49745 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 49746 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 49747 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 49748 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 49749 | PORT_MODIFY("IN-19") | |
| 49750 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 49751 | PORT_MODIFY("IN-20") | |
| 49752 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 49753 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49754 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49755 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49756 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49711 | PORT_INCLUDE( sc4_base ) | |
| 49712 | PORT_MODIFY("IN-1") | |
| 49713 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49714 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("collec") | |
| 49715 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 49716 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 49717 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 49718 | PORT_MODIFY("IN-2") | |
| 49719 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 49720 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49721 | PORT_MODIFY("IN-8") | |
| 49722 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk cas") | |
| 49723 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk nud") | |
| 49724 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk pic") | |
| 49725 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("move u") | |
| 49726 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("lef hi") | |
| 49727 | PORT_MODIFY("IN-9") | |
| 49728 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("mid hi") | |
| 49729 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("rgt hi") | |
| 49730 | PORT_MODIFY("IN-16") | |
| 49731 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49732 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49733 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49734 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49735 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49736 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49737 | PORT_MODIFY("IN-17") | |
| 49738 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49739 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49740 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49741 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49742 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 49743 | PORT_MODIFY("IN-18") | |
| 49744 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 49745 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 49746 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 49747 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 49748 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 49749 | PORT_MODIFY("IN-19") | |
| 49750 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 49751 | PORT_MODIFY("IN-20") | |
| 49752 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 49753 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 49754 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 49755 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 49756 | // 0x0010 - "deflt" // standard input (expected here) | |
| 49757 | 49757 | INPUT_PORTS_END |
| 49758 | 49758 | |
| 49759 | 49759 | // PR2076 CASH EXPLOSION CEXP SOUNDS CASH EXPLSION |
| r31373 | r31374 | |
| 49776 | 49776 | |
| 49777 | 49777 | // I guess this isn't a fruit machine |
| 49778 | 49778 | INPUT_PORTS_START( sc4casrya ) // this structure is generated |
| 49779 | PORT_INCLUDE( sc4_base ) | |
| 49780 | PORT_MODIFY("IN-1") | |
| 49781 | // 0x0100 - "esc" // known extended input, usually 'hopper fit' | |
| 49782 | PORT_MODIFY("IN-2") | |
| 49783 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("tilt") | |
| 49784 | // 0x0100 - "c hop" // unexpected here | |
| 49785 | PORT_MODIFY("IN-4") | |
| 49786 | // 0x0100 - "vib" // known extended input, usually 'hopper low' | |
| 49787 | PORT_MODIFY("IN-6") | |
| 49788 | // 0x0001 - "arm l" // standard input (expected here) | |
| 49789 | PORT_MODIFY("IN-8") | |
| 49790 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("arm r") | |
| 49791 | PORT_MODIFY("IN-16") | |
| 49792 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49793 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 49794 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 49795 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 49796 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 49797 | PORT_MODIFY("IN-17") | |
| 49798 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49799 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 49800 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 49801 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 49802 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 49803 | PORT_MODIFY("IN-18") | |
| 49804 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49805 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 49806 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 49807 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 49808 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 49809 | PORT_MODIFY("IN-19") | |
| 49810 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49811 | PORT_MODIFY("IN-20") | |
| 49812 | // 0x0001 - "green OR t bot" // standard input (motherboard) | |
| 49813 | // 0x0002 - "door l" // standard input (expected here) | |
| 49814 | // 0x0004 - "top do" // standard input (expected here) | |
| 49815 | // 0x0008 - "cashbo OR cash b" // standard input (expected here) | |
| 49816 | // 0x0010 - "defloa" // standard input (expected here) | |
| 49779 | PORT_INCLUDE( sc4_base ) | |
| 49780 | PORT_MODIFY("IN-1") | |
| 49781 | // 0x0100 - "esc" // known extended input, usually 'hopper fit' | |
| 49782 | PORT_MODIFY("IN-2") | |
| 49783 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("tilt") | |
| 49784 | // 0x0100 - "c hop" // unexpected here | |
| 49785 | PORT_MODIFY("IN-4") | |
| 49786 | // 0x0100 - "vib" // known extended input, usually 'hopper low' | |
| 49787 | PORT_MODIFY("IN-6") | |
| 49788 | // 0x0001 - "arm l" // standard input (expected here) | |
| 49789 | PORT_MODIFY("IN-8") | |
| 49790 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("arm r") | |
| 49791 | PORT_MODIFY("IN-16") | |
| 49792 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49793 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 49794 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 49795 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 49796 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 49797 | PORT_MODIFY("IN-17") | |
| 49798 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49799 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 49800 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 49801 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 49802 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 49803 | PORT_MODIFY("IN-18") | |
| 49804 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49805 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 49806 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 49807 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 49808 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 49809 | PORT_MODIFY("IN-19") | |
| 49810 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 49811 | PORT_MODIFY("IN-20") | |
| 49812 | // 0x0001 - "green OR t bot" // standard input (motherboard) | |
| 49813 | // 0x0002 - "door l" // standard input (expected here) | |
| 49814 | // 0x0004 - "top do" // standard input (expected here) | |
| 49815 | // 0x0008 - "cashbo OR cash b" // standard input (expected here) | |
| 49816 | // 0x0010 - "defloa" // standard input (expected here) | |
| 49817 | 49817 | INPUT_PORTS_END |
| 49818 | 49818 | |
| 49819 | 49819 | // PR2073, CZECH CASINO ROYALE.......................CROY SOUNDS... (not standard header) |
| r31373 | r31374 | |
| 49821 | 49821 | GAMEL( 200?, sc4casryb ,sc4casry, sc4, sc4casrya, sc4_state, sc4, ROT0, "Mazooma","Casino Royale (PR2073) (Czech) (Mazooma) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49822 | 49822 | |
| 49823 | 49823 | INPUT_PORTS_START( sc4clucl ) // this structure is generated |
| 49824 | PORT_INCLUDE( sc4_base ) | |
| 49825 | PORT_MODIFY("IN-1") | |
| 49826 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 49827 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49828 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49829 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49830 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 49831 | PORT_MODIFY("IN-2") | |
| 49832 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 49833 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 49834 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 49835 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49836 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 49837 | PORT_MODIFY("IN-3") | |
| 49838 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49839 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49840 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49841 | PORT_MODIFY("IN-4") | |
| 49842 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 49843 | PORT_MODIFY("IN-5") | |
| 49844 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49845 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49846 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49847 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49848 | PORT_MODIFY("IN-8") | |
| 49849 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 49850 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk mtr") | |
| 49851 | PORT_MODIFY("IN-16") | |
| 49852 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49853 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49854 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49855 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49856 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49857 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49858 | PORT_MODIFY("IN-17") | |
| 49859 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49860 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49861 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49862 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49863 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49864 | PORT_MODIFY("IN-18") | |
| 49865 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49866 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49867 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49868 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 49869 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 49870 | PORT_MODIFY("IN-19") | |
| 49871 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 49872 | PORT_MODIFY("IN-20") | |
| 49873 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49874 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49875 | // 0x0004 - "topdor" // standard input (expected here) | |
| 49876 | // 0x0008 - "botdor" // standard input (expected here) | |
| 49877 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49824 | PORT_INCLUDE( sc4_base ) | |
| 49825 | PORT_MODIFY("IN-1") | |
| 49826 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 49827 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49828 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49829 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49830 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 49831 | PORT_MODIFY("IN-2") | |
| 49832 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 49833 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("trans") | |
| 49834 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 49835 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49836 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 49837 | PORT_MODIFY("IN-3") | |
| 49838 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49839 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49840 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49841 | PORT_MODIFY("IN-4") | |
| 49842 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 49843 | PORT_MODIFY("IN-5") | |
| 49844 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49845 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49846 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49847 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49848 | PORT_MODIFY("IN-8") | |
| 49849 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 49850 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk mtr") | |
| 49851 | PORT_MODIFY("IN-16") | |
| 49852 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49853 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49854 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49855 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49856 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49857 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49858 | PORT_MODIFY("IN-17") | |
| 49859 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49860 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49861 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49862 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49863 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49864 | PORT_MODIFY("IN-18") | |
| 49865 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49866 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49867 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49868 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 49869 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 49870 | PORT_MODIFY("IN-19") | |
| 49871 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 49872 | PORT_MODIFY("IN-20") | |
| 49873 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49874 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49875 | // 0x0004 - "topdor" // standard input (expected here) | |
| 49876 | // 0x0008 - "botdor" // standard input (expected here) | |
| 49877 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49878 | 49878 | INPUT_PORTS_END |
| 49879 | 49879 | |
| 49880 | 49880 | // PR2237 CLUB CLUEDO CLUB CLUEDO CLUB CCLU SOUNDS CLUB CLUEDO |
| r31373 | r31374 | |
| 49882 | 49882 | GAMEL( 200?, sc4clucla ,sc4clucl, sc4, sc4clucl, sc4_state, sc4, ROT0, "Mazooma","Cluedo Club (Mazooma) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49883 | 49883 | |
| 49884 | 49884 | INPUT_PORTS_START( sc4cyc ) // this structure is generated |
| 49885 | PORT_INCLUDE( sc4_base ) | |
| 49886 | PORT_MODIFY("IN-1") | |
| 49887 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49888 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49889 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 49890 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 49891 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 49892 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 49893 | PORT_MODIFY("IN-2") | |
| 49894 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 49895 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49896 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49897 | PORT_MODIFY("IN-3") | |
| 49898 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49899 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49900 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49901 | PORT_MODIFY("IN-5") | |
| 49902 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49903 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49904 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49905 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49906 | PORT_MODIFY("IN-6") | |
| 49907 | // 0x0001 - "perc1" // standard input (expected here) | |
| 49908 | // 0x0002 - "perc2" // standard input (expected here) | |
| 49909 | // 0x0004 - "perc3" // standard input (expected here) | |
| 49910 | // 0x0008 - "perc4" // standard input (expected here) | |
| 49911 | PORT_MODIFY("IN-8") | |
| 49912 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 49913 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 49914 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 49915 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk ss") | |
| 49916 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk haz") | |
| 49917 | PORT_MODIFY("IN-16") | |
| 49918 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49919 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49920 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49921 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49922 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49923 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49924 | PORT_MODIFY("IN-17") | |
| 49925 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49926 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49927 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49928 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49929 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49930 | PORT_MODIFY("IN-18") | |
| 49931 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49932 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49933 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49934 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49935 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49936 | PORT_MODIFY("IN-19") | |
| 49937 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49938 | PORT_MODIFY("IN-20") | |
| 49939 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49940 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49941 | // 0x0004 - "topdor" // standard input (expected here) | |
| 49942 | // 0x0008 - "botdor" // standard input (expected here) | |
| 49943 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49885 | PORT_INCLUDE( sc4_base ) | |
| 49886 | PORT_MODIFY("IN-1") | |
| 49887 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 49888 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49889 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2 OR high") | |
| 49890 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3 OR low") | |
| 49891 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("colect") | |
| 49892 | // 0x0100 - "hoplow" // known extended input, usually 'hopper fit' | |
| 49893 | PORT_MODIFY("IN-2") | |
| 49894 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchng") | |
| 49895 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49896 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49897 | PORT_MODIFY("IN-3") | |
| 49898 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49899 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49900 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49901 | PORT_MODIFY("IN-5") | |
| 49902 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49903 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49904 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49905 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49906 | PORT_MODIFY("IN-6") | |
| 49907 | // 0x0001 - "perc1" // standard input (expected here) | |
| 49908 | // 0x0002 - "perc2" // standard input (expected here) | |
| 49909 | // 0x0004 - "perc3" // standard input (expected here) | |
| 49910 | // 0x0008 - "perc4" // standard input (expected here) | |
| 49911 | PORT_MODIFY("IN-8") | |
| 49912 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk fea") | |
| 49913 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk sht") | |
| 49914 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tk nud") | |
| 49915 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk ss") | |
| 49916 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk haz") | |
| 49917 | PORT_MODIFY("IN-16") | |
| 49918 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49919 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49920 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49921 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49922 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49923 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49924 | PORT_MODIFY("IN-17") | |
| 49925 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49926 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49927 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49928 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49929 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 49930 | PORT_MODIFY("IN-18") | |
| 49931 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 49932 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 49933 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 49934 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 49935 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 49936 | PORT_MODIFY("IN-19") | |
| 49937 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 49938 | PORT_MODIFY("IN-20") | |
| 49939 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 49940 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 49941 | // 0x0004 - "topdor" // standard input (expected here) | |
| 49942 | // 0x0008 - "botdor" // standard input (expected here) | |
| 49943 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49944 | 49944 | INPUT_PORTS_END |
| 49945 | 49945 | |
| 49946 | 49946 | // half size sound rom, or missing a rom |
| r31373 | r31374 | |
| 49952 | 49952 | GAMEL( 200?, sc4cycd ,sc4cyc, sc4, sc4cyc, sc4_state, sc4, ROT0, "Mazooma","Count Yer Cash (Mazooma) (Scorpion 4) (set 5)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 49953 | 49953 | |
| 49954 | 49954 | INPUT_PORTS_START( sc4cyccl ) // this structure is generated |
| 49955 | PORT_INCLUDE( sc4_base ) | |
| 49956 | PORT_MODIFY("IN-1") | |
| 49957 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 49958 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49959 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49960 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49961 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 49962 | PORT_MODIFY("IN-2") | |
| 49963 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 49964 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 49965 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49966 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49967 | PORT_MODIFY("IN-3") | |
| 49968 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49969 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49970 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49971 | PORT_MODIFY("IN-4") | |
| 49972 | // 0x0001 - "hop2lo" // unexpected here | |
| 49973 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 49974 | PORT_MODIFY("IN-5") | |
| 49975 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49976 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49977 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49978 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49979 | PORT_MODIFY("IN-8") | |
| 49980 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t fet") | |
| 49981 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t sht") | |
| 49982 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("t nuds") | |
| 49983 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("t ssht") | |
| 49984 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("t sfet") | |
| 49985 | PORT_MODIFY("IN-9") | |
| 49986 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("t hazd") | |
| 49987 | PORT_MODIFY("IN-16") | |
| 49988 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49989 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49990 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49991 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49992 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49993 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49994 | PORT_MODIFY("IN-17") | |
| 49995 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49996 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49997 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49998 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49999 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50000 | PORT_MODIFY("IN-18") | |
| 50001 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50002 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50003 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50004 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 50005 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 50006 | PORT_MODIFY("IN-19") | |
| 50007 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 50008 | PORT_MODIFY("IN-20") | |
| 50009 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 50010 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 50011 | // 0x0004 - "topdor" // standard input (expected here) | |
| 50012 | // 0x0008 - "botdor" // standard input (expected here) | |
| 50013 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 49955 | PORT_INCLUDE( sc4_base ) | |
| 49956 | PORT_MODIFY("IN-1") | |
| 49957 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 49958 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 49959 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 49960 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 49961 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 49962 | PORT_MODIFY("IN-2") | |
| 49963 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 49964 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 49965 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 49966 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 49967 | PORT_MODIFY("IN-3") | |
| 49968 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 49969 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 49970 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 49971 | PORT_MODIFY("IN-4") | |
| 49972 | // 0x0001 - "hop2lo" // unexpected here | |
| 49973 | // 0x0002 - "hop1lo OR hop lo" // known extended(?) input, sometimes 'hop hi' | |
| 49974 | PORT_MODIFY("IN-5") | |
| 49975 | // 0x0001 - "priz4" // standard input (expected here) | |
| 49976 | // 0x0002 - "priz3" // standard input (expected here) | |
| 49977 | // 0x0004 - "priz2" // standard input (expected here) | |
| 49978 | // 0x0008 - "priz1" // standard input (expected here) | |
| 49979 | PORT_MODIFY("IN-8") | |
| 49980 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("t fet") | |
| 49981 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("t sht") | |
| 49982 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("t nuds") | |
| 49983 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("t ssht") | |
| 49984 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("t sfet") | |
| 49985 | PORT_MODIFY("IN-9") | |
| 49986 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("t hazd") | |
| 49987 | PORT_MODIFY("IN-16") | |
| 49988 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 49989 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 49990 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 49991 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 49992 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 49993 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 49994 | PORT_MODIFY("IN-17") | |
| 49995 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 49996 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 49997 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 49998 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 49999 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50000 | PORT_MODIFY("IN-18") | |
| 50001 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50002 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50003 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50004 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 50005 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 50006 | PORT_MODIFY("IN-19") | |
| 50007 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 50008 | PORT_MODIFY("IN-20") | |
| 50009 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 50010 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 50011 | // 0x0004 - "topdor" // standard input (expected here) | |
| 50012 | // 0x0008 - "botdor" // standard input (expected here) | |
| 50013 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 50014 | 50014 | INPUT_PORTS_END |
| 50015 | 50015 | |
| 50016 | 50016 | // half size sound rom, or missing a rom |
| r31373 | r31374 | |
| 50021 | 50021 | GAMEL( 200?, sc4cycclc ,sc4cyccl, sc4, sc4cyccl, sc4_state, sc4, ROT0, "Mazooma","Count Yer Cash Club (Mazooma) (Scorpion 4) (set 4)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50022 | 50022 | |
| 50023 | 50023 | INPUT_PORTS_START( sc4supst ) // this structure is generated |
| 50024 | PORT_INCLUDE( sc4_base ) | |
| 50025 | PORT_MODIFY("IN-1") | |
| 50026 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("coll") | |
| 50027 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 50028 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("blnk1") | |
| 50029 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("blnk2") | |
| 50030 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("blnk3") | |
| 50031 | PORT_MODIFY("IN-2") | |
| 50032 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 50033 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50034 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50035 | PORT_MODIFY("IN-16") | |
| 50036 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50037 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50038 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50039 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50040 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50041 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 50042 | PORT_MODIFY("IN-17") | |
| 50043 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50044 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50045 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50046 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50047 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50048 | PORT_MODIFY("IN-18") | |
| 50049 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50050 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50051 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50052 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50053 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50054 | PORT_MODIFY("IN-19") | |
| 50055 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50056 | PORT_MODIFY("IN-20") | |
| 50057 | // 0x0001 - "test" // standard input (motherboard) | |
| 50058 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50059 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50060 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50061 | // 0x0010 - "hp dmp" // standard input (expected here) | |
| 50024 | PORT_INCLUDE( sc4_base ) | |
| 50025 | PORT_MODIFY("IN-1") | |
| 50026 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("coll") | |
| 50027 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("trans") | |
| 50028 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("blnk1") | |
| 50029 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("blnk2") | |
| 50030 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("blnk3") | |
| 50031 | PORT_MODIFY("IN-2") | |
| 50032 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stake") | |
| 50033 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50034 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50035 | PORT_MODIFY("IN-16") | |
| 50036 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50037 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50038 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50039 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50040 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50041 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 50042 | PORT_MODIFY("IN-17") | |
| 50043 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50044 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50045 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50046 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50047 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50048 | PORT_MODIFY("IN-18") | |
| 50049 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50050 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50051 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50052 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50053 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50054 | PORT_MODIFY("IN-19") | |
| 50055 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50056 | PORT_MODIFY("IN-20") | |
| 50057 | // 0x0001 - "test" // standard input (motherboard) | |
| 50058 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50059 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50060 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50061 | // 0x0010 - "hp dmp" // standard input (expected here) | |
| 50062 | 50062 | INPUT_PORTS_END |
| 50063 | 50063 | |
| 50064 | 50064 | // PR2206 STREAKX STRX SOUNDS SUPER STREAX |
| r31373 | r31374 | |
| 50066 | 50066 | GAMEL( 200?, sc4supsta ,sc4supst, sc4, sc4supst, sc4_state, sc4, ROT0, "Mazooma","Super Streax (Mazooma) (Scorpion 4) (set 2)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50067 | 50067 | |
| 50068 | 50068 | INPUT_PORTS_START( sc4sf ) // this structure is generated |
| 50069 | PORT_INCLUDE( sc4_base ) | |
| 50070 | PORT_MODIFY("IN-1") | |
| 50071 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50072 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("excnge") | |
| 50073 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50074 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50075 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50076 | PORT_MODIFY("IN-2") | |
| 50077 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("coll") | |
| 50078 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50079 | PORT_MODIFY("IN-4") | |
| 50080 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 50081 | PORT_MODIFY("IN-8") | |
| 50082 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("brd ex") | |
| 50083 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("higher") | |
| 50084 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lower") | |
| 50085 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 50086 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 50087 | PORT_MODIFY("IN-16") | |
| 50088 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50089 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50090 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50091 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50092 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50093 | PORT_MODIFY("IN-17") | |
| 50094 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50095 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50096 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50097 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50098 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50099 | PORT_MODIFY("IN-18") | |
| 50100 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50101 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50102 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50103 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50104 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50105 | PORT_MODIFY("IN-19") | |
| 50106 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50107 | PORT_MODIFY("IN-20") | |
| 50108 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50109 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50110 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50111 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50112 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50069 | PORT_INCLUDE( sc4_base ) | |
| 50070 | PORT_MODIFY("IN-1") | |
| 50071 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50072 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("excnge") | |
| 50073 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50074 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50075 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50076 | PORT_MODIFY("IN-2") | |
| 50077 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("coll") | |
| 50078 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50079 | PORT_MODIFY("IN-4") | |
| 50080 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 50081 | PORT_MODIFY("IN-8") | |
| 50082 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("brd ex") | |
| 50083 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("higher") | |
| 50084 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lower") | |
| 50085 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("tk fet") | |
| 50086 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("tk csh") | |
| 50087 | PORT_MODIFY("IN-16") | |
| 50088 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50089 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50090 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50091 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50092 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50093 | PORT_MODIFY("IN-17") | |
| 50094 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50095 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50096 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50097 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50098 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50099 | PORT_MODIFY("IN-18") | |
| 50100 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50101 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50102 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50103 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50104 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50105 | PORT_MODIFY("IN-19") | |
| 50106 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50107 | PORT_MODIFY("IN-20") | |
| 50108 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50109 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50110 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50111 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50112 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50113 | 50113 | INPUT_PORTS_END |
| 50114 | 50114 | |
| 50115 | 50115 | // NUMBER PR2024 STREET FIGHTER STRF SOUNDS STREET FIGHTER |
| r31373 | r31374 | |
| 50120 | 50120 | GAMEL( 200?, sc4sfd ,sc4sf, sc4, sc4sf, sc4_state, sc4, ROT0, "Mazooma","Street Fighter (Mazooma) (Scorpion 4) (set 5)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50121 | 50121 | |
| 50122 | 50122 | INPUT_PORTS_START( sc4hyde ) // this structure is generated |
| 50123 | PORT_INCLUDE( sc4_base ) | |
| 50124 | PORT_MODIFY("IN-1") | |
| 50125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold a") | |
| 50127 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold b") | |
| 50128 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold c") | |
| 50129 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 50130 | PORT_MODIFY("IN-2") | |
| 50131 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 50132 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50133 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50134 | PORT_MODIFY("IN-8") | |
| 50135 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 50136 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 50137 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ftr") | |
| 50138 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 50139 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ko") | |
| 50140 | PORT_MODIFY("IN-9") | |
| 50141 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("blast") | |
| 50142 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("cash") | |
| 50143 | PORT_MODIFY("IN-16") | |
| 50144 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50145 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50146 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50147 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50148 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50149 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50150 | PORT_MODIFY("IN-17") | |
| 50151 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50152 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50153 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50154 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50155 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50156 | PORT_MODIFY("IN-18") | |
| 50157 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50158 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50159 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50160 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50161 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50162 | PORT_MODIFY("IN-19") | |
| 50163 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50164 | PORT_MODIFY("IN-20") | |
| 50165 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50166 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50167 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50168 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50169 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50123 | PORT_INCLUDE( sc4_base ) | |
| 50124 | PORT_MODIFY("IN-1") | |
| 50125 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50126 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold a") | |
| 50127 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold b") | |
| 50128 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold c") | |
| 50129 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("stop") | |
| 50130 | PORT_MODIFY("IN-2") | |
| 50131 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xchnge") | |
| 50132 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50133 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50134 | PORT_MODIFY("IN-8") | |
| 50135 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 50136 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 50137 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("ftr") | |
| 50138 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 50139 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("ko") | |
| 50140 | PORT_MODIFY("IN-9") | |
| 50141 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("blast") | |
| 50142 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("cash") | |
| 50143 | PORT_MODIFY("IN-16") | |
| 50144 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50145 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50146 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50147 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50148 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50149 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50150 | PORT_MODIFY("IN-17") | |
| 50151 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50152 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50153 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50154 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50155 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50156 | PORT_MODIFY("IN-18") | |
| 50157 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50158 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50159 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50160 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50161 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50162 | PORT_MODIFY("IN-19") | |
| 50163 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50164 | PORT_MODIFY("IN-20") | |
| 50165 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50166 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50167 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50168 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50169 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50170 | 50170 | INPUT_PORTS_END |
| 50171 | 50171 | |
| 50172 | 50172 | // PR2036 HYDE & STREAK HYDE SOUNDS HYDE & STREAK |
| r31373 | r31374 | |
| 50176 | 50176 | GAMEL( 200?, sc4hydec ,sc4hyde, sc4, sc4hyde, sc4_state, sc4, ROT0, "Mazooma","Hyde & Streak (Mazooma) (Scorpion 4) (set 4)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50177 | 50177 | |
| 50178 | 50178 | INPUT_PORTS_START( sc4rtclb ) // this structure is generated |
| 50179 | PORT_INCLUDE( sc4_base ) | |
| 50180 | PORT_MODIFY("IN-1") | |
| 50181 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 50182 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 50183 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 50184 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 50185 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 50186 | PORT_MODIFY("IN-2") | |
| 50187 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 50188 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 50189 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50190 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50191 | PORT_MODIFY("IN-3") | |
| 50192 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 50193 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 50194 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 50195 | PORT_MODIFY("IN-4") | |
| 50196 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 50197 | PORT_MODIFY("IN-5") | |
| 50198 | // 0x0001 - "priz4" // standard input (expected here) | |
| 50199 | // 0x0002 - "priz3" // standard input (expected here) | |
| 50200 | // 0x0004 - "priz2" // standard input (expected here) | |
| 50201 | // 0x0008 - "priz1" // standard input (expected here) | |
| 50202 | PORT_MODIFY("IN-8") | |
| 50203 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("knk lo") | |
| 50204 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("fet lo") | |
| 50205 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nud lo") | |
| 50206 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nud hi") | |
| 50207 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet hi") | |
| 50208 | PORT_MODIFY("IN-9") | |
| 50209 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("knk hi") | |
| 50210 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk knk") | |
| 50211 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("tk fet") | |
| 50212 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("tk nud") | |
| 50213 | PORT_MODIFY("IN-16") | |
| 50214 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50215 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50216 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50217 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50218 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50219 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50220 | PORT_MODIFY("IN-17") | |
| 50221 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50222 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50223 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50224 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50225 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50226 | PORT_MODIFY("IN-18") | |
| 50227 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50228 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50229 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50230 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 50231 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 50232 | PORT_MODIFY("IN-19") | |
| 50233 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 50234 | PORT_MODIFY("IN-20") | |
| 50235 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 50236 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 50237 | // 0x0004 - "topdor" // standard input (expected here) | |
| 50238 | // 0x0008 - "botdor" // standard input (expected here) | |
| 50239 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 50179 | PORT_INCLUDE( sc4_base ) | |
| 50180 | PORT_MODIFY("IN-1") | |
| 50181 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 50182 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 50183 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 50184 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 50185 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 50186 | PORT_MODIFY("IN-2") | |
| 50187 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 50188 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchng") | |
| 50189 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50190 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50191 | PORT_MODIFY("IN-3") | |
| 50192 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 50193 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 50194 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 50195 | PORT_MODIFY("IN-4") | |
| 50196 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 50197 | PORT_MODIFY("IN-5") | |
| 50198 | // 0x0001 - "priz4" // standard input (expected here) | |
| 50199 | // 0x0002 - "priz3" // standard input (expected here) | |
| 50200 | // 0x0004 - "priz2" // standard input (expected here) | |
| 50201 | // 0x0008 - "priz1" // standard input (expected here) | |
| 50202 | PORT_MODIFY("IN-8") | |
| 50203 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("knk lo") | |
| 50204 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("fet lo") | |
| 50205 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("nud lo") | |
| 50206 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("nud hi") | |
| 50207 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("fet hi") | |
| 50208 | PORT_MODIFY("IN-9") | |
| 50209 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("knk hi") | |
| 50210 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("tk knk") | |
| 50211 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("tk fet") | |
| 50212 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_3 ) PORT_NAME("tk nud") | |
| 50213 | PORT_MODIFY("IN-16") | |
| 50214 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50215 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50216 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50217 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50218 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50219 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50220 | PORT_MODIFY("IN-17") | |
| 50221 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50222 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50223 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50224 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50225 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50226 | PORT_MODIFY("IN-18") | |
| 50227 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50228 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50229 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50230 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 50231 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 50232 | PORT_MODIFY("IN-19") | |
| 50233 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 50234 | PORT_MODIFY("IN-20") | |
| 50235 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 50236 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 50237 | // 0x0004 - "topdor" // standard input (expected here) | |
| 50238 | // 0x0008 - "botdor" // standard input (expected here) | |
| 50239 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 50240 | 50240 | INPUT_PORTS_END |
| 50241 | 50241 | |
| 50242 | 50242 | // PR2051 CLUB ROLLING THUNDER CLRT SOUNDS ROLLING THUNDER |
| r31373 | r31374 | |
| 50256 | 50256 | |
| 50257 | 50257 | // only sc4jive has this structure intact |
| 50258 | 50258 | INPUT_PORTS_START( sc4jive ) // this structure is generated |
| 50259 | PORT_INCLUDE( sc4_base ) | |
| 50260 | PORT_MODIFY("IN-1") | |
| 50261 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50262 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 50263 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 50264 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 50265 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 50266 | PORT_MODIFY("IN-2") | |
| 50267 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 50268 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50269 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50270 | PORT_MODIFY("IN-8") | |
| 50271 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tke cs") | |
| 50272 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tke sh") | |
| 50273 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take_w") | |
| 50274 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 50275 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("collec") | |
| 50276 | PORT_MODIFY("IN-16") | |
| 50277 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50278 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50279 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50280 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50281 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50282 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50283 | PORT_MODIFY("IN-17") | |
| 50284 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50285 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50286 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50287 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50288 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50289 | PORT_MODIFY("IN-18") | |
| 50290 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50291 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50292 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50293 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50294 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50295 | PORT_MODIFY("IN-19") | |
| 50296 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50297 | PORT_MODIFY("IN-20") | |
| 50298 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50299 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50300 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50301 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50302 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50259 | PORT_INCLUDE( sc4_base ) | |
| 50260 | PORT_MODIFY("IN-1") | |
| 50261 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50262 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold 1") | |
| 50263 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 2") | |
| 50264 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 3") | |
| 50265 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("collec") | |
| 50266 | PORT_MODIFY("IN-2") | |
| 50267 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exchge") | |
| 50268 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50269 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50270 | PORT_MODIFY("IN-8") | |
| 50271 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tke cs") | |
| 50272 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tke sh") | |
| 50273 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("take_w") | |
| 50274 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("spin") | |
| 50275 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("collec") | |
| 50276 | PORT_MODIFY("IN-16") | |
| 50277 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50278 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50279 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50280 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50281 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50282 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50283 | PORT_MODIFY("IN-17") | |
| 50284 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50285 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50286 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50287 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50288 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50289 | PORT_MODIFY("IN-18") | |
| 50290 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50291 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50292 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50293 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50294 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50295 | PORT_MODIFY("IN-19") | |
| 50296 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50297 | PORT_MODIFY("IN-20") | |
| 50298 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50299 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50300 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50301 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50302 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50303 | 50303 | INPUT_PORTS_END |
| 50304 | 50304 | |
| 50305 | 50305 | // PR2096 JIVE MONEY JIVE SOUNDS JIVE MONEY |
| r31373 | r31374 | |
| 50311 | 50311 | GAMEL( 200?, sc4jived ,sc4jive, sc4, sc4jive, sc4_state, sc4, ROT0, "Mazooma","Jive Money (PR2160) (Mazooma) (Scorpion 4) (set 4)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50312 | 50312 | |
| 50313 | 50313 | INPUT_PORTS_START( sc4mclb ) // this structure is generated |
| 50314 | PORT_INCLUDE( sc4_base ) | |
| 50315 | PORT_MODIFY("IN-1") | |
| 50316 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 50317 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 50318 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 50319 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 50320 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 50321 | PORT_MODIFY("IN-2") | |
| 50322 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 50323 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 50324 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 50325 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50326 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 50327 | PORT_MODIFY("IN-3") | |
| 50328 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 50329 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 50330 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 50331 | PORT_MODIFY("IN-4") | |
| 50332 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 50333 | PORT_MODIFY("IN-5") | |
| 50334 | // 0x0001 - "priz4" // standard input (expected here) | |
| 50335 | // 0x0002 - "priz3" // standard input (expected here) | |
| 50336 | // 0x0004 - "priz2" // standard input (expected here) | |
| 50337 | // 0x0008 - "priz1" // standard input (expected here) | |
| 50338 | PORT_MODIFY("IN-8") | |
| 50339 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 50340 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk mtr") | |
| 50341 | PORT_MODIFY("IN-16") | |
| 50342 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50343 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50344 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50345 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50346 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50347 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50348 | PORT_MODIFY("IN-17") | |
| 50349 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50350 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50351 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50352 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50353 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50354 | PORT_MODIFY("IN-18") | |
| 50355 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50356 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50357 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50358 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 50359 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 50360 | PORT_MODIFY("IN-19") | |
| 50361 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 50362 | PORT_MODIFY("IN-20") | |
| 50363 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 50364 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 50365 | // 0x0004 - "topdor" // standard input (expected here) | |
| 50366 | // 0x0008 - "botdor" // standard input (expected here) | |
| 50367 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 50314 | PORT_INCLUDE( sc4_base ) | |
| 50315 | PORT_MODIFY("IN-1") | |
| 50316 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cn/col") | |
| 50317 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("hold1") | |
| 50318 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold2") | |
| 50319 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold3") | |
| 50320 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold4") | |
| 50321 | PORT_MODIFY("IN-2") | |
| 50322 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("stop") | |
| 50323 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("xfer") | |
| 50324 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("exchng") | |
| 50325 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50326 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4 ) PORT_NAME("start") | |
| 50327 | PORT_MODIFY("IN-3") | |
| 50328 | // 0x0004 - "stk 4" // standard input (expected here) | |
| 50329 | // 0x0008 - "stk 3" // standard input (expected here) | |
| 50330 | // 0x0010 - "stk 2" // standard input (expected here) | |
| 50331 | PORT_MODIFY("IN-4") | |
| 50332 | // 0x0100 - "hoplow" // known extended input, usually 'hopper low' | |
| 50333 | PORT_MODIFY("IN-5") | |
| 50334 | // 0x0001 - "priz4" // standard input (expected here) | |
| 50335 | // 0x0002 - "priz3" // standard input (expected here) | |
| 50336 | // 0x0004 - "priz2" // standard input (expected here) | |
| 50337 | // 0x0008 - "priz1" // standard input (expected here) | |
| 50338 | PORT_MODIFY("IN-8") | |
| 50339 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("tk nud") | |
| 50340 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("tk mtr") | |
| 50341 | PORT_MODIFY("IN-16") | |
| 50342 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50343 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50344 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50345 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50346 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50347 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50348 | PORT_MODIFY("IN-17") | |
| 50349 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50350 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50351 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50352 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50353 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50354 | PORT_MODIFY("IN-18") | |
| 50355 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50356 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50357 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50358 | // 0x0008 - "dil14 OR perc1" // standard input (motherboard) | |
| 50359 | // 0x0010 - "dil15 OR perc2" // standard input (motherboard) | |
| 50360 | PORT_MODIFY("IN-19") | |
| 50361 | // 0x0001 - "dil16 OR perc3" // standard input (motherboard) | |
| 50362 | PORT_MODIFY("IN-20") | |
| 50363 | // 0x0001 - "grnbut" // standard input (motherboard) | |
| 50364 | // 0x0002 - "dorlok" // standard input (expected here) | |
| 50365 | // 0x0004 - "topdor" // standard input (expected here) | |
| 50366 | // 0x0008 - "botdor" // standard input (expected here) | |
| 50367 | // 0x0010 - "hopdmp" // standard input (expected here) | |
| 50368 | 50368 | INPUT_PORTS_END |
| 50369 | 50369 | |
| 50370 | 50370 | // no sound roms |
| r31373 | r31374 | |
| 50378 | 50378 | |
| 50379 | 50379 | |
| 50380 | 50380 | INPUT_PORTS_START( sc4monot ) // this structure is generated |
| 50381 | PORT_INCLUDE( sc4_base ) | |
| 50382 | PORT_MODIFY("IN-1") | |
| 50383 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50384 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 50385 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50386 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50387 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50388 | PORT_MODIFY("IN-2") | |
| 50389 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("streak") | |
| 50390 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50391 | PORT_MODIFY("IN-16") | |
| 50392 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50393 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 50394 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 50395 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 50396 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 50397 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50398 | PORT_MODIFY("IN-17") | |
| 50399 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50400 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 50401 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 50402 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 50403 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 50404 | PORT_MODIFY("IN-18") | |
| 50405 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50406 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 50407 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 50408 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 50409 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 50410 | PORT_MODIFY("IN-19") | |
| 50411 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50412 | PORT_MODIFY("IN-20") | |
| 50413 | // 0x0001 - "green" // standard input (motherboard) | |
| 50414 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50415 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50416 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50417 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50381 | PORT_INCLUDE( sc4_base ) | |
| 50382 | PORT_MODIFY("IN-1") | |
| 50383 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50384 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("transf") | |
| 50385 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50386 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50387 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50388 | PORT_MODIFY("IN-2") | |
| 50389 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("streak") | |
| 50390 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50391 | PORT_MODIFY("IN-16") | |
| 50392 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50393 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 50394 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 50395 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 50396 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 50397 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50398 | PORT_MODIFY("IN-17") | |
| 50399 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50400 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 50401 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 50402 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 50403 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 50404 | PORT_MODIFY("IN-18") | |
| 50405 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50406 | // 0x0002 - "dil sw" // standard input (motherboard) | |
| 50407 | // 0x0004 - "dil sw" // standard input (motherboard) | |
| 50408 | // 0x0008 - "dil sw" // standard input (motherboard) | |
| 50409 | // 0x0010 - "dil sw" // standard input (motherboard) | |
| 50410 | PORT_MODIFY("IN-19") | |
| 50411 | // 0x0001 - "dil sw" // standard input (motherboard) | |
| 50412 | PORT_MODIFY("IN-20") | |
| 50413 | // 0x0001 - "green" // standard input (motherboard) | |
| 50414 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50415 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50416 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50417 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50418 | 50418 | INPUT_PORTS_END |
| 50419 | 50419 | |
| 50420 | 50420 | GAMEL( 200?, sc4monot ,0, sc4, sc4monot, sc4_state, sc4, ROT0, "Mazooma","Monopoly TTT (PR2133) (Mazooma) (Scorpion 4) (set 1)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) // PR2133MONOPOLY TTT MONOPOLY TTT MAZ MONL SOUNDS MONOPOLY |
| r31373 | r31374 | |
| 50423 | 50423 | GAMEL( 200?, sc4monotc ,sc4monot, sc4, sc4monot, sc4_state, sc4, ROT0, "Mazooma","Monopoly TTT (PR2133) (Mazooma) (Scorpion 4) (set 4)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) // PR2133MONOPOLY TTT MONOPOLY TTT ARCADE MONL SOUNDS MONOPOLY |
| 50424 | 50424 | |
| 50425 | 50425 | INPUT_PORTS_START( sc4r2r ) // this structure is generated |
| 50426 | PORT_INCLUDE( sc4_base ) | |
| 50427 | PORT_MODIFY("IN-1") | |
| 50428 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50429 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("take f") | |
| 50430 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50431 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50432 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50433 | PORT_MODIFY("IN-2") | |
| 50434 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("a ndge") | |
| 50435 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("swop t") | |
| 50436 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50437 | PORT_MODIFY("IN-7") | |
| 50438 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("tk pik") | |
| 50439 | PORT_MODIFY("IN-8") | |
| 50440 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("rht lo") | |
| 50441 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("mid lo") | |
| 50442 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lef lo") | |
| 50443 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef hi") | |
| 50444 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("mid hi") | |
| 50445 | PORT_MODIFY("IN-9") | |
| 50446 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("rht hi") | |
| 50447 | PORT_MODIFY("IN-16") | |
| 50448 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50449 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50450 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50451 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50452 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50453 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50454 | PORT_MODIFY("IN-17") | |
| 50455 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50456 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50457 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50458 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50459 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50460 | PORT_MODIFY("IN-18") | |
| 50461 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50462 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50463 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50464 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50465 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50466 | PORT_MODIFY("IN-19") | |
| 50467 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50468 | PORT_MODIFY("IN-20") | |
| 50469 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50470 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50471 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50472 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50473 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50426 | PORT_INCLUDE( sc4_base ) | |
| 50427 | PORT_MODIFY("IN-1") | |
| 50428 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50429 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("take f") | |
| 50430 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50431 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50432 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50433 | PORT_MODIFY("IN-2") | |
| 50434 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("a ndge") | |
| 50435 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("swop t") | |
| 50436 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50437 | PORT_MODIFY("IN-7") | |
| 50438 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_7_0 ) PORT_NAME("tk pik") | |
| 50439 | PORT_MODIFY("IN-8") | |
| 50440 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("rht lo") | |
| 50441 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("mid lo") | |
| 50442 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("lef lo") | |
| 50443 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("lef hi") | |
| 50444 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("mid hi") | |
| 50445 | PORT_MODIFY("IN-9") | |
| 50446 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("rht hi") | |
| 50447 | PORT_MODIFY("IN-16") | |
| 50448 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50449 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50450 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50451 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50452 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50453 | // 0x0100 - "top up" // known extended input, usually 'top up' | |
| 50454 | PORT_MODIFY("IN-17") | |
| 50455 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50456 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50457 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50458 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50459 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50460 | PORT_MODIFY("IN-18") | |
| 50461 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50462 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50463 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50464 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50465 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50466 | PORT_MODIFY("IN-19") | |
| 50467 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50468 | PORT_MODIFY("IN-20") | |
| 50469 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50470 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50471 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50472 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50473 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50474 | 50474 | INPUT_PORTS_END |
| 50475 | 50475 | |
| 50476 | 50476 | // PR2037 REEL TO REEL RTOR SOUNDS REEL 2 REEL |
| r31373 | r31374 | |
| 50480 | 50480 | GAMEL( 200?, sc4r2rc ,sc4r2r, sc4, sc4r2r, sc4_state, sc4, ROT0, "Mazooma","Reel To Reel (Mazooma) (Scorpion 4) (set 4)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50481 | 50481 | |
| 50482 | 50482 | INPUT_PORTS_START( sc4revo ) // this structure is generated |
| 50483 | PORT_INCLUDE( sc4_base ) | |
| 50484 | PORT_MODIFY("IN-1") | |
| 50485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50486 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 50487 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50488 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50489 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50490 | PORT_MODIFY("IN-2") | |
| 50491 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("colect") | |
| 50492 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchge") | |
| 50493 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50494 | PORT_MODIFY("IN-4") | |
| 50495 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 50496 | PORT_MODIFY("IN-8") | |
| 50497 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nge hi") | |
| 50498 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("wsp hi") | |
| 50499 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("csh hi") | |
| 50500 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("csh lo") | |
| 50501 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("wsp lo") | |
| 50502 | PORT_MODIFY("IN-9") | |
| 50503 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nge lo") | |
| 50504 | PORT_MODIFY("IN-16") | |
| 50505 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50506 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50507 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50508 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50509 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50510 | PORT_MODIFY("IN-17") | |
| 50511 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50512 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50513 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50514 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50515 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50516 | PORT_MODIFY("IN-18") | |
| 50517 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50518 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50519 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50520 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50521 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50522 | PORT_MODIFY("IN-19") | |
| 50523 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50524 | PORT_MODIFY("IN-20") | |
| 50525 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50526 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50527 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50528 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50529 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50483 | PORT_INCLUDE( sc4_base ) | |
| 50484 | PORT_MODIFY("IN-1") | |
| 50485 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancel") | |
| 50486 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 50487 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold 1") | |
| 50488 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold 2") | |
| 50489 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold 3") | |
| 50490 | PORT_MODIFY("IN-2") | |
| 50491 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("colect") | |
| 50492 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exchge") | |
| 50493 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50494 | PORT_MODIFY("IN-4") | |
| 50495 | // 0x0010 - "top up" // known extended(?) input, sometimes 'top up' | |
| 50496 | PORT_MODIFY("IN-8") | |
| 50497 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("nge hi") | |
| 50498 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("wsp hi") | |
| 50499 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("csh hi") | |
| 50500 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("csh lo") | |
| 50501 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("wsp lo") | |
| 50502 | PORT_MODIFY("IN-9") | |
| 50503 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("nge lo") | |
| 50504 | PORT_MODIFY("IN-16") | |
| 50505 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50506 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50507 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50508 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50509 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50510 | PORT_MODIFY("IN-17") | |
| 50511 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50512 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50513 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50514 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50515 | // 0x0010 - "dil 10" // standard input (motherboard) | |
| 50516 | PORT_MODIFY("IN-18") | |
| 50517 | // 0x0001 - "dil 11" // standard input (motherboard) | |
| 50518 | // 0x0002 - "dil 12" // standard input (motherboard) | |
| 50519 | // 0x0004 - "dil 13" // standard input (motherboard) | |
| 50520 | // 0x0008 - "dil 14" // standard input (motherboard) | |
| 50521 | // 0x0010 - "dil 15" // standard input (motherboard) | |
| 50522 | PORT_MODIFY("IN-19") | |
| 50523 | // 0x0001 - "dil 16" // standard input (motherboard) | |
| 50524 | PORT_MODIFY("IN-20") | |
| 50525 | // 0x0001 - "testsw" // standard input (motherboard) | |
| 50526 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50527 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50528 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50529 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50530 | 50530 | INPUT_PORTS_END |
| 50531 | 50531 | |
| 50532 | 50532 | // PR2020 REVOLVER REV SOUNDS REVOLVER |
| r31373 | r31374 | |
| 50538 | 50538 | GAMEL( 200?, sc4revoe ,sc4revo, sc4, sc4revo, sc4_state, sc4, ROT0, "Mazooma","Revolver (Mazooma) (Scorpion 4) (set 6)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50539 | 50539 | |
| 50540 | 50540 | INPUT_PORTS_START( sc4slih ) // this structure is generated |
| 50541 | PORT_INCLUDE( sc4_base ) | |
| 50542 | PORT_MODIFY("IN-1") | |
| 50543 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 50544 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 50545 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 50546 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 50547 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 50548 | PORT_MODIFY("IN-2") | |
| 50549 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xfer") | |
| 50550 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 50551 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50552 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50553 | PORT_MODIFY("IN-8") | |
| 50554 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 50555 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 50556 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkcsh") | |
| 50557 | PORT_MODIFY("IN-16") | |
| 50558 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50559 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50560 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50561 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50562 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50563 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 50564 | PORT_MODIFY("IN-17") | |
| 50565 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50566 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50567 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50568 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50569 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50570 | PORT_MODIFY("IN-18") | |
| 50571 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50572 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50573 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50574 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 50575 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 50576 | PORT_MODIFY("IN-19") | |
| 50577 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 50578 | PORT_MODIFY("IN-20") | |
| 50579 | // 0x0001 - "test" // standard input (motherboard) | |
| 50580 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50581 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50582 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50583 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50541 | PORT_INCLUDE( sc4_base ) | |
| 50542 | PORT_MODIFY("IN-1") | |
| 50543 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("canc") | |
| 50544 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("colct") | |
| 50545 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 50546 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 50547 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 50548 | PORT_MODIFY("IN-2") | |
| 50549 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("xfer") | |
| 50550 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_1 ) PORT_NAME("exch") | |
| 50551 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50552 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refill") | |
| 50553 | PORT_MODIFY("IN-8") | |
| 50554 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("bonus") | |
| 50555 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("shot") | |
| 50556 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("tkcsh") | |
| 50557 | PORT_MODIFY("IN-16") | |
| 50558 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50559 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50560 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50561 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50562 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50563 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 50564 | PORT_MODIFY("IN-17") | |
| 50565 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50566 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50567 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50568 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50569 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50570 | PORT_MODIFY("IN-18") | |
| 50571 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50572 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50573 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50574 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 50575 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 50576 | PORT_MODIFY("IN-19") | |
| 50577 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 50578 | PORT_MODIFY("IN-20") | |
| 50579 | // 0x0001 - "test" // standard input (motherboard) | |
| 50580 | // 0x0002 - "dor lk" // standard input (expected here) | |
| 50581 | // 0x0004 - "tp dor" // standard input (expected here) | |
| 50582 | // 0x0008 - "csh bx" // standard input (expected here) | |
| 50583 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50584 | 50584 | INPUT_PORTS_END |
| 50585 | 50585 | |
| 50586 | 50586 | // half size sound roms |
| r31373 | r31374 | |
| 50593 | 50593 | GAMEL( 200?, sc4slihe ,sc4slih, sc4, sc4slih, sc4_state, sc4, ROT0, "Mazooma","Some Like It Hot (Mazooma) (Scorpion 4) (set 6)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_CLICKABLE_ARTWORK, layout_bfm_sc4 ) |
| 50594 | 50594 | |
| 50595 | 50595 | INPUT_PORTS_START( sc4gcb ) // this structure is generated |
| 50596 | PORT_INCLUDE( sc4_base ) | |
| 50597 | PORT_MODIFY("IN-1") | |
| 50598 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 50599 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 50600 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 50601 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 50602 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 50603 | PORT_MODIFY("IN-2") | |
| 50604 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 50605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 50607 | PORT_MODIFY("IN-8") | |
| 50608 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 50609 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 50610 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 50611 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 50612 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 50613 | PORT_MODIFY("IN-9") | |
| 50614 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 50615 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 50616 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 50617 | PORT_MODIFY("IN-16") | |
| 50618 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50619 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50620 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50621 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50622 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50623 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 50624 | PORT_MODIFY("IN-17") | |
| 50625 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50626 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50627 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50628 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50629 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50630 | PORT_MODIFY("IN-18") | |
| 50631 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50632 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50633 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50634 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 50635 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 50636 | PORT_MODIFY("IN-19") | |
| 50637 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 50638 | PORT_MODIFY("IN-20") | |
| 50639 | // 0x0001 - "test" // standard input (motherboard) | |
| 50640 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 50641 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 50642 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 50643 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50596 | PORT_INCLUDE( sc4_base ) | |
| 50597 | PORT_MODIFY("IN-1") | |
| 50598 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_0 ) PORT_NAME("cancl") | |
| 50599 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_1 ) PORT_NAME("stake") | |
| 50600 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_2 ) PORT_NAME("hold1") | |
| 50601 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_3 ) PORT_NAME("hold2") | |
| 50602 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_1_4 ) PORT_NAME("hold3") | |
| 50603 | PORT_MODIFY("IN-2") | |
| 50604 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_0 ) PORT_NAME("exch") | |
| 50605 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_2 ) PORT_NAME("start") | |
| 50606 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3 ) PORT_NAME("refil") | |
| 50607 | PORT_MODIFY("IN-8") | |
| 50608 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_0 ) PORT_NAME("c lo") | |
| 50609 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_1 ) PORT_NAME("b lo") | |
| 50610 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_2 ) PORT_NAME("f lo") | |
| 50611 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_3 ) PORT_NAME("step") | |
| 50612 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_8_4 ) PORT_NAME("f hi") | |
| 50613 | PORT_MODIFY("IN-9") | |
| 50614 | PORT_BIT( 0x0001, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_0 ) PORT_NAME("b hi") | |
| 50615 | PORT_BIT( 0x0002, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_1 ) PORT_NAME("c hi") | |
| 50616 | PORT_BIT( 0x0004, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_9_2 ) PORT_NAME("take") | |
| 50617 | PORT_MODIFY("IN-16") | |
| 50618 | // 0x0001 - "dil 1" // standard input (motherboard) | |
| 50619 | // 0x0002 - "dil 2" // standard input (motherboard) | |
| 50620 | // 0x0004 - "dil 3" // standard input (motherboard) | |
| 50621 | // 0x0008 - "dil 4" // standard input (motherboard) | |
| 50622 | // 0x0010 - "dil 5" // standard input (motherboard) | |
| 50623 | // 0x0100 - "topup" // known extended input, usually 'top up' | |
| 50624 | PORT_MODIFY("IN-17") | |
| 50625 | // 0x0001 - "dil 6" // standard input (motherboard) | |
| 50626 | // 0x0002 - "dil 7" // standard input (motherboard) | |
| 50627 | // 0x0004 - "dil 8" // standard input (motherboard) | |
| 50628 | // 0x0008 - "dil 9" // standard input (motherboard) | |
| 50629 | // 0x0010 - "dil10" // standard input (motherboard) | |
| 50630 | PORT_MODIFY("IN-18") | |
| 50631 | // 0x0001 - "dil11" // standard input (motherboard) | |
| 50632 | // 0x0002 - "dil12" // standard input (motherboard) | |
| 50633 | // 0x0004 - "dil13" // standard input (motherboard) | |
| 50634 | // 0x0008 - "dil14" // standard input (motherboard) | |
| 50635 | // 0x0010 - "dil15" // standard input (motherboard) | |
| 50636 | PORT_MODIFY("IN-19") | |
| 50637 | // 0x0001 - "dil16" // standard input (motherboard) | |
| 50638 | PORT_MODIFY("IN-20") | |
| 50639 | // 0x0001 - "test" // standard input (motherboard) | |
| 50640 | // 0x0002 - "dorlk" // standard input (expected here) | |
| 50641 | // 0x0004 - "tpdor" // standard input (expected here) | |
| 50642 | // 0x0008 - "cshbx" // standard input (expected here) | |
| 50643 | // 0x0010 - "deflt" // standard input (expected here) | |
| 50644 | 50644 | INPUT_PORTS_END |
| 50645 | 50645 | |
| 50646 | 50646 | // no sound roms |
| r31373 | r31374 | |
|---|---|---|
| 207 | 207 | PORT_START( "PADDLE1" ) /* fake input port for player 2 paddle */ |
| 208 | 208 | PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(2) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot1") |
| 209 | 209 | |
| 210 | PORT_START( "PADDLE2" ) /* fake input port for player 3 paddle */ | |
| 211 | PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(3) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot2") | |
| 210 | PORT_START( "PADDLE2" ) /* fake input port for player 3 paddle */ | |
| 211 | PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(3) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot2") | |
| 212 | 212 | |
| 213 | PORT_START( "PADDLE3" ) /* fake input port for player 4 paddle */ | |
| 214 | PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(4) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot3") | |
| 213 | PORT_START( "PADDLE3" ) /* fake input port for player 4 paddle */ | |
| 214 | PORT_BIT( 0xff, 0x00, IPT_PADDLE ) PORT_SENSITIVITY(2) PORT_KEYDELTA(100) PORT_CENTERDELTA(0) PORT_PLAYER(4) NETLIST_ANALOG_PORT_CHANGED("maincpu", "pot3") | |
| 215 | 215 | |
| 216 | 216 | PORT_START("IN0") /* fake as well */ |
| 217 | 217 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_COIN1 ) NETLIST_LOGIC_PORT_CHANGED("maincpu", "coinsw") |
| r31373 | r31374 | |
| 284 | 284 | #endif |
| 285 | 285 | MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot0", "A10_POT.DIAL") |
| 286 | 286 | MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot1", "B10_POT.DIAL") |
| 287 | MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot2", "B9B_POT.DIAL") | |
| 288 | MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot3", "B9A_POT.DIAL") | |
| 287 | MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot2", "B9B_POT.DIAL") | |
| 288 | MCFG_NETLIST_ANALOG_INPUT("maincpu", "pot3", "B9A_POT.DIAL") | |
| 289 | 289 | MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1a", "DIPSW1.POS", 0, 0x01) |
| 290 | 290 | MCFG_NETLIST_LOGIC_INPUT("maincpu", "sw1b", "DIPSW2.POS", 0, 0x01) |
| 291 | 291 | MCFG_NETLIST_LOGIC_INPUT("maincpu", "coinsw", "COIN_SW.POS", 0, 0x01) |
| r31373 | r31374 | |
|---|---|---|
| 750 | 750 | MCFG_VOODOO_TMUMEM(2,2) |
| 751 | 751 | MCFG_VOODOO_SCREEN_TAG("screen") |
| 752 | 752 | MCFG_VOODOO_CPU_TAG("dsp") |
| 753 | MCFG_VOODOO_VBLANK_CB(WRITELINE(nwktr_state,voodoo_vblank_0)) | |
| 753 | MCFG_VOODOO_VBLANK_CB(WRITELINE(nwktr_state,voodoo_vblank_0)) | |
| 754 | 754 | |
| 755 | 755 | MCFG_SCREEN_ADD("screen", RASTER) |
| 756 | 756 | MCFG_SCREEN_REFRESH_RATE(60) |
| r31373 | r31374 | |
| 767 | 767 | MCFG_K001604_GFX_INDEX2(1) |
| 768 | 768 | MCFG_K001604_LAYER_SIZE(0) |
| 769 | 769 | MCFG_K001604_ROZ_SIZE(1) |
| 770 | MCFG_K001604_TXT_OFFSET(0) // correct? | |
| 771 | MCFG_K001604_ROZ_OFFSET(0) // correct? | |
| 770 | MCFG_K001604_TXT_OFFSET(0) // correct? | |
| 771 | MCFG_K001604_ROZ_OFFSET(0) // correct? | |
| 772 | 772 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 773 | 773 | MCFG_K001604_PALETTE("palette") |
| 774 | 774 | |
| r31373 | r31374 | |
| 780 | 780 | MCFG_RF5C400_ADD("rfsnd", XTAL_16_9344MHz) // as per Guru readme above |
| 781 | 781 | MCFG_SOUND_ROUTE(0, "lspeaker", 1.0) |
| 782 | 782 | MCFG_SOUND_ROUTE(1, "rspeaker", 1.0) |
| 783 | ||
| 783 | ||
| 784 | 784 | MCFG_DEVICE_ADD("konppc", KONPPC, 0) |
| 785 | 785 | MCFG_KONPPC_CGBOARD_NUMBER(2) |
| 786 | MCFG_KONPPC_CGBOARD_TYPE(CGBOARD_TYPE_NWKTR) | |
| 786 | MCFG_KONPPC_CGBOARD_TYPE(CGBOARD_TYPE_NWKTR) | |
| 787 | 787 | MACHINE_CONFIG_END |
| 788 | 788 | |
| 789 | 789 | static MACHINE_CONFIG_DERIVED( thrilld, nwktr ) |
| r31373 | r31374 | |
| 794 | 794 | MCFG_K001604_GFX_INDEX2(1) |
| 795 | 795 | MCFG_K001604_LAYER_SIZE(1) |
| 796 | 796 | MCFG_K001604_ROZ_SIZE(1) |
| 797 | MCFG_K001604_TXT_OFFSET(0) // correct? | |
| 798 | MCFG_K001604_ROZ_OFFSET(0) // correct? | |
| 797 | MCFG_K001604_TXT_OFFSET(0) // correct? | |
| 798 | MCFG_K001604_ROZ_OFFSET(0) // correct? | |
| 799 | 799 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 800 | 800 | MCFG_K001604_PALETTE("palette") |
| 801 | 801 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 204 | 204 | ROM_LOAD("u5.bin", 0x00000, 0x40000, CRC(e5126980) SHA1(2c6d412c87bf27098dae4351958d84e8f9348423)) |
| 205 | 205 | ROM_RELOAD( 0x80000, 0x40000) |
| 206 | 206 | ROM_LOAD("u6.bin", 0x40000, 0x40000, CRC(eb241633) SHA1(8e5db75b32ed2ea74088615bbe1403d4c8feafbd)) |
| 207 | ROM_RELOAD( 0xc0000, 0x40000) | |
| 207 | ROM_RELOAD( 0xc0000, 0x40000) | |
| 208 | 208 | ROM_END |
| 209 | 209 | |
| 210 | 210 | /*------------------------------------------------------------------- |
| r31373 | r31374 | |
|---|---|---|
| 374 | 374 | Notes: |
| 375 | 375 | OSC1 - oscillator 20.000MHz |
| 376 | 376 | JP1-7 - JUMPER unknown function |
| 377 | SW1 - PUSHBUTTON | |
| 378 | SW2 - 8X2 DIPswitch | |
| 377 | SW1 - PUSHBUTTON | |
| 378 | SW2 - 8X2 DIPswitch | |
| 379 | 379 | SCSI-CTRL - SCSI-II controller MB86604A |
| 380 | 380 | CNDB25 - DB-25 SCSI-II connector |
| 381 | 381 | IC17S-IC38S - FlashROM (SOP56), 64Mb. |
| r31373 | r31374 | |
| 386 | 386 | CN1/2/3 - connectors joining to main board |
| 387 | 387 | |
| 388 | 388 | Games known to use this PCB include.... |
| 389 | Sticker EPROM MASKROMs | |
| 389 | Sticker EPROM MASKROMs | |
| 390 | 390 | Game on cart IC16# # of SOP56 Notes |
| 391 | 391 | ---------------------------------------------------------------------------------------------------- |
| 392 | 392 | Puyo Puyo Fever (prototype) * not present 22 (64Mb) no cart, only development PCB |
| r31373 | r31374 | |
| 5738 | 5738 | |
| 5739 | 5739 | ROM_REGION( 0x10000000, "rom_board", ROMREGION_ERASEFF) |
| 5740 | 5740 | // real encrypted ROM dump |
| 5741 | ROM_LOAD( "fpr-24423.ic8", 0x00000000, 0x4000000, CRC(c85513ce) SHA1(88490fe64c0866059492b0c1c714b50f3f270676) ) | |
| 5741 | ROM_LOAD( "fpr-24423.ic8", 0x00000000, 0x4000000, CRC(c85513ce) SHA1(88490fe64c0866059492b0c1c714b50f3f270676) ) | |
| 5742 | 5742 | // decrypted version of IC8 |
| 5743 | 5743 | ROM_LOAD( "fpr-24423.ic8d", 0x00000000, 0x4000000, CRC(209a991c) SHA1(d76228a215c50ff3085708182b8e47fd2ebc6a47) ) |
| 5744 | ROM_LOAD( "fpr-24424.ic9", 0x04000000, 0x4000000, CRC(7bba2402) SHA1(94d637969c58d5dfa3ee64bc3cfb9495dbb97511) ) | |
| 5745 | ROM_LOAD( "fpr-24425.ic10", 0x08000000, 0x4000000, CRC(6223ebac) SHA1(64c0ec61c108acbb557e7d3837f578deba832cb6) ) | |
| 5746 | ROM_LOAD( "fpr-24426.ic11", 0x0c000000, 0x4000000, CRC(c78b0981) SHA1(f889acf9065566e11ff985a3b6c4824e364d57ae) ) | |
| 5744 | ROM_LOAD( "fpr-24424.ic9", 0x04000000, 0x4000000, CRC(7bba2402) SHA1(94d637969c58d5dfa3ee64bc3cfb9495dbb97511) ) | |
| 5745 | ROM_LOAD( "fpr-24425.ic10", 0x08000000, 0x4000000, CRC(6223ebac) SHA1(64c0ec61c108acbb557e7d3837f578deba832cb6) ) | |
| 5746 | ROM_LOAD( "fpr-24426.ic11", 0x0c000000, 0x4000000, CRC(c78b0981) SHA1(f889acf9065566e11ff985a3b6c4824e364d57ae) ) | |
| 5747 | 5747 | |
| 5748 | 5748 | ROM_REGION( 4, "rom_key", 0 ) |
| 5749 | ROM_LOAD( "rhytngk-key.bin", 0x000000, 0x000004, CRC(e2560d28) SHA1(46fb9b47a0df3035f92db2b0c63a6e4e0745ad29) ) | |
| 5749 | ROM_LOAD( "rhytngk-key.bin", 0x000000, 0x000004, CRC(e2560d28) SHA1(46fb9b47a0df3035f92db2b0c63a6e4e0745ad29) ) | |
| 5750 | 5750 | |
| 5751 | 5751 | ROM_REGION(0x4, "boardid", ROMREGION_ERASEVAL(0x04)) |
| 5752 | 5752 | ROM_END |
| r31373 | r31374 | |
| 8837 | 8837 | /* 0170 */ GAME( 2007, manicpnc, naomi, naomim4, naomi, naomi_state, naomi, ROT0, "Sega", "Manic Panic Ghosts!", GAME_FLAGS ) |
| 8838 | 8838 | /* 0170 */ GAME( 2007, pokasuka, manicpnc, naomim4, naomi, naomi_state, naomi, ROT0, "Sega", "Pokasuka Ghost", GAME_FLAGS ) |
| 8839 | 8839 | /* 0175 */ GAME( 2007, asndynmt, naomi, naomim4, naomi, naomi_state, naomi, ROT0, "Sega", "Asian Dynamite", GAME_FLAGS ) |
| 8840 | /* 0177 */ GAME( 2007, rhytngk, naomi, naomim4, naomi, naomi_state, naomi, ROT0, "Sega/Nintendo", "Rhythm Tengoku", GAME_FLAGS ) | |
| 8840 | /* 0177 */ GAME( 2007, rhytngk, naomi, naomim4, naomi, naomi_state, naomi, ROT0, "Sega/Nintendo", "Rhythm Tengoku", GAME_FLAGS ) | |
| 8841 | 8841 | // 00xx Mayjinsen (Formation Battle in May) - prototype, never released |
| 8842 | 8842 | |
| 8843 | 8843 | /* Cartridge prototypes of games released on GD-ROM */ |
| r31373 | r31374 | |
|---|---|---|
| 520 | 520 | MCFG_DECO16IC_BANK2_CB(dassault_state, bank_callback) |
| 521 | 521 | MCFG_DECO16IC_PF12_8X8_BANK(0) |
| 522 | 522 | MCFG_DECO16IC_PF12_16X16_BANK(2) |
| 523 | ||
| 523 | ||
| 524 | 524 | MCFG_DECO16IC_GFXDECODE("gfxdecode") |
| 525 | 525 | MCFG_DECO16IC_PALETTE("palette") |
| 526 | 526 |
| r31373 | r31374 | |
|---|---|---|
| 262 | 262 | { |
| 263 | 263 | /* bits 0-3 ROM bank */ |
| 264 | 264 | membank("bank1")->set_entry(data & 0x0f); |
| 265 | ||
| 265 | ||
| 266 | 266 | if (data & 0xf0) |
| 267 | 267 | { |
| 268 | 268 | //logerror("%04x: (lines) write %02x\n",device->safe_pc(), data); |
| 269 | 269 | //popmessage("lines = %02x", data); |
| 270 | 270 | } |
| 271 | ||
| 271 | ||
| 272 | 272 | /* other bits unknown */ |
| 273 | 273 | } |
| 274 | 274 | |
| r31373 | r31374 | |
| 337 | 337 | ROM_LOAD32_WORD( "878c07.h27", 0x00000, 0x40000, CRC(eeed912c) SHA1(b2e27610b38f3fc9c2cdad600b03c8bae4fb9138) ) |
| 338 | 338 | ROM_LOAD32_WORD( "878c08.k27", 0x00002, 0x40000, CRC(4d14626d) SHA1(226b1d83fb82586302be0a67737a427475856537) ) |
| 339 | 339 | |
| 340 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 341 | ROM_LOAD32_WORD( "878c05.h5", 0x00000, 0x40000, CRC(01f4aea5) SHA1(124123823be6bd597805484539d821aaaadde2c0) ) | |
| 340 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 341 | ROM_LOAD32_WORD( "878c05.h5", 0x00000, 0x40000, CRC(01f4aea5) SHA1(124123823be6bd597805484539d821aaaadde2c0) ) | |
| 342 | 342 | ROM_LOAD32_WORD( "878c06.k5", 0x00002, 0x40000, CRC(edfaaaaf) SHA1(67468c4ce47e8d43d58de8d3b50b048c66508156) ) |
| 343 | 343 | |
| 344 | 344 | ROM_REGION( 0x0100, "proms", 0 ) |
| r31373 | r31374 | |
| 361 | 361 | ROM_LOAD32_WORD( "878c07.h27", 0x00000, 0x40000, CRC(eeed912c) SHA1(b2e27610b38f3fc9c2cdad600b03c8bae4fb9138) ) |
| 362 | 362 | ROM_LOAD32_WORD( "878c08.k27", 0x00002, 0x40000, CRC(4d14626d) SHA1(226b1d83fb82586302be0a67737a427475856537) ) |
| 363 | 363 | |
| 364 | ROM_REGION( 0x80000, "k051960", 0 ) | |
| 364 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 365 | 365 | ROM_LOAD32_WORD( "878c05.h5", 0x00000, 0x40000, CRC(01f4aea5) SHA1(124123823be6bd597805484539d821aaaadde2c0) ) |
| 366 | 366 | ROM_LOAD32_WORD( "878c06.k5", 0x00002, 0x40000, CRC(edfaaaaf) SHA1(67468c4ce47e8d43d58de8d3b50b048c66508156) ) |
| 367 | 367 | |
| r31373 | r31374 | |
| 385 | 385 | ROM_LOAD32_WORD( "878c07.h27", 0x00000, 0x40000, CRC(eeed912c) SHA1(b2e27610b38f3fc9c2cdad600b03c8bae4fb9138) ) |
| 386 | 386 | ROM_LOAD32_WORD( "878c08.k27", 0x00002, 0x40000, CRC(4d14626d) SHA1(226b1d83fb82586302be0a67737a427475856537) ) |
| 387 | 387 | |
| 388 | ROM_REGION( 0x80000, "k051960", 0 ) | |
| 388 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 389 | 389 | ROM_LOAD32_WORD( "878c05.h5", 0x00000, 0x40000, CRC(01f4aea5) SHA1(124123823be6bd597805484539d821aaaadde2c0) ) |
| 390 | 390 | ROM_LOAD32_WORD( "878c06.k5", 0x00002, 0x40000, CRC(edfaaaaf) SHA1(67468c4ce47e8d43d58de8d3b50b048c66508156) ) |
| 391 | 391 |
| r31373 | r31374 | |
|---|---|---|
| 208 | 208 | DECLARE_DRIVER_INIT(ryukobou); |
| 209 | 209 | TIMER_DEVICE_CALLBACK_MEMBER(lev5_timer_irq_cb); |
| 210 | 210 | TIMER_DEVICE_CALLBACK_MEMBER(lhb_timer_irq_cb); |
| 211 | TIMER_DEVICE_CALLBACK_MEMBER(lev3_timer_irq_cb); | |
| 211 | TIMER_DEVICE_CALLBACK_MEMBER(lev3_timer_irq_cb); | |
| 212 | 212 | virtual void video_start(); |
| 213 | 213 | UINT32 screen_update_igs011(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); |
| 214 | 214 | void screen_eof_vbowl(screen_device &screen, bool state); |
| r31373 | r31374 | |
|---|---|---|
| 359 | 359 | required_device<cdda_device> m_cdda; |
| 360 | 360 | |
| 361 | 361 | typedef void (cubo_state::*input_hack_func)(); |
| 362 | ||
| 362 | input_hack_func m_input_hack; | |
| 363 | 363 | |
| 364 | void cndypuzl_input_hack(); | |
| 365 | void haremchl_input_hack(); | |
| 366 | void lsrquiz_input_hack(); | |
| 367 | void lsrquiz2_input_hack(); | |
| 368 | void lasstixx_input_hack(); | |
| 369 | void mgnumber_input_hack(); | |
| 370 | void mgprem11_input_hack(); | |
| 364 | void cndypuzl_input_hack(); | |
| 365 | void haremchl_input_hack(); | |
| 366 | void lsrquiz_input_hack(); | |
| 367 | void lsrquiz2_input_hack(); | |
| 368 | void lasstixx_input_hack(); | |
| 369 | void mgnumber_input_hack(); | |
| 370 | void mgprem11_input_hack(); | |
| 371 | 371 | }; |
| 372 | 372 | |
| 373 | 373 | static void handle_cd32_joystick_cia(running_machine &machine, UINT8 pra, UINT8 dra); |
| r31373 | r31374 | |
|---|---|---|
| 624 | 624 | MCFG_TTL74123_B_PIN_VALUE(1) /* B pin - pulled high */ |
| 625 | 625 | MCFG_TTL74123_CLEAR_PIN_VALUE(1) /* Clear pin - pulled high */ |
| 626 | 626 | MCFG_TTL74123_OUTPUT_CHANGED_CB(WRITE8(nyny_state, ic48_1_74123_output_changed)) |
| 627 | ||
| 627 | ||
| 628 | 628 | MCFG_DEVICE_ADD("pia1", PIA6821, 0) |
| 629 | 629 | MCFG_PIA_READPA_HANDLER(IOPORT("IN0")) |
| 630 | 630 | MCFG_PIA_READPB_HANDLER(IOPORT("IN1")) |
| r31373 | r31374 | |
|---|---|---|
| 724 | 724 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */ |
| 725 | 725 | ROM_LOAD( "775-c01.bin", 0x00000, 0x08000, CRC(0ced785a) SHA1(1eebe005a968fbaac595c168499107e34763976c) ) |
| 726 | 726 | |
| 727 | ROM_REGION( 0x100000, "k052109", 0 ) | |
| 727 | ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ | |
| 728 | 728 | ROM_LOAD32_BYTE( "775-a07a.bin", 0x00000, 0x20000, CRC(e716bdf3) SHA1(82e10132f248aed8cc1aea6bb7afe9a1479c8b59) ) |
| 729 | 729 | ROM_LOAD32_BYTE( "775-a07e.bin", 0x00001, 0x20000, CRC(0986e3a5) SHA1(61c33a3f2e4fde7d23d440b5c3151fe38e25716b) ) |
| 730 | 730 | ROM_LOAD32_BYTE( "775-a08a.bin", 0x00002, 0x20000, CRC(3ddd11a4) SHA1(4831a891d6cb4507053d576eddd658c338318176) ) |
| r31373 | r31374 | |
| 738 | 738 | ROM_LOAD32_BYTE( "775-f08d.bin", 0xc0002, 0x10000, CRC(102dcace) SHA1(03036b6d9d66a12cb3e97980f149c09d1efbd6d8) ) |
| 739 | 739 | ROM_LOAD32_BYTE( "775-f08h.bin", 0xc0003, 0x10000, CRC(ad9d7016) SHA1(91e9f279b781eefcafffc70afe207f35cc6f4d9d) ) |
| 740 | 740 | |
| 741 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 741 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 742 | 742 | ROM_LOAD32_BYTE( "775-a05a.bin", 0x00000, 0x10000, CRC(a0767045) SHA1(e6df0731a9fb3b3d918607de81844e1f9353aac7) ) |
| 743 | 743 | ROM_LOAD32_BYTE( "775-a05e.bin", 0x00001, 0x10000, CRC(2f656f08) SHA1(140e7948c45d27c6705622d588a65b59ebcc624c) ) |
| 744 | 744 | ROM_LOAD32_BYTE( "775-a06a.bin", 0x00002, 0x10000, CRC(77a34ad0) SHA1(3653fb8458c1e7eb7d83b5cd63f02343c0f2d93e) ) |
| r31373 | r31374 | |
| 779 | 779 | ROM_REGION( 0x10000, "audiocpu", 0 ) /* 64k for the SOUND CPU */ |
| 780 | 780 | ROM_LOAD( "775-c01.bin", 0x00000, 0x08000, CRC(0ced785a) SHA1(1eebe005a968fbaac595c168499107e34763976c) ) |
| 781 | 781 | |
| 782 | ROM_REGION( 0x100000, "k052109", 0 ) | |
| 782 | ROM_REGION( 0x100000, "k052109", 0 ) /* tiles */ | |
| 783 | 783 | ROM_LOAD32_BYTE( "775-a07a.bin", 0x00000, 0x20000, CRC(e716bdf3) SHA1(82e10132f248aed8cc1aea6bb7afe9a1479c8b59) ) |
| 784 | 784 | ROM_LOAD32_BYTE( "775-a07e.bin", 0x00001, 0x20000, CRC(0986e3a5) SHA1(61c33a3f2e4fde7d23d440b5c3151fe38e25716b) ) |
| 785 | 785 | ROM_LOAD32_BYTE( "775-a08a.bin", 0x00002, 0x20000, CRC(3ddd11a4) SHA1(4831a891d6cb4507053d576eddd658c338318176) ) |
| r31373 | r31374 | |
| 793 | 793 | ROM_LOAD32_BYTE( "775-f08d.bin", 0xc0002, 0x10000, CRC(102dcace) SHA1(03036b6d9d66a12cb3e97980f149c09d1efbd6d8) ) |
| 794 | 794 | ROM_LOAD32_BYTE( "775-f08h.bin", 0xc0003, 0x10000, CRC(ad9d7016) SHA1(91e9f279b781eefcafffc70afe207f35cc6f4d9d) ) |
| 795 | 795 | |
| 796 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 796 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 797 | 797 | ROM_LOAD32_BYTE( "775-a05a.bin", 0x00000, 0x10000, CRC(a0767045) SHA1(e6df0731a9fb3b3d918607de81844e1f9353aac7) ) |
| 798 | 798 | ROM_LOAD32_BYTE( "775-a05e.bin", 0x00001, 0x10000, CRC(2f656f08) SHA1(140e7948c45d27c6705622d588a65b59ebcc624c) ) |
| 799 | 799 | ROM_LOAD32_BYTE( "775-a06a.bin", 0x00002, 0x10000, CRC(77a34ad0) SHA1(3653fb8458c1e7eb7d83b5cd63f02343c0f2d93e) ) |
| r31373 | r31374 | |
| 844 | 844 | ROM_LOAD32_BYTE( "873c07b.e4", 0x40002, 0x10000, CRC(12a2b8ba) SHA1(ffa32ca116e0b6ca65bb9ce83dd28f5c027956a5) ) |
| 845 | 845 | ROM_LOAD32_BYTE( "873c07d.e3", 0x40003, 0x10000, CRC(fae9f965) SHA1(780c234507835c37bde445ab34f069714cc7a506) ) |
| 846 | 846 | |
| 847 | ROM_REGION( 0x80000, "k051960", 0 ) | |
| 847 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 848 | 848 | ROM_LOAD32_BYTE( "873c04a.f11", 0x00000, 0x10000, CRC(f7740bf3) SHA1(f64b7e807f19a9523a517024a9eb56736cdda6bb) ) |
| 849 | 849 | ROM_LOAD32_BYTE( "873c04c.f10", 0x00001, 0x10000, CRC(5dacbd2b) SHA1(deb943b99fd296d20be9c4250b2348549f65ba37) ) |
| 850 | 850 | ROM_LOAD32_BYTE( "873c05a.f9", 0x00002, 0x10000, CRC(d73e107d) SHA1(ba63b195e20a98c476e7d0f8d0187bc3327a8822) ) |
| r31373 | r31374 | |
| 877 | 877 | ROM_LOAD32_BYTE( "873c07b.e4", 0x40002, 0x10000, CRC(12a2b8ba) SHA1(ffa32ca116e0b6ca65bb9ce83dd28f5c027956a5) ) |
| 878 | 878 | ROM_LOAD32_BYTE( "873c07d.e3", 0x40003, 0x10000, CRC(fae9f965) SHA1(780c234507835c37bde445ab34f069714cc7a506) ) |
| 879 | 879 | |
| 880 | ROM_REGION( 0x80000, "k051960", 0 ) | |
| 880 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 881 | 881 | ROM_LOAD32_BYTE( "873c04a.f11", 0x00000, 0x10000, CRC(f7740bf3) SHA1(f64b7e807f19a9523a517024a9eb56736cdda6bb) ) |
| 882 | 882 | ROM_LOAD32_BYTE( "873c04c.f10", 0x00001, 0x10000, CRC(5dacbd2b) SHA1(deb943b99fd296d20be9c4250b2348549f65ba37) ) |
| 883 | 883 | ROM_LOAD32_BYTE( "873c05a.f9", 0x00002, 0x10000, CRC(d73e107d) SHA1(ba63b195e20a98c476e7d0f8d0187bc3327a8822) ) |
| r31373 | r31374 | |
| 910 | 910 | ROM_LOAD32_BYTE( "873c07b.e4", 0x40002, 0x10000, CRC(12a2b8ba) SHA1(ffa32ca116e0b6ca65bb9ce83dd28f5c027956a5) ) |
| 911 | 911 | ROM_LOAD32_BYTE( "873c07d.e3", 0x40003, 0x10000, CRC(fae9f965) SHA1(780c234507835c37bde445ab34f069714cc7a506) ) |
| 912 | 912 | |
| 913 | ROM_REGION( 0x80000, "k051960", 0 ) | |
| 913 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 914 | 914 | ROM_LOAD32_BYTE( "873c04a.f11", 0x00000, 0x10000, CRC(f7740bf3) SHA1(f64b7e807f19a9523a517024a9eb56736cdda6bb) ) |
| 915 | 915 | ROM_LOAD32_BYTE( "873c04c.f10", 0x00001, 0x10000, CRC(5dacbd2b) SHA1(deb943b99fd296d20be9c4250b2348549f65ba37) ) |
| 916 | 916 | ROM_LOAD32_BYTE( "873c05a.f9", 0x00002, 0x10000, CRC(d73e107d) SHA1(ba63b195e20a98c476e7d0f8d0187bc3327a8822) ) |
| r31373 | r31374 | |
| 943 | 943 | ROM_LOAD32_BYTE( "873c07b.e4", 0x40002, 0x10000, CRC(12a2b8ba) SHA1(ffa32ca116e0b6ca65bb9ce83dd28f5c027956a5) ) |
| 944 | 944 | ROM_LOAD32_BYTE( "873c07d.e3", 0x40003, 0x10000, CRC(fae9f965) SHA1(780c234507835c37bde445ab34f069714cc7a506) ) |
| 945 | 945 | |
| 946 | ROM_REGION( 0x80000, "k051960", 0 ) | |
| 946 | ROM_REGION( 0x80000, "k051960", 0 ) /* sprites */ | |
| 947 | 947 | ROM_LOAD32_BYTE( "873c04a.f11", 0x00000, 0x10000, CRC(f7740bf3) SHA1(f64b7e807f19a9523a517024a9eb56736cdda6bb) ) |
| 948 | 948 | ROM_LOAD32_BYTE( "873c04c.f10", 0x00001, 0x10000, CRC(5dacbd2b) SHA1(deb943b99fd296d20be9c4250b2348549f65ba37) ) |
| 949 | 949 | ROM_LOAD32_BYTE( "873c05a.f9", 0x00002, 0x10000, CRC(d73e107d) SHA1(ba63b195e20a98c476e7d0f8d0187bc3327a8822) ) |
| r31373 | r31374 | |
|---|---|---|
| 349 | 349 | |
| 350 | 350 | |
| 351 | 351 | static ADDRESS_MAP_START( megaphx_pic_io_map, AS_IO, 8, megaphx_state ) |
| 352 | // AM_RANGE(0x00, 0x00) AM_WRITE(playmark_oki_banking_w) | |
| 353 | // AM_RANGE(0x01, 0x01) AM_READWRITE(playmark_snd_command_r, playmark_oki_w) | |
| 354 | // AM_RANGE(0x02, 0x02) AM_READWRITE(playmark_snd_flag_r, playmark_snd_control_w) | |
| 355 | // AM_RANGE(PIC16C5x_T0, PIC16C5x_T0) AM_READ(PIC16C5X_T0_clk_r) | |
| 352 | // AM_RANGE(0x00, 0x00) AM_WRITE(playmark_oki_banking_w) | |
| 353 | // AM_RANGE(0x01, 0x01) AM_READWRITE(playmark_snd_command_r, playmark_oki_w) | |
| 354 | // AM_RANGE(0x02, 0x02) AM_READWRITE(playmark_snd_flag_r, playmark_snd_control_w) | |
| 355 | // AM_RANGE(PIC16C5x_T0, PIC16C5x_T0) AM_READ(PIC16C5X_T0_clk_r) | |
| 356 | 356 | ADDRESS_MAP_END |
| 357 | 357 | |
| 358 | 358 |
| r31373 | r31374 | |
|---|---|---|
| 1156 | 1156 | ROM_LOAD( "h6", 0x2000, 0x1000, CRC(257f4e0d) SHA1(cd61f3cf70c536aa207ebfdd28be54ac586b5249) ) // = im6_d.b6 kingdrby |
| 1157 | 1157 | |
| 1158 | 1158 | ROM_REGION( 0x1000, "soundcpu", 0 ) |
| 1159 | ROM_LOAD( "sg1_b.e1", 0x0000, 0x1000, BAD_DUMP CRC(92ef3c13) SHA1(1bf1e4106b37aadfc02822184510740e18a54d5c) ) | |
| 1159 | ROM_LOAD( "sg1_b.e1", 0x0000, 0x1000, BAD_DUMP CRC(92ef3c13) SHA1(1bf1e4106b37aadfc02822184510740e18a54d5c) ) // not in this set, using kingdrby one... | |
| 1160 | 1160 | |
| 1161 | 1161 | ROM_REGION( 0x4000, "slave", 0 ) |
| 1162 | 1162 | ROM_LOAD( "h1", 0x0000, 0x1000, CRC(444aa020) SHA1(0d40e9499892177b4d8123ad7b6909e8f6e0c8ab) ) |
| r31373 | r31374 | |
|---|---|---|
| 22 | 22 | see bfm_sc4.c |
| 23 | 23 | |
| 24 | 24 | The hopper(s) are not currently emulated, many of the games can |
| 25 | ||
| 25 | be operated in 'Door Open' mode granting you free credits. | |
| 26 | 26 | |
| 27 | Most games will show a RAM error on first boot due, after that they | |
| 28 | will initialize their NVRAM. | |
| 27 | Most games will show a RAM error on first boot due, after that they | |
| 28 | will initialize their NVRAM. | |
| 29 | 29 | |
| 30 | If 'Read Meters' is shown press the 'Cancel' button (this moves around | |
| 31 | per game, so where it maps might not be obvious) Doing this will allow | |
| 32 | the games to run in Door Open mode, pressing 'Start' (also moves around) | |
| 33 | will allow you to test the game. Not all games have this feature. | |
| 30 | If 'Read Meters' is shown press the 'Cancel' button (this moves around | |
| 31 | per game, so where it maps might not be obvious) Doing this will allow | |
| 32 | the games to run in Door Open mode, pressing 'Start' (also moves around) | |
| 33 | will allow you to test the game. Not all games have this feature. | |
| 34 | 34 | |
| 35 | Pressing the service key ('Green Button') often allows test mode to be | |
| 36 | entered, some games have more comprehensive tests than others. | |
| 35 | Pressing the service key ('Green Button') often allows test mode to be | |
| 36 | entered, some games have more comprehensive tests than others. | |
| 37 | 37 | |
| 38 | Various (poorly programmed) sets require specific Jackpot 'keys' etc. to | |
| 39 | boot and won't even warn you if they're invalid, others allow you to | |
| 40 | set options if keys are not present. (again the buttons to do so move | |
| 41 | between games) | |
| 38 | Various (poorly programmed) sets require specific Jackpot 'keys' etc. to | |
| 39 | boot and won't even warn you if they're invalid, others allow you to | |
| 40 | set options if keys are not present. (again the buttons to do so move | |
| 41 | between games) | |
| 42 | 42 | |
| 43 | Many games have missing sound roms, incorrect sound roms, or badly | |
| 44 | dumped sound roms. We also have several dumps where only sound roms | |
| 45 | are present. | |
| 43 | Many games have missing sound roms, incorrect sound roms, or badly | |
| 44 | dumped sound roms. We also have several dumps where only sound roms | |
| 45 | are present. | |
| 46 | 46 | |
| 47 | ||
| 47 | Many of the titles here were also released on the SC5 platform. | |
| 48 | 48 | |
| 49 | 49 | */ |
| 50 | 50 | |
| r31373 | r31374 | |
| 723 | 723 | |
| 724 | 724 | MCFG_BFMBDA_ADD("vfd0",0) |
| 725 | 725 | |
| 726 | // | |
| 726 | // MCFG_DEFAULT_LAYOUT(layout_bfm_sc4) | |
| 727 | 727 | |
| 728 | 728 | MCFG_SOUND_ADD("ymz", YMZ280B, 16000000) // ?? Mhz |
| 729 | 729 | MCFG_YMZ280B_IRQ_HANDLER(WRITELINE(sc4_state, bfm_sc4_irqhandler)) |
| r31373 | r31374 | |
| 942 | 942 | PORT_DIPSETTING( 0x10, DEF_STR( On ) ) |
| 943 | 943 | PORT_BIT( 0xffe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 944 | 944 | |
| 945 | PORT_START("IN-10") | |
| 945 | PORT_START("IN-10") | |
| 946 | 946 | PORT_DIPNAME( 0x01, 0x00, "IN 10-0 (STRB 10 Data 0)" ) |
| 947 | 947 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 948 | 948 | PORT_DIPSETTING( 0x01, DEF_STR( On ) ) |
| r31373 | r31374 | |
| 980 | 980 | PORT_BIT( 0xffe0, IP_ACTIVE_HIGH, IPT_UNUSED ) |
| 981 | 981 | |
| 982 | 982 | // where are 11,12,13,14,15 ? |
| 983 | ||
| 983 | ||
| 984 | 984 | PORT_START("IN-16") |
| 985 | 985 | PORT_DIPNAME( 0x01, 0x00, "IN 16-0 (STRB 16 Data 0)" ) |
| 986 | 986 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| r31373 | r31374 | |
| 1098 | 1098 | PORT_BIT( 0x0008, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_3) PORT_NAME("IN2-3") |
| 1099 | 1099 | PORT_BIT( 0x0010, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_4) PORT_NAME("IN2-4") |
| 1100 | 1100 | PORT_BIT( 0x0020, IP_ACTIVE_HIGH, SC45_BUTTON_MATRIX_2_5) PORT_NAME("IN2-5") |
| 1101 | ||
| 1101 | ||
| 1102 | 1102 | PORT_MODIFY("IN-3") |
| 1103 | 1103 | PORT_DIPNAME( 0x04, 0x00, "IN 3-2 (STK 4 3.2)" ) |
| 1104 | 1104 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1105 | 1105 | PORT_DIPSETTING( 0x04, DEF_STR( On ) ) |
| 1106 | PORT_DIPNAME( 0x08, 0x00, "IN 3-3 (STK 2 3.3)" ) | |
| 1106 | PORT_DIPNAME( 0x08, 0x00, "IN 3-3 (STK 2 3.3)" ) | |
| 1107 | 1107 | PORT_DIPSETTING( 0x00, DEF_STR( Off ) ) |
| 1108 | 1108 | PORT_DIPSETTING( 0x08, DEF_STR( On ) ) |
| 1109 | 1109 | PORT_DIPNAME( 0x10, 0x00, "IN 3-4 (STK 3 3.4)" ) |
| r31373 | r31374 | |
| 1178 | 1178 | PORT_DIPNAME( 0x0004, 0x0000, "Service Door" ) // SERDOR20.2 |
| 1179 | 1179 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1180 | 1180 | PORT_DIPSETTING( 0x0004, DEF_STR( On ) ) |
| 1181 | PORT_DIPNAME( 0x0008, 0x0000, "Cashbox Door" ) // CSHDOR20.3 | |
| 1181 | PORT_DIPNAME( 0x0008, 0x0000, "Cashbox Door" ) // CSHDOR20.3 | |
| 1182 | 1182 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 1183 | 1183 | PORT_DIPSETTING( 0x0008, DEF_STR( On ) ) |
| 1184 | 1184 | PORT_DIPNAME( 0x0010, 0x0000, "Hopper DMP" ) // HOPDMP20.4 |
| r31373 | r31374 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | The microcontroller mainly controls the animation of the enemy robots, |
| 33 | 33 | the communication between the 68000 and MCU is probably not emulated |
| 34 | 100% correct but it works. | |
| 34 | 100% correct but it works. | |
| 35 | 35 | |
| 36 | 36 | Emulation by Bryan McPhail, mish@tendril.co.uk |
| 37 | 37 | |
| r31373 | r31374 | |
| 68 | 68 | |
| 69 | 69 | static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, tigeroad_state ) |
| 70 | 70 | AM_RANGE(0x000000, 0x03ffff) AM_ROM |
| 71 | ||
| 71 | ||
| 72 | 72 | AM_RANGE(0xfe0800, 0xfe0cff) AM_RAM AM_SHARE("spriteram") |
| 73 | 73 | AM_RANGE(0xfe0d00, 0xfe1807) AM_RAM /* still part of OBJ RAM */ |
| 74 | 74 | AM_RANGE(0xfe4000, 0xfe4001) AM_READ_PORT("P1_P2") AM_WRITE(tigeroad_videoctrl_w) /* char bank, coin counters, + ? */ |
| r31373 | r31374 | |
| 77 | 77 | AM_RANGE(0xfe8000, 0xfe8003) AM_WRITE(tigeroad_scroll_w) |
| 78 | 78 | AM_RANGE(0xfe800e, 0xfe800f) AM_WRITEONLY /* fe800e = watchdog or IRQ acknowledge */ |
| 79 | 79 | AM_RANGE(0xfec000, 0xfec7ff) AM_RAM_WRITE(tigeroad_videoram_w) AM_SHARE("videoram") |
| 80 | ||
| 80 | ||
| 81 | 81 | AM_RANGE(0xff8000, 0xff87ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 82 | 82 | AM_RANGE(0xffc000, 0xffffff) AM_RAM AM_SHARE("ram16") |
| 83 | 83 | ADDRESS_MAP_END |
| r31373 | r31374 | |
| 93 | 93 | AM_RANGE(0xe8000, 0xe8003) AM_WRITE(tigeroad_scroll_w) |
| 94 | 94 | AM_RANGE(0xe800e, 0xe800f) AM_WRITENOP /* ? */ |
| 95 | 95 | AM_RANGE(0xec000, 0xec7ff) AM_RAM_WRITE(tigeroad_videoram_w) AM_SHARE("videoram") |
| 96 | ||
| 96 | ||
| 97 | 97 | AM_RANGE(0xf8000, 0xf87ff) AM_RAM_DEVWRITE("palette", palette_device, write) AM_SHARE("palette") |
| 98 | 98 | AM_RANGE(0xfc000, 0xfffff) AM_RAM AM_SHARE("ram16") |
| 99 | 99 | ADDRESS_MAP_END |
| r31373 | r31374 | |
| 564 | 564 | |
| 565 | 565 | static GFXDECODE_START( tigeroad ) |
| 566 | 566 | GFXDECODE_ENTRY( "text", 0, text_layout, 0x300, 16 ) |
| 567 | GFXDECODE_ENTRY( "tiles", 0, tile_layout, 0x100, 16 ) | |
| 567 | GFXDECODE_ENTRY( "tiles", 0, tile_layout, 0x100, 16 ) | |
| 568 | 568 | GFXDECODE_ENTRY( "sprites", 0, sprite_layout, 0x200, 16 ) |
| 569 | 569 | GFXDECODE_END |
| 570 | 570 | |
| r31373 | r31374 | |
| 1177 | 1177 | |
| 1178 | 1178 | GAME( 1991, bballs, 0, bballs, bballs, tigeroad_state, bballs, ROT0, "Comad", "Bouncing Balls", GAME_SUPPORTS_SAVE ) |
| 1179 | 1179 | GAME( 1991, bballsa, bballs, bballs, bballs, tigeroad_state, bballs, ROT0, "Comad", "Bouncing Balls (Adult)", GAME_SUPPORTS_SAVE ) |
| 1180 | ||
| 1181 |
| r31373 | r31374 | |
|---|---|---|
| 3136 | 3136 | *************************************/ |
| 3137 | 3137 | |
| 3138 | 3138 | /* Atari */ |
| 3139 | GAME( 1996, wg3dh, 0, wg3dh, wg3dh, seattle_state, wg3dh, ROT0, "Atari Games", "Wayne Gretzky's 3D Hockey", GAME_SUPPORTS_SAVE ) | |
| 3140 | GAME( 1996, mace, 0, mace, mace, seattle_state, mace, ROT0, "Atari Games", "Mace: The Dark Age (boot ROM 1.0ce, HDD 1.0b)", GAME_SUPPORTS_SAVE ) | |
| 3141 | GAME( 1997, macea, mace, mace, mace, seattle_state, mace, ROT0, "Atari Games", "Mace: The Dark Age (HDD 1.0a)", GAME_SUPPORTS_SAVE ) | |
| 3139 | GAME( 1996, wg3dh, 0, wg3dh, wg3dh, seattle_state, wg3dh, ROT0, "Atari Games", "Wayne Gretzky's 3D Hockey", GAME_SUPPORTS_SAVE ) | |
| 3140 | GAME( 1996, mace, 0, mace, mace, seattle_state, mace, ROT0, "Atari Games", "Mace: The Dark Age (boot ROM 1.0ce, HDD 1.0b)", GAME_SUPPORTS_SAVE ) | |
| 3141 | GAME( 1997, macea, mace, mace, mace, seattle_state, mace, ROT0, "Atari Games", "Mace: The Dark Age (HDD 1.0a)", GAME_SUPPORTS_SAVE ) | |
| 3142 | 3142 | GAME( 1996, sfrush, 0, sfrush, sfrush, seattle_state, sfrush, ROT0, "Atari Games", "San Francisco Rush", GAME_SUPPORTS_SAVE ) |
| 3143 | 3143 | GAME( 1996, sfrushrk, 0, sfrushrk, sfrushrk, seattle_state, sfrushrk, ROT0, "Atari Games", "San Francisco Rush: The Rock", GAME_NOT_WORKING | GAME_SUPPORTS_SAVE ) |
| 3144 | GAME( 1998, calspeed, 0, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 2.1a, 4/17/98)", GAME_SUPPORTS_SAVE ) | |
| 3145 | GAME( 1998, calspeeda,calspeed, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 1.0r7a 3/4/98)", GAME_SUPPORTS_SAVE ) | |
| 3146 | GAME( 1998, vaportrx, 0, vaportrx, vaportrx, seattle_state, vaportrx, ROT0, "Atari Games", "Vapor TRX", GAME_SUPPORTS_SAVE ) | |
| 3147 | GAME( 1998, vaportrxp,vaportrx, vaportrx, vaportrx, seattle_state, vaportrx, ROT0, "Atari Games", "Vapor TRX (prototype)", GAME_SUPPORTS_SAVE ) | |
| 3144 | GAME( 1998, calspeed, 0, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 2.1a, 4/17/98)", GAME_SUPPORTS_SAVE ) | |
| 3145 | GAME( 1998, calspeeda,calspeed, calspeed, calspeed, seattle_state, calspeed, ROT0, "Atari Games", "California Speed (Version 1.0r7a 3/4/98)", GAME_SUPPORTS_SAVE ) | |
| 3146 | GAME( 1998, vaportrx, 0, vaportrx, vaportrx, seattle_state, vaportrx, ROT0, "Atari Games", "Vapor TRX", GAME_SUPPORTS_SAVE ) | |
| 3147 | GAME( 1998, vaportrxp,vaportrx, vaportrx, vaportrx, seattle_state, vaportrx, ROT0, "Atari Games", "Vapor TRX (prototype)", GAME_SUPPORTS_SAVE ) | |
| 3148 | 3148 | |
| 3149 | 3149 | /* Midway */ |
| 3150 | 3150 | GAME( 1997, biofreak, 0, biofreak, biofreak, seattle_state, biofreak, ROT0, "Midway Games", "BioFreaks (prototype)", GAME_SUPPORTS_SAVE ) |
| 3151 | GAME( 1997, blitz, 0, blitz, blitz, seattle_state, blitz, ROT0, "Midway Games", "NFL Blitz (boot ROM 1.2)", GAME_SUPPORTS_SAVE ) | |
| 3152 | GAME( 1997, blitz11, blitz, blitz, blitz, seattle_state, blitz, ROT0, "Midway Games", "NFL Blitz (boot ROM 1.1)", GAME_SUPPORTS_SAVE ) | |
| 3151 | GAME( 1997, blitz, 0, blitz, blitz, seattle_state, blitz, ROT0, "Midway Games", "NFL Blitz (boot ROM 1.2)", GAME_SUPPORTS_SAVE ) | |
| 3152 | GAME( 1997, blitz11, blitz, blitz, blitz, seattle_state, blitz, ROT0, "Midway Games", "NFL Blitz (boot ROM 1.1)", GAME_SUPPORTS_SAVE ) | |
| 3153 | 3153 | GAME( 1998, blitz99, 0, blitz99, blitz99, seattle_state, blitz99, ROT0, "Midway Games", "NFL Blitz '99", GAME_SUPPORTS_SAVE ) |
| 3154 | 3154 | GAME( 1999, blitz2k, 0, blitz2k, blitz99, seattle_state, blitz2k, ROT0, "Midway Games", "NFL Blitz 2000 Gold Edition", GAME_SUPPORTS_SAVE ) |
| 3155 | 3155 | GAME( 1998, carnevil, 0, carnevil, carnevil, seattle_state, carnevil, ROT0, "Midway Games", "CarnEvil (v1.0.3)", GAME_SUPPORTS_SAVE ) |
| r31373 | r31374 | |
|---|---|---|
| 337 | 337 | // d4: bonus sound generator |
| 338 | 338 | // d5: sound enabled |
| 339 | 339 | // other bits: unused |
| 340 | ||
| 340 | ||
| 341 | 341 | int bits_gone_hi = data & ~m_sound_state[0]; |
| 342 | 342 | m_sound_state[0] = data; |
| 343 | 343 | |
| r31373 | r31374 | |
| 347 | 347 | if (bits_gone_hi & 0x04) m_samples->start(2, SND_BASEHIT); |
| 348 | 348 | if (bits_gone_hi & 0x08) m_samples->start(3, SND_INVADERHIT); |
| 349 | 349 | if (bits_gone_hi & 0x10) m_samples->start(3, SND_INVADERHIT); |
| 350 | ||
| 350 | ||
| 351 | 351 | machine().sound().system_enable(data & 0x20); |
| 352 | 352 | } |
| 353 | 353 | |
| r31373 | r31374 | |
| 671 | 671 | MCFG_I8255_OUT_PORTA_CB(WRITE8(astinvad_state, spcking2_sound1_w)) |
| 672 | 672 | MCFG_I8255_OUT_PORTB_CB(WRITE8(astinvad_state, spcking2_sound2_w)) |
| 673 | 673 | MCFG_I8255_OUT_PORTC_CB(WRITE8(astinvad_state, spcking2_sound3_w)) |
| 674 | ||
| 674 | ||
| 675 | 675 | /* video hardware */ |
| 676 | 676 | MCFG_SCREEN_MODIFY("screen") |
| 677 | 677 | MCFG_SCREEN_RAW_PARAMS(VIDEO_CLOCK, 320, 0, 256, 256, 16, 240) |
| r31373 | r31374 | |
|---|---|---|
| 10 | 10 | static ADDRESS_MAP_START( main_map_noslot, AS_PROGRAM, 16, neogeo_state ) |
| 11 | 11 | AM_RANGE(0x000000, 0x00007f) AM_READ(banked_vectors_r) |
| 12 | 12 | AM_RANGE(0x000080, 0x0fffff) AM_ROM |
| 13 | // AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK("cartridge") | |
| 14 | // AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) | |
| 13 | // AM_RANGE(0x200000, 0x2fffff) AM_ROMBANK("cartridge") | |
| 14 | // AM_RANGE(0x2ffff0, 0x2fffff) AM_WRITE(main_cpu_bank_select_w) | |
| 15 | 15 | AM_IMPORT_FROM( neogeo_main_map ) |
| 16 | 16 | ADDRESS_MAP_END |
| 17 | 17 | |
| r31373 | r31374 | |
| 8480 | 8480 | * |
| 8481 | 8481 | *************************************/ |
| 8482 | 8482 | |
| 8483 | ||
| 8483 | // macros allow code below to be copy+pasted into slot devices more easily | |
| 8484 | 8484 | #define cpuregion memregion("maincpu")->base() |
| 8485 | 8485 | #define cpuregion_size memregion("maincpu")->bytes() |
| 8486 | 8486 | #define spr_region memregion("sprites")->base() |
| r31373 | r31374 | |
| 9824 | 9824 | /* N.C.I - LE CORTEX */ |
| 9825 | 9825 | // Bang Bang Busters (c)2010 - MVS?/AES |
| 9826 | 9826 | // Treasure of the Caribbean (c)2011 - MVS?/AES |
| 9827 |
| r31373 | r31374 | |
|---|---|---|
| 342 | 342 | MCFG_DECO16IC_SPLIT(0) |
| 343 | 343 | MCFG_DECO16IC_WIDTH12(1) |
| 344 | 344 | MCFG_DECO16IC_PF1_TRANS_MASK(0x0f) |
| 345 | MCFG_DECO16IC_PF2_TRANS_MASK(0x1f) | |
| 345 | MCFG_DECO16IC_PF2_TRANS_MASK(0x1f) // pf2 has 5bpp graphics | |
| 346 | 346 | MCFG_DECO16IC_PF1_COL_BANK(0) |
| 347 | MCFG_DECO16IC_PF2_COL_BANK(0) | |
| 347 | MCFG_DECO16IC_PF2_COL_BANK(0) // pf2 is non default | |
| 348 | 348 | MCFG_DECO16IC_PF1_COL_MASK(0x0f) |
| 349 | 349 | MCFG_DECO16IC_PF2_COL_MASK(0x0f) |
| 350 | 350 | // no bank1 callback |
| r31373 | r31374 | |
|---|---|---|
| 984 | 984 | MCFG_VOODOO_TMUMEM(4,0) |
| 985 | 985 | MCFG_VOODOO_SCREEN_TAG("screen") |
| 986 | 986 | MCFG_VOODOO_CPU_TAG("dsp") |
| 987 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_0)) | |
| 987 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_0)) | |
| 988 | 988 | |
| 989 | 989 | MCFG_DEVICE_ADD("k033906_1", K033906, 0) |
| 990 | 990 | MCFG_K033906_VOODOO("voodoo0") |
| r31373 | r31374 | |
| 1017 | 1017 | |
| 1018 | 1018 | MCFG_DEVICE_ADD("adc12138", ADC12138, 0) |
| 1019 | 1019 | MCFG_ADC1213X_IPT_CONVERT_CB(hornet_state, adc12138_input_callback) |
| 1020 | ||
| 1020 | ||
| 1021 | 1021 | MCFG_DEVICE_ADD("konppc", KONPPC, 0) |
| 1022 | 1022 | MCFG_KONPPC_CGBOARD_NUMBER(1) |
| 1023 | 1023 | MCFG_KONPPC_CGBOARD_TYPE(CGBOARD_TYPE_HORNET) |
| r31373 | r31374 | |
| 1063 | 1063 | MCFG_K037122_PALETTE("palette") |
| 1064 | 1064 | |
| 1065 | 1065 | MCFG_DEVICE_REMOVE("voodoo0") |
| 1066 | ||
| 1066 | ||
| 1067 | 1067 | MCFG_DEVICE_ADD("voodoo0", VOODOO_1, STD_VOODOO_1_CLOCK) |
| 1068 | 1068 | MCFG_VOODOO_FBMEM(2) |
| 1069 | 1069 | MCFG_VOODOO_TMUMEM(4,0) |
| 1070 | 1070 | MCFG_VOODOO_SCREEN_TAG("lscreen") |
| 1071 | 1071 | MCFG_VOODOO_CPU_TAG("dsp") |
| 1072 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_0)) | |
| 1073 | ||
| 1072 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_0)) | |
| 1073 | ||
| 1074 | 1074 | MCFG_DEVICE_ADD("voodoo1", VOODOO_1, STD_VOODOO_1_CLOCK) |
| 1075 | 1075 | MCFG_VOODOO_FBMEM(2) |
| 1076 | 1076 | MCFG_VOODOO_TMUMEM(4,0) |
| 1077 | 1077 | MCFG_VOODOO_SCREEN_TAG("rscreen") |
| 1078 | 1078 | MCFG_VOODOO_CPU_TAG("dsp2") |
| 1079 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_1)) | |
| 1079 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_1)) | |
| 1080 | 1080 | |
| 1081 | 1081 | MCFG_DEVICE_ADD("k033906_2", K033906, 0) |
| 1082 | 1082 | MCFG_K033906_VOODOO("voodoo1") |
| r31373 | r31374 | |
| 1098 | 1098 | MCFG_SCREEN_SIZE(512, 384) |
| 1099 | 1099 | MCFG_SCREEN_VISIBLE_AREA(0, 511, 0, 383) |
| 1100 | 1100 | MCFG_SCREEN_UPDATE_DRIVER(hornet_state, screen_update_hornet_2board) |
| 1101 | ||
| 1101 | ||
| 1102 | 1102 | MCFG_DEVICE_REMOVE("konppc") |
| 1103 | 1103 | MCFG_DEVICE_ADD("konppc", KONPPC, 0) |
| 1104 | 1104 | MCFG_KONPPC_CGBOARD_NUMBER(2) |
| r31373 | r31374 | |
| 1118 | 1118 | MCFG_VOODOO_TMUMEM(4,0) |
| 1119 | 1119 | MCFG_VOODOO_SCREEN_TAG("lscreen") |
| 1120 | 1120 | MCFG_VOODOO_CPU_TAG("dsp") |
| 1121 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_0)) | |
| 1122 | ||
| 1121 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_0)) | |
| 1122 | ||
| 1123 | 1123 | MCFG_DEVICE_REMOVE("voodoo1") |
| 1124 | 1124 | MCFG_DEVICE_ADD("voodoo1", VOODOO_2, STD_VOODOO_2_CLOCK) |
| 1125 | 1125 | MCFG_VOODOO_FBMEM(2) |
| 1126 | 1126 | MCFG_VOODOO_TMUMEM(4,0) |
| 1127 | 1127 | MCFG_VOODOO_SCREEN_TAG("rscreen") |
| 1128 | 1128 | MCFG_VOODOO_CPU_TAG("dsp2") |
| 1129 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_1)) | |
| 1129 | MCFG_VOODOO_VBLANK_CB(WRITELINE(hornet_state,voodoo_vblank_1)) | |
| 1130 | 1130 | MACHINE_CONFIG_END |
| 1131 | 1131 | |
| 1132 | 1132 | static MACHINE_CONFIG_DERIVED( sscope2, hornet_2board_v2) |
| r31373 | r31374 | |
|---|---|---|
| 192 | 192 | MCFG_PALETTE_INIT_OWNER(mustache_state, mustache) |
| 193 | 193 | |
| 194 | 194 | /* sound hardware */ |
| 195 | MCFG_DEVICE_ADD("seibu_sound", SEIBU_SOUND, 0) | |
| 195 | MCFG_DEVICE_ADD("seibu_sound", SEIBU_SOUND, 0) // for seibu_sound_decrypt on the MAIN cpu (not sound) | |
| 196 | 196 | |
| 197 | 197 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 198 | 198 |
| r31373 | r31374 | |
|---|---|---|
| 582 | 582 | |
| 583 | 583 | MCFG_DEVICE_ADD("ppi8255", I8255A, 0) |
| 584 | 584 | /* PPI 8255 group A & B set to Mode 0. |
| 585 | Port A, B and lower 4 bits of C set as Input. | |
| 586 | High 4 bits of C set as Output */ | |
| 585 | Port A, B and lower 4 bits of C set as Input. | |
| 586 | High 4 bits of C set as Output */ | |
| 587 | 587 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) |
| 588 | 588 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN1")) |
| 589 | 589 | MCFG_I8255_IN_PORTC_CB(IOPORT("IN2")) |
| r31373 | r31374 | |
|---|---|---|
| 16 | 16 | VRAM 256kbyte (4Display/Access bank) |
| 17 | 17 | |
| 18 | 18 | PaletteRAM 96kbyte |
| 19 | ||
| 19 | ||
| 20 | 20 | Display 320(x)*224(y) |
| 21 | 21 | |
| 22 | 22 | Sprite 16(x)*240(y(max))*380(max) (96 sprite/line(max)) |
| r31373 | r31374 | |
| 605 | 605 | |
| 606 | 606 | void midas_state::machine_reset() |
| 607 | 607 | { |
| 608 | ||
| 609 | 608 | } |
| 610 | 609 | |
| 611 | ||
| 612 | 610 | |
| 613 | 611 | |
| 612 | ||
| 614 | 613 | WRITE_LINE_MEMBER(midas_state::livequiz_irqhandler) |
| 615 | 614 | { |
| 616 | 615 | logerror("YMZ280 is generating an interrupt. State=%08x\n",state); |
| r31373 | r31374 | |
|---|---|---|
| 152 | 152 | /* video hardware */ |
| 153 | 153 | MCFG_DEVICE_ADD( "tms9928a", TMS9928A, XTAL_10_738635MHz / 2 ) |
| 154 | 154 | MCFG_TMS9928A_VRAM_SIZE(0x4000) |
| 155 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(kingpin_state, vdp_interrupt)) | |
| 156 | ||
| 155 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(kingpin_state, vdp_interrupt)) | |
| 156 | ||
| 157 | 157 | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 158 | 158 | MCFG_SCREEN_UPDATE_DEVICE( "tms9928a", tms9928a_device, screen_update ) |
| 159 | 159 |
| r31373 | r31374 | |
|---|---|---|
| 358 | 358 | |
| 359 | 359 | MCFG_MC6845_ADD("crtc", MC6845, "screen", CRTC_CLOCK) |
| 360 | 360 | // *** MC6845 init *** |
| 361 | // | |
| 361 | // | |
| 362 | 362 | // Register: 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 |
| 363 | 363 | // Value: 0x45 0x30 0x36 0x0A 0x28 0x00 0x26 0x27 0x00 0x07 0x20 0x0B 0x00 0x00 0x00 0x00 0x00 0x00. |
| 364 | 364 | MCFG_MC6845_SHOW_BORDER_AREA(false) |
| r31373 | r31374 | |
|---|---|---|
| 18 | 18 | public: |
| 19 | 19 | wpc_95_state(const machine_config &mconfig, device_type type, const char *tag) |
| 20 | 20 | : driver_device(mconfig, type, tag), |
| 21 | maincpu(*this, "maincpu"), | |
| 22 | dcs(*this, "dcs"), | |
| 23 | rombank(*this, "rombank"), | |
| 24 | mainram(*this, "mainram"), | |
| 25 | nvram(*this, "nvram"), | |
| 26 | pic(*this, "pic"), | |
| 27 | lamp(*this, "lamp"), | |
| 28 | out(*this, "out") | |
| 21 | maincpu(*this, "maincpu"), | |
| 22 | dcs(*this, "dcs"), | |
| 23 | rombank(*this, "rombank"), | |
| 24 | mainram(*this, "mainram"), | |
| 25 | nvram(*this, "nvram"), | |
| 26 | pic(*this, "pic"), | |
| 27 | lamp(*this, "lamp"), | |
| 28 | out(*this, "out") | |
| 29 | 29 | { } |
| 30 | 30 | |
| 31 | 31 | DECLARE_WRITE8_MEMBER(bank_w); |
| r31373 | r31374 | |
| 509 | 509 | |
| 510 | 510 | static INPUT_PORTS_START( afm ) |
| 511 | 511 | PORT_START("SW.0") |
| 512 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 513 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 514 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 515 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 516 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 517 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 518 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 519 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 512 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 513 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 514 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 515 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 516 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 517 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 518 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 519 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 520 | 520 | |
| 521 | 521 | PORT_START("SW.1") |
| 522 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 523 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 524 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 525 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 526 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 527 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 528 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 529 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 522 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 523 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 524 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 525 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 526 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 527 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 528 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 529 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 530 | 530 | |
| 531 | 531 | PORT_START("SW.2") |
| 532 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 533 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 534 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 535 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 536 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 537 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 538 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 539 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 532 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 533 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 534 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 535 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 536 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 537 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 538 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 539 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 540 | 540 | |
| 541 | 541 | PORT_START("SW.3") |
| 542 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 543 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 544 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IAN") | |
| 545 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 546 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 547 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 548 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 549 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 542 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 543 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 544 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IAN") | |
| 545 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 546 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 547 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 548 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 549 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 550 | 550 | |
| 551 | 551 | PORT_START("SW.4") |
| 552 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 553 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 554 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 555 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 556 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 557 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 558 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 559 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 552 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 553 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 554 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 555 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 556 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 557 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 558 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 559 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 560 | 560 | |
| 561 | 561 | PORT_START("SW.5") |
| 562 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 563 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 564 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 565 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 566 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 567 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 568 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 569 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 562 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 563 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 564 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 565 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 566 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 567 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 568 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 569 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 570 | 570 | |
| 571 | 571 | PORT_START("SW.6") |
| 572 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 573 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 574 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 575 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 576 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 577 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 578 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 579 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 572 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 573 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 574 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 575 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 576 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 577 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 578 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 579 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 580 | 580 | |
| 581 | 581 | PORT_START("SW.7") |
| 582 | ||
| 582 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 583 | 583 | |
| 584 | 584 | PORT_START("DOOR") |
| 585 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 586 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 587 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 588 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 589 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 590 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 591 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 592 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 585 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 586 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 587 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 588 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 589 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 590 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 591 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 592 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 593 | 593 | |
| 594 | 594 | PORT_START("DSW") |
| 595 | 595 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 600 | 600 | PORT_DIPSETTING( 0xec, "Spain") |
| 601 | 601 | |
| 602 | 602 | PORT_START("FLIPPERS") |
| 603 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 604 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 605 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 606 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 607 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 608 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 609 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 610 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 603 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 604 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 605 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 606 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 607 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 608 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 609 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 610 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 611 | 611 | INPUT_PORTS_END |
| 612 | 612 | |
| 613 | 613 | const char *const wpc_95_state::lamps_cc[64] = { |
| r31373 | r31374 | |
| 634 | 634 | |
| 635 | 635 | static INPUT_PORTS_START( cc ) |
| 636 | 636 | PORT_START("SW.0") |
| 637 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 638 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 639 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 640 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 641 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Mine entrance") | |
| 642 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 643 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R return") | |
| 644 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 637 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 638 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 639 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 640 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 641 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Mine entrance") | |
| 642 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 643 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R return") | |
| 644 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 645 | 645 | |
| 646 | 646 | PORT_START("SW.1") |
| 647 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 648 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 649 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 650 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 651 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 652 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L return") | |
| 653 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 654 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup (bot)") | |
| 647 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 648 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 649 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 650 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 651 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 652 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L return") | |
| 653 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 654 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup (bot)") | |
| 655 | 655 | |
| 656 | 656 | PORT_START("SW.2") |
| 657 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 658 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 659 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 660 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 661 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 662 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L loop bottom") | |
| 663 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Rt loop bottom") | |
| 664 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 657 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 658 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 659 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 660 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 661 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 662 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L loop bottom") | |
| 663 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Rt loop bottom") | |
| 664 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 665 | 665 | |
| 666 | 666 | PORT_START("SW.3") |
| 667 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Mine popper") | |
| 668 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Saloon popper") | |
| 669 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 670 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup (top)") | |
| 671 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 672 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Beer mug switch") | |
| 673 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L bonus X lane") | |
| 674 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet exit") | |
| 667 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Mine popper") | |
| 668 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Saloon popper") | |
| 669 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 670 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R standup (top)") | |
| 671 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 672 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Beer mug switch") | |
| 673 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L bonus X lane") | |
| 674 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet exit") | |
| 675 | 675 | |
| 676 | 676 | PORT_START("SW.4") |
| 677 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 678 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 679 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 680 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 681 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 682 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop top") | |
| 683 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R bonus X lane") | |
| 684 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop top") | |
| 677 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 678 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 679 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 680 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 681 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 682 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop top") | |
| 683 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R bonus X lane") | |
| 684 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop top") | |
| 685 | 685 | |
| 686 | 686 | PORT_START("SW.5") |
| 687 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #1 (L)") | |
| 688 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #2 (LC)") | |
| 689 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #3 (RC)") | |
| 690 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #4 (R)") | |
| 691 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp make") | |
| 692 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 693 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skill bowl") | |
| 694 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bot R ramp") | |
| 687 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #1 (L)") | |
| 688 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #2 (LC)") | |
| 689 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #3 (RC)") | |
| 690 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop #4 (R)") | |
| 691 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp make") | |
| 692 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 693 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skill bowl") | |
| 694 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bot R ramp") | |
| 695 | 695 | |
| 696 | 696 | PORT_START("SW.6") |
| 697 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Train encoder") | |
| 698 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Train home") | |
| 699 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Saloon gate") | |
| 700 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 701 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Saloon bart toy") | |
| 702 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 703 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Mine home") | |
| 704 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Mine encoder") | |
| 697 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Train encoder") | |
| 698 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Train home") | |
| 699 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Saloon gate") | |
| 700 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 701 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Saloon bart toy") | |
| 702 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 703 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Mine home") | |
| 704 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Mine encoder") | |
| 705 | 705 | |
| 706 | 706 | PORT_START("SW.7") |
| 707 | 707 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 708 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 709 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp make") | |
| 710 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp make") | |
| 711 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 712 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup (top)") | |
| 713 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup (bot)") | |
| 708 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 709 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp make") | |
| 710 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp make") | |
| 711 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 712 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup (top)") | |
| 713 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L standup (bot)") | |
| 714 | 714 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) |
| 715 | 715 | |
| 716 | 716 | PORT_START("DOOR") |
| 717 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 718 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 719 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 720 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 721 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 722 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 723 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 724 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 717 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 718 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 719 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 720 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 721 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 722 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 723 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 724 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 725 | 725 | |
| 726 | 726 | PORT_START("DSW") |
| 727 | 727 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 732 | 732 | PORT_DIPSETTING( 0xec, "Spain") |
| 733 | 733 | |
| 734 | 734 | PORT_START("FLIPPERS") |
| 735 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 736 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 737 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 738 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 739 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 740 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 741 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 742 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 735 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 736 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 737 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 738 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 739 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 740 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 741 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 742 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 743 | 743 | INPUT_PORTS_END |
| 744 | 744 | |
| 745 | 745 | const char *const wpc_95_state::lamps_cv[64] = { |
| r31373 | r31374 | |
| 766 | 766 | |
| 767 | 767 | static INPUT_PORTS_START( cv ) |
| 768 | 768 | PORT_START("SW.0") |
| 769 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Back box luck") | |
| 770 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Wire ramp enter") | |
| 771 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 772 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 773 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop upper") | |
| 774 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top Eddy") | |
| 775 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 776 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 769 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Back box luck") | |
| 770 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Wire ramp enter") | |
| 771 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 772 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 773 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop upper") | |
| 774 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top Eddy") | |
| 775 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 776 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 777 | 777 | |
| 778 | 778 | PORT_START("SW.1") |
| 779 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 780 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 781 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop upper") | |
| 782 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 783 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop left") | |
| 784 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 785 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 786 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop right") | |
| 779 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 780 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 781 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop upper") | |
| 782 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 783 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop left") | |
| 784 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 785 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 786 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop right") | |
| 787 | 787 | |
| 788 | 788 | PORT_START("SW.2") |
| 789 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 790 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 791 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 792 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 793 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 794 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Poppor opto") | |
| 795 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"WOW\" targets") | |
| 796 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top targets") | |
| 789 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 790 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 791 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 792 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 793 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 794 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Poppor opto") | |
| 795 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"WOW\" targets") | |
| 796 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top targets") | |
| 797 | 797 | |
| 798 | 798 | PORT_START("SW.3") |
| 799 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left lane") | |
| 800 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ringmaster up") | |
| 801 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ringmaster mid") | |
| 802 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ringmaster down") | |
| 803 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 804 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Trough upper") | |
| 805 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Trough middle") | |
| 806 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop enter") | |
| 799 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left lane") | |
| 800 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ringmaster up") | |
| 801 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ringmaster mid") | |
| 802 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ringmaster down") | |
| 803 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 804 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Trough upper") | |
| 805 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Trough middle") | |
| 806 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop enter") | |
| 807 | 807 | |
| 808 | 808 | PORT_START("SW.4") |
| 809 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 810 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 811 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper jet") | |
| 812 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 813 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower jet") | |
| 814 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skill shot") | |
| 815 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 816 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ring 'N', 'G'") | |
| 809 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 810 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 811 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper jet") | |
| 812 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 813 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower jet") | |
| 814 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Skill shot") | |
| 815 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 816 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ring 'N', 'G'") | |
| 817 | 817 | |
| 818 | 818 | PORT_START("SW.5") |
| 819 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Light\" standup") | |
| 820 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Lock\" standup") | |
| 821 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp enter") | |
| 822 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp magnet") | |
| 823 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made") | |
| 824 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp lock low") | |
| 825 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp lock mid") | |
| 826 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp lock high") | |
| 819 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Light\" standup") | |
| 820 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Lock\" standup") | |
| 821 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp enter") | |
| 822 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp magnet") | |
| 823 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made") | |
| 824 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp lock low") | |
| 825 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp lock mid") | |
| 826 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp lock high") | |
| 827 | 827 | |
| 828 | 828 | PORT_START("SW.6") |
| 829 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left saucer") | |
| 830 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right saucer") | |
| 831 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 832 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Big ball rebound") | |
| 833 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Volt\" right") | |
| 834 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Volt\" left") | |
| 835 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 836 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 829 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left saucer") | |
| 830 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right saucer") | |
| 831 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 832 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Big ball rebound") | |
| 833 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Volt\" right") | |
| 834 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Volt\" left") | |
| 835 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 836 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 837 | 837 | |
| 838 | 838 | PORT_START("SW.7") |
| 839 | ||
| 839 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 840 | 840 | |
| 841 | 841 | PORT_START("DOOR") |
| 842 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 843 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 844 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 845 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 846 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 847 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 848 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 849 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 842 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 843 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 844 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 845 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 846 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 847 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 848 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 849 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 850 | 850 | |
| 851 | 851 | PORT_START("DSW") |
| 852 | 852 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 857 | 857 | PORT_DIPSETTING( 0xec, "Spain") |
| 858 | 858 | |
| 859 | 859 | PORT_START("FLIPPERS") |
| 860 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 861 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 862 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 863 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 864 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right spinner") | |
| 865 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 866 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left spinner") | |
| 867 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 860 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 861 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 862 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 863 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 864 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right spinner") | |
| 865 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 866 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left spinner") | |
| 867 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 868 | 868 | INPUT_PORTS_END |
| 869 | 869 | |
| 870 | 870 | const char *const wpc_95_state::lamps_congo[64] = { |
| r31373 | r31374 | |
| 891 | 891 | |
| 892 | 892 | static INPUT_PORTS_START( congo ) |
| 893 | 893 | PORT_START("SW.0") |
| 894 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner left loop") | |
| 895 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper loop") | |
| 896 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 897 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 898 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet exit") | |
| 899 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 900 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt return lane") | |
| 901 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 894 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner left loop") | |
| 895 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper loop") | |
| 896 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 897 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 898 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet exit") | |
| 899 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 900 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt return lane") | |
| 901 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 902 | 902 | |
| 903 | 903 | PORT_START("SW.1") |
| 904 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 905 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 906 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 907 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 908 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt eject rubber") | |
| 909 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lt return lane") | |
| 910 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 911 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"You\" standup") | |
| 904 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 905 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 906 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 907 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 908 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt eject rubber") | |
| 909 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lt return lane") | |
| 910 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 911 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"You\" standup") | |
| 912 | 912 | |
| 913 | 913 | PORT_START("SW.2") |
| 914 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 915 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 916 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 917 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 918 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 919 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Volcano stack") | |
| 920 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Mystery\" eject") | |
| 921 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right eject") | |
| 914 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 915 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 916 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 917 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 918 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 919 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Volcano stack") | |
| 920 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Mystery\" eject") | |
| 921 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right eject") | |
| 922 | 922 | |
| 923 | 923 | PORT_START("SW.3") |
| 924 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock ball 1") | |
| 925 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock ball 2") | |
| 926 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock ball 3") | |
| 927 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Mine shaft\"") | |
| 928 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 929 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left bank top") | |
| 930 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left bank center") | |
| 931 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left bank bottom") | |
| 924 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock ball 1") | |
| 925 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock ball 2") | |
| 926 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock ball 3") | |
| 927 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Mine shaft\"") | |
| 928 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 929 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left bank top") | |
| 930 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left bank center") | |
| 931 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left bank bottom") | |
| 932 | 932 | |
| 933 | 933 | PORT_START("SW.4") |
| 934 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Travi\"") | |
| 935 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Com\"") | |
| 936 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2-way popper") | |
| 937 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"We are\" standup") | |
| 938 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Watching\" standup") | |
| 939 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Perimeter def\"") | |
| 940 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 941 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp exit") | |
| 934 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Travi\"") | |
| 935 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Com\"") | |
| 936 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("2-way popper") | |
| 937 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"We are\" standup") | |
| 938 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Watching\" standup") | |
| 939 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"Perimeter def\"") | |
| 940 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 941 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp exit") | |
| 942 | 942 | |
| 943 | 943 | PORT_START("SW.5") |
| 944 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 945 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 946 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 947 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 948 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 949 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 950 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 951 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp exit") | |
| 944 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 945 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 946 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 947 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 948 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 949 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 950 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 951 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp exit") | |
| 952 | 952 | |
| 953 | 953 | PORT_START("SW.6") |
| 954 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(A)MY") | |
| 955 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A(M)Y") | |
| 956 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("AM(Y)") | |
| 957 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(C)ONGO") | |
| 958 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C(O)NGO") | |
| 959 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("CO(N)GO") | |
| 960 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("CON(G)O") | |
| 961 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("CONG(O)") | |
| 954 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(A)MY") | |
| 955 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A(M)Y") | |
| 956 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("AM(Y)") | |
| 957 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(C)ONGO") | |
| 958 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C(O)NGO") | |
| 959 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("CO(N)GO") | |
| 960 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("CON(G)O") | |
| 961 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("CONG(O)") | |
| 962 | 962 | |
| 963 | 963 | PORT_START("SW.7") |
| 964 | ||
| 964 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 965 | 965 | |
| 966 | 966 | PORT_START("DOOR") |
| 967 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 968 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 969 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 970 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 971 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 972 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 973 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 974 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 967 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 968 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 969 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 970 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 971 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 972 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 973 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 974 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 975 | 975 | |
| 976 | 976 | PORT_START("DSW") |
| 977 | 977 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 982 | 982 | PORT_DIPSETTING( 0xec, "Spain") |
| 983 | 983 | |
| 984 | 984 | PORT_START("FLIPPERS") |
| 985 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 986 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 987 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 988 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 989 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 990 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 991 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper EOS") | |
| 992 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 985 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 986 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 987 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 988 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 989 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 990 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 991 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper EOS") | |
| 992 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 993 | 993 | INPUT_PORTS_END |
| 994 | 994 | |
| 995 | 995 | const char *const wpc_95_state::lamps_jy[64] = { |
| r31373 | r31374 | |
| 1016 | 1016 | |
| 1017 | 1017 | static INPUT_PORTS_START( jy ) |
| 1018 | 1018 | PORT_START("SW.0") |
| 1019 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Toaster gun") | |
| 1020 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rebound sw") | |
| 1021 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1022 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1023 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top left crane") | |
| 1024 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1025 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return lane") | |
| 1026 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1019 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Toaster gun") | |
| 1020 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rebound sw") | |
| 1021 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1022 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1023 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top left crane") | |
| 1024 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1025 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return lane") | |
| 1026 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1027 | 1027 | |
| 1028 | 1028 | PORT_START("SW.1") |
| 1029 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1030 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1031 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1032 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1033 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1034 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rght return lane") | |
| 1035 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1036 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Crane down") | |
| 1029 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1030 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1031 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1032 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1033 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1034 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rght return lane") | |
| 1035 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1036 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Crane down") | |
| 1037 | 1037 | |
| 1038 | 1038 | PORT_START("SW.2") |
| 1039 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1040 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1041 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1042 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1043 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1044 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock up 2") | |
| 1045 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock up 1") | |
| 1046 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top right crane") | |
| 1039 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1040 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1041 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1042 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1043 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1044 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock up 2") | |
| 1045 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock up 1") | |
| 1046 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top right crane") | |
| 1047 | 1047 | |
| 1048 | 1048 | PORT_START("SW.3") |
| 1049 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Past spinner") | |
| 1050 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("In the sewer") | |
| 1051 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock jam") | |
| 1052 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Past crane") | |
| 1053 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp exit") | |
| 1054 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 1 left") | |
| 1055 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 2") | |
| 1056 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 3") | |
| 1049 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Past spinner") | |
| 1050 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("In the sewer") | |
| 1051 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lock jam") | |
| 1052 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Past crane") | |
| 1053 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp exit") | |
| 1054 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 1 left") | |
| 1055 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 2") | |
| 1056 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 3") | |
| 1057 | 1057 | |
| 1058 | 1058 | PORT_START("SW.4") |
| 1059 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 1060 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 1061 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 4") | |
| 1062 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 5 rght") | |
| 1063 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1064 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L L 3 bank bot") | |
| 1065 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L L 3 bank mid") | |
| 1066 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L L 3 bank top") | |
| 1059 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 1060 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 1061 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 4") | |
| 1062 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Car targ 5 rght") | |
| 1063 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1064 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L L 3 bank bot") | |
| 1065 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L L 3 bank mid") | |
| 1066 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L L 3 bank top") | |
| 1067 | 1067 | |
| 1068 | 1068 | PORT_START("SW.5") |
| 1069 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R 3 bank bot") | |
| 1070 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R 3 bank mid") | |
| 1071 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R 3 bank top") | |
| 1072 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U L 3 bank bot") | |
| 1073 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U L 3 bank mid") | |
| 1074 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U L 3 bank top") | |
| 1075 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bowl entry") | |
| 1076 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bowl exit") | |
| 1069 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R 3 bank bot") | |
| 1070 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R 3 bank mid") | |
| 1071 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R 3 bank top") | |
| 1072 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U L 3 bank bot") | |
| 1073 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U L 3 bank mid") | |
| 1074 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U L 3 bank top") | |
| 1075 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bowl entry") | |
| 1076 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bowl exit") | |
| 1077 | 1077 | |
| 1078 | 1078 | PORT_START("SW.6") |
| 1079 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp entry") | |
| 1080 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Scoop down") | |
| 1081 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Scoop made") | |
| 1082 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Dog entry") | |
| 1083 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1084 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R 3 bank bottom") | |
| 1085 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R 3 bank middle") | |
| 1086 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R 3 bank top") | |
| 1079 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp entry") | |
| 1080 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Scoop down") | |
| 1081 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Scoop made") | |
| 1082 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Dog entry") | |
| 1083 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1084 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R 3 bank bottom") | |
| 1085 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R 3 bank middle") | |
| 1086 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R 3 bank top") | |
| 1087 | 1087 | |
| 1088 | 1088 | PORT_START("SW.7") |
| 1089 | ||
| 1089 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1090 | 1090 | |
| 1091 | 1091 | PORT_START("DOOR") |
| 1092 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1093 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1094 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1095 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1096 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1097 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1098 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1099 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1092 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1093 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1094 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1095 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1096 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1097 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1098 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1099 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1100 | 1100 | |
| 1101 | 1101 | PORT_START("DSW") |
| 1102 | 1102 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1107 | 1107 | PORT_DIPSETTING( 0xec, "Spain") |
| 1108 | 1108 | |
| 1109 | 1109 | PORT_START("FLIPPERS") |
| 1110 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1111 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1112 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1113 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1114 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Spinner") | |
| 1115 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1116 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1117 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1110 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1111 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1112 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1113 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1114 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Spinner") | |
| 1115 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1116 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1117 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1118 | 1118 | INPUT_PORTS_END |
| 1119 | 1119 | |
| 1120 | 1120 | const char *const wpc_95_state::lamps_mm[64] = { |
| r31373 | r31374 | |
| 1141 | 1141 | |
| 1142 | 1142 | static INPUT_PORTS_START( mm ) |
| 1143 | 1143 | PORT_START("SW.0") |
| 1144 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1145 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Catapult target") | |
| 1146 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1147 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1148 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L troll target") | |
| 1149 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1150 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1151 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1144 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1145 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Catapult target") | |
| 1146 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1147 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1148 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L troll target") | |
| 1149 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1150 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1151 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1152 | 1152 | |
| 1153 | 1153 | PORT_START("SW.1") |
| 1154 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1155 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1156 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1157 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1158 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R troll target") | |
| 1159 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1160 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1161 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right eject") | |
| 1154 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1155 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1156 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1157 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1158 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R troll target") | |
| 1159 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1160 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1161 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right eject") | |
| 1162 | 1162 | |
| 1163 | 1163 | PORT_START("SW.2") |
| 1164 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1165 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1166 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1167 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1168 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1169 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1170 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Castle gate") | |
| 1171 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Catapult") | |
| 1164 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1165 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1166 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1167 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1168 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1169 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 1170 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Castle gate") | |
| 1171 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Catapult") | |
| 1172 | 1172 | |
| 1173 | 1173 | PORT_START("SW.3") |
| 1174 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Moat enter") | |
| 1175 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1176 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1177 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Castle lock") | |
| 1178 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L troll (U/pfld)") | |
| 1179 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R troll (U/pfld)") | |
| 1180 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1181 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1174 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Moat enter") | |
| 1175 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1176 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1177 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Castle lock") | |
| 1178 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L troll (U/pfld)") | |
| 1179 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R troll (U/pfld)") | |
| 1180 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1181 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1182 | 1182 | |
| 1183 | 1183 | PORT_START("SW.4") |
| 1184 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1185 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1186 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1187 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1188 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1189 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drawbridge up") | |
| 1190 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drawbridge down") | |
| 1191 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tower exit") | |
| 1184 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1185 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1186 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1187 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1188 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1189 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drawbridge up") | |
| 1190 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drawbridge down") | |
| 1191 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tower exit") | |
| 1192 | 1192 | |
| 1193 | 1193 | PORT_START("SW.5") |
| 1194 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1195 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1196 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1197 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1198 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1199 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1200 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1201 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1194 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1195 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1196 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1197 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1198 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1199 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1200 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1201 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1202 | 1202 | |
| 1203 | 1203 | PORT_START("SW.6") |
| 1204 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right bank top") | |
| 1205 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right bank mid") | |
| 1206 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right bank bot") | |
| 1207 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L troll up") | |
| 1208 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R troll up") | |
| 1209 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1210 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1211 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1204 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right bank top") | |
| 1205 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right bank mid") | |
| 1206 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right bank bot") | |
| 1207 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L troll up") | |
| 1208 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R troll up") | |
| 1209 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1210 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1211 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1212 | 1212 | |
| 1213 | 1213 | PORT_START("SW.7") |
| 1214 | ||
| 1214 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1215 | 1215 | |
| 1216 | 1216 | PORT_START("DOOR") |
| 1217 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1218 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1219 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1220 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1221 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1222 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1223 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1224 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1217 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1218 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1219 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1220 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1221 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1222 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1223 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1224 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1225 | 1225 | |
| 1226 | 1226 | PORT_START("DSW") |
| 1227 | 1227 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1232 | 1232 | PORT_DIPSETTING( 0xec, "Spain") |
| 1233 | 1233 | |
| 1234 | 1234 | PORT_START("FLIPPERS") |
| 1235 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1236 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1237 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1238 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1239 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1240 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1241 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1242 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1235 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1236 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1237 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1238 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1239 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1240 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1241 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1242 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1243 | 1243 | INPUT_PORTS_END |
| 1244 | 1244 | |
| 1245 | 1245 | const char *const wpc_95_state::lamps_mb[64] = { |
| r31373 | r31374 | |
| 1266 | 1266 | |
| 1267 | 1267 | static INPUT_PORTS_START( mb ) |
| 1268 | 1268 | PORT_START("SW.0") |
| 1269 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1270 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac standup top") | |
| 1271 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1272 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1273 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac standup bot") | |
| 1274 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1275 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1276 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1269 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1270 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac standup top") | |
| 1271 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1272 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1273 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac standup bot") | |
| 1274 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1275 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1276 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1277 | 1277 | |
| 1278 | 1278 | PORT_START("SW.1") |
| 1279 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1280 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1281 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tomb treasure") | |
| 1282 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1283 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Dracula target") | |
| 1284 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1285 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1286 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left eject") | |
| 1279 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1280 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1281 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tomb treasure") | |
| 1282 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1283 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Dracula target") | |
| 1284 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1285 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1286 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left eject") | |
| 1287 | 1287 | |
| 1288 | 1288 | PORT_START("SW.2") |
| 1289 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1290 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1291 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1292 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1293 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1294 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1295 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1296 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1289 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1290 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1291 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1292 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1293 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1294 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1295 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1296 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1297 | 1297 | |
| 1298 | 1298 | PORT_START("SW.3") |
| 1299 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1300 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L flip opto") | |
| 1301 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R flip opto") | |
| 1302 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L blue tgt") | |
| 1303 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C blue tgt") | |
| 1304 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R blue tgt") | |
| 1305 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L flip prox") | |
| 1306 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R flip prox") | |
| 1299 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1300 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L flip opto") | |
| 1301 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R flip opto") | |
| 1302 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L blue tgt") | |
| 1303 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C blue tgt") | |
| 1304 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R blue tgt") | |
| 1305 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L flip prox") | |
| 1306 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R flip prox") | |
| 1307 | 1307 | |
| 1308 | 1308 | PORT_START("SW.4") |
| 1309 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1310 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1311 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1312 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1313 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1314 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1315 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle top lane") | |
| 1316 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1309 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1310 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1311 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1312 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1313 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1314 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 1315 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle top lane") | |
| 1316 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 1317 | 1317 | |
| 1318 | 1318 | PORT_START("SW.5") |
| 1319 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1320 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1321 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1322 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1323 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center loop") | |
| 1324 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1325 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1326 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1319 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 1320 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 1321 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 1322 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 1323 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center loop") | |
| 1324 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 1325 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 1326 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 1327 | 1327 | |
| 1328 | 1328 | PORT_START("SW.6") |
| 1329 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1330 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1331 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp lock") | |
| 1332 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 5") | |
| 1333 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 4") | |
| 1334 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 3") | |
| 1335 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 2") | |
| 1336 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 1") | |
| 1329 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 1330 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 1331 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp lock") | |
| 1332 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 5") | |
| 1333 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 4") | |
| 1334 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 3") | |
| 1335 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 2") | |
| 1336 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drac position 1") | |
| 1337 | 1337 | |
| 1338 | 1338 | PORT_START("SW.7") |
| 1339 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Up/dn bank up") | |
| 1340 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Up/dn bank down") | |
| 1341 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Frank table down") | |
| 1342 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Frank table up") | |
| 1343 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L up/dn bank tgt") | |
| 1344 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R up/dn bank tgt") | |
| 1345 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Frank hit") | |
| 1346 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1339 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Up/dn bank up") | |
| 1340 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Up/dn bank down") | |
| 1341 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Frank table down") | |
| 1342 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Frank table up") | |
| 1343 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L up/dn bank tgt") | |
| 1344 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R up/dn bank tgt") | |
| 1345 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Frank hit") | |
| 1346 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1347 | 1347 | |
| 1348 | 1348 | PORT_START("DOOR") |
| 1349 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1350 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1351 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1352 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1353 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1354 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1355 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1356 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1349 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1350 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1351 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1352 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1353 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1354 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1355 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1356 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1357 | 1357 | |
| 1358 | 1358 | PORT_START("DSW") |
| 1359 | 1359 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1364 | 1364 | PORT_DIPSETTING( 0xec, "Spain") |
| 1365 | 1365 | |
| 1366 | 1366 | PORT_START("FLIPPERS") |
| 1367 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1368 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1369 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1370 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1371 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1372 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1373 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center spinner") | |
| 1374 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1367 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1368 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1369 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1370 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1371 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1372 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1373 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center spinner") | |
| 1374 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1375 | 1375 | INPUT_PORTS_END |
| 1376 | 1376 | |
| 1377 | 1377 | const char *const wpc_95_state::lamps_nbaf[64] = { |
| r31373 | r31374 | |
| 1398 | 1398 | |
| 1399 | 1399 | static INPUT_PORTS_START( nbaf ) |
| 1400 | 1400 | PORT_START("SW.0") |
| 1401 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1402 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Backbos basket") | |
| 1403 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1404 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1405 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shhoter lane") | |
| 1406 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lt return lane") | |
| 1407 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt return lane") | |
| 1408 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L R standup") | |
| 1401 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 1402 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Backbos basket") | |
| 1403 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1404 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1405 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shhoter lane") | |
| 1406 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lt return lane") | |
| 1407 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt return lane") | |
| 1408 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L R standup") | |
| 1409 | 1409 | |
| 1410 | 1410 | PORT_START("SW.1") |
| 1411 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1412 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1413 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1414 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1415 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Eject hole") | |
| 1416 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1417 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1418 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R standup") | |
| 1411 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1412 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1413 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1414 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1415 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Eject hole") | |
| 1416 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1417 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1418 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("U R standup") | |
| 1419 | 1419 | |
| 1420 | 1420 | PORT_START("SW.2") |
| 1421 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1422 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1423 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1424 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1425 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1426 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center ramp opto") | |
| 1427 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R loop ent opto") | |
| 1428 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop exit") | |
| 1421 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1422 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1423 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1424 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1425 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1426 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Center ramp opto") | |
| 1427 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R loop ent opto") | |
| 1428 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop exit") | |
| 1429 | 1429 | |
| 1430 | 1430 | PORT_START("SW.3") |
| 1431 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup '3'") | |
| 1432 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 'P'") | |
| 1433 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 'T'") | |
| 1434 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 1435 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 1436 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 1437 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop enter") | |
| 1438 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop made") | |
| 1431 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup '3'") | |
| 1432 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 'P'") | |
| 1433 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Standup 'T'") | |
| 1434 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 1435 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 1436 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 1437 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop enter") | |
| 1438 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop made") | |
| 1439 | 1439 | |
| 1440 | 1440 | PORT_START("SW.4") |
| 1441 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 4") | |
| 1442 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 4") | |
| 1443 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender lock pos") | |
| 1444 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 2") | |
| 1445 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 1") | |
| 1446 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jets ball drain") | |
| 1447 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 1448 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 1441 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 4") | |
| 1442 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 4") | |
| 1443 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender lock pos") | |
| 1444 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 2") | |
| 1445 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Defender pos 1") | |
| 1446 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jets ball drain") | |
| 1447 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L slingshot") | |
| 1448 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R slingshot") | |
| 1449 | 1449 | |
| 1450 | 1450 | PORT_START("SW.5") |
| 1451 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1452 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 1453 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L loop ramp exit") | |
| 1454 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 1455 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 4") | |
| 1456 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 3") | |
| 1457 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 2") | |
| 1458 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 1") | |
| 1451 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1452 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 1453 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L loop ramp exit") | |
| 1454 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 1455 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 4") | |
| 1456 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 3") | |
| 1457 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 2") | |
| 1458 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"In the paint\" 1") | |
| 1459 | 1459 | |
| 1460 | 1460 | PORT_START("SW.6") |
| 1461 | ||
| 1461 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1462 | 1462 | |
| 1463 | 1463 | PORT_START("SW.7") |
| 1464 | ||
| 1464 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1465 | 1465 | |
| 1466 | 1466 | PORT_START("DOOR") |
| 1467 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1468 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1469 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1470 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1471 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1472 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1473 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1474 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1467 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1468 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1469 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1470 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1471 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1472 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1473 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1474 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1475 | 1475 | |
| 1476 | 1476 | PORT_START("DSW") |
| 1477 | 1477 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1482 | 1482 | PORT_DIPSETTING( 0xec, "Spain") |
| 1483 | 1483 | |
| 1484 | 1484 | PORT_START("FLIPPERS") |
| 1485 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1486 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1487 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1488 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1489 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Basket made") | |
| 1490 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1491 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Basket hold") | |
| 1492 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1485 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1486 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1487 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1488 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1489 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Basket made") | |
| 1490 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1491 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Basket hold") | |
| 1492 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1493 | 1493 | INPUT_PORTS_END |
| 1494 | 1494 | |
| 1495 | 1495 | const char *const wpc_95_state::lamps_ngg[64] = { |
| r31373 | r31374 | |
| 1516 | 1516 | |
| 1517 | 1517 | static INPUT_PORTS_START( ngg ) |
| 1518 | 1518 | PORT_START("SW.0") |
| 1519 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1520 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp make") | |
| 1521 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1522 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1523 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center ramp make") | |
| 1524 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1525 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 1526 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter groove") | |
| 1519 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1520 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp make") | |
| 1521 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1522 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1523 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center ramp make") | |
| 1524 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1525 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 1526 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter groove") | |
| 1527 | 1527 | |
| 1528 | 1528 | PORT_START("SW.1") |
| 1529 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1530 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1531 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet adv standup") | |
| 1532 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1533 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Underground pass") | |
| 1534 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 1535 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1536 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Kickback") | |
| 1529 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1530 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1531 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Jet adv standup") | |
| 1532 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1533 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Underground pass") | |
| 1534 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 1535 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1536 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Kickback") | |
| 1537 | 1537 | |
| 1538 | 1538 | PORT_START("SW.2") |
| 1539 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1540 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1541 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1542 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1543 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1544 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 5") | |
| 1545 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 6") | |
| 1546 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Jet popper") | |
| 1539 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1540 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1541 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1542 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1543 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1544 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 5") | |
| 1545 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 6") | |
| 1546 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Jet popper") | |
| 1547 | 1547 | |
| 1548 | 1548 | PORT_START("SW.3") |
| 1549 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L gofer down") | |
| 1550 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R gofer down") | |
| 1551 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1552 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Putt out popper") | |
| 1553 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Rt popper jam") | |
| 1554 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1555 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp down") | |
| 1556 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp down") | |
| 1549 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L gofer down") | |
| 1550 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R gofer down") | |
| 1551 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1552 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Putt out popper") | |
| 1553 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Rt popper jam") | |
| 1554 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1555 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left ramp down") | |
| 1556 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp down") | |
| 1557 | 1557 | |
| 1558 | 1558 | PORT_START("SW.4") |
| 1559 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1560 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1561 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top jet") | |
| 1562 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 1563 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1564 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top skill shot") | |
| 1565 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Mid skill shot") | |
| 1566 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower skill shot") | |
| 1559 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1560 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1561 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top jet") | |
| 1562 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 1563 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 1564 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top skill shot") | |
| 1565 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Mid skill shot") | |
| 1566 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower skill shot") | |
| 1567 | 1567 | |
| 1568 | 1568 | PORT_START("SW.5") |
| 1569 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left spinner") | |
| 1570 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right spinner") | |
| 1571 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner wheel opto") | |
| 1572 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Outer wheel opto") | |
| 1573 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left gofer 1") | |
| 1574 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left gofer 2") | |
| 1575 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Behind L gofer") | |
| 1576 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Hole in 1 made") | |
| 1569 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left spinner") | |
| 1570 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right spinner") | |
| 1571 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner wheel opto") | |
| 1572 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Outer wheel opto") | |
| 1573 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left gofer 1") | |
| 1574 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left gofer 2") | |
| 1575 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Behind L gofer") | |
| 1576 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Hole in 1 made") | |
| 1577 | 1577 | |
| 1578 | 1578 | PORT_START("SW.6") |
| 1579 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left cart path") | |
| 1580 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right cart path") | |
| 1581 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp make") | |
| 1582 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Golf cart") | |
| 1583 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right gofer 1") | |
| 1584 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right gofer 2") | |
| 1585 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Adv trap value") | |
| 1586 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Sand trap eject") | |
| 1579 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left cart path") | |
| 1580 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right cart path") | |
| 1581 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right ramp make") | |
| 1582 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Golf cart") | |
| 1583 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right gofer 1") | |
| 1584 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right gofer 2") | |
| 1585 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Adv trap value") | |
| 1586 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Sand trap eject") | |
| 1587 | 1587 | |
| 1588 | 1588 | PORT_START("SW.7") |
| 1589 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("K-I-C-K advance") | |
| 1590 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(K)ICK") | |
| 1591 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("K(I)CK") | |
| 1592 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("KI(C)K") | |
| 1593 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("KIC(K)") | |
| 1594 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Captive ball") | |
| 1595 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1596 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1589 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("K-I-C-K advance") | |
| 1590 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(K)ICK") | |
| 1591 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("K(I)CK") | |
| 1592 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("KI(C)K") | |
| 1593 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("KIC(K)") | |
| 1594 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Captive ball") | |
| 1595 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1596 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1597 | 1597 | |
| 1598 | 1598 | PORT_START("DOOR") |
| 1599 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1600 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1601 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1602 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1603 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1604 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1605 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1606 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1599 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1600 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1601 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1602 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1603 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1604 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1605 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1606 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1607 | 1607 | |
| 1608 | 1608 | PORT_START("DSW") |
| 1609 | 1609 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1614 | 1614 | PORT_DIPSETTING( 0xec, "Spain") |
| 1615 | 1615 | |
| 1616 | 1616 | PORT_START("FLIPPERS") |
| 1617 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1618 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1619 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1620 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1621 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 1622 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1623 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1617 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1618 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1619 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1620 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1621 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper EOS") | |
| 1622 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1623 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1624 | 1624 | INPUT_PORTS_END |
| 1625 | 1625 | |
| 1626 | 1626 | const char *const wpc_95_state::lamps_sc[64] = { |
| r31373 | r31374 | |
| 1656 | 1656 | |
| 1657 | 1657 | static INPUT_PORTS_START( sc ) |
| 1658 | 1658 | PORT_START("SW.0") |
| 1659 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("TP trough (roof)") | |
| 1660 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("TP trough (move)") | |
| 1661 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1662 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1663 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right orbit") | |
| 1664 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1665 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1666 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ballshooter") | |
| 1659 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("TP trough (roof)") | |
| 1660 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("TP trough (move)") | |
| 1661 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1662 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1663 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right orbit") | |
| 1664 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1665 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1666 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ballshooter") | |
| 1667 | 1667 | |
| 1668 | 1668 | PORT_START("SW.1") |
| 1669 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1670 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1671 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1672 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1673 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("UR flip rollover") | |
| 1674 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1675 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1676 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left orbit") | |
| 1669 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1670 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1671 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1672 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1673 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("UR flip rollover") | |
| 1674 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 1675 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 1676 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left orbit") | |
| 1677 | 1677 | |
| 1678 | 1678 | PORT_START("SW.2") |
| 1679 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1680 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1681 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1682 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1683 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1684 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lockup 1 front") | |
| 1685 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lockup 2 rear") | |
| 1686 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1679 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1680 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1681 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1682 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1683 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1684 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lockup 1 front") | |
| 1685 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Lockup 2 rear") | |
| 1686 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1687 | 1687 | |
| 1688 | 1688 | PORT_START("SW.3") |
| 1689 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Kickback") | |
| 1690 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left big kick") | |
| 1691 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tokn chute exit") | |
| 1692 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1693 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1694 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top jet") | |
| 1695 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1696 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1689 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Kickback") | |
| 1690 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left big kick") | |
| 1691 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tokn chute exit") | |
| 1692 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1693 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1694 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top jet") | |
| 1695 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1696 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1697 | 1697 | |
| 1698 | 1698 | PORT_START("SW.4") |
| 1699 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(A)LARM standup") | |
| 1700 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A(L)ARM standup") | |
| 1701 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("AL(A)RM standup") | |
| 1702 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ALA(R)M standup") | |
| 1703 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ALAR(M) standup") | |
| 1704 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Movng target C") | |
| 1705 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Movng target B") | |
| 1706 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Movng target A") | |
| 1699 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("(A)LARM standup") | |
| 1700 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("A(L)ARM standup") | |
| 1701 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("AL(A)RM standup") | |
| 1702 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ALA(R)M standup") | |
| 1703 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("ALAR(M) standup") | |
| 1704 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Movng target C") | |
| 1705 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Movng target B") | |
| 1706 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Movng target A") | |
| 1707 | 1707 | |
| 1708 | 1708 | PORT_START("SW.5") |
| 1709 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TL 3bank top") | |
| 1710 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TL 3bank middle") | |
| 1711 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TL 3bank bottom") | |
| 1712 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TR 3bank bottom") | |
| 1713 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TR 3bank middle") | |
| 1714 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TR 3bank top") | |
| 1715 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top left lane") | |
| 1716 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top popper") | |
| 1709 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TL 3bank top") | |
| 1710 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TL 3bank middle") | |
| 1711 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TL 3bank bottom") | |
| 1712 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TR 3bank bottom") | |
| 1713 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TR 3bank middle") | |
| 1714 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("TR 3bank top") | |
| 1715 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top left lane") | |
| 1716 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top popper") | |
| 1717 | 1717 | |
| 1718 | 1718 | PORT_START("SW.6") |
| 1719 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BL 3bank top") | |
| 1720 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BL 3bank middle") | |
| 1721 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BL 3bank bottom") | |
| 1722 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BR 3bank bottom") | |
| 1723 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BR 3bank middle") | |
| 1724 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BR 3bank top") | |
| 1725 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bank kickout") | |
| 1726 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top right lane") | |
| 1719 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BL 3bank top") | |
| 1720 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BL 3bank middle") | |
| 1721 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BL 3bank bottom") | |
| 1722 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BR 3bank bottom") | |
| 1723 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BR 3bank middle") | |
| 1724 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("BR 3bank top") | |
| 1725 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bank kickout") | |
| 1726 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top right lane") | |
| 1727 | 1727 | |
| 1728 | 1728 | PORT_START("SW.7") |
| 1729 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left token lvl") | |
| 1730 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right token lvl") | |
| 1731 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp entrance") | |
| 1732 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made") | |
| 1733 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Wheel channel A") | |
| 1734 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Wheel channel B") | |
| 1735 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1736 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1729 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left token lvl") | |
| 1730 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right token lvl") | |
| 1731 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp entrance") | |
| 1732 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made") | |
| 1733 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Wheel channel A") | |
| 1734 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Wheel channel B") | |
| 1735 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1736 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1737 | 1737 | |
| 1738 | 1738 | PORT_START("DOOR") |
| 1739 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1740 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1741 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1742 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1743 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1744 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1745 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1746 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1739 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1740 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1741 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1742 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1743 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1744 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1745 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1746 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1747 | 1747 | |
| 1748 | 1748 | PORT_START("DSW") |
| 1749 | 1749 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1754 | 1754 | PORT_DIPSETTING( 0xec, "Spain") |
| 1755 | 1755 | |
| 1756 | 1756 | PORT_START("FLIPPERS") |
| 1757 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1758 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1759 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1760 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1761 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper EOS") | |
| 1762 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1763 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Token coin slot") | |
| 1764 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1757 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1758 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1759 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1760 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1761 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper EOS") | |
| 1762 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1763 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Token coin slot") | |
| 1764 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1765 | 1765 | INPUT_PORTS_END |
| 1766 | 1766 | |
| 1767 | 1767 | const char *const wpc_95_state::lamps_ss[64] = { |
| r31373 | r31374 | |
| 1788 | 1788 | |
| 1789 | 1789 | static INPUT_PORTS_START( ss ) |
| 1790 | 1790 | PORT_START("SW.0") |
| 1791 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1792 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Wheel index") | |
| 1793 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1794 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1795 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1796 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1797 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt flipper lane") | |
| 1798 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1791 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1792 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Wheel index") | |
| 1793 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1794 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1795 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1796 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1797 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt flipper lane") | |
| 1798 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 1799 | 1799 | |
| 1800 | 1800 | PORT_START("SW.1") |
| 1801 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1802 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1803 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1804 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1805 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Extra ball lane") | |
| 1806 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lft flipper lane") | |
| 1807 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1808 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Single standup") | |
| 1801 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1802 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1803 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1804 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1805 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Extra ball lane") | |
| 1806 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lft flipper lane") | |
| 1807 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1808 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Single standup") | |
| 1809 | 1809 | |
| 1810 | 1810 | PORT_START("SW.2") |
| 1811 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1812 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1813 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1814 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1815 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1816 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1817 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left kickout") | |
| 1818 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Crate entrance") | |
| 1811 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1812 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1813 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1814 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1815 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1816 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 1817 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left kickout") | |
| 1818 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Crate entrance") | |
| 1819 | 1819 | |
| 1820 | 1820 | PORT_START("SW.3") |
| 1821 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin left") | |
| 1822 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin center") | |
| 1823 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin right") | |
| 1824 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 1825 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 1826 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 1827 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 1828 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin entrance") | |
| 1821 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin left") | |
| 1822 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin center") | |
| 1823 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin right") | |
| 1824 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp enter") | |
| 1825 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right ramp enter") | |
| 1826 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left ramp made") | |
| 1827 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right ramp made") | |
| 1828 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coffin entrance") | |
| 1829 | 1829 | |
| 1830 | 1830 | PORT_START("SW.4") |
| 1831 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1832 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1833 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper jet") | |
| 1834 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center jet") | |
| 1835 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower jet") | |
| 1836 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper slingshot") | |
| 1837 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Crate sensor") | |
| 1838 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 1831 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 1832 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 1833 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper jet") | |
| 1834 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center jet") | |
| 1835 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lower jet") | |
| 1836 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Upper slingshot") | |
| 1837 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Crate sensor") | |
| 1838 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 1839 | 1839 | |
| 1840 | 1840 | PORT_START("SW.5") |
| 1841 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank upper") | |
| 1842 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank mid") | |
| 1843 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank lower") | |
| 1844 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left leaper") | |
| 1845 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center leaper") | |
| 1846 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right leaper") | |
| 1847 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt ramp 10 point") | |
| 1848 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 1841 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank upper") | |
| 1842 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank mid") | |
| 1843 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank lower") | |
| 1844 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left leaper") | |
| 1845 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center leaper") | |
| 1846 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right leaper") | |
| 1847 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rt ramp 10 point") | |
| 1848 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop") | |
| 1849 | 1849 | |
| 1850 | 1850 | PORT_START("SW.6") |
| 1851 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left skull lane") | |
| 1852 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center skull lane") | |
| 1853 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right skull lane") | |
| 1854 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Secret passage") | |
| 1855 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1856 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1857 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1858 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1851 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left skull lane") | |
| 1852 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center skull lane") | |
| 1853 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right skull lane") | |
| 1854 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Secret passage") | |
| 1855 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1856 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1857 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1858 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1859 | 1859 | |
| 1860 | 1860 | PORT_START("SW.7") |
| 1861 | ||
| 1861 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1862 | 1862 | |
| 1863 | 1863 | PORT_START("DOOR") |
| 1864 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1865 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1866 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1867 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1868 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1869 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1870 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1871 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1864 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1865 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1866 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1867 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1868 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1869 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1870 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1871 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1872 | 1872 | |
| 1873 | 1873 | PORT_START("DSW") |
| 1874 | 1874 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1879 | 1879 | PORT_DIPSETTING( 0xec, "Spain") |
| 1880 | 1880 | |
| 1881 | 1881 | PORT_START("FLIPPERS") |
| 1882 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1883 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1884 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1885 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1886 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1887 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1888 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1889 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1882 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 1883 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 1884 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 1885 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 1886 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1887 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 1888 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1889 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 1890 | 1890 | INPUT_PORTS_END |
| 1891 | 1891 | |
| 1892 | 1892 | const char *const wpc_95_state::lamps_totan[64] = { |
| r31373 | r31374 | |
| 1913 | 1913 | |
| 1914 | 1914 | static INPUT_PORTS_START( totan ) |
| 1915 | 1915 | PORT_START("SW.0") |
| 1916 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Harem passage") | |
| 1917 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vanish tunnel") | |
| 1918 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1919 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1920 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp enter") | |
| 1921 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1922 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 1923 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ball shooter") | |
| 1916 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Harem passage") | |
| 1917 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Vanish tunnel") | |
| 1918 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 1919 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 1920 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp enter") | |
| 1921 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 1922 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right inlane") | |
| 1923 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ball shooter") | |
| 1924 | 1924 | |
| 1925 | 1925 | PORT_START("SW.1") |
| 1926 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1927 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1928 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Genie standup") | |
| 1929 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1930 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bazaar eject") | |
| 1931 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 1932 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1933 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left wire make") | |
| 1926 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 1927 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 1928 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Genie standup") | |
| 1929 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 1930 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bazaar eject") | |
| 1931 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left inlane") | |
| 1932 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 1933 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left wire make") | |
| 1934 | 1934 | |
| 1935 | 1935 | PORT_START("SW.2") |
| 1936 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1937 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1938 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1939 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1940 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1941 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left cage opto") | |
| 1942 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right cage opto") | |
| 1943 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left eject") | |
| 1936 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 1937 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 1938 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 1939 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 1940 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 1941 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left cage opto") | |
| 1942 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right cage opto") | |
| 1943 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left eject") | |
| 1944 | 1944 | |
| 1945 | 1945 | PORT_START("SW.3") |
| 1946 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made left") | |
| 1947 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Genie target") | |
| 1948 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 1949 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop left") | |
| 1950 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop right") | |
| 1951 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Mini standups") | |
| 1952 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made right") | |
| 1953 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right captive ball") | |
| 1946 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made left") | |
| 1947 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Genie target") | |
| 1948 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop") | |
| 1949 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop left") | |
| 1950 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Inner loop right") | |
| 1951 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Mini standups") | |
| 1952 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ramp made right") | |
| 1953 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right captive ball") | |
| 1954 | 1954 | |
| 1955 | 1955 | PORT_START("SW.4") |
| 1956 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 1957 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slign") | |
| 1958 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1959 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1960 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 1961 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lamp spin CCW") | |
| 1962 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lamp spin CW") | |
| 1963 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left captive ball") | |
| 1956 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 1957 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slign") | |
| 1958 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 1959 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 1960 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle jet") | |
| 1961 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lamp spin CCW") | |
| 1962 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lamp spin CW") | |
| 1963 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left captive ball") | |
| 1964 | 1964 | |
| 1965 | 1965 | PORT_START("SW.5") |
| 1966 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left standups") | |
| 1967 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right standups") | |
| 1968 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top skill") | |
| 1969 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle skill") | |
| 1970 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom skill") | |
| 1971 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock 1 (bot)") | |
| 1972 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock 2") | |
| 1973 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock 3 (top)") | |
| 1966 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left standups") | |
| 1967 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right standups") | |
| 1968 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top skill") | |
| 1969 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Middle skill") | |
| 1970 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom skill") | |
| 1971 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock 1 (bot)") | |
| 1972 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock 2") | |
| 1973 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock 3 (top)") | |
| 1974 | 1974 | |
| 1975 | 1975 | PORT_START("SW.6") |
| 1976 | ||
| 1976 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1977 | 1977 | |
| 1978 | 1978 | PORT_START("SW.7") |
| 1979 | ||
| 1979 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 1980 | 1980 | |
| 1981 | 1981 | PORT_START("DOOR") |
| 1982 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1983 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1984 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1985 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1986 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1987 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1988 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1989 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1982 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 1983 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 1984 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 1985 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 1986 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 1987 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 1988 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 1989 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 1990 | 1990 | |
| 1991 | 1991 | PORT_START("DSW") |
| 1992 | 1992 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 1997 | 1997 | PORT_DIPSETTING( 0xec, "Spain") |
| 1998 | 1998 | |
| 1999 | 1999 | PORT_START("FLIPPERS") |
| 2000 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 2001 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 2002 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 2003 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 2004 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2005 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 2006 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2007 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 2000 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 2001 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 2002 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 2003 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 2004 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2005 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 2006 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2007 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 2008 | 2008 | INPUT_PORTS_END |
| 2009 | 2009 | |
| 2010 | 2010 | const char *const wpc_95_state::lamps_cp[64] = { |
| r31373 | r31374 | |
| 2031 | 2031 | |
| 2032 | 2032 | static INPUT_PORTS_START( cp ) |
| 2033 | 2033 | PORT_START("SW.0") |
| 2034 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Made ramp") | |
| 2035 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Heavy bag") | |
| 2036 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 2037 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 2038 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock up 1") | |
| 2039 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 2040 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 2041 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 2034 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Made ramp") | |
| 2035 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Heavy bag") | |
| 2036 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 2037 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 2038 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock up 1") | |
| 2039 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 2040 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 2041 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 2042 | 2042 | |
| 2043 | 2043 | PORT_START("SW.1") |
| 2044 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 2045 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 2046 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 2047 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2048 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank mid") | |
| 2049 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 2050 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 2051 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Popper") | |
| 2044 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 2045 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 2046 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Ball launch") | |
| 2047 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2048 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank mid") | |
| 2049 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 2050 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 2051 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Popper") | |
| 2052 | 2052 | |
| 2053 | 2053 | PORT_START("SW.2") |
| 2054 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 2055 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 2056 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 2057 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 2058 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 2059 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left jab made") | |
| 2060 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Corner eject") | |
| 2061 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right jab made") | |
| 2054 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 2055 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 2056 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 2057 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 2058 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 2059 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left jab made") | |
| 2060 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Corner eject") | |
| 2061 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right jab made") | |
| 2062 | 2062 | |
| 2063 | 2063 | PORT_START("SW.3") |
| 2064 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Boxer pole cntr") | |
| 2065 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Behnd left scoop") | |
| 2066 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Behnd rght scoop") | |
| 2067 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Enter ramp") | |
| 2068 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Jump rope") | |
| 2069 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Bag pole center") | |
| 2070 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Boxer pole right") | |
| 2071 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Boxer pole left") | |
| 2064 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Boxer pole cntr") | |
| 2065 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Behnd left scoop") | |
| 2066 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Behnd rght scoop") | |
| 2067 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Enter ramp") | |
| 2068 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Jump rope") | |
| 2069 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Bag pole center") | |
| 2070 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Boxer pole right") | |
| 2071 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Boxer pole left") | |
| 2072 | 2072 | |
| 2073 | 2073 | PORT_START("SW.4") |
| 2074 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 2075 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 2076 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank bottom") | |
| 2077 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank top") | |
| 2078 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left half guy") | |
| 2079 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rght half guy") | |
| 2080 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock up 2") | |
| 2081 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock up 3") | |
| 2074 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 2075 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 2076 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank bottom") | |
| 2077 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Three bank top") | |
| 2078 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left half guy") | |
| 2079 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rght half guy") | |
| 2080 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock up 2") | |
| 2081 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Lock up 3") | |
| 2082 | 2082 | |
| 2083 | 2083 | PORT_START("SW.5") |
| 2084 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left scoop up") | |
| 2085 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right scoop up") | |
| 2086 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Power shot") | |
| 2087 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rope cam") | |
| 2088 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Speed bag") | |
| 2089 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Boxer gut 1") | |
| 2090 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Boxer gut 2") | |
| 2091 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Boxer head") | |
| 2084 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left scoop up") | |
| 2085 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right scoop up") | |
| 2086 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Power shot") | |
| 2087 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Rope cam") | |
| 2088 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Speed bag") | |
| 2089 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Boxer gut 1") | |
| 2090 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Boxer gut 2") | |
| 2091 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Boxer head") | |
| 2092 | 2092 | |
| 2093 | 2093 | PORT_START("SW.6") |
| 2094 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Exit rope") | |
| 2095 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter speed bag") | |
| 2096 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2097 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter lockup") | |
| 2098 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2099 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top of ramp") | |
| 2100 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2101 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter rope") | |
| 2094 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Exit rope") | |
| 2095 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter speed bag") | |
| 2096 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2097 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter lockup") | |
| 2098 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2099 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Top of ramp") | |
| 2100 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2101 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Enter rope") | |
| 2102 | 2102 | |
| 2103 | 2103 | PORT_START("SW.7") |
| 2104 | ||
| 2104 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2105 | 2105 | |
| 2106 | 2106 | PORT_START("DOOR") |
| 2107 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 2108 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 2109 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 2110 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 2111 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 2112 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 2113 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 2114 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 2107 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 2108 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 2109 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 2110 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 2111 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 2112 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 2113 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 2114 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 2115 | 2115 | |
| 2116 | 2116 | PORT_START("DSW") |
| 2117 | 2117 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 2122 | 2122 | PORT_DIPSETTING( 0xec, "Spain") |
| 2123 | 2123 | |
| 2124 | 2124 | PORT_START("FLIPPERS") |
| 2125 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 2126 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 2127 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 2128 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 2129 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2130 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 2131 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2132 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 2125 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 2126 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 2127 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 2128 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 2129 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2130 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 2131 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2132 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 2133 | 2133 | INPUT_PORTS_END |
| 2134 | 2134 | |
| 2135 | 2135 | const char *const wpc_95_state::lamps_ttt[64] = { |
| r31373 | r31374 | |
| 2156 | 2156 | |
| 2157 | 2157 | static INPUT_PORTS_START( ttt ) |
| 2158 | 2158 | PORT_START("SW.0") |
| 2159 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2160 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2161 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 2162 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 2163 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2164 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 2165 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right post") | |
| 2166 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2159 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2160 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2161 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 2162 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 2163 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2164 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right sling") | |
| 2165 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right post") | |
| 2166 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2167 | 2167 | |
| 2168 | 2168 | PORT_START("SW.1") |
| 2169 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 2170 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 2171 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2172 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2173 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2174 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left post") | |
| 2175 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 2176 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2169 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 2170 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 2171 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2172 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2173 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2174 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left post") | |
| 2175 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left sling") | |
| 2176 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2177 | 2177 | |
| 2178 | 2178 | PORT_START("SW.2") |
| 2179 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"9\"") | |
| 2180 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"8\"") | |
| 2181 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"7\"") | |
| 2182 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"6\"") | |
| 2183 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"5\"") | |
| 2184 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Kicker opto") | |
| 2185 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2186 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2179 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"9\"") | |
| 2180 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"8\"") | |
| 2181 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"7\"") | |
| 2182 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"6\"") | |
| 2183 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"5\"") | |
| 2184 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Kicker opto") | |
| 2185 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2186 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2187 | 2187 | |
| 2188 | 2188 | PORT_START("SW.3") |
| 2189 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"4\"") | |
| 2190 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"3\"") | |
| 2191 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"2\"") | |
| 2192 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"1\"") | |
| 2193 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2194 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2195 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2196 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2189 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"4\"") | |
| 2190 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"3\"") | |
| 2191 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"2\"") | |
| 2192 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Hole \"1\"") | |
| 2193 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2194 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2195 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2196 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2197 | 2197 | |
| 2198 | 2198 | PORT_START("SW.4") |
| 2199 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ticket opto") | |
| 2200 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tickets low") | |
| 2201 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ticket test") | |
| 2202 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2203 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2204 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2205 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2206 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2199 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ticket opto") | |
| 2200 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Tickets low") | |
| 2201 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Ticket test") | |
| 2202 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2203 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2204 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2205 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2206 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2207 | 2207 | |
| 2208 | 2208 | PORT_START("SW.5") |
| 2209 | ||
| 2209 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2210 | 2210 | |
| 2211 | 2211 | PORT_START("SW.6") |
| 2212 | ||
| 2212 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2213 | 2213 | |
| 2214 | 2214 | PORT_START("SW.7") |
| 2215 | ||
| 2215 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 2216 | 2216 | |
| 2217 | 2217 | PORT_START("DOOR") |
| 2218 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 2219 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 2220 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 2221 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 2222 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 2223 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 2224 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 2225 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 2218 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 2219 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 2220 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 2221 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 2222 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 2223 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 2224 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 2225 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 2226 | 2226 | |
| 2227 | 2227 | PORT_START("DSW") |
| 2228 | 2228 | PORT_DIPNAME(0xff, 0xfc, "Country") PORT_DIPLOCATION("SW1:1,2,3,4,5,6,7,8") |
| r31373 | r31374 | |
| 2233 | 2233 | PORT_DIPSETTING( 0xec, "Spain") |
| 2234 | 2234 | |
| 2235 | 2235 | PORT_START("FLIPPERS") |
| 2236 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 2237 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 2238 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 2239 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 2240 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2241 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 2242 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2243 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 2236 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 2237 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 2238 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 2239 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 2240 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2241 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 2242 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 2243 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 2244 | 2244 | INPUT_PORTS_END |
| 2245 | 2245 | |
| 2246 | 2246 | static MACHINE_CONFIG_START( wpc_95, wpc_95_state ) |
| r31373 | r31374 | |
|---|---|---|
| 635 | 635 | MCFG_S3C2410_NAND_DATA_W_CB(WRITE8(ghosteo_state, s3c2410_nand_data_w)) |
| 636 | 636 | |
| 637 | 637 | // MCFG_DEVICE_ADD("nand", NAND, 0) |
| 638 | // MCFG_NAND_TYPE(NAND_CHIP_K9F5608U0D) | |
| 638 | // MCFG_NAND_TYPE(NAND_CHIP_K9F5608U0D) // or another variant with ID 0xEC 0x75 ? | |
| 639 | 639 | // MCFG_DEVICE_CONFIG(bballoon_nand_intf) |
| 640 | 640 | |
| 641 | 641 | // MCFG_I2CMEM_ADD("i2cmem", 0xA0, 0, 0x100, NULL) |
| r31373 | r31374 | |
|---|---|---|
| 343 | 343 | |
| 344 | 344 | MCFG_DEVICE_ADD("s2636_0", S2636, 0) |
| 345 | 345 | MCFG_S2636_WORKRAM_SIZE(0x100) |
| 346 | MCFG_S2636_OFFSETS(0, -16) | |
| 346 | MCFG_S2636_OFFSETS(0, -16) // -8, -16 | |
| 347 | 347 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 348 | 348 | |
| 349 | 349 | MCFG_DEVICE_ADD("s2636_1", S2636, 0) |
| 350 | 350 | MCFG_S2636_WORKRAM_SIZE(0x100) |
| 351 | MCFG_S2636_OFFSETS(0, -16) | |
| 351 | MCFG_S2636_OFFSETS(0, -16) // -9, -16 | |
| 352 | 352 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 353 | 353 | |
| 354 | 354 | MCFG_DEVICE_ADD("saa5050", SAA5050, 6000000) |
| r31373 | r31374 | |
|---|---|---|
| 1712 | 1712 | MCFG_DECO16IC_GFXDECODE("gfxdecode") |
| 1713 | 1713 | MCFG_DECO16IC_PALETTE("palette") |
| 1714 | 1714 | |
| 1715 | MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) | |
| 1715 | MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) // pf3 is in 8bpp mode, pf4 is not used | |
| 1716 | 1716 | MCFG_DECO16IC_SPLIT(0) |
| 1717 | 1717 | MCFG_DECO16IC_WIDTH12(0) |
| 1718 | 1718 | MCFG_DECO16IC_PF1_TRANS_MASK(0xff) |
| r31373 | r31374 | |
| 1777 | 1777 | { |
| 1778 | 1778 | bank = bank >> 4; |
| 1779 | 1779 | bank = (bank & 1) | ((bank & 4) >> 1) | ((bank & 2) << 1); |
| 1780 | ||
| 1780 | ||
| 1781 | 1781 | return bank * 0x1000; |
| 1782 | 1782 | } |
| 1783 | 1783 | |
| r31373 | r31374 | |
| 2129 | 2129 | |
| 2130 | 2130 | MCFG_DEVICE_ADD("tilegen2", DECO16IC, 0) |
| 2131 | 2131 | MCFG_DECO16IC_SPLIT(0) |
| 2132 | MCFG_DECO16IC_WIDTH12(0) | |
| 2132 | MCFG_DECO16IC_WIDTH12(0) // lockload definitely wants pf34 half width.. | |
| 2133 | 2133 | MCFG_DECO16IC_PF1_TRANS_MASK(0xff) |
| 2134 | 2134 | MCFG_DECO16IC_PF2_TRANS_MASK(0xff) |
| 2135 | 2135 | MCFG_DECO16IC_PF1_COL_BANK(0x04) |
| r31373 | r31374 | |
| 2146 | 2146 | MCFG_DEVICE_ADD("spritegen_zoom", DECO_ZOOMSPR, 0) |
| 2147 | 2147 | MCFG_DECO_ZOOMSPR_GFXDECODE("gfxdecode") |
| 2148 | 2148 | MCFG_DECO_ZOOMSPR_PALETTE("palette") |
| 2149 | ||
| 2149 | ||
| 2150 | 2150 | MCFG_DECO146_ADD("ioprot") |
| 2151 | 2151 | MCFG_DECO146_SET_SOUNDLATCH_CALLBACK(deco32_state, deco32_sound_cb) |
| 2152 | 2152 | MCFG_DECO146_SET_INTERFACE_SCRAMBLE_REVERSE |
| r31373 | r31374 | |
|---|---|---|
| 659 | 659 | |
| 660 | 660 | MCFG_DEVICE_ADD("fcppi0", I8255A, 0) |
| 661 | 661 | /* Init with 0x9a... A, B and high C as input |
| 662 | ||
| 662 | Serial Eprom connected to Port C */ | |
| 663 | 663 | MCFG_I8255_IN_PORTA_CB(IOPORT("SYSTEM")) |
| 664 | 664 | MCFG_I8255_IN_PORTB_CB(IOPORT("INPUT")) |
| 665 | 665 | MCFG_I8255_IN_PORTC_CB(READ8(fortecar_state, ppi0_portc_r)) |
| r31373 | r31374 | |
|---|---|---|
| 267 | 267 | ROM_LOAD32_WORD( "875b08.j19", 0x100002, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) ) |
| 268 | 268 | /* second half empty */ |
| 269 | 269 | |
| 270 | ROM_REGION( 0x200000, "k051960", 0 ) | |
| 270 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ | |
| 271 | 271 | ROM_LOAD32_WORD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) |
| 272 | 272 | ROM_LOAD32_WORD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) |
| 273 | 273 | ROM_LOAD32_WORD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) |
| r31373 | r31374 | |
| 299 | 299 | /* second half empty */ |
| 300 | 300 | |
| 301 | 301 | |
| 302 | ROM_REGION( 0x200000, "k051960", 0 ) | |
| 302 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ | |
| 303 | 303 | ROM_LOAD32_WORD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) |
| 304 | 304 | ROM_LOAD32_WORD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) |
| 305 | 305 | ROM_LOAD32_WORD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) |
| r31373 | r31374 | |
| 330 | 330 | ROM_LOAD32_WORD( "875b08.j19", 0x100002, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) ) |
| 331 | 331 | /* second half empty */ |
| 332 | 332 | |
| 333 | ROM_REGION( 0x200000, "k051960", 0 ) | |
| 333 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ | |
| 334 | 334 | ROM_LOAD32_WORD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) |
| 335 | 335 | ROM_LOAD32_WORD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) |
| 336 | 336 | ROM_LOAD32_WORD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) |
| r31373 | r31374 | |
| 361 | 361 | ROM_LOAD32_WORD( "875b08.j19", 0x100002, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) ) |
| 362 | 362 | /* second half empty */ |
| 363 | 363 | |
| 364 | ROM_REGION( 0x200000, "k051960", 0 ) | |
| 364 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ | |
| 365 | 365 | ROM_LOAD32_WORD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) |
| 366 | 366 | ROM_LOAD32_WORD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) |
| 367 | 367 | ROM_LOAD32_WORD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) |
| r31373 | r31374 | |
| 392 | 392 | ROM_LOAD32_WORD( "875b08.j19", 0x100002, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) ) |
| 393 | 393 | /* second half empty */ |
| 394 | 394 | |
| 395 | ROM_REGION( 0x200000, "k051960", 0 ) | |
| 395 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ | |
| 396 | 396 | ROM_LOAD32_WORD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) |
| 397 | 397 | ROM_LOAD32_WORD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) |
| 398 | 398 | ROM_LOAD32_WORD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) |
| r31373 | r31374 | |
| 423 | 423 | ROM_LOAD32_WORD( "875b08.j19", 0x100002, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) ) |
| 424 | 424 | /* second half empty */ |
| 425 | 425 | |
| 426 | ROM_REGION( 0x200000, "k051960", 0 ) | |
| 426 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ | |
| 427 | 427 | ROM_LOAD32_WORD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) |
| 428 | 428 | ROM_LOAD32_WORD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) |
| 429 | 429 | ROM_LOAD32_WORD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) |
| r31373 | r31374 | |
| 454 | 454 | ROM_LOAD32_WORD( "875b08.j19", 0x100002, 0x40000, CRC(f9387966) SHA1(470ecc4a5a3edd08d5e0ab10b0c590db1968fb0a) ) |
| 455 | 455 | /* second half empty */ |
| 456 | 456 | |
| 457 | ROM_REGION( 0x200000, "k051960", 0 ) | |
| 457 | ROM_REGION( 0x200000, "k051960", 0 ) /* sprites */ | |
| 458 | 458 | ROM_LOAD( "875b10.k08", 0x000000, 0x80000, CRC(0b1035b1) SHA1(db04020761386e79249762cd1540208375c38c7f) ) |
| 459 | 459 | ROM_LOAD( "875b09.k02", 0x000002, 0x80000, CRC(e76b3c19) SHA1(6838e07460b3eaaeb129208ad0696c8019bd63d9) ) |
| 460 | 460 | ROM_LOAD( "875b06.j08", 0x100000, 0x40000, CRC(081a0566) SHA1(3a4aa14178fe76a030224743c9e9cd974e08bd79) ) |
| r31373 | r31374 | |
|---|---|---|
| 186 | 186 | /* bits 0-1 = ROM bank */ |
| 187 | 187 | m_rombank = data & 0x03; |
| 188 | 188 | membank("bank1")->set_entry(m_rombank); |
| 189 | ||
| 189 | ||
| 190 | 190 | /* bits 3/4 = coin counters */ |
| 191 | 191 | coin_counter_w(machine(), 0, data & 0x08); |
| 192 | 192 | coin_counter_w(machine(), 1, data & 0x10); |
| 193 | ||
| 193 | ||
| 194 | 194 | /* bit 5 = select palette RAM or work RAM at 5800-5fff */ |
| 195 | 195 | m_palette_selected = ~data & 0x20; |
| 196 | ||
| 196 | ||
| 197 | 197 | /* bit 6 = enable char ROM reading through the video RAM */ |
| 198 | 198 | m_k052109->set_rmrd_line((data & 0x40) ? ASSERT_LINE : CLEAR_LINE); |
| 199 | ||
| 199 | ||
| 200 | 200 | /* bit 7 used but unknown */ |
| 201 | ||
| 201 | ||
| 202 | 202 | /* other bits unknown */ |
| 203 | ||
| 203 | ||
| 204 | 204 | if ((data & 0x84) != 0x80) |
| 205 | 205 | logerror("%04x: setlines %02x\n", machine().device("maincpu")->safe_pc(), data); |
| 206 | 206 | } |
| r31373 | r31374 | |
|---|---|---|
| 481 | 481 | ROM_LOAD32_BYTE( "891e09d", 0x40002, 0x10000, CRC(4e1335e6) SHA1(b892ab40a41978a89658ea2e7aabe9b073430b5d) ) |
| 482 | 482 | ROM_LOAD32_BYTE( "891e09b", 0x40003, 0x10000, CRC(b6f914fb) SHA1(e95f3e899c2ead15ef8a529dbc67e8f4a0f88bdd) ) |
| 483 | 483 | |
| 484 | ROM_REGION( 0x100000, "k051960", 0 ) | |
| 484 | ROM_REGION( 0x100000, "k051960", 0 ) /* sprites */ | |
| 485 | 485 | ROM_LOAD32_BYTE( "891e06e", 0x00000, 0x10000, CRC(0b04db1c) SHA1(0beae7bb8da49379915c0253ce03091eb71a58b5) ) |
| 486 | 486 | ROM_LOAD32_BYTE( "891e06a", 0x00001, 0x10000, CRC(5ee37327) SHA1(f63ddaf63af06ea5421b0361315940582ef57922) ) |
| 487 | 487 | ROM_LOAD32_BYTE( "891e05e", 0x00002, 0x10000, CRC(b356e729) SHA1(2cda591415b0f139fdb1f80c349d432bb0579d8e) ) |
| r31373 | r31374 | |
|---|---|---|
| 99 | 99 | void descramble_sound(); |
| 100 | 100 | DECO16IC_BANK_CB_MEMBER(bank_callback); |
| 101 | 101 | DECOSPR_PRIORITY_CB_MEMBER(pri_callback); |
| 102 | ||
| 102 | ||
| 103 | 103 | required_ioport m_io_in0; |
| 104 | 104 | required_ioport m_io_in1; |
| 105 | 105 | required_ioport m_io_in2; |
| r31373 | r31374 | |
|---|---|---|
| 271 | 271 | /* video hardware */ |
| 272 | 272 | MCFG_DEVICE_ADD( "tms9928a", TMS9928A, XTAL_10_738635MHz / 2 ) |
| 273 | 273 | MCFG_TMS9928A_VRAM_SIZE(0x4000) |
| 274 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(sg1000a_state, vdp_interrupt)) | |
| 275 | ||
| 274 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(sg1000a_state, vdp_interrupt)) | |
| 275 | ||
| 276 | 276 | MCFG_TMS9928A_SCREEN_ADD_NTSC( "screen" ) |
| 277 | 277 | MCFG_SCREEN_UPDATE_DEVICE( "tms9928a", tms9928a_device, screen_update ) |
| 278 | 278 |
| r31373 | r31374 | |
|---|---|---|
| 685 | 685 | MCFG_VOODOO_TMUMEM(4,4) |
| 686 | 686 | MCFG_VOODOO_SCREEN_TAG("screen") |
| 687 | 687 | MCFG_VOODOO_CPU_TAG("maincpu") |
| 688 | MCFG_VOODOO_VBLANK_CB(WRITELINE(savquest_state,vblank_assert)) | |
| 688 | MCFG_VOODOO_VBLANK_CB(WRITELINE(savquest_state,vblank_assert)) | |
| 689 | 689 | MACHINE_CONFIG_END |
| 690 | 690 | |
| 691 | 691 | ROM_START( savquest ) |
| r31373 | r31374 | |
|---|---|---|
| 3713 | 3713 | m_maincpu->sh2drc_add_fastram(0x06000000, 0x060d7fff, 0, &m_sysh1_workram_h[0]); |
| 3714 | 3714 | m_maincpu->sh2drc_add_fastram(0x060d9000, 0x060fffff, 0, &m_sysh1_workram_h[0xd9000/4]); |
| 3715 | 3715 | m_maincpu->sh2drc_add_fastram(0x00000000, 0x001fffff, 1, &m_rom[0]); |
| 3716 | m_maincpu->sh2drc_add_fastram(0x20000000, 0x201fffff, 1, &m_rom[0]); | |
| 3716 | m_maincpu->sh2drc_add_fastram(0x20000000, 0x201fffff, 1, &m_rom[0]); | |
| 3717 | 3717 | } |
| 3718 | 3718 | |
| 3719 | 3719 | GAME( 1995, coolridr, 0, coolridr, coolridr, coolridr_state, coolridr, ROT0, "Sega", "Cool Riders",GAME_IMPERFECT_SOUND) // region is set in test mode, this set is for Japan, USA and Export (all regions) |
| r31373 | r31374 | |
|---|---|---|
| 266 | 266 | WRITE16_MEMBER(proconn_state::serial_transmit) |
| 267 | 267 | { |
| 268 | 268 | //Don't like the look of this, should be a clock somewhere |
| 269 | ||
| 269 | ||
| 270 | 270 | // should probably be in the pios above |
| 271 | 271 | |
| 272 | 272 | if (offset == 0) |
| r31373 | r31374 | |
| 275 | 275 | { |
| 276 | 276 | m_vfd->data(data & (1<<i)); |
| 277 | 277 | m_vfd->sclk(1); |
| 278 | m_vfd->sclk(0); | |
| 278 | m_vfd->sclk(0); | |
| 279 | 279 | } |
| 280 | 280 | } |
| 281 | 281 | } |
| r31373 | r31374 | |
|---|---|---|
| 436 | 436 | |
| 437 | 437 | // video hardware |
| 438 | 438 | MCFG_DEVICE_ADD( TMS9118_TAG, TMS9118, XTAL_10_738635MHz / 2 ) |
| 439 | ||
| 439 | MCFG_TMS9928A_VRAM_SIZE(0x4000) | |
| 440 | 440 | MCFG_TMS9928A_OUT_INT_LINE_CB(INPUTLINE(M6809_TAG, INPUT_LINE_IRQ0)) |
| 441 | 441 | MCFG_TMS9928A_SCREEN_ADD_NTSC( SCREEN_TAG ) |
| 442 | 442 | MCFG_SCREEN_UPDATE_DEVICE( TMS9118_TAG, tms9118_device, screen_update ) |
| r31373 | r31374 | |
|---|---|---|
| 69 | 69 | |
| 70 | 70 | |
| 71 | 71 | TODO: I/O is generally a nightmare, probably needs a rebuild at the address level. |
| 72 | Inputs need a sort out. | |
| 73 | Some games require dongles for security, need to figure this out. | |
| 72 | Inputs need a sort out. | |
| 73 | Some games require dongles for security, need to figure this out. | |
| 74 | 74 | ******************************************************************************************/ |
| 75 | 75 | #include "emu.h" |
| 76 | 76 | #include "includes/maygay1b.h" |
| r31373 | r31374 | |
| 469 | 469 | WRITE8_MEMBER( maygay1b_state::lamp_data_w ) |
| 470 | 470 | { |
| 471 | 471 | //The two A/B ports are merged back into one, to make one row of 8 lamps. |
| 472 | ||
| 472 | ||
| 473 | 473 | if (m_old_lamp_strobe != m_lamp_strobe) |
| 474 | 474 | { |
| 475 | 475 | // Because of the nature of the lamping circuit, there is an element of persistance |
| r31373 | r31374 | |
| 482 | 482 | } |
| 483 | 483 | m_old_lamp_strobe = m_lamp_strobe; |
| 484 | 484 | } |
| 485 | ||
| 485 | ||
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | READ8_MEMBER( maygay1b_state::kbd_r ) |
| r31373 | r31374 | |
| 494 | 494 | WRITE8_MEMBER( maygay1b_state::lamp_data_2_w ) |
| 495 | 495 | { |
| 496 | 496 | //The two A/B ports are merged back into one, to make one row of 8 lamps. |
| 497 | ||
| 497 | ||
| 498 | 498 | if (m_old_lamp_strobe2 != m_lamp_strobe2) |
| 499 | 499 | { |
| 500 | 500 | // Because of the nature of the lamping circuit, there is an element of persistance |
| r31373 | r31374 | |
| 507 | 507 | } |
| 508 | 508 | m_old_lamp_strobe2 = m_lamp_strobe2; |
| 509 | 509 | } |
| 510 | ||
| 510 | ||
| 511 | 511 | } |
| 512 | 512 | |
| 513 | 513 | // machine driver for maygay m1 board ///////////////////////////////// |
| r31373 | r31374 | |
| 541 | 541 | |
| 542 | 542 | MCFG_TIMER_DRIVER_ADD_PERIODIC("nmitimer", maygay1b_state, maygay1b_nmitimer_callback, attotime::from_hz(75)) // freq? |
| 543 | 543 | MCFG_DEVICE_ADD("i8279", I8279, M1_MASTER_CLOCK/4) // unknown clock |
| 544 | MCFG_I8279_OUT_SL_CB(WRITE8(maygay1b_state, scanlines_w)) // scan SL lines | |
| 545 | MCFG_I8279_OUT_DISP_CB(WRITE8(maygay1b_state, lamp_data_w)) // display A&B | |
| 546 | MCFG_I8279_IN_RL_CB(READ8(maygay1b_state, kbd_r)) // kbd RL lines | |
| 547 | MCFG_DEVICE_ADD("i8279_2", I8279, M1_MASTER_CLOCK/4) // unknown clock | |
| 548 | MCFG_I8279_OUT_DISP_CB(WRITE8(maygay1b_state, lamp_data_2_w)) // display A&B | |
| 549 | ||
| 544 | MCFG_I8279_OUT_SL_CB(WRITE8(maygay1b_state, scanlines_w)) // scan SL lines | |
| 545 | MCFG_I8279_OUT_DISP_CB(WRITE8(maygay1b_state, lamp_data_w)) // display A&B | |
| 546 | MCFG_I8279_IN_RL_CB(READ8(maygay1b_state, kbd_r)) // kbd RL lines | |
| 547 | MCFG_DEVICE_ADD("i8279_2", I8279, M1_MASTER_CLOCK/4) // unknown clock | |
| 548 | MCFG_I8279_OUT_DISP_CB(WRITE8(maygay1b_state, lamp_data_2_w)) // display A&B | |
| 549 | ||
| 550 | 550 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 551 | 551 | |
| 552 | 552 | MCFG_DEFAULT_LAYOUT(layout_maygay1b) |
| r31373 | r31374 | |
|---|---|---|
| 23 | 23 | MCFG_CPU_PROGRAM_MAP(sam_map) |
| 24 | 24 | MACHINE_CONFIG_END |
| 25 | 25 | |
| 26 | #define ROM_LOAD_BOOT_EPROM | |
| 26 | #define ROM_LOAD_BOOT_EPROM \ | |
| 27 | 27 | ROM_REGION( 0x100000, "boot", ROMREGION_ERASEFF ) \ |
| 28 | 28 | ROM_LOAD( "boot_eprom_01_02.bin", 0x0000, 0x100000, CRC(92c93cba) SHA1(aed7ba2f988df8c95e2ad08f70409152d5caa49a)) \ |
| 29 | 29 | ROM_LOAD( "boot_eprom_01_06.bin", 0x0000, 0x0e8ac8, CRC(fe7bcece) SHA1(775590bbd52c24950db86cc231566ba3780030d8)) \ |
| 30 | 30 | ROM_LOAD( "boot_eprom_02_10.bin", 0x0000, 0x0f0304, CRC(0f3fd4a4) SHA1(115d0b73c40fcdb2d202a0a9065472d216ca89e0)) \ |
| 31 | 31 | ROM_LOAD( "boot_eprom_02_30.bin", 0x0000, 0x0f0624, CRC(a4258c49) SHA1(d865edf7d1c6d2c922980dd192222dc24bc092a0)) \ |
| 32 | ROM_LOAD( "boot_eprom_03_10.bin", 0x0000, 0x100000, CRC(de017f82) SHA1(e4a9a818fa3f1754374cd00b52b8a087d6c442a9)) \ | |
| 33 | ||
| 32 | ROM_LOAD( "boot_eprom_03_10.bin", 0x0000, 0x100000, CRC(de017f82) SHA1(e4a9a818fa3f1754374cd00b52b8a087d6c442a9)) | |
| 34 | 33 | /*------------------------------------------------------------------- |
| 35 | 34 | / 24 |
| 36 | 35 | /-------------------------------------------------------------------*/ |
| r31373 | r31374 | |
| 1065 | 1064 | ROM_LOAD( "wpt1400l.bin", 0x0000, 0x1c7072c, CRC(00eff09c) SHA1(847203d4d2ce8d11a5403374f2d5b6dda8458bc9)) |
| 1066 | 1065 | ROM_END |
| 1067 | 1066 | |
| 1068 | GAME( 200?, 24_130 ,24_150, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1069 | GAME( 200?, 24_140 ,24_150, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1070 | GAME( 200?, 24_144 ,24_150, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.44", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1071 | GAME( 200?, 24_150 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.50", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1072 | GAME( 200?, bdk_130 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v1.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1073 | GAME( 200?, bdk_150 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v1.50", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1074 | GAME( 200?, bdk_160 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v1.60", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1075 | GAME( 200?, bdk_200 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1076 | GAME( 200?, bdk_210 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1077 | GAME( 200?, bdk_220 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.20", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1078 | GAME( 200?, bdk_290 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.90", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1079 | GAME( 200?, bdk_294 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.94", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1067 | GAME( 200?, 24_130 ,24_150, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1068 | GAME( 200?, 24_140 ,24_150, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1069 | GAME( 200?, 24_144 ,24_150, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.44", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1070 | GAME( 200?, 24_150 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "24 v1.50", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1071 | GAME( 200?, bdk_130 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v1.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1072 | GAME( 200?, bdk_150 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v1.50", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1073 | GAME( 200?, bdk_160 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v1.60", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1074 | GAME( 200?, bdk_200 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1075 | GAME( 200?, bdk_210 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1076 | GAME( 200?, bdk_220 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.20", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1077 | GAME( 200?, bdk_290 ,bdk_294, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.90", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1078 | GAME( 200?, bdk_294 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Batman - The Dark Knight v2.94", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1080 | 1079 | // Missing version 1.30 (26-Jan-2010), 1.20 (25-Jan-2010), 1.10 (21-Jan-2010), 1.00 (15-Jan-2010) |
| 1081 | GAME( 200?, bbh_140 ,bbh_160, sam, sam, driver_device, 0, ROT0, "Stern", "Big Buck Hunter Pro v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1082 | GAME( 200?, bbh_150 ,bbh_160, sam, sam, driver_device, 0, ROT0, "Stern", "Big Buck Hunter Pro v1.50", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1083 | GAME( 200?, bbh_160 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Big Buck Hunter Pro v1.60", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1084 | GAME( 200?, csi_102 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v1.02", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1085 | GAME( 200?, csi_103 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v1.03", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1086 | GAME( 200?, csi_104 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v1.04", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1087 | GAME( 200?, csi_200 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1088 | GAME( 200?, csi_210 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1089 | GAME( 200?, csi_230 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1090 | GAME( 200?, csi_240 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1091 | GAME( 200?, fg_1000af ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1092 | GAME( 200?, fg_1000ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1093 | GAME( 200?, fg_1000ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1094 | GAME( 200?, fg_1000al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1095 | GAME( 200?, fg_110af ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1096 | GAME( 200?, fg_110ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1097 | GAME( 200?, fg_110ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1098 | GAME( 200?, fg_110al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1099 | GAME( 200?, fg_120af ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1100 | GAME( 200?, fg_120ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1101 | GAME( 200?, fg_120ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1102 | GAME( 200?, fg_120al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1103 | GAME( 200?, fg_300ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v3.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1104 | GAME( 200?, fg_400a ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v4.0 (English)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1105 | GAME( 200?, fg_400ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v4.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1106 | GAME( 200?, fg_700af ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v7.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1107 | GAME( 200?, fg_700al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v7.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1108 | GAME( 200?, fg_800al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v8.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1109 | GAME( 200?, im2_100 ,im2_140, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1110 | GAME( 200?, im2_110 ,im2_140, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1111 | GAME( 200?, im2_120 ,im2_140, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.20", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1112 | GAME( 200?, im2_140 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1113 | GAME( 200?, indy_113a ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1114 | GAME( 200?, indy_113f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1115 | GAME( 200?, indy_113g ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1116 | GAME( 200?, indy_113i ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1117 | GAME( 200?, indy_113l ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1118 | GAME( 200?, indy_114a ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1119 | GAME( 200?, indy_114f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1120 | GAME( 200?, indy_114g ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1121 | GAME( 200?, indy_114i ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1122 | GAME( 200?, indy_114l ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1123 | GAME( 200?, indy_116a ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1124 | GAME( 200?, indy_116f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1125 | GAME( 200?, indy_116g ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1126 | GAME( 200?, indy_116i ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1127 | GAME( 200?, indy_116l ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1128 | GAME( 200?, indy_210 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1129 | GAME( 200?, indy_210f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v2.10 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1080 | GAME( 200?, bbh_140 ,bbh_160, sam, sam, driver_device, 0, ROT0, "Stern", "Big Buck Hunter Pro v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1081 | GAME( 200?, bbh_150 ,bbh_160, sam, sam, driver_device, 0, ROT0, "Stern", "Big Buck Hunter Pro v1.50", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1082 | GAME( 200?, bbh_160 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Big Buck Hunter Pro v1.60", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1083 | GAME( 200?, csi_102 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v1.02", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1084 | GAME( 200?, csi_103 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v1.03", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1085 | GAME( 200?, csi_104 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v1.04", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1086 | GAME( 200?, csi_200 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1087 | GAME( 200?, csi_210 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1088 | GAME( 200?, csi_230 ,csi_240, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1089 | GAME( 200?, csi_240 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "C.S.I. v2.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1090 | GAME( 200?, fg_1000af ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1091 | GAME( 200?, fg_1000ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1092 | GAME( 200?, fg_1000ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1093 | GAME( 200?, fg_1000al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v10.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1094 | GAME( 200?, fg_110af ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1095 | GAME( 200?, fg_110ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1096 | GAME( 200?, fg_110ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1097 | GAME( 200?, fg_110al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v11.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1098 | GAME( 200?, fg_120af ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1099 | GAME( 200?, fg_120ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1100 | GAME( 200?, fg_120ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1101 | GAME( 200?, fg_120al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v12.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1102 | GAME( 200?, fg_300ai ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v3.0 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1103 | GAME( 200?, fg_400a ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v4.0 (English)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1104 | GAME( 200?, fg_400ag ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v4.0 (English,German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1105 | GAME( 200?, fg_700af ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v7.0 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1106 | GAME( 200?, fg_700al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v7.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1107 | GAME( 200?, fg_800al ,fg_120af, sam, sam, driver_device, 0, ROT0, "Stern", "Family Guy v8.0 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1108 | GAME( 200?, im2_100 ,im2_140, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1109 | GAME( 200?, im2_110 ,im2_140, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1110 | GAME( 200?, im2_120 ,im2_140, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.20", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1111 | GAME( 200?, im2_140 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Iron Man 2 v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1112 | GAME( 200?, indy_113a ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1113 | GAME( 200?, indy_113f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1114 | GAME( 200?, indy_113g ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1115 | GAME( 200?, indy_113i ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1116 | GAME( 200?, indy_113l ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.13 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1117 | GAME( 200?, indy_114a ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1118 | GAME( 200?, indy_114f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1119 | GAME( 200?, indy_114g ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1120 | GAME( 200?, indy_114i ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1121 | GAME( 200?, indy_114l ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.14 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1122 | GAME( 200?, indy_116a ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1123 | GAME( 200?, indy_116f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1124 | GAME( 200?, indy_116g ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1125 | GAME( 200?, indy_116i ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1126 | GAME( 200?, indy_116l ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v1.16 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1127 | GAME( 200?, indy_210 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1128 | GAME( 200?, indy_210f ,indy_210, sam, sam, driver_device, 0, ROT0, "Stern", "Indiana Jones v2.10 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1130 | 1129 | // Missing versions 4.00 (21-May-2009), 3.00 (20-May-2009), 2.00 (19-May-2009) and 1.00 (14-May-2009) of NBA |
| 1131 | GAME( 200?, nba_500 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v5.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1132 | GAME( 200?, nba_600 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v6.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1133 | GAME( 200?, nba_700 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v7.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1134 | GAME( 200?, nba_801 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v8.01", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1135 | GAME( 200?, nba_802 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v8.02", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1136 | GAME( 200?, potc_110af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.10 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1137 | GAME( 200?, potc_110ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.10 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1138 | GAME( 200?, potc_110gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.10 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1130 | GAME( 200?, nba_500 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v5.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1131 | GAME( 200?, nba_600 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v6.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1132 | GAME( 200?, nba_700 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v7.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1133 | GAME( 200?, nba_801 ,nba_802, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v8.01", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1134 | GAME( 200?, nba_802 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "NBA v8.02", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1135 | GAME( 200?, potc_110af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.10 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1136 | GAME( 200?, potc_110ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.10 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1137 | GAME( 200?, potc_110gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.10 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1139 | 1138 | // Missing version 1.11 for other languages ??? August 17, 2006 |
| 1140 | GAME( 200?, potc_111as ,potc_600, | |
| 1139 | GAME( 200?, potc_111as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.11 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1141 | 1140 | // Missing version 1.12 August 24, 2006 |
| 1142 | GAME( 200?, potc_113af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1143 | GAME( 200?, potc_113ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1144 | GAME( 200?, potc_113as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1145 | GAME( 200?, potc_113gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1141 | GAME( 200?, potc_113af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1142 | GAME( 200?, potc_113ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1143 | GAME( 200?, potc_113as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1144 | GAME( 200?, potc_113gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.13 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1146 | 1145 | // Missing version 1.14 October 11, 2006 |
| 1147 | GAME( 200?, potc_115af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1148 | GAME( 200?, potc_115ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1149 | GAME( 200?, potc_115as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1150 | GAME( 200?, potc_115gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1146 | GAME( 200?, potc_115af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1147 | GAME( 200?, potc_115ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1148 | GAME( 200?, potc_115as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1149 | GAME( 200?, potc_115gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v1.15 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1151 | 1150 | // Missing version 2.00 April 11, 2007 |
| 1152 | GAME( 200?, potc_300af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1153 | GAME( 200?, potc_300ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1154 | GAME( 200?, potc_300as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1155 | GAME( 200?, potc_300gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1156 | GAME( 200?, potc_400af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1157 | GAME( 200?, potc_400ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1158 | GAME( 200?, potc_400as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1159 | GAME( 200?, potc_400gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1151 | GAME( 200?, potc_300af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1152 | GAME( 200?, potc_300ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1153 | GAME( 200?, potc_300as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1154 | GAME( 200?, potc_300gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v3.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1155 | GAME( 200?, potc_400af ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1156 | GAME( 200?, potc_400ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1157 | GAME( 200?, potc_400as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1158 | GAME( 200?, potc_400gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v4.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1160 | 1159 | // Missing version 5.00 September 27, 2007 |
| 1161 | GAME( 200?, potc_600 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1162 | GAME( 200?, potc_600ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1163 | GAME( 200?, potc_600as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1164 | GAME( 200?, potc_600gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1165 | GAME( 200?, sh_141 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Shrek v1.41", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1166 | GAME( 200?, skc_090 ,skc_105, sam, sam, driver_device, 0, ROT0, "Stern", "Simpsons Kooky Carnival (Redemption) v0.90 New Jersey", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1160 | GAME( 200?, potc_600 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1161 | GAME( 200?, potc_600ai ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1162 | GAME( 200?, potc_600as ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1163 | GAME( 200?, potc_600gf ,potc_600, sam, sam, driver_device, 0, ROT0, "Stern", "Pirates of the Caribbean v6.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1164 | GAME( 200?, sh_141 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Shrek v1.41", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1165 | GAME( 200?, skc_090 ,skc_105, sam, sam, driver_device, 0, ROT0, "Stern", "Simpsons Kooky Carnival (Redemption) v0.90 New Jersey", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1167 | 1166 | // Missing version 1.00 |
| 1168 | 1167 | // Missing version 1.01 April 10, 2006 |
| 1169 | 1168 | // Missing version 1.02 April 12, 2006 |
| 1170 | GAME( 200?, skc_103 ,skc_105, | |
| 1169 | GAME( 200?, skc_103 ,skc_105, sam, sam, driver_device, 0, ROT0, "Stern", "Simpsons Kooky Carnival (Redemption) v1.03", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1171 | 1170 | // Missing version 1.04 May 12, 2006 |
| 1172 | GAME( 200?, skc_105 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Simpsons Kooky Carnival (Redemption) v1.05", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1173 | GAME( 200?, sman_130ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1174 | GAME( 200?, sman_130ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1175 | GAME( 200?, sman_130es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1176 | GAME( 200?, sman_130gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1177 | GAME( 200?, sman_140e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1178 | GAME( 200?, sman_140ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1179 | GAME( 200?, sman_140ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1180 | GAME( 200?, sman_140es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1181 | GAME( 200?, sman_140gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1182 | GAME( 200?, sman_142e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.42", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1183 | GAME( 200?, sman_160e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1184 | GAME( 200?, sman_160ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1185 | GAME( 200?, sman_160ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1186 | GAME( 200?, sman_160es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1187 | GAME( 200?, sman_160gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1188 | GAME( 200?, sman_170e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1189 | GAME( 200?, sman_170ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1190 | GAME( 200?, sman_170ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1191 | GAME( 200?, sman_170es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1192 | GAME( 200?, sman_170gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1193 | GAME( 200?, sman_190e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1194 | GAME( 200?, sman_190ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1195 | GAME( 200?, sman_190ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1196 | GAME( 200?, sman_190es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1197 | GAME( 200?, sman_190gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1198 | GAME( 200?, sman_192e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1199 | GAME( 200?, sman_192ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1200 | GAME( 200?, sman_192ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1201 | GAME( 200?, sman_192es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1202 | GAME( 200?, sman_192gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1203 | GAME( 200?, sman_200e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1204 | GAME( 200?, sman_210e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1205 | GAME( 200?, sman_210f ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1206 | GAME( 200?, sman_210ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1207 | GAME( 200?, sman_210es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1208 | GAME( 200?, sman_210gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1209 | GAME( 200?, sman_220e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.20", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1210 | GAME( 200?, sman_230e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1211 | GAME( 200?, sman_240 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1212 | GAME( 200?, wof_100a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v1.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1213 | GAME( 200?, wof_200a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1214 | GAME( 200?, wof_200f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1215 | GAME( 200?, wof_200g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1216 | GAME( 200?, wof_200i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1217 | GAME( 200?, wof_300a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1218 | GAME( 200?, wof_300f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1219 | GAME( 200?, wof_300g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1220 | GAME( 200?, wof_300i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1221 | GAME( 200?, wof_300l ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1222 | GAME( 200?, wof_400a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1223 | GAME( 200?, wof_400f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1224 | GAME( 200?, wof_400g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1225 | GAME( 200?, wof_400i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1226 | GAME( 200?, wof_400l ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1227 | GAME( 200?, wof_500a ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1228 | GAME( 200?, wof_500f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1229 | GAME( 200?, wof_500g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1230 | GAME( 200?, wof_500i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1231 | GAME( 200?, wof_500l ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1232 | GAME( 200?, wpt_103a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.03", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1233 | GAME( 200?, wpt_105a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.05", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1234 | GAME( 200?, wpt_106a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1235 | GAME( 200?, wpt_106f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1236 | GAME( 200?, wpt_106g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1237 | GAME( 200?, wpt_106i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1238 | GAME( 200?, wpt_106l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1171 | GAME( 200?, skc_105 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Simpsons Kooky Carnival (Redemption) v1.05", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1172 | GAME( 200?, sman_130ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1173 | GAME( 200?, sman_130ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1174 | GAME( 200?, sman_130es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1175 | GAME( 200?, sman_130gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.30 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1176 | GAME( 200?, sman_140e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1177 | GAME( 200?, sman_140ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1178 | GAME( 200?, sman_140ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1179 | GAME( 200?, sman_140es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1180 | GAME( 200?, sman_140gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.40 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1181 | GAME( 200?, sman_142e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.42", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1182 | GAME( 200?, sman_160e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1183 | GAME( 200?, sman_160ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1184 | GAME( 200?, sman_160ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1185 | GAME( 200?, sman_160es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1186 | GAME( 200?, sman_160gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.60 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1187 | GAME( 200?, sman_170e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1188 | GAME( 200?, sman_170ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1189 | GAME( 200?, sman_170ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1190 | GAME( 200?, sman_170es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1191 | GAME( 200?, sman_170gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.70 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1192 | GAME( 200?, sman_190e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1193 | GAME( 200?, sman_190ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1194 | GAME( 200?, sman_190ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1195 | GAME( 200?, sman_190es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1196 | GAME( 200?, sman_190gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.90 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1197 | GAME( 200?, sman_192e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1198 | GAME( 200?, sman_192ef ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1199 | GAME( 200?, sman_192ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1200 | GAME( 200?, sman_192es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1201 | GAME( 200?, sman_192gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v1.92 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1202 | GAME( 200?, sman_200e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1203 | GAME( 200?, sman_210e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1204 | GAME( 200?, sman_210f ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1205 | GAME( 200?, sman_210ei ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1206 | GAME( 200?, sman_210es ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1207 | GAME( 200?, sman_210gf ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.10 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1208 | GAME( 200?, sman_220e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.20", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1209 | GAME( 200?, sman_230e ,sman_240, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.30", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1210 | GAME( 200?, sman_240 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Spider-Man v2.40", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1211 | GAME( 200?, wof_100a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v1.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1212 | GAME( 200?, wof_200a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1213 | GAME( 200?, wof_200f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1214 | GAME( 200?, wof_200g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1215 | GAME( 200?, wof_200i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v2.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1216 | GAME( 200?, wof_300a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1217 | GAME( 200?, wof_300f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1218 | GAME( 200?, wof_300g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1219 | GAME( 200?, wof_300i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1220 | GAME( 200?, wof_300l ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v3.0 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1221 | GAME( 200?, wof_400a ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1222 | GAME( 200?, wof_400f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1223 | GAME( 200?, wof_400g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1224 | GAME( 200?, wof_400i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1225 | GAME( 200?, wof_400l ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v4.0 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1226 | GAME( 200?, wof_500a ,0, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1227 | GAME( 200?, wof_500f ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1228 | GAME( 200?, wof_500g ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1229 | GAME( 200?, wof_500i ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1230 | GAME( 200?, wof_500l ,wof_500a, sam, sam, driver_device, 0, ROT0, "Stern", "Wheel of Fortune v5.0 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1231 | GAME( 200?, wpt_103a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.03", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1232 | GAME( 200?, wpt_105a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.05", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1233 | GAME( 200?, wpt_106a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1234 | GAME( 200?, wpt_106f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1235 | GAME( 200?, wpt_106g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1236 | GAME( 200?, wpt_106i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1237 | GAME( 200?, wpt_106l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.06 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1239 | 1238 | // Missing version 1.07 should be 5 different files per language |
| 1240 | GAME( 200?, wpt_108a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1241 | GAME( 200?, wpt_108f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1242 | GAME( 200?, wpt_108g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1243 | GAME( 200?, wpt_108i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1244 | GAME( 200?, wpt_108l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1245 | GAME( 200?, wpt_109a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1246 | GAME( 200?, wpt_109f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1247 | GAME( 200?, wpt_109f2 ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (French)(alt)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1248 | GAME( 200?, wpt_109g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1249 | GAME( 200?, wpt_109i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1250 | GAME( 200?, wpt_109l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1251 | GAME( 200?, wpt_111a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1252 | GAME( 200?, wpt_111af ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1253 | GAME( 200?, wpt_111ai ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1254 | GAME( 200?, wpt_111al ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1255 | GAME( 200?, wpt_111f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1256 | GAME( 200?, wpt_111g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1257 | GAME( 200?, wpt_111gf ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1258 | GAME( 200?, wpt_111i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1259 | GAME( 200?, wpt_111l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1260 | GAME( 200?, wpt_112a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1261 | GAME( 200?, wpt_112af ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1262 | GAME( 200?, wpt_112ai ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1263 | GAME( 200?, wpt_112al ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1264 | GAME( 200?, wpt_112f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1265 | GAME( 200?, wpt_112g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1266 | GAME( 200?, wpt_112gf ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1267 | GAME( 200?, wpt_112i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1268 | GAME( 200?, wpt_112l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1269 | GAME( 200?, wpt_1400 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1270 | GAME( 200?, wpt_1400af ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1271 | GAME( 200?, wpt_1400ai ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1272 | GAME( 200?, wpt_1400al ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1273 | GAME( 200?, wpt_1400f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1274 | GAME( 200?, wpt_1400g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1275 | GAME( 200?, wpt_1400gf ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1276 | GAME( 200?, wpt_1400i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1277 | GAME( 200?, wpt_1400l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1239 | GAME( 200?, wpt_108a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1240 | GAME( 200?, wpt_108f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1241 | GAME( 200?, wpt_108g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1242 | GAME( 200?, wpt_108i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1243 | GAME( 200?, wpt_108l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.08 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1244 | GAME( 200?, wpt_109a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1245 | GAME( 200?, wpt_109f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1246 | GAME( 200?, wpt_109f2 ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (French)(alt)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1247 | GAME( 200?, wpt_109g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1248 | GAME( 200?, wpt_109i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1249 | GAME( 200?, wpt_109l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.09 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1250 | GAME( 200?, wpt_111a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1251 | GAME( 200?, wpt_111af ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1252 | GAME( 200?, wpt_111ai ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1253 | GAME( 200?, wpt_111al ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1254 | GAME( 200?, wpt_111f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1255 | GAME( 200?, wpt_111g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1256 | GAME( 200?, wpt_111gf ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1257 | GAME( 200?, wpt_111i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1258 | GAME( 200?, wpt_111l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.11 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1259 | GAME( 200?, wpt_112a ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1260 | GAME( 200?, wpt_112af ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1261 | GAME( 200?, wpt_112ai ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1262 | GAME( 200?, wpt_112al ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1263 | GAME( 200?, wpt_112f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1264 | GAME( 200?, wpt_112g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1265 | GAME( 200?, wpt_112gf ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1266 | GAME( 200?, wpt_112i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1267 | GAME( 200?, wpt_112l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v1.12 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1268 | GAME( 200?, wpt_1400 ,0, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1269 | GAME( 200?, wpt_1400af ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (English,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1270 | GAME( 200?, wpt_1400ai ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (English,Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1271 | GAME( 200?, wpt_1400al ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (English,Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1272 | GAME( 200?, wpt_1400f ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1273 | GAME( 200?, wpt_1400g ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (German)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1274 | GAME( 200?, wpt_1400gf ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (German,French)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1275 | GAME( 200?, wpt_1400i ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (Italian)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) | |
| 1276 | GAME( 200?, wpt_1400l ,wpt_1400, sam, sam, driver_device, 0, ROT0, "Stern", "World Poker Tour v14.00 (Spanish)", GAME_NOT_WORKING | GAME_NO_SOUND | GAME_MECHANICAL) |
| r31373 | r31374 | |
|---|---|---|
| 394 | 394 | MCFG_PALETTE_ADD("palette", 4096) |
| 395 | 395 | MCFG_PALETTE_FORMAT(xBBBBBGGGGGRRRRR) |
| 396 | 396 | MCFG_PALETTE_MEMBITS(16) |
| 397 | ||
| 397 | ||
| 398 | 398 | MCFG_GFXDECODE_ADD("gfxdecode", "palette", simpl156) |
| 399 | 399 | |
| 400 | 400 | MCFG_DEVICE_ADD("tilegen1", DECO16IC, 0) |
| r31373 | r31374 | |
|---|---|---|
| 7 | 7 | Hardware and protection reverse-engineering and general assistance by ElSemi. |
| 8 | 8 | MAME driver by R. Belmont, Olivier Galibert, and ElSemi. |
| 9 | 9 | |
| 10 | TODO (updated as for April 2014): | |
| 11 | - all Model 2B games: FIFO comms looks way wrong, and 3d is mostly missing/incomplete. Games also tends to stalls at some point, culprit might be when i960 tries | |
| 12 | to use a burst type opcode read; | |
| 13 | - Inputs needs device-ification and clean-ups; | |
| 14 | - Sound comms actually passes thru a 8251-compatible device, hook it up; | |
| 15 | - daytona: runs at half speed in gameplay; | |
| 16 | - desert: several 3d bugs, presumably down to FIFO; | |
| 17 | - dynamcop: stalls at stage select screen; | |
| 18 | - fvipers: enables timers, but then irq register is empty, hence it crashes with an "interrupt halt" at POST (regression); | |
| 19 | - lastbrnx: uses external DMA port 0 for uploading SHARC program, hook-up might not be 100% right; | |
| 20 | - lastbrnx: uses a shitload of unsupported SHARC opcodes (compute_fmul_avg, shift operation 0x11, ALU operation 0x89 (compute_favg)); | |
| 21 | - lastbrnx: eventually crashes in attract mode, geo_parse_nn_s() is the culprit apparently; | |
| 22 | - manxtt: missing 3d; | |
| 23 | - motoraid: stalls after course select; | |
| 24 | - pltkidsa: after few secs of gameplay, background 3d disappears and everything reports a collision against the player; | |
| 25 | - skytargt: MAME hardlocks after disclaimer screen; | |
| 26 | - srallyc: opponent cars flickers like wild; | |
| 27 | - vcop: lightgun input is offsetted; | |
| 28 | - vcop: sound dies at enter initial screen (i.e. after played the game once); | |
| 29 | - vcop: tilemap priority bug at stage select screen; | |
| 30 | - vf2: stalls after disclaimer screen; | |
| 31 | - vstriker: countdown in team select goes way too fast ... | |
| 32 | - vstriker: ... meanwhile gameplay is way too slow!? | |
| 33 | - zeroguna: stalls after some seconds of gameplay; | |
| 10 | TODO (updated as for April 2014): | |
| 11 | - all Model 2B games: FIFO comms looks way wrong, and 3d is mostly missing/incomplete. Games also tends to stalls at some point, culprit might be when i960 tries | |
| 12 | to use a burst type opcode read; | |
| 13 | - Inputs needs device-ification and clean-ups; | |
| 14 | - Sound comms actually passes thru a 8251-compatible device, hook it up; | |
| 15 | - daytona: runs at half speed in gameplay; | |
| 16 | - desert: several 3d bugs, presumably down to FIFO; | |
| 17 | - dynamcop: stalls at stage select screen; | |
| 18 | - fvipers: enables timers, but then irq register is empty, hence it crashes with an "interrupt halt" at POST (regression); | |
| 19 | - lastbrnx: uses external DMA port 0 for uploading SHARC program, hook-up might not be 100% right; | |
| 20 | - lastbrnx: uses a shitload of unsupported SHARC opcodes (compute_fmul_avg, shift operation 0x11, ALU operation 0x89 (compute_favg)); | |
| 21 | - lastbrnx: eventually crashes in attract mode, geo_parse_nn_s() is the culprit apparently; | |
| 22 | - manxtt: missing 3d; | |
| 23 | - motoraid: stalls after course select; | |
| 24 | - pltkidsa: after few secs of gameplay, background 3d disappears and everything reports a collision against the player; | |
| 25 | - skytargt: MAME hardlocks after disclaimer screen; | |
| 26 | - srallyc: opponent cars flickers like wild; | |
| 27 | - vcop: lightgun input is offsetted; | |
| 28 | - vcop: sound dies at enter initial screen (i.e. after played the game once); | |
| 29 | - vcop: tilemap priority bug at stage select screen; | |
| 30 | - vf2: stalls after disclaimer screen; | |
| 31 | - vstriker: countdown in team select goes way too fast ... | |
| 32 | - vstriker: ... meanwhile gameplay is way too slow!? | |
| 33 | - zeroguna: stalls after some seconds of gameplay; | |
| 34 | 34 | |
| 35 | 35 | OK (controls may be wrong/missing/incomplete) |
| 36 | 36 | -- |
| r31373 | r31374 | |
| 548 | 548 | return iptval; |
| 549 | 549 | } |
| 550 | 550 | |
| 551 | /* PORT_DIPSETTING( 0x00, "0" ) // 0: neutral | |
| 552 | PORT_DIPSETTING( 0x10, "1" ) // 2nd gear | |
| 553 | PORT_DIPSETTING( 0x20, "2" ) // 1st gear | |
| 554 | PORT_DIPSETTING( 0x30, "3" ) | |
| 555 | PORT_DIPSETTING( 0x40, "4" ) | |
| 556 | PORT_DIPSETTING( 0x50, "5" ) // 4th gear | |
| 557 | PORT_DIPSETTING( 0x60, "6" ) // 3rd gear | |
| 558 | PORT_DIPSETTING( 0x70, "7" )*/ | |
| 551 | /* PORT_DIPSETTING( 0x00, "0" ) // 0: neutral | |
| 552 | PORT_DIPSETTING( 0x10, "1" ) // 2nd gear | |
| 553 | PORT_DIPSETTING( 0x20, "2" ) // 1st gear | |
| 554 | PORT_DIPSETTING( 0x30, "3" ) | |
| 555 | PORT_DIPSETTING( 0x40, "4" ) | |
| 556 | PORT_DIPSETTING( 0x50, "5" ) // 4th gear | |
| 557 | PORT_DIPSETTING( 0x60, "6" ) // 3rd gear | |
| 558 | PORT_DIPSETTING( 0x70, "7" )*/ | |
| 559 | 559 | |
| 560 | 560 | /* Used specifically by Sega Rally, others might be different */ |
| 561 | 561 | CUSTOM_INPUT_MEMBER(model2_state::srallyc_gearbox_r) |
| r31373 | r31374 | |
| 774 | 774 | } |
| 775 | 775 | else |
| 776 | 776 | { |
| 777 | // if(m_coprocnt == 0) | |
| 778 | // return; | |
| 777 | // if(m_coprocnt == 0) | |
| 778 | // return; | |
| 779 | 779 | |
| 780 | 780 | //osd_printf_debug("copro_fifo_w: %08X, %08X, %08X at %08X\n", data, offset, mem_mask, space.device().safe_pc()); |
| 781 | 781 | if (m_dsp_type == DSP_TYPE_SHARC) |
| r31373 | r31374 | |
|---|---|---|
| 704 | 704 | |
| 705 | 705 | /* start with the TMS9928a video configuration */ |
| 706 | 706 | MCFG_DEVICE_ADD( "tms9928a", TMS9128, XTAL_10_738635MHz / 2 ) /* TMS9128NL on the board */ |
| 707 | ||
| 707 | MCFG_TMS9928A_VRAM_SIZE(0x4000) | |
| 708 | 708 | MCFG_TMS9928A_OUT_INT_LINE_CB(WRITELINE(cliffhgr_state, vdp_interrupt)) |
| 709 | 709 | |
| 710 | 710 | /* override video rendering and raw screen info */ |
| r31373 | r31374 | |
|---|---|---|
| 53 | 53 | |
| 54 | 54 | SOLVER(Solver, 48000) |
| 55 | 55 | PARAM(Solver.ACCURACY, 1e-5) |
| 56 | ||
| 56 | PARAM(Solver.LTE, 5e-2) // Default is not enough for paddle control | |
| 57 | 57 | ANALOG_INPUT(V5, 5) |
| 58 | 58 | |
| 59 | 59 | /* AY 8910 internal resistors */ |
| r31373 | r31374 | |
| 482 | 482 | MCFG_SOUND_MODIFY("aysnd") |
| 483 | 483 | MCFG_SOUND_ROUTES_RESET() |
| 484 | 484 | MCFG_AY8910_OUTPUT_TYPE(AY8910_RESISTOR_OUTPUT) /* Does Sky Skipper have the same filtering? */ |
| 485 | ||
| 485 | MCFG_AY8910_RES_LOADS(2000.0, 2000.0, 2000.0) | |
| 486 | 486 | MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW0")) |
| 487 | 487 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(popeye_state, popeye_portB_w)) |
| 488 | 488 | MCFG_SOUND_ROUTE_EX(0, "snd_nl", 1.0, 0) |
| r31373 | r31374 | |
|---|---|---|
| 84 | 84 | required_device<palette_device> m_palette; |
| 85 | 85 | optional_shared_ptr<UINT8> m_generic_paletteram_8; |
| 86 | 86 | optional_shared_ptr<UINT16> m_generic_paletteram_16; |
| 87 | ||
| 87 | ||
| 88 | 88 | void igs025_to_igs022_callback( void ); |
| 89 | 89 | |
| 90 | 90 | int m_toggle; |
| r31373 | r31374 | |
|---|---|---|
| 789 | 789 | MCFG_TMPZ84C011_ZC0_CB(DEVWRITELINE("audiocpu", tmpz84c011_device, trg3)) |
| 790 | 790 | |
| 791 | 791 | MCFG_NVRAM_ADD_0FILL("nvram") |
| 792 | ||
| 792 | ||
| 793 | 793 | /* video hardware */ |
| 794 | 794 | MCFG_SCREEN_ADD("screen", RASTER) |
| 795 | 795 | MCFG_SCREEN_REFRESH_RATE(60) |
| r31373 | r31374 | |
|---|---|---|
| 3215 | 3215 | MCFG_K001604_GFX_INDEX2(1) |
| 3216 | 3216 | MCFG_K001604_LAYER_SIZE(0) |
| 3217 | 3217 | MCFG_K001604_ROZ_SIZE(1) |
| 3218 | MCFG_K001604_TXT_OFFSET(0) // correct? | |
| 3219 | MCFG_K001604_ROZ_OFFSET(0) // correct? | |
| 3218 | MCFG_K001604_TXT_OFFSET(0) // correct? | |
| 3219 | MCFG_K001604_ROZ_OFFSET(0) // correct? | |
| 3220 | 3220 | MCFG_K001604_GFXDECODE("gfxdecode") |
| 3221 | 3221 | MCFG_K001604_PALETTE("palette") |
| 3222 | 3222 |
| r31373 | r31374 | |
|---|---|---|
| 93 | 93 | #endif |
| 94 | 94 | |
| 95 | 95 | CIRCUIT_LAYOUT( pongdoubles ) |
| 96 | SOLVER(Solver, 48000) | |
| 97 | PARAM(Solver.ACCURACY, 1e-7) // works and is sufficient | |
| 96 | SOLVER(Solver, 48000) | |
| 97 | PARAM(Solver.ACCURACY, 1e-7) // works and is sufficient | |
| 98 | 98 | //CHIP("CLOCK", CLOCK_14_318_MHZ) |
| 99 | ||
| 99 | MAINCLOCK(CLOCK, 14318000.0) | |
| 100 | 100 | |
| 101 | 101 | ANALOG_INPUT(V5, 5) |
| 102 | 102 | #define VCC "V5", Q |
| 103 | 103 | #define GND "GND", Q |
| 104 | 104 | |
| 105 | ||
| 105 | CHIP("F9", 7493) | |
| 106 | 106 | CHIP("F10", 7493) |
| 107 | 107 | CHIP("F7", 74107) |
| 108 | 108 | CHIP("F8", 7430) |
| r31373 | r31374 | |
| 110 | 110 | |
| 111 | 111 | CHIP("E9", 7493) |
| 112 | 112 | CHIP("E10", 7493) |
| 113 | CHIP("D10", 74107) | |
| 114 | CHIP("D9", 7410) | |
| 113 | CHIP("D10", 74107) | |
| 114 | CHIP("D9", 7410) | |
| 115 | 115 | |
| 116 | CHIP("G6", 7410) | |
| 117 | CHIP("H6", 7400) | |
| 118 | CHIP("F6", 7402) | |
| 116 | CHIP("G6", 7410) | |
| 117 | CHIP("H6", 7400) | |
| 118 | CHIP("F6", 7402) | |
| 119 | 119 | |
| 120 | CHIP("F4", 74107) | |
| 121 | CHIP("G4", 7400) | |
| 122 | CHIP("G3", 7427) | |
| 120 | CHIP("F4", 74107) | |
| 121 | CHIP("G4", 7400) | |
| 122 | CHIP("G3", 7427) | |
| 123 | 123 | |
| 124 | ||
| 124 | CHIP("E4", 7427) | |
| 125 | 125 | CHIP("E3", 7410) |
| 126 | 126 | CHIP("D3", 7402) |
| 127 | 127 | CHIP("G2", 7402) |
| 128 | 128 | CHIP("F3", 7425) |
| 129 | ||
| 129 | CHIP("C6", 7448) | |
| 130 | 130 | CHIP("C7", 74153) |
| 131 | 131 | CHIP("D7", 74153) |
| 132 | 132 | |
| r31373 | r31374 | |
| 138 | 138 | CHIP("D6", 7410) |
| 139 | 139 | CHIP("D4", 7430) |
| 140 | 140 | |
| 141 | //CHIP("B10", 555_Mono, &b10_555_desc) | |
| 142 | CHIP_555_Mono(B10, &b10_555_desc) | |
| 141 | //CHIP("B10", 555_Mono, &b10_555_desc) | |
| 142 | CHIP_555_Mono(B10, &b10_555_desc) | |
| 143 | 143 | |
| 144 | // NETLIST - analog start | |
| 145 | POT(B10_POT, RES_K(1)) // This is a guess!! | |
| 146 | PARAM(B10_POT.DIALLOG, 1) // Log Dial ... | |
| 147 | RES(B10_RPRE, 470) | |
| 144 | // NETLIST - analog start | |
| 145 | POT(B10_POT, RES_K(1)) // This is a guess!! | |
| 146 | PARAM(B10_POT.DIALLOG, 1) // Log Dial ... | |
| 147 | RES(B10_RPRE, 470) | |
| 148 | 148 | |
| 149 | NET_C(B10_POT.1, V5) | |
| 150 | NET_C(B10_POT.3, GND) | |
| 151 | NET_C(B10_POT.2, B10_RPRE.1) | |
| 152 | NET_C(B10_RPRE.2, B10.5) | |
| 153 | // NETLIST - analog end | |
| 149 | NET_C(B10_POT.1, V5) | |
| 150 | NET_C(B10_POT.3, GND) | |
| 151 | NET_C(B10_POT.2, B10_RPRE.1) | |
| 152 | NET_C(B10_RPRE.2, B10.5) | |
| 153 | // NETLIST - analog end | |
| 154 | 154 | |
| 155 | 155 | |
| 156 | 156 | CHIP("C10", 7404) |
| r31373 | r31374 | |
| 158 | 158 | CHIP("B8", 7400) |
| 159 | 159 | CHIP("A8", 7420) |
| 160 | 160 | |
| 161 | //CHIP("A10", 555_Mono, &a10_555_desc) | |
| 162 | CHIP_555_Mono(A10, &a10_555_desc) | |
| 161 | //CHIP("A10", 555_Mono, &a10_555_desc) | |
| 162 | CHIP_555_Mono(A10, &a10_555_desc) | |
| 163 | 163 | |
| 164 | // NETLIST - analog start | |
| 165 | POT(A10_POT, RES_K(1)) // This is a guess!! | |
| 166 | PARAM(A10_POT.DIALLOG, 1) // Log Dial ... | |
| 167 | RES(A10_RPRE, 470) | |
| 164 | // NETLIST - analog start | |
| 165 | POT(A10_POT, RES_K(1)) // This is a guess!! | |
| 166 | PARAM(A10_POT.DIALLOG, 1) // Log Dial ... | |
| 167 | RES(A10_RPRE, 470) | |
| 168 | 168 | |
| 169 | NET_C(A10_POT.1, V5) | |
| 170 | NET_C(A10_POT.3, GND) | |
| 171 | NET_C(A10_POT.2, A10_RPRE.1) | |
| 172 | NET_C(A10_RPRE.2, A10.5) | |
| 173 | // NETLIST - analog end | |
| 169 | NET_C(A10_POT.1, V5) | |
| 170 | NET_C(A10_POT.3, GND) | |
| 171 | NET_C(A10_POT.2, A10_RPRE.1) | |
| 172 | NET_C(A10_RPRE.2, A10.5) | |
| 173 | // NETLIST - analog end | |
| 174 | 174 | |
| 175 | ||
| 175 | CHIP("A9", 7493) | |
| 176 | 176 | |
| 177 | 177 | CHIP("H4", 7474) |
| 178 | 178 | |
| r31373 | r31374 | |
| 192 | 192 | CHIP("B6", 7474) |
| 193 | 193 | CHIP("H5", 7400) |
| 194 | 194 | CHIP("E7", 7400) |
| 195 | //CHIP("F5", 555_Mono, &f5_555_desc) | |
| 196 | CHIP_555_Mono(F5, &f5_555_desc) | |
| 195 | //CHIP("F5", 555_Mono, &f5_555_desc) | |
| 196 | CHIP_555_Mono(F5, &f5_555_desc) | |
| 197 | 197 | |
| 198 | //CHIP("G5", 555_Mono, &g5_555_desc) | |
| 199 | CHIP_555_Mono(G5, &g5_555_desc) | |
| 198 | //CHIP("G5", 555_Mono, &g5_555_desc) | |
| 199 | CHIP_555_Mono(G5, &g5_555_desc) | |
| 200 | 200 | CHIP("C3", 7474) |
| 201 | 201 | CHIP("C2", 7400) |
| 202 | 202 | |
| 203 | ||
| 203 | CHIP("F2", 7493) | |
| 204 | 204 | CHIP("H2", 7400) |
| 205 | 205 | CHIP("H3", 74107) |
| 206 | 206 | |
| r31373 | r31374 | |
| 211 | 211 | |
| 212 | 212 | CHIP("C8", 7490) |
| 213 | 213 | CHIP("D8", 7490) |
| 214 | ||
| 214 | CHIP("C9", 74107) | |
| 215 | 215 | |
| 216 | CHIP("A1", 74153) | |
| 217 | CHIP("B1", 74153) | |
| 216 | CHIP("A1", 74153) | |
| 217 | CHIP("B1", 74153) | |
| 218 | 218 | |
| 219 | CHIP("B2", 7474) | |
| 220 | CHIP("H1", 7402) | |
| 221 | CHIP("G1", 7404) | |
| 219 | CHIP("B2", 7474) | |
| 220 | CHIP("H1", 7402) | |
| 221 | CHIP("G1", 7404) | |
| 222 | 222 | |
| 223 | CHIP("E1", 7400) | |
| 224 | CHIP("A2", 7420) | |
| 225 | CHIP("D1", 7493) | |
| 226 | CHIP("C1", 7493) | |
| 223 | CHIP("E1", 7400) | |
| 224 | CHIP("A2", 7420) | |
| 225 | CHIP("D1", 7493) | |
| 226 | CHIP("C1", 7493) | |
| 227 | 227 | |
| 228 | CHIP("J1", 7474) | |
| 229 | CHIP("F1", 7427) | |
| 228 | CHIP("J1", 7474) | |
| 229 | CHIP("F1", 7427) | |
| 230 | 230 | |
| 231 | CHIP("J10", 7400) | |
| 232 | CHIP("H10", 7474) | |
| 233 | CHIP("G10", 7474) | |
| 234 | //CHIP("A3", 555_Mono, &a3_555_desc) | |
| 235 | CHIP_555_Mono(A3, &a3_555_desc) | |
| 231 | CHIP("J10", 7400) | |
| 232 | CHIP("H10", 7474) | |
| 233 | CHIP("G10", 7474) | |
| 234 | //CHIP("A3", 555_Mono, &a3_555_desc) | |
| 235 | CHIP_555_Mono(A3, &a3_555_desc) | |
| 236 | 236 | |
| 237 | //CHIP("B9A", 555_Mono, &b9a_555_desc) | |
| 238 | CHIP_555_Mono(B9A, &b9a_555_desc) | |
| 237 | //CHIP("B9A", 555_Mono, &b9a_555_desc) | |
| 238 | CHIP_555_Mono(B9A, &b9a_555_desc) | |
| 239 | 239 | |
| 240 | // NETLIST - analog start | |
| 241 | POT(B9A_POT, RES_K(1)) // This is a guess!! | |
| 242 | PARAM(B9A_POT.DIALLOG, 1) // Log Dial ... | |
| 243 | RES(B9A_RPRE, 470) | |
| 240 | // NETLIST - analog start | |
| 241 | POT(B9A_POT, RES_K(1)) // This is a guess!! | |
| 242 | PARAM(B9A_POT.DIALLOG, 1) // Log Dial ... | |
| 243 | RES(B9A_RPRE, 470) | |
| 244 | 244 | |
| 245 | NET_C(B9A_POT.1, V5) | |
| 246 | NET_C(B9A_POT.3, GND) | |
| 247 | NET_C(B9A_POT.2, B9A_RPRE.1) | |
| 248 | NET_C(B9A_RPRE.2, B9A.5) | |
| 249 | // NETLIST - analog end | |
| 245 | NET_C(B9A_POT.1, V5) | |
| 246 | NET_C(B9A_POT.3, GND) | |
| 247 | NET_C(B9A_POT.2, B9A_RPRE.1) | |
| 248 | NET_C(B9A_RPRE.2, B9A.5) | |
| 249 | // NETLIST - analog end | |
| 250 | 250 | |
| 251 | //CHIP("B9B", 555_Mono, &b9b_555_desc) | |
| 252 | CHIP_555_Mono(B9B, &b9b_555_desc) | |
| 251 | //CHIP("B9B", 555_Mono, &b9b_555_desc) | |
| 252 | CHIP_555_Mono(B9B, &b9b_555_desc) | |
| 253 | 253 | |
| 254 | // NETLIST - analog start | |
| 255 | POT(B9B_POT, RES_K(1)) // This is a guess!! | |
| 256 | PARAM(B9B_POT.DIALLOG, 1) // Log Dial ... | |
| 257 | RES(B9B_RPRE, 470) | |
| 254 | // NETLIST - analog start | |
| 255 | POT(B9B_POT, RES_K(1)) // This is a guess!! | |
| 256 | PARAM(B9B_POT.DIALLOG, 1) // Log Dial ... | |
| 257 | RES(B9B_RPRE, 470) | |
| 258 | 258 | |
| 259 | NET_C(B9B_POT.1, V5) | |
| 260 | NET_C(B9B_POT.3, GND) | |
| 261 | NET_C(B9B_POT.2, B9B_RPRE.1) | |
| 262 | NET_C(B9B_RPRE.2, B9B.5) | |
| 263 | // NETLIST - analog end | |
| 259 | NET_C(B9B_POT.1, V5) | |
| 260 | NET_C(B9B_POT.3, GND) | |
| 261 | NET_C(B9B_POT.2, B9B_RPRE.1) | |
| 262 | NET_C(B9B_RPRE.2, B9B.5) | |
| 263 | // NETLIST - analog end | |
| 264 | 264 | |
| 265 | ||
| 265 | CHIP_SERIES_RC(C33, &c33_desc) | |
| 266 | 266 | |
| 267 | 267 | #if 0 |
| 268 | CHIP("PAD1", PADDLE1_VERTICAL_INPUT, &pad1_desc) | |
| 269 | PADDLE_CONNECTION("PAD1", "A10") | |
| 268 | CHIP("PAD1", PADDLE1_VERTICAL_INPUT, &pad1_desc) | |
| 269 | PADDLE_CONNECTION("PAD1", "A10") | |
| 270 | 270 | |
| 271 | CHIP("PAD2", PADDLE2_VERTICAL_INPUT, &pad2_desc) | |
| 272 | PADDLE_CONNECTION("PAD2", "B10") | |
| 271 | CHIP("PAD2", PADDLE2_VERTICAL_INPUT, &pad2_desc) | |
| 272 | PADDLE_CONNECTION("PAD2", "B10") | |
| 273 | 273 | |
| 274 | CHIP("PAD3", PADDLE3_VERTICAL_INPUT, &pad3_desc) | |
| 275 | PADDLE_CONNECTION("PAD3", "B9B") | |
| 274 | CHIP("PAD3", PADDLE3_VERTICAL_INPUT, &pad3_desc) | |
| 275 | PADDLE_CONNECTION("PAD3", "B9B") | |
| 276 | 276 | |
| 277 | CHIP("PAD4", PADDLE4_VERTICAL_INPUT, &pad4_desc) | |
| 278 | PADDLE_CONNECTION("PAD4", "B9A") | |
| 277 | CHIP("PAD4", PADDLE4_VERTICAL_INPUT, &pad4_desc) | |
| 278 | PADDLE_CONNECTION("PAD4", "B9A") | |
| 279 | 279 | |
| 280 | CHIP("LATCH", LATCH) | |
| 281 | CHIP("COIN", COIN_INPUT) | |
| 282 | CHIP("START", START_INPUT) | |
| 283 | CHIP("DIPSW1", DIPSWITCH, &dipswitch1_desc) | |
| 280 | CHIP("LATCH", LATCH) | |
| 281 | CHIP("COIN", COIN_INPUT) | |
| 282 | CHIP("START", START_INPUT) | |
| 283 | CHIP("DIPSW1", DIPSWITCH, &dipswitch1_desc) | |
| 284 | 284 | |
| 285 | ||
| 285 | VIDEO(pongdoubles) | |
| 286 | 286 | #endif |
| 287 | 287 | |
| 288 | //CHIP("COIN", COIN_INPUT) | |
| 289 | CHIP_INPUT_ACTIVE_LOW(COIN) | |
| 290 | //CHIP("LATCH", LATCH) | |
| 291 | CHIP_LATCH(LATCH) | |
| 292 | //CHIP("START", START_INPUT) | |
| 293 | CHIP_INPUT_ACTIVE_HIGH(START) | |
| 294 | //CHIP("DIPSW1", DIPSWITCH, &dipswitch1_desc) | |
| 295 | SWITCH2(DIPSW1) | |
| 296 | SWITCH2(DIPSW2) | |
| 288 | //CHIP("COIN", COIN_INPUT) | |
| 289 | CHIP_INPUT_ACTIVE_LOW(COIN) | |
| 290 | //CHIP("LATCH", LATCH) | |
| 291 | CHIP_LATCH(LATCH) | |
| 292 | //CHIP("START", START_INPUT) | |
| 293 | CHIP_INPUT_ACTIVE_HIGH(START) | |
| 294 | //CHIP("DIPSW1", DIPSWITCH, &dipswitch1_desc) | |
| 295 | SWITCH2(DIPSW1) | |
| 296 | SWITCH2(DIPSW2) | |
| 297 | 297 | #ifdef DEBUG |
| 298 | 298 | CHIP("LOG1", VCD_LOG, &vcd_log_desc) |
| 299 | 299 | #endif |
| 300 | 300 | |
| 301 | 301 | // Not used, need to be connected |
| 302 | CONNECTION(GND, "C2", 1) | |
| 303 | CONNECTION(GND, "C2", 2) | |
| 304 | CONNECTION(GND, "A5", 1) | |
| 305 | CONNECTION(GND, "A5", 2) | |
| 306 | CONNECTION(GND, "G7", 4) | |
| 307 | CONNECTION(GND, "G7", 1) | |
| 308 | CONNECTION(GND, "G7",13) | |
| 309 | CONNECTION(GND, "G7",12) | |
| 310 | CONNECTION(GND, "J10",13) | |
| 311 | CONNECTION(GND, "J10",12) | |
| 312 | CONNECTION(GND, "C10",9) | |
| 313 | CONNECTION(GND, "C10",11) | |
| 314 | CONNECTION(GND, "C10",13) | |
| 315 | CONNECTION(GND, "B1",10) | |
| 316 | CONNECTION(GND, "B1",11) | |
| 317 | CONNECTION(GND, "B1",12) | |
| 318 | CONNECTION(GND, "B1",13) | |
| 319 | CONNECTION(GND, "E7",12) | |
| 320 | CONNECTION(GND, "E7",13) | |
| 321 | CONNECTION(GND, "H1",11) | |
| 322 | CONNECTION(GND, "H1",12) | |
| 323 | CONNECTION(GND, "G1",9) | |
| 302 | CONNECTION(GND, "C2", 1) | |
| 303 | CONNECTION(GND, "C2", 2) | |
| 304 | CONNECTION(GND, "A5", 1) | |
| 305 | CONNECTION(GND, "A5", 2) | |
| 306 | CONNECTION(GND, "G7", 4) | |
| 307 | CONNECTION(GND, "G7", 1) | |
| 308 | CONNECTION(GND, "G7",13) | |
| 309 | CONNECTION(GND, "G7",12) | |
| 310 | CONNECTION(GND, "J10",13) | |
| 311 | CONNECTION(GND, "J10",12) | |
| 312 | CONNECTION(GND, "C10",9) | |
| 313 | CONNECTION(GND, "C10",11) | |
| 314 | CONNECTION(GND, "C10",13) | |
| 315 | CONNECTION(GND, "B1",10) | |
| 316 | CONNECTION(GND, "B1",11) | |
| 317 | CONNECTION(GND, "B1",12) | |
| 318 | CONNECTION(GND, "B1",13) | |
| 319 | CONNECTION(GND, "E7",12) | |
| 320 | CONNECTION(GND, "E7",13) | |
| 321 | CONNECTION(GND, "H1",11) | |
| 322 | CONNECTION(GND, "H1",12) | |
| 323 | CONNECTION(GND, "G1",9) | |
| 324 | 324 | |
| 325 | ||
| 325 | // HRESET Circuit | |
| 326 | 326 | |
| 327 | CONNECTION("CLOCK", Q, "F7", 12) | |
| 328 | CONNECTION(VCC, "F7", 1) | |
| 329 | CONNECTION(VCC, "F7", 4) | |
| 330 | CONNECTION(VCC, "F7", 13) | |
| 327 | CONNECTION("CLOCK", Q, "F7", 12) | |
| 328 | CONNECTION(VCC, "F7", 1) | |
| 329 | CONNECTION(VCC, "F7", 4) | |
| 330 | CONNECTION(VCC, "F7", 13) | |
| 331 | 331 | |
| 332 | ||
| 332 | #define CLK "F7", 3 | |
| 333 | 333 | |
| 334 | 334 | CONNECTION("F9", 12, "F9", 1) |
| 335 | 335 | CONNECTION(CLK, "F9", 14) |
| r31373 | r31374 | |
| 348 | 348 | |
| 349 | 349 | CONNECTION("F7", 5, "F8", 1) |
| 350 | 350 | CONNECTION("F10", 11, "F8", 11) |
| 351 | ||
| 351 | CONNECTION("F10", 8, "F8", 12) | |
| 352 | 352 | CONNECTION("F9", 8, "F8", 5) |
| 353 | 353 | CONNECTION("F9", 9, "F8", 6) |
| 354 | ||
| 354 | CONNECTION(VCC, "F8", 2) | |
| 355 | 355 | CONNECTION(VCC, "F8", 3) |
| 356 | 356 | CONNECTION(VCC, "F8", 4) |
| 357 | 357 | |
| r31373 | r31374 | |
| 360 | 360 | CONNECTION(VCC, "E8", 13) |
| 361 | 361 | CONNECTION(VCC, "E8", 10) |
| 362 | 362 | |
| 363 | #define H1 "F9", 12 | |
| 364 | #define H2 "F9", 9 | |
| 365 | #define H4 "F9", 8 | |
| 366 | #define H8 "F9", 11 | |
| 367 | #define H16 "F10", 12 | |
| 368 | #define H32 "F10", 9 | |
| 369 | #define H64 "F10", 8 | |
| 370 | #define H128 "F10", 11 | |
| 371 | #define H256 "F7", 5 | |
| 372 | #define H256_n "F7", 6 | |
| 373 | #define HRESET "E8", 8 | |
| 374 | #define HRESET_n "E8", 9 | |
| 363 | #define H1 "F9", 12 | |
| 364 | #define H2 "F9", 9 | |
| 365 | #define H4 "F9", 8 | |
| 366 | #define H8 "F9", 11 | |
| 367 | #define H16 "F10", 12 | |
| 368 | #define H32 "F10", 9 | |
| 369 | #define H64 "F10", 8 | |
| 370 | #define H128 "F10", 11 | |
| 371 | #define H256 "F7", 5 | |
| 372 | #define H256_n "F7", 6 | |
| 373 | #define HRESET "E8", 8 | |
| 374 | #define HRESET_n "E8", 9 | |
| 375 | 375 | |
| 376 | 376 | |
| 377 | ||
| 377 | // VRESET Circuit | |
| 378 | 378 | CONNECTION("E9", 12, "E9", 1) |
| 379 | ||
| 379 | CONNECTION(HRESET, "E9", 14) | |
| 380 | 380 | CONNECTION("E8", 6, "E9", 2) |
| 381 | 381 | CONNECTION("E8", 6, "E9", 3) |
| 382 | 382 | |
| r31373 | r31374 | |
| 399 | 399 | CONNECTION(VCC, "E8", 1) |
| 400 | 400 | CONNECTION(VCC, "E8", 4) |
| 401 | 401 | |
| 402 | #define V1 "E9", 12 | |
| 403 | #define V2 "E9", 9 | |
| 404 | #define V4 "E9", 8 | |
| 405 | #define V8 "E9", 11 | |
| 406 | #define V16 "E10", 12 | |
| 407 | #define V32 "E10", 9 | |
| 408 | #define V64 "E10", 8 | |
| 409 | #define V128 "E10", 11 | |
| 410 | #define V256 "D10", 5 | |
| 411 | #define V256_n "D10", 6 | |
| 412 | #define VRESET "E8", 6 | |
| 413 | #define VRESET_n "E8", 5 | |
| 402 | #define V1 "E9", 12 | |
| 403 | #define V2 "E9", 9 | |
| 404 | #define V4 "E9", 8 | |
| 405 | #define V8 "E9", 11 | |
| 406 | #define V16 "E10", 12 | |
| 407 | #define V32 "E10", 9 | |
| 408 | #define V64 "E10", 8 | |
| 409 | #define V128 "E10", 11 | |
| 410 | #define V256 "D10", 5 | |
| 411 | #define V256_n "D10", 6 | |
| 412 | #define VRESET "E8", 6 | |
| 413 | #define VRESET_n "E8", 5 | |
| 414 | 414 | |
| 415 | 415 | |
| 416 | // HSync Logic | |
| 417 | CONNECTION(H16, "G6", 3) | |
| 418 | CONNECTION(H64, "G6", 4) | |
| 419 | CONNECTION(H64, "G6", 5) | |
| 416 | // HSync Logic | |
| 417 | CONNECTION(H16, "G6", 3) | |
| 418 | CONNECTION(H64, "G6", 4) | |
| 419 | CONNECTION(H64, "G6", 5) | |
| 420 | 420 | |
| 421 | CONNECTION("G6", 6, "H6", 4) | |
| 422 | CONNECTION(HRESET_n, "H6", 10) | |
| 423 | CONNECTION("H6", 6, "H6", 9) | |
| 424 | CONNECTION("H6", 8, "H6", 5) | |
| 421 | CONNECTION("G6", 6, "H6", 4) | |
| 422 | CONNECTION(HRESET_n, "H6", 10) | |
| 423 | CONNECTION("H6", 6, "H6", 9) | |
| 424 | CONNECTION("H6", 8, "H6", 5) | |
| 425 | 425 | |
| 426 | ||
| 426 | CONNECTION(H64, "D2", 9) | |
| 427 | 427 | |
| 428 | CONNECTION(H64, "D3", 3) | |
| 429 | CONNECTION("H6", 6, "D3", 2) | |
| 428 | CONNECTION(H64, "D3", 3) | |
| 429 | CONNECTION("H6", 6, "D3", 2) | |
| 430 | 430 | |
| 431 | CONNECTION("D2", 8, "C2", 9) | |
| 432 | //CONNECTION("D2", 8, "C2", 10) | |
| 433 | CONNECTION(H32, "C2", 10) // Not shown. Accurate? | |
| 431 | CONNECTION("D2", 8, "C2", 9) | |
| 432 | //CONNECTION("D2", 8, "C2", 10) | |
| 433 | CONNECTION(H32, "C2", 10) // Not shown. Accurate? | |
| 434 | 434 | |
| 435 | CONNECTION(VCC, "B2", 10) | |
| 436 | CONNECTION("C2", 8, "B2", 12) | |
| 437 | CONNECTION(H16, "B2", 11) | |
| 438 | CONNECTION("D3", 1, "B2", 13) | |
| 435 | CONNECTION(VCC, "B2", 10) | |
| 436 | CONNECTION("C2", 8, "B2", 12) | |
| 437 | CONNECTION(H16, "B2", 11) | |
| 438 | CONNECTION("D3", 1, "B2", 13) | |
| 439 | 439 | |
| 440 | #define HBLANK "H6", 8 | |
| 441 | #define HBLANK_n "H6", 6 | |
| 442 | #define HSYNC_n "B2", 8 | |
| 440 | #define HBLANK "H6", 8 | |
| 441 | #define HBLANK_n "H6", 6 | |
| 442 | #define HSYNC_n "B2", 8 | |
| 443 | 443 | |
| 444 | // VSync Logic | |
| 445 | CONNECTION(VRESET, "F6", 8) | |
| 446 | CONNECTION(V16, "F6", 12) | |
| 447 | CONNECTION("F6", 10, "F6", 11) | |
| 448 | CONNECTION("F6", 13, "F6", 9) | |
| 444 | // VSync Logic | |
| 445 | CONNECTION(VRESET, "F6", 8) | |
| 446 | CONNECTION(V16, "F6", 12) | |
| 447 | CONNECTION("F6", 10, "F6", 11) | |
| 448 | CONNECTION("F6", 13, "F6", 9) | |
| 449 | 449 | |
| 450 | CONNECTION(V8, "H6", 1) | |
| 451 | CONNECTION(V8, "H6", 2) | |
| 450 | CONNECTION(V8, "H6", 1) | |
| 451 | CONNECTION(V8, "H6", 2) | |
| 452 | 452 | |
| 453 | CONNECTION("F6", 13, "G6", 1) | |
| 454 | CONNECTION(V4, "G6", 2) | |
| 455 | CONNECTION("H6", 3, "G6", 13) | |
| 453 | CONNECTION("F6", 13, "G6", 1) | |
| 454 | CONNECTION(V4, "G6", 2) | |
| 455 | CONNECTION("H6", 3, "G6", 13) | |
| 456 | 456 | |
| 457 | #define VBLANK "F6", 13 | |
| 458 | #define VBLANK_n "F6", 10 | |
| 457 | #define VBLANK "F6", 13 | |
| 458 | #define VBLANK_n "F6", 10 | |
| 459 | 459 | |
| 460 | 460 | |
| 461 | // Net circuit | |
| 462 | CONNECTION(H256, "F4", 8) | |
| 463 | CONNECTION(H256_n, "F4", 11) | |
| 464 | CONNECTION(CLK, "F4", 9) | |
| 465 | CONNECTION(VCC, "F4", 10) | |
| 461 | // Net circuit | |
| 462 | CONNECTION(H256, "F4", 8) | |
| 463 | CONNECTION(H256_n, "F4", 11) | |
| 464 | CONNECTION(CLK, "F4", 9) | |
| 465 | CONNECTION(VCC, "F4", 10) | |
| 466 | 466 | |
| 467 | CONNECTION("F4", 6, "G4", 5) | |
| 468 | CONNECTION(H256, "G4", 4) | |
| 467 | CONNECTION("F4", 6, "G4", 5) | |
| 468 | CONNECTION(H256, "G4", 4) | |
| 469 | 469 | |
| 470 | CONNECTION(V4, "G3", 3) | |
| 471 | CONNECTION(VBLANK, "G3", 4) | |
| 472 | CONNECTION("G4", 6, "G3", 5) | |
| 470 | CONNECTION(V4, "G3", 3) | |
| 471 | CONNECTION(VBLANK, "G3", 4) | |
| 472 | CONNECTION("G4", 6, "G3", 5) | |
| 473 | 473 | |
| 474 | ||
| 474 | #define NET "G3", 6 | |
| 475 | 475 | |
| 476 | 476 | |
| 477 | ||
| 477 | // Score decoding circuit | |
| 478 | 478 | CONNECTION("C9", 2, "D7", 6) |
| 479 | 479 | CONNECTION("C8", 8, "D7", 5) |
| 480 | 480 | CONNECTION("C9", 6, "D7", 4) |
| r31373 | r31374 | |
| 501 | 501 | CONNECTION(GND, "C7", 1) |
| 502 | 502 | CONNECTION(GND, "C7", 15) |
| 503 | 503 | |
| 504 | ||
| 504 | CONNECTION(H128, "E4", 1) | |
| 505 | 505 | CONNECTION(H128, "E4", 2) |
| 506 | 506 | CONNECTION(H128, "E4", 13) |
| 507 | 507 | |
| r31373 | r31374 | |
| 600 | 600 | CONNECTION("D6", 6, "D4", 3) |
| 601 | 601 | |
| 602 | 602 | |
| 603 | // Coin / Start Logic | |
| 604 | CONNECTION("COIN", 1, "C10", 5) | |
| 603 | // Coin / Start Logic | |
| 604 | CONNECTION("COIN", 1, "C10", 5) | |
| 605 | 605 | |
| 606 | // Capacitor C33 used to drive a ~0.1ms low pulse | |
| 607 | // onto A3 pin 2 at the falling edge of COIN. | |
| 608 | CONNECTION("COIN", 1, "C33", 1) | |
| 609 | CONNECTION(VCC, "C33", 2) | |
| 606 | // Capacitor C33 used to drive a ~0.1ms low pulse | |
| 607 | // onto A3 pin 2 at the falling edge of COIN. | |
| 608 | CONNECTION("COIN", 1, "C33", 1) | |
| 609 | CONNECTION(VCC, "C33", 2) | |
| 610 | 610 | |
| 611 | CONNECTION(VCC, "A3", 4) | |
| 612 | CONNECTION("C33", 3, "A3", 2) | |
| 611 | CONNECTION(VCC, "A3", 4) | |
| 612 | CONNECTION("C33", 3, "A3", 2) | |
| 613 | 613 | |
| 614 | ||
| 614 | CONNECTION("A3", 3, "D2", 11) | |
| 615 | 615 | |
| 616 | CONNECTION(VCC, "B2", 4) | |
| 617 | CONNECTION("D2", 10, "B2", 3) | |
| 618 | CONNECTION("C10", 6, "B2", 2) | |
| 619 | CONNECTION("C10", 6, "B2", 1) | |
| 616 | CONNECTION(VCC, "B2", 4) | |
| 617 | CONNECTION("D2", 10, "B2", 3) | |
| 618 | CONNECTION("C10", 6, "B2", 2) | |
| 619 | CONNECTION("C10", 6, "B2", 1) | |
| 620 | 620 | |
| 621 | CONNECTION("J10", 3, "LATCH", 1) | |
| 622 | CONNECTION("B2", 6, "LATCH", 2) | |
| 621 | CONNECTION("J10", 3, "LATCH", 1) | |
| 622 | CONNECTION("B2", 6, "LATCH", 2) | |
| 623 | 623 | |
| 624 | CONNECTION("LATCH", 3, "H6", 12) | |
| 625 | CONNECTION("LATCH", 3, "H6", 13) // Wrong pins on schematic | |
| 624 | CONNECTION("LATCH", 3, "H6", 12) | |
| 625 | CONNECTION("LATCH", 3, "H6", 13) // Wrong pins on schematic | |
| 626 | 626 | |
| 627 | CONNECTION("START", 1, "J10", 9) | |
| 628 | CONNECTION("START", 1, "J10", 10) | |
| 627 | CONNECTION("START", 1, "J10", 9) | |
| 628 | CONNECTION("START", 1, "J10", 10) | |
| 629 | 629 | |
| 630 | CONNECTION(VCC, "C3", 10) | |
| 631 | CONNECTION("H10", 6, "C3", 12) | |
| 632 | CONNECTION("B2", 5, "C3", 11) | |
| 633 | CONNECTION(VCC, "C3", 13) | |
| 630 | CONNECTION(VCC, "C3", 10) | |
| 631 | CONNECTION("H10", 6, "C3", 12) | |
| 632 | CONNECTION("B2", 5, "C3", 11) | |
| 633 | CONNECTION(VCC, "C3", 13) | |
| 634 | 634 | |
| 635 | CONNECTION("H6", 11, "H10", 4) | |
| 636 | CONNECTION(VCC, "H10", 2) | |
| 637 | CONNECTION("B2", 6, "H10", 1) | |
| 638 | CONNECTION("G10", 9, "H10", 3) | |
| 635 | CONNECTION("H6", 11, "H10", 4) | |
| 636 | CONNECTION(VCC, "H10", 2) | |
| 637 | CONNECTION("B2", 6, "H10", 1) | |
| 638 | CONNECTION("G10", 9, "H10", 3) | |
| 639 | 639 | |
| 640 | CONNECTION("H10", 5, "J10", 2) | |
| 641 | CONNECTION("G10", 9, "J10", 1) | |
| 640 | CONNECTION("H10", 5, "J10", 2) | |
| 641 | CONNECTION("G10", 9, "J10", 1) | |
| 642 | 642 | |
| 643 | CONNECTION(VCC, "G10", 4) | |
| 644 | CONNECTION("G10", 9, "G10", 2) | |
| 645 | CONNECTION("J10", 8, "G10", 3) | |
| 646 | CONNECTION("H10", 8, "G10", 1) | |
| 643 | CONNECTION(VCC, "G10", 4) | |
| 644 | CONNECTION("G10", 9, "G10", 2) | |
| 645 | CONNECTION("J10", 8, "G10", 3) | |
| 646 | CONNECTION("H10", 8, "G10", 1) | |
| 647 | 647 | |
| 648 | CONNECTION(VCC, "H10", 10) | |
| 649 | CONNECTION("G10", 5, "H10", 12) | |
| 650 | CONNECTION(V256, "H10", 11) | |
| 651 | CONNECTION(VCC, "H10", 13) | |
| 648 | CONNECTION(VCC, "H10", 10) | |
| 649 | CONNECTION("G10", 5, "H10", 12) | |
| 650 | CONNECTION(V256, "H10", 11) | |
| 651 | CONNECTION(VCC, "H10", 13) | |
| 652 | 652 | |
| 653 | CONNECTION("H10", 9, "J10", 4) | |
| 654 | CONNECTION("H10", 6, "J10", 5) | |
| 653 | CONNECTION("H10", 9, "J10", 4) | |
| 654 | CONNECTION("H10", 6, "J10", 5) | |
| 655 | 655 | |
| 656 | CONNECTION("H6", 11, "G10", 10) | |
| 657 | CONNECTION(VCC, "G10", 12) | |
| 658 | CONNECTION("B3", 3, "G10", 11) | |
| 659 | CONNECTION("J10", 6, "G10", 13) // Schematic shows pin 10 | |
| 656 | CONNECTION("H6", 11, "G10", 10) | |
| 657 | CONNECTION(VCC, "G10", 12) | |
| 658 | CONNECTION("B3", 3, "G10", 11) | |
| 659 | CONNECTION("J10", 6, "G10", 13) // Schematic shows pin 10 | |
| 660 | 660 | |
| 661 | ||
| 661 | CONNECTION("J10", 6, "E5", 9) // Schematic says E6? | |
| 662 | 662 | |
| 663 | #define ATTRACT_n "D2", 4 | |
| 664 | #define ATTRACT "G10", 9 | |
| 663 | #define ATTRACT_n "D2", 4 | |
| 664 | #define ATTRACT "G10", 9 | |
| 665 | 665 | |
| 666 | #define SRST "E5", 8 | |
| 667 | #define SRST_n "J10", 6 | |
| 666 | #define SRST "E5", 8 | |
| 667 | #define SRST_n "J10", 6 | |
| 668 | 668 | |
| 669 | 669 | |
| 670 | ||
| 670 | // Game Control Logic | |
| 671 | 671 | CONNECTION("H7", 6, "E7", 9) |
| 672 | 672 | CONNECTION("H6", 8, "E7", 10) |
| 673 | 673 | |
| r31373 | r31374 | |
| 677 | 677 | CONNECTION(ATTRACT_n, "E2", 2) |
| 678 | 678 | |
| 679 | 679 | CONNECTION(SRST_n, "E7", 4) |
| 680 | ||
| 680 | CONNECTION("E7", 8, "E7", 5) | |
| 681 | 681 | |
| 682 | 682 | CONNECTION("E7", 6, "E7", 1) |
| 683 | 683 | CONNECTION("E7", 6, "E7", 2) |
| r31373 | r31374 | |
| 694 | 694 | CONNECTION(VCC, "B6", 10) |
| 695 | 695 | CONNECTION("G3", 8, "B6", 11) |
| 696 | 696 | |
| 697 | ||
| 697 | CONNECTION(ATTRACT, "D2", 3) | |
| 698 | 698 | |
| 699 | 699 | |
| 700 | 700 | |
| 701 | ||
| 701 | // Horizontal Ball Counter | |
| 702 | 702 | CONNECTION(ATTRACT_n, "E2", 4) |
| 703 | ||
| 703 | CONNECTION("B6", 8, "E2", 5) | |
| 704 | 704 | |
| 705 | 705 | CONNECTION("H5", 8, "G8", 3) |
| 706 | 706 | CONNECTION("H5", 6, "G8", 4) |
| r31373 | r31374 | |
| 732 | 732 | CONNECTION("H8", 15, "H7", 12) |
| 733 | 733 | CONNECTION("G7", 5, "H7", 13) |
| 734 | 734 | |
| 735 | ||
| 735 | #define HVID_n "H7", 8 | |
| 736 | 736 | |
| 737 | 737 | CONNECTION("H8", 15, "G6", 9) |
| 738 | 738 | CONNECTION("G8", 15, "G6", 10) |
| r31373 | r31374 | |
| 777 | 777 | CONNECTION("E3", 6, "D3", 11) |
| 778 | 778 | CONNECTION("E3", 6, "D3", 12) |
| 779 | 779 | |
| 780 | #define VVID_n "E3", 6 | |
| 781 | #define VVID "D3", 13 | |
| 780 | #define VVID_n "E3", 6 | |
| 781 | #define VVID "D3", 13 | |
| 782 | 782 | |
| 783 | 783 | |
| 784 | 784 | // Hit Logic |
| r31373 | r31374 | |
| 797 | 797 | CONNECTION("B3", 8, "B3", 12) |
| 798 | 798 | CONNECTION("B3", 8, "B3", 13) |
| 799 | 799 | |
| 800 | #define HIT "B3", 8 | |
| 801 | #define HIT_n "B3", 11 | |
| 800 | #define HIT "B3", 8 | |
| 801 | #define HIT_n "B3", 11 | |
| 802 | 802 | |
| 803 | 803 | |
| 804 | ||
| 804 | // Horizontal Ball Control | |
| 805 | 805 | CONNECTION("E2", 8, "E2", 12) |
| 806 | 806 | CONNECTION("C3", 6, "E2", 13) |
| 807 | 807 | |
| r31373 | r31374 | |
| 854 | 854 | CONNECTION("G4", 11, "H4", 13) |
| 855 | 855 | CONNECTION("G4", 3, "H4", 10) |
| 856 | 856 | |
| 857 | ||
| 857 | CONNECTION("H5", 3, "H5", 12) | |
| 858 | 858 | CONNECTION("H4", 9, "H5", 13) |
| 859 | 859 | |
| 860 | 860 | CONNECTION("H5", 3, "H5", 4) |
| r31373 | r31374 | |
| 874 | 874 | CONNECTION(H64, "B1", 14) |
| 875 | 875 | CONNECTION(H256, "B1", 2) |
| 876 | 876 | CONNECTION(GND, "B1", 1) |
| 877 | ||
| 877 | CONNECTION(GND, "B1", 15) // Added | |
| 878 | 878 | |
| 879 | ||
| 879 | CONNECTION("A7", 8, "A1", 6) | |
| 880 | 880 | CONNECTION("D1", 8, "A1", 5) |
| 881 | 881 | CONNECTION("A9", 8, "A1", 4) |
| 882 | 882 | CONNECTION("C1", 8, "A1", 3) |
| r31373 | r31374 | |
| 943 | 943 | |
| 944 | 944 | |
| 945 | 945 | |
| 946 | ||
| 946 | // Paddle 1 Vertical | |
| 947 | 947 | CONNECTION(V256_n, "B10", 2) |
| 948 | 948 | CONNECTION(VCC, "B10", 4) |
| 949 | 949 | |
| r31373 | r31374 | |
| 966 | 966 | CONNECTION("A8", 8, "B8", 2) |
| 967 | 967 | |
| 968 | 968 | // Paddle 1N Vertical |
| 969 | ||
| 969 | CONNECTION(V256_n, "B9A", 2) | |
| 970 | 970 | CONNECTION(VCC, "B9A", 4) |
| 971 | 971 | |
| 972 | 972 | CONNECTION("B9A", 3, "G1", 1) |
| r31373 | r31374 | |
| 1012 | 1012 | CONNECTION("A8", 6, "B8", 12) |
| 1013 | 1013 | |
| 1014 | 1014 | // Paddle 2N Vertical |
| 1015 | ||
| 1015 | CONNECTION(V256_n, "B9B", 2) | |
| 1016 | 1016 | CONNECTION(VCC, "B9B", 4) |
| 1017 | 1017 | |
| 1018 | 1018 | CONNECTION("B9B", 3, "G1", 3) |
| r31373 | r31374 | |
| 1034 | 1034 | CONNECTION("A2", 6, "E1", 10) |
| 1035 | 1035 | |
| 1036 | 1036 | |
| 1037 | // Paddle N Horizontal | |
| 1038 | CONNECTION(H64, "G1", 5) | |
| 1037 | // Paddle N Horizontal | |
| 1038 | CONNECTION(H64, "G1", 5) | |
| 1039 | 1039 | |
| 1040 | CONNECTION(VCC, "J1", 4) | |
| 1041 | CONNECTION("G1", 6, "J1", 2) | |
| 1042 | CONNECTION(H4, "J1", 3) | |
| 1043 | CONNECTION(ATTRACT_n, "J1", 1) | |
| 1040 | CONNECTION(VCC, "J1", 4) | |
| 1041 | CONNECTION("G1", 6, "J1", 2) | |
| 1042 | CONNECTION(H4, "J1", 3) | |
| 1043 | CONNECTION(ATTRACT_n, "J1", 1) | |
| 1044 | 1044 | |
| 1045 | CONNECTION("C3", 9, "J1", 10) | |
| 1046 | CONNECTION(VCC, "J1", 12) | |
| 1047 | CONNECTION("G4", 8, "J1", 11) | |
| 1048 | CONNECTION(H256, "J1", 13) | |
| 1045 | CONNECTION("C3", 9, "J1", 10) | |
| 1046 | CONNECTION(VCC, "J1", 12) | |
| 1047 | CONNECTION("G4", 8, "J1", 11) | |
| 1048 | CONNECTION(H256, "J1", 13) | |
| 1049 | 1049 | |
| 1050 | CONNECTION("J1", 9, "F1", 4) | |
| 1051 | CONNECTION("G1", 6, "F1", 3) | |
| 1052 | CONNECTION("J1", 6, "F1", 5) | |
| 1050 | CONNECTION("J1", 9, "F1", 4) | |
| 1051 | CONNECTION("G1", 6, "F1", 3) | |
| 1052 | CONNECTION("J1", 6, "F1", 5) | |
| 1053 | 1053 | |
| 1054 | CONNECTION("F1", 6, "H1", 8) | |
| 1055 | CONNECTION("F1", 6, "H1", 9) | |
| 1054 | CONNECTION("F1", 6, "H1", 8) | |
| 1055 | CONNECTION("F1", 6, "H1", 9) | |
| 1056 | 1056 | |
| 1057 | CONNECTION("H1", 10, "F1", 13) | |
| 1058 | CONNECTION(H256, "F1", 2) // Schematic says 256V | |
| 1059 | CONNECTION("E1", 11, "F1", 1) | |
| 1057 | CONNECTION("H1", 10, "F1", 13) | |
| 1058 | CONNECTION(H256, "F1", 2) // Schematic says 256V | |
| 1059 | CONNECTION("E1", 11, "F1", 1) | |
| 1060 | 1060 | |
| 1061 | CONNECTION("H1", 10, "F1", 11) | |
| 1062 | CONNECTION(H256_n, "F1", 9) | |
| 1063 | CONNECTION("E1", 8, "F1", 10) | |
| 1061 | CONNECTION("H1", 10, "F1", 11) | |
| 1062 | CONNECTION(H256_n, "F1", 9) | |
| 1063 | CONNECTION("E1", 8, "F1", 10) | |
| 1064 | 1064 | |
| 1065 | 1065 | |
| 1066 | 1066 | // Paddle Horizontal |
| r31373 | r31374 | |
| 1080 | 1080 | CONNECTION(H256_n, "G3", 2) |
| 1081 | 1081 | CONNECTION("G4", 8, "G3", 13) |
| 1082 | 1082 | |
| 1083 | CONNECTION("F1", 12, "H1", 2) | |
| 1084 | CONNECTION("G3", 8, "H1", 3) | |
| 1083 | CONNECTION("F1", 12, "H1", 2) | |
| 1084 | CONNECTION("G3", 8, "H1", 3) | |
| 1085 | 1085 | |
| 1086 | CONNECTION("F1", 8, "H1", 5) | |
| 1087 | CONNECTION("G3", 12, "H1", 6) | |
| 1086 | CONNECTION("F1", 8, "H1", 5) | |
| 1087 | CONNECTION("G3", 12, "H1", 6) | |
| 1088 | 1088 | |
| 1089 | CONNECTION("H1", 1, "G1", 13) | |
| 1090 | CONNECTION("H1", 4, "G1", 11) | |
| 1089 | CONNECTION("H1", 1, "G1", 13) | |
| 1090 | CONNECTION("H1", 4, "G1", 11) | |
| 1091 | 1091 | |
| 1092 | 1092 | |
| 1093 | 1093 | // Sound |
| r31373 | r31374 | |
| 1151 | 1151 | CONNECTION(VCC, "C9", 11) |
| 1152 | 1152 | CONNECTION(SRST_n, "C9", 10) |
| 1153 | 1153 | |
| 1154 | CONNECTION(VCC, "DIPSW1", 1) | |
| 1155 | CONNECTION("C8", 8, "DIPSW1", 2) | |
| 1154 | CONNECTION(VCC, "DIPSW1", 1) | |
| 1155 | CONNECTION("C8", 8, "DIPSW1", 2) | |
| 1156 | 1156 | |
| 1157 | 1157 | CONNECTION("C8", 12, "D9", 1) |
| 1158 | ||
| 1158 | //CONNECTION("DIPSW1", 3, "D9", 2) | |
| 1159 | 1159 | CONNECTION("DIPSW1", Q, "D9", 2) |
| 1160 | 1160 | CONNECTION("C9", 3, "D9", 13) |
| 1161 | 1161 | |
| 1162 | //CONNECTION(VCC, "DIPSW1", 4) | |
| 1163 | //CONNECTION("D8", 8, "DIPSW1", 5) | |
| 1164 | CONNECTION(VCC, "DIPSW2", 1) | |
| 1165 | CONNECTION("D8", 8, "DIPSW2", 2) | |
| 1162 | //CONNECTION(VCC, "DIPSW1", 4) | |
| 1163 | //CONNECTION("D8", 8, "DIPSW1", 5) | |
| 1164 | CONNECTION(VCC, "DIPSW2", 1) | |
| 1165 | CONNECTION("D8", 8, "DIPSW2", 2) | |
| 1166 | 1166 | |
| 1167 | 1167 | CONNECTION("D8", 12, "D9", 3) |
| 1168 | ||
| 1168 | //CONNECTION("DIPSW1", 6, "D9", 4) | |
| 1169 | 1169 | CONNECTION("DIPSW2", Q, "D9", 4) |
| 1170 | 1170 | CONNECTION("C9", 5, "D9", 5) |
| 1171 | 1171 | |
| 1172 | CONNECTION("D9", 12, "B3", 1) | |
| 1173 | CONNECTION("D9", 6, "B3", 2) | |
| 1172 | CONNECTION("D9", 12, "B3", 1) | |
| 1173 | CONNECTION("D9", 6, "B3", 2) | |
| 1174 | 1174 | |
| 1175 | ||
| 1175 | // Missing Logic in DICE | |
| 1176 | 1176 | |
| 1177 | NET_C(G6.12, A5.13) | |
| 1178 | NET_C(B2.8, A5.12) | |
| 1179 | NET_C(A5.11, E5.11) | |
| 1177 | NET_C(G6.12, A5.13) | |
| 1178 | NET_C(B2.8, A5.12) | |
| 1179 | NET_C(A5.11, E5.11) | |
| 1180 | 1180 | |
| 1181 | // Video Summing | |
| 1182 | CONNECTION("F3", 13, "G2", 4) // Ball | |
| 1183 | CONNECTION("F3", 12, "G1", 10) | |
| 1184 | CONNECTION("F3", 10, NET) | |
| 1185 | CONNECTION("F3", 9, "G1", 12) | |
| 1181 | // Video Summing | |
| 1182 | CONNECTION("F3", 13, "G2", 4) // Ball | |
| 1183 | CONNECTION("F3", 12, "G1", 10) | |
| 1184 | CONNECTION("F3", 10, NET) | |
| 1185 | CONNECTION("F3", 9, "G1", 12) | |
| 1186 | 1186 | |
| 1187 | ||
| 1187 | CONNECTION("F3", 8, "E5", 13) | |
| 1188 | 1188 | |
| 1189 | // FIXME: pong doubles uses different resistor values! | |
| 1190 | RES(RV1, 1000) | |
| 1191 | RES(RV2, 1200) | |
| 1192 | RES(RV3, 22000) | |
| 1193 | NET_C(E5.12, RV1.1) //Video | |
| 1194 | NET_C(D4.8, RV2.1) //Score | |
| 1195 | NET_C(E5.10, RV3.1) | |
| 1189 | // FIXME: pong doubles uses different resistor values! | |
| 1190 | RES(RV1, 1000) | |
| 1191 | RES(RV2, 1200) | |
| 1192 | RES(RV3, 22000) | |
| 1193 | NET_C(E5.12, RV1.1) //Video | |
| 1194 | NET_C(D4.8, RV2.1) //Score | |
| 1195 | NET_C(E5.10, RV3.1) | |
| 1196 | 1196 | |
| 1197 | NET_C(RV1.2, RV2.2) | |
| 1198 | NET_C(RV2.2, RV3.2) | |
| 1197 | NET_C(RV1.2, RV2.2) | |
| 1198 | NET_C(RV2.2, RV3.2) | |
| 1199 | 1199 | |
| 1200 | ||
| 1200 | ALIAS(videomix, RV3.2) | |
| 1201 | 1201 | |
| 1202 | 1202 | #if 0 |
| 1203 | CONNECTION("VIDEO", 1, "E5", 12) // VIDEO | |
| 1204 | CONNECTION("VIDEO", 2, "D4", 8) // SCORE | |
| 1203 | CONNECTION("VIDEO", 1, "E5", 12) // VIDEO | |
| 1204 | CONNECTION("VIDEO", 2, "D4", 8) // SCORE | |
| 1205 | 1205 | |
| 1206 | CONNECTION("VIDEO", Video::HBLANK_PIN, HBLANK) | |
| 1207 | CONNECTION("VIDEO", Video::VBLANK_PIN, VBLANK) | |
| 1206 | CONNECTION("VIDEO", Video::HBLANK_PIN, HBLANK) | |
| 1207 | CONNECTION("VIDEO", Video::VBLANK_PIN, VBLANK) | |
| 1208 | 1208 | #endif |
| 1209 | 1209 | |
| 1210 | // Audio Summing | |
| 1211 | CONNECTION(ATTRACT_n, "C2", 4) | |
| 1212 | CONNECTION("C5", 6, "C2", 5) | |
| 1210 | // Audio Summing | |
| 1211 | CONNECTION(ATTRACT_n, "C2", 4) | |
| 1212 | CONNECTION("C5", 6, "C2", 5) | |
| 1213 | 1213 | |
| 1214 | //CONNECTION("AUDIO", 1, "C2", 6) | |
| 1215 | ALIAS(AUDIO, C2.6) | |
| 1214 | //CONNECTION("AUDIO", 1, "C2", 6) | |
| 1215 | ALIAS(AUDIO, C2.6) | |
| 1216 | 1216 | |
| 1217 | 1217 | #ifdef DEBUG |
| 1218 | CONNECTION("LOG1", 1, "COIN", 1) | |
| 1219 | CONNECTION("LOG1", 2, "A3", 3) | |
| 1220 | CONNECTION("LOG1", 3, "B2", 5) | |
| 1221 | CONNECTION("LOG1", 4, "H10", 5) | |
| 1222 | CONNECTION("LOG1", 5, "C3", 9) | |
| 1223 | CONNECTION("LOG1", 6, "G10", 5) | |
| 1224 | CONNECTION("LOG1", 7, "E2", 6) | |
| 1225 | CONNECTION("LOG1", 8, "B3", 3) | |
| 1218 | CONNECTION("LOG1", 1, "COIN", 1) | |
| 1219 | CONNECTION("LOG1", 2, "A3", 3) | |
| 1220 | CONNECTION("LOG1", 3, "B2", 5) | |
| 1221 | CONNECTION("LOG1", 4, "H10", 5) | |
| 1222 | CONNECTION("LOG1", 5, "C3", 9) | |
| 1223 | CONNECTION("LOG1", 6, "G10", 5) | |
| 1224 | CONNECTION("LOG1", 7, "E2", 6) | |
| 1225 | CONNECTION("LOG1", 8, "B3", 3) | |
| 1226 | 1226 | #endif |
| 1227 | 1227 | |
| 1228 | 1228 | |
| 1229 | 1229 | CIRCUIT_LAYOUT_END |
| 1230 | ||
| 1231 |
| r31373 | r31374 | |
|---|---|---|
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | Diagnostic Menu: |
| 52 | Press and keep P1 Start and Reset | |
| 53 | You'll see cross hatch test screen, then press P1 Start again. | |
| 52 | Press and keep P1 Start and Reset | |
| 53 | You'll see cross hatch test screen, then press P1 Start again. | |
| 54 | 54 | |
| 55 | 55 | |
| 56 | 56 | Secret menu hack [totmejan only] (I couldn't find official way to enter, so it's a hack): |
| 57 | Mame internal debugger: | |
| 58 | PC=ECFFD ; 'SECRET MENU' | |
| 59 | Keys: BACKSPC, ENTER, Z, P1 START | |
| 57 | Mame internal debugger: | |
| 58 | PC=ECFFD ; 'SECRET MENU' | |
| 59 | Keys: BACKSPC, ENTER, Z, P1 START | |
| 60 | 60 | |
| 61 | PC=E2EE2; 'TODAY: DATA' screen | |
| 62 | Keys: Z | |
| 61 | PC=E2EE2; 'TODAY: DATA' screen | |
| 62 | Keys: Z | |
| 63 | 63 | |
| 64 | ||
| 64 | PC=ECC72; 'HMODE' screen | |
| 65 | 65 | |
| 66 | 66 | |
| 67 | 67 | *******************************************************************************************/ |
| r31373 | r31374 | |
| 496 | 496 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 497 | 497 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 498 | 498 | |
| 499 | /* These games seems have 2 DIP Switches, DIPSW-A and DIPSW-B | |
| 500 | Game reads these switches at port C000h (16 bit) with two calls (subroutine 0EF522h [totmejan]) | |
| 499 | /* These games seems have 2 DIP Switches, DIPSW-A and DIPSW-B | |
| 500 | Game reads these switches at port C000h (16 bit) with two calls (subroutine 0EF522h [totmejan]) | |
| 501 | 501 | Needs to be rearranged and cleaned up (DSW1 current holds all dips and DSW2 appears to be additional inputs) */ |
| 502 | 502 | |
| 503 | 503 | PORT_START("DSW1") |
| r31373 | r31374 | |
| 527 | 527 | PORT_DIPSETTING( 0x0000, DEF_STR( On ) ) |
| 528 | 528 | PORT_DIPUNKNOWN_DIPLOC( 0x0080, 0x0080, "DSWA:8" ) |
| 529 | 529 | |
| 530 | ||
| 530 | PORT_DIPNAME( 0x0300, 0x0100, "Starting Points" ) PORT_DIPLOCATION("DSWB:1,2") | |
| 531 | 531 | PORT_DIPSETTING( 0x0300, "1500" ) |
| 532 | 532 | PORT_DIPSETTING( 0x0200, "2000" ) |
| 533 | 533 | PORT_DIPSETTING( 0x0100, "1000" ) |
| r31373 | r31374 | |
| 535 | 535 | |
| 536 | 536 | PORT_DIPUNKNOWN_DIPLOC( 0x0400, 0x0400, "DSWB:3" ) |
| 537 | 537 | PORT_DIPUNKNOWN_DIPLOC( 0x0800, 0x0800, "DSWB:4" ) |
| 538 | /* [totmejan] Game definitely uses these, reads these 2 bits and stores at address 01A28h as 0-1st bit; | |
| 539 | Sub-routine at E7C19h does some arithmetic operations depending on these. | |
| 540 | I cound't understand whats going on. Call performs just before dealing tiles. */ | |
| 538 | /* [totmejan] Game definitely uses these, reads these 2 bits and stores at address 01A28h as 0-1st bit; | |
| 539 | Sub-routine at E7C19h does some arithmetic operations depending on these. | |
| 540 | I cound't understand whats going on. Call performs just before dealing tiles. */ | |
| 541 | 541 | |
| 542 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSWB:5") | |
| 542 | PORT_DIPNAME( 0x1000, 0x1000, DEF_STR( Demo_Sounds ) ) PORT_DIPLOCATION("DSWB:5") | |
| 543 | 543 | PORT_DIPSETTING( 0x1000, DEF_STR( On ) ) |
| 544 | 544 | PORT_DIPSETTING( 0x0000, DEF_STR( Off ) ) |
| 545 | 545 | PORT_DIPNAME( 0x2000, 0x2000, "Explicit Scenes" ) PORT_DIPLOCATION("DSWB:6") |
| r31373 | r31374 | |
| 549 | 549 | PORT_DIPUNKNOWN_DIPLOC( 0x8000, 0x8000, "DSWB:8" ) |
| 550 | 550 | |
| 551 | 551 | PORT_START("DSW2") |
| 552 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 553 | PORT_BIT( 0xfffe, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 0x0002 must be kept low to work as service coin | |
| 552 | PORT_BIT( 0x0001, IP_ACTIVE_LOW, IPT_SERVICE1 ) | |
| 553 | PORT_BIT( 0xfffe, IP_ACTIVE_LOW, IPT_UNKNOWN ) // 0x0002 must be kept low to work as service coin | |
| 554 | 554 | INPUT_PORTS_END |
| 555 | 555 | |
| 556 | 556 |
| r31373 | r31374 | |
|---|---|---|
| 737 | 737 | |
| 738 | 738 | MCFG_DEVICE_ADD("cage", ATARI_CAGE, 0) |
| 739 | 739 | MCFG_ATARI_CAGE_SPEEDUP(0) // TODO: speedup address |
| 740 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(metalmx_state,cage_irq_callback)) | |
| 740 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(metalmx_state,cage_irq_callback)) | |
| 741 | 741 | MACHINE_CONFIG_END |
| 742 | 742 | |
| 743 | 743 |
| r31373 | r31374 | |
|---|---|---|
| 222 | 222 | static ADDRESS_MAP_START( star100_map, AS_PROGRAM, 8, goldstar_state ) |
| 223 | 223 | AM_RANGE(0x0000, 0xbfff) AM_ROM |
| 224 | 224 | |
| 225 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(sangho_fg_vidram_w ) AM_SHARE("fg_vidram") // videoram 1 | |
| 226 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(sangho_fg_atrram_w ) AM_SHARE("fg_atrram") // atrram 1 | |
| 225 | AM_RANGE(0xc800, 0xcfff) AM_RAM_WRITE(sangho_fg_vidram_w ) AM_SHARE("fg_vidram") // videoram 1 | |
| 226 | AM_RANGE(0xd000, 0xd7ff) AM_RAM_WRITE(sangho_fg_atrram_w ) AM_SHARE("fg_atrram") // atrram 1 | |
| 227 | 227 | |
| 228 | 228 | AM_RANGE(0xd800, 0xd83f) AM_RAM AM_SHARE("reel1_scroll") |
| 229 | 229 | AM_RANGE(0xd840, 0xd9ff) AM_RAM |
| r31373 | r31374 | |
| 236 | 236 | AM_RANGE(0xe200, 0xe3ff) AM_RAM_WRITE(goldstar_reel2_ram_w ) AM_SHARE("reel2_ram") |
| 237 | 237 | AM_RANGE(0xe400, 0xe5ff) AM_RAM_WRITE(goldstar_reel3_ram_w ) AM_SHARE("reel3_ram") |
| 238 | 238 | |
| 239 | AM_RANGE(0xe600, 0xe7ff) AM_RAM_WRITE(sangho_bg_vidram_w ) AM_SHARE("bg_vidram") | |
| 239 | AM_RANGE(0xe600, 0xe7ff) AM_RAM_WRITE(sangho_bg_vidram_w ) AM_SHARE("bg_vidram") // videoram 2 | |
| 240 | 240 | |
| 241 | 241 | AM_RANGE(0xe800, 0xe9ff) AM_RAM_WRITE(sangho_reel1_attrram_w ) AM_SHARE("reel1_attrram") |
| 242 | 242 | AM_RANGE(0xea00, 0xebff) AM_RAM_WRITE(sangho_reel2_attrram_w ) AM_SHARE("reel2_attrram") |
| 243 | 243 | AM_RANGE(0xec00, 0xedff) AM_RAM_WRITE(sangho_reel3_attrram_w ) AM_SHARE("reel3_attrram") |
| 244 | 244 | |
| 245 | AM_RANGE(0xee00, 0xefff) AM_RAM_WRITE(sangho_bg_atrram_w ) AM_SHARE("bg_atrram") | |
| 245 | AM_RANGE(0xee00, 0xefff) AM_RAM_WRITE(sangho_bg_atrram_w ) AM_SHARE("bg_atrram") // atrram 2 | |
| 246 | 246 | |
| 247 | 247 | AM_RANGE(0xf000, 0xf7ff) AM_RAM AM_SHARE("nvram") |
| 248 | 248 | AM_RANGE(0xf800, 0xffff) AM_RAM |
| r31373 | r31374 | |
| 278 | 278 | |
| 279 | 279 | static ADDRESS_MAP_START( star100_readport, AS_IO, 8, goldstar_state ) |
| 280 | 280 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 281 | ||
| 281 | ||
| 282 | 282 | AM_RANGE(0x08, 0x08) AM_DEVREADWRITE("aysnd", ay8910_device, data_r, data_w) |
| 283 | 283 | AM_RANGE(0x0c, 0x0c) AM_DEVWRITE("aysnd", ay8910_device, address_w) |
| 284 | 284 | |
| r31373 | r31374 | |
| 291 | 291 | AM_RANGE(0x1c, 0x1c) AM_DEVWRITE("ramdac", ramdac_device, index_w) |
| 292 | 292 | AM_RANGE(0x1d ,0x1d) AM_DEVWRITE("ramdac", ramdac_device, pal_w) |
| 293 | 293 | AM_RANGE(0x1e ,0x1e) AM_DEVWRITE("ramdac", ramdac_device, mask_w) |
| 294 | ||
| 295 | AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW4-0") // the first 4 bits map to DSW4 1 to 4. | |
| 296 | AM_RANGE(0x21, 0x21) AM_READ_PORT("DSW4-1") // the first 4 bits map to DSW4 5 to 8. | |
| 297 | 294 | |
| 298 | AM_RANGE(0x24, 0x24) AM_WRITE(sangho_coincount_w) // coin counters. | |
| 295 | AM_RANGE(0x20, 0x20) AM_READ_PORT("DSW4-0") // the first 4 bits map to DSW4 1 to 4. | |
| 296 | AM_RANGE(0x21, 0x21) AM_READ_PORT("DSW4-1") // the first 4 bits map to DSW4 5 to 8. | |
| 299 | 297 | |
| 298 | AM_RANGE(0x24, 0x24) AM_WRITE(sangho_coincount_w) // coin counters. | |
| 299 | ||
| 300 | 300 | AM_RANGE(0x25, 0x25) AM_READ_PORT("DSW2") |
| 301 | 301 | AM_RANGE(0x26, 0x26) AM_READ_PORT("DSW3") |
| 302 | 302 | |
| 303 | AM_RANGE(0xe0, 0xe0) AM_WRITENOP // writting 0's and 1's constantly. seems watchdog feeder. | |
| 304 | AM_RANGE(0xe1, 0xe1) AM_WRITE(sangho_enable_w) // enable/disable reels register. | |
| 303 | AM_RANGE(0xe0, 0xe0) AM_WRITENOP // writting 0's and 1's constantly. seems watchdog feeder. | |
| 304 | AM_RANGE(0xe1, 0xe1) AM_WRITE(sangho_enable_w) // enable/disable reels register. | |
| 305 | 305 | |
| 306 | 306 | ADDRESS_MAP_END |
| 307 | 307 | |
| 308 | 308 | /* |
| 309 | 08: W (3F) AY8910 data | |
| 310 | 0C: W (07) AY8910 address | |
| 309 | 08: W (3F) AY8910 data | |
| 310 | 0C: W (07) AY8910 address | |
| 311 | 311 | |
| 312 | 10: R Input #0 | |
| 313 | 11: R Input #1 | |
| 314 | 12: R Input #2 | |
| 315 | 13: R Input #3 | |
| 316 | ||
| 317 | 14: R DSW #1 | |
| 312 | 10: R Input #0 | |
| 313 | 11: R Input #1 | |
| 314 | 12: R Input #2 | |
| 315 | 13: R Input #3 | |
| 318 | 316 | |
| 317 | 14: R DSW #1 | |
| 318 | ||
| 319 | 319 | 17: W |
| 320 | 320 | |
| 321 | 1C: W \ these looks like RAMDAC commands. After write to 1C, there are 3 writes to 1D. | |
| 322 | 1D: W / bp: 6c5b. | |
| 321 | 1C: W \ these looks like RAMDAC commands. After write to 1C, there are 3 writes to 1D. | |
| 322 | 1D: W / bp: 6c5b. | |
| 323 | 323 | 1E: W (FF) --> seems the RAMDAC mask. |
| 324 | 324 | |
| 325 | 325 | 20: R DSW #4-0 |
| r31373 | r31374 | |
| 332 | 332 | 2F: W (9C) |
| 333 | 333 | |
| 334 | 334 | E0: W |
| 335 | E1: W | |
| 335 | E1: W Reels enable/disable register | |
| 336 | 336 | */ |
| 337 | 337 | |
| 338 | 338 | static ADDRESS_MAP_START( ramdac_map, AS_0, 8, goldstar_state ) |
| 339 | 339 | AM_RANGE(0x000, 0x3ff) AM_DEVREADWRITE("ramdac", ramdac_device, ramdac_pal_r, ramdac_rgb666_w) |
| 340 | ADDRESS_MAP_END | |
| 340 | ADDRESS_MAP_END | |
| 341 | 341 | |
| 342 | /* | |
| 342 | /* | |
| 343 | 343 | RAMDAC written commands: |
| 344 | 344 | |
| 345 | 345 | 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D 1C 1D 1D 1D |
| r31373 | r31374 | |
| 972 | 972 | static ADDRESS_MAP_START( bonusch_map, AS_PROGRAM, 8, goldstar_state ) |
| 973 | 973 | /* Reels stuff and RAM are there just as placeholder, and obviously in wrong offset */ |
| 974 | 974 | |
| 975 | AM_RANGE(0x0000, 0xbfff) AM_ROM | |
| 975 | AM_RANGE(0x0000, 0xbfff) AM_ROM // ok | |
| 976 | 976 | |
| 977 | 977 | AM_RANGE(0xd800, 0xdfff) AM_RAM //AM_SHARE("nvram") |
| 978 | 978 | AM_RANGE(0xf000, 0xffff) AM_RAM |
| r31373 | r31374 | |
| 1016 | 1016 | ADDRESS_MAP_GLOBAL_MASK(0xff) |
| 1017 | 1017 | AM_RANGE(0x10, 0x10) AM_READ_PORT("IN0") |
| 1018 | 1018 | AM_RANGE(0x20, 0x20) AM_READ_PORT("IN1") |
| 1019 | AM_RANGE(0x50, 0x50) AM_DEVWRITE("sn1", sn76489_device, write) /* SN76489 #1 */ | |
| 1020 | AM_RANGE(0x51, 0x51) AM_DEVWRITE("sn2", sn76489_device, write) /* SN76489 #2 */ | |
| 1021 | AM_RANGE(0x52, 0x52) AM_DEVWRITE("sn3", sn76489_device, write) /* SN76489 #3 */ | |
| 1022 | AM_RANGE(0x53, 0x53) AM_DEVWRITE("sn4", sn76489_device, write) /* SN76489 #4 */ | |
| 1019 | AM_RANGE(0x50, 0x50) AM_DEVWRITE("sn1", sn76489_device, write) /* SN76489 #1 */ | |
| 1020 | AM_RANGE(0x51, 0x51) AM_DEVWRITE("sn2", sn76489_device, write) /* SN76489 #2 */ | |
| 1021 | AM_RANGE(0x52, 0x52) AM_DEVWRITE("sn3", sn76489_device, write) /* SN76489 #3 */ | |
| 1022 | AM_RANGE(0x53, 0x53) AM_DEVWRITE("sn4", sn76489_device, write) /* SN76489 #4 */ | |
| 1023 | 1023 | AM_RANGE(0x60, 0x60) AM_READ_PORT("IN3") |
| 1024 | 1024 | ADDRESS_MAP_END |
| 1025 | 1025 | |
| r31373 | r31374 | |
| 6153 | 6153 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SLOT_STOP2 ) PORT_NAME("Stop 2 / Small") |
| 6154 | 6154 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_START1 ) PORT_NAME("Start") |
| 6155 | 6155 | |
| 6156 | // PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1) PORT_NAME("IN0-1") | |
| 6157 | // PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2) PORT_NAME("IN0-2") | |
| 6158 | // PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3) PORT_NAME("IN0-3: BIG") | |
| 6159 | // PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("IN0-4: DOUBLE UP") | |
| 6160 | // PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5) PORT_NAME("IN0-5: TAKE") | |
| 6161 | // PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6) PORT_NAME("IN0-6: BET") | |
| 6162 | // PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7) PORT_NAME("IN0-7: SMALL") | |
| 6163 | // PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8) PORT_NAME("IN0-8: START") | |
| 6156 | // PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1) PORT_NAME("IN0-1") | |
| 6157 | // PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2) PORT_NAME("IN0-2") | |
| 6158 | // PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_3) PORT_NAME("IN0-3: BIG") | |
| 6159 | // PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_4) PORT_NAME("IN0-4: DOUBLE UP") | |
| 6160 | // PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_5) PORT_NAME("IN0-5: TAKE") | |
| 6161 | // PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_6) PORT_NAME("IN0-6: BET") | |
| 6162 | // PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_7) PORT_NAME("IN0-7: SMALL") | |
| 6163 | // PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8) PORT_NAME("IN0-8: START") | |
| 6164 | 6164 | |
| 6165 | 6165 | PORT_START("IN1") |
| 6166 | 6166 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r31373 | r31374 | |
| 6169 | 6169 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6170 | 6170 | PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* Coin A */ |
| 6171 | 6171 | PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_COIN2 ) PORT_IMPULSE(2) /* Coin B */ |
| 6172 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) | |
| 6172 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_GAMBLE_KEYIN ) /* Key In */ | |
| 6173 | 6173 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN3 ) PORT_IMPULSE(2) /* Coin C */ |
| 6174 | 6174 | |
| 6175 | 6175 | PORT_START("IN2") |
| r31373 | r31374 | |
| 6182 | 6182 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_9) PORT_NAME("Settings / Test Mode") PORT_TOGGLE |
| 6183 | 6183 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_SERVICE ) PORT_CODE(KEYCODE_0) PORT_NAME("Statistics") |
| 6184 | 6184 | |
| 6185 | PORT_START("IN3") | |
| 6185 | PORT_START("IN3") // reflected in test mode | |
| 6186 | 6186 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6187 | 6187 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6188 | 6188 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r31373 | r31374 | |
| 6192 | 6192 | PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6193 | 6193 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6194 | 6194 | |
| 6195 | PORT_START("IN4") | |
| 6195 | PORT_START("IN4") // reflected in test mode | |
| 6196 | 6196 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6197 | 6197 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6198 | 6198 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r31373 | r31374 | |
| 6203 | 6203 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6204 | 6204 | |
| 6205 | 6205 | PORT_START("DSW1") |
| 6206 | PORT_DIPNAME( 0x01, 0x00, "Key Out" ) | |
| 6206 | PORT_DIPNAME( 0x01, 0x00, "Key Out" ) PORT_DIPLOCATION("SW1:1") | |
| 6207 | 6207 | PORT_DIPSETTING( 0x00, "x1" ) |
| 6208 | 6208 | PORT_DIPSETTING( 0x01, "x100" ) |
| 6209 | PORT_DIPNAME( 0x02, 0x02, "Bonus Rate" ) | |
| 6209 | PORT_DIPNAME( 0x02, 0x02, "Bonus Rate" ) PORT_DIPLOCATION("SW1:2") | |
| 6210 | 6210 | PORT_DIPSETTING( 0x00, "1/24" ) |
| 6211 | 6211 | PORT_DIPSETTING( 0x02, "1/32" ) |
| 6212 | PORT_DIPNAME( 0x04, 0x04, "Spin Rate" ) | |
| 6212 | PORT_DIPNAME( 0x04, 0x04, "Spin Rate" ) PORT_DIPLOCATION("SW1:3") | |
| 6213 | 6213 | PORT_DIPSETTING( 0x04, "Slow" ) |
| 6214 | 6214 | PORT_DIPSETTING( 0x00, "Fast" ) |
| 6215 | PORT_DIPNAME( 0x18, 0x18, "Double Up Rate" ) | |
| 6215 | PORT_DIPNAME( 0x18, 0x18, "Double Up Rate" ) PORT_DIPLOCATION("SW1:4,5") | |
| 6216 | 6216 | PORT_DIPSETTING( 0x18, "60%" ) |
| 6217 | 6217 | PORT_DIPSETTING( 0x10, "70%" ) |
| 6218 | 6218 | PORT_DIPSETTING( 0x08, "80%" ) |
| 6219 | 6219 | PORT_DIPSETTING( 0x00, "90%" ) |
| 6220 | PORT_DIPNAME( 0xe0, 0xe0, "Game Rate" ) | |
| 6220 | PORT_DIPNAME( 0xe0, 0xe0, "Game Rate" ) PORT_DIPLOCATION("SW1:6,7,8") | |
| 6221 | 6221 | PORT_DIPSETTING( 0xe0, "50%" ) |
| 6222 | 6222 | PORT_DIPSETTING( 0xc0, "60%" ) |
| 6223 | 6223 | PORT_DIPSETTING( 0xa0, "65%" ) |
| r31373 | r31374 | |
| 6228 | 6228 | PORT_DIPSETTING( 0x00, "90%" ) |
| 6229 | 6229 | |
| 6230 | 6230 | PORT_START("DSW2") |
| 6231 | PORT_DIPNAME( 0x01, 0x01, "Bonus Min Bet" ) | |
| 6231 | PORT_DIPNAME( 0x01, 0x01, "Bonus Min Bet" ) PORT_DIPLOCATION("SW2:1") | |
| 6232 | 6232 | PORT_DIPSETTING( 0x01, "16" ) |
| 6233 | 6233 | PORT_DIPSETTING( 0x00, "32" ) |
| 6234 | PORT_DIPNAME( 0x02, 0x02, "Number of Jackpot" ) | |
| 6234 | PORT_DIPNAME( 0x02, 0x02, "Number of Jackpot" ) PORT_DIPLOCATION("SW2:2") | |
| 6235 | 6235 | PORT_DIPSETTING( 0x00, "3 2" ) |
| 6236 | 6236 | PORT_DIPSETTING( 0x02, "6 3" ) |
| 6237 | PORT_DIPNAME( 0x04, 0x04, "Double Up" ) | |
| 6237 | PORT_DIPNAME( 0x04, 0x04, "Double Up" ) PORT_DIPLOCATION("SW2:3") | |
| 6238 | 6238 | PORT_DIPSETTING( 0x04, DEF_STR( Yes ) ) |
| 6239 | 6239 | PORT_DIPSETTING( 0x00, DEF_STR( No ) ) |
| 6240 | PORT_DIPNAME( 0x18, 0x18, "Payout Limit" ) | |
| 6240 | PORT_DIPNAME( 0x18, 0x18, "Payout Limit" ) PORT_DIPLOCATION("SW2:4,5") | |
| 6241 | 6241 | PORT_DIPSETTING( 0x18, "1000" ) |
| 6242 | 6242 | PORT_DIPSETTING( 0x10, "2000" ) |
| 6243 | 6243 | PORT_DIPSETTING( 0x08, "5000" ) |
| 6244 | 6244 | PORT_DIPSETTING( 0x00, "No Limit" ) |
| 6245 | PORT_DIPNAME( 0x20, 0x20, "Bonus" ) | |
| 6245 | PORT_DIPNAME( 0x20, 0x20, "Bonus" ) PORT_DIPLOCATION("SW2:6") | |
| 6246 | 6246 | PORT_DIPSETTING( 0x20, "Normal" ) |
| 6247 | 6247 | PORT_DIPSETTING( 0x00, "Random" ) |
| 6248 | PORT_DIPNAME( 0xc0, 0xc0, "Number of Clown" ) | |
| 6248 | PORT_DIPNAME( 0xc0, 0xc0, "Number of Clown" ) PORT_DIPLOCATION("SW2:7,8") | |
| 6249 | 6249 | PORT_DIPSETTING( 0xc0, "60%" ) |
| 6250 | 6250 | PORT_DIPSETTING( 0x80, "70%" ) |
| 6251 | 6251 | PORT_DIPSETTING( 0x40, "80%" ) |
| 6252 | 6252 | PORT_DIPSETTING( 0x00, "90%" ) |
| 6253 | 6253 | |
| 6254 | 6254 | PORT_START("DSW3") |
| 6255 | PORT_DIPNAME( 0x07, 0x07, "Key In Rate" ) | |
| 6255 | PORT_DIPNAME( 0x07, 0x07, "Key In Rate" ) PORT_DIPLOCATION("SW3:1,2,3") | |
| 6256 | 6256 | PORT_DIPSETTING( 0x00, "100 Credits" ) |
| 6257 | 6257 | PORT_DIPSETTING( 0x01, "110 Credits" ) |
| 6258 | 6258 | PORT_DIPSETTING( 0x02, "120 Credits" ) |
| r31373 | r31374 | |
| 6261 | 6261 | PORT_DIPSETTING( 0x05, "400 Credits" ) |
| 6262 | 6262 | PORT_DIPSETTING( 0x06, "500 Credits" ) |
| 6263 | 6263 | PORT_DIPSETTING( 0x07, "1000 Credits" ) |
| 6264 | PORT_DIPNAME( 0x18, 0x00, "Bet Limit" ) | |
| 6264 | PORT_DIPNAME( 0x18, 0x00, "Bet Limit" ) PORT_DIPLOCATION("SW3:4,5") | |
| 6265 | 6265 | PORT_DIPSETTING( 0x18, "32 (Limit of Bonus: 1/4)" ) |
| 6266 | 6266 | PORT_DIPSETTING( 0x10, "64 (Limit of Bonus: 1/2)" ) |
| 6267 | 6267 | PORT_DIPSETTING( 0x08, "72 (Limit of Bonus: All)" ) |
| 6268 | 6268 | PORT_DIPSETTING( 0x00, "80 (Limit of Bonus: All)" ) |
| 6269 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6269 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:6") | |
| 6270 | 6270 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6271 | 6271 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6272 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6272 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:7") | |
| 6273 | 6273 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6274 | 6274 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6275 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6275 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:8") | |
| 6276 | 6276 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6277 | 6277 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6278 | 6278 | |
| 6279 | 6279 | PORT_START("DSW4-0") |
| 6280 | PORT_DIPNAME( 0x07, 0x07, "Coinage A, B & C" ) | |
| 6280 | PORT_DIPNAME( 0x07, 0x07, "Coinage A, B & C" ) PORT_DIPLOCATION("SW4:1,2,3") | |
| 6281 | 6281 | PORT_DIPSETTING( 0x00, "1 Coin / 1 Credit" ) |
| 6282 | 6282 | PORT_DIPSETTING( 0x01, "1 Coin / 5 Credits" ) |
| 6283 | 6283 | PORT_DIPSETTING( 0x02, "1 Coin / 10 Credits" ) |
| r31373 | r31374 | |
| 6288 | 6288 | PORT_DIPSETTING( 0x07, "1 Coin / 100 Credit" ) |
| 6289 | 6289 | |
| 6290 | 6290 | /* the following two are 'bonus', and need conditional port since they are in different banks */ |
| 6291 | PORT_DIPNAME( 0x08, 0x08, "Bonus (switch-1)" ) | |
| 6291 | PORT_DIPNAME( 0x08, 0x08, "Bonus (switch-1)" ) PORT_DIPLOCATION("SW4:4") | |
| 6292 | 6292 | PORT_DIPSETTING( 0x08, "20000" ) PORT_CONDITION("DSW4-1", 0x01, NOTEQUALS, 0x00) |
| 6293 | 6293 | PORT_DIPSETTING( 0x08, "40000" ) PORT_CONDITION("DSW4-1", 0x01, EQUALS, 0x00) |
| 6294 | 6294 | PORT_DIPSETTING( 0x00, "30000" ) PORT_CONDITION("DSW4-1", 0x01, NOTEQUALS, 0x00) |
| r31373 | r31374 | |
| 6296 | 6296 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 6297 | 6297 | |
| 6298 | 6298 | PORT_START("DSW4-1") |
| 6299 | PORT_DIPNAME( 0x01, 0x01, "Bonus (switch-2)" ) | |
| 6299 | PORT_DIPNAME( 0x01, 0x01, "Bonus (switch-2)" ) PORT_DIPLOCATION("SW4:5") | |
| 6300 | 6300 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6301 | 6301 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6302 | 6302 | |
| 6303 | PORT_DIPNAME( 0x02, 0x02, "Max Bonus" ) | |
| 6303 | PORT_DIPNAME( 0x02, 0x02, "Max Bonus" ) PORT_DIPLOCATION("SW4:6") | |
| 6304 | 6304 | PORT_DIPSETTING( 0x00, "100000" ) |
| 6305 | 6305 | PORT_DIPSETTING( 0x02, "200000" ) |
| 6306 | PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) | |
| 6306 | PORT_DIPNAME( 0x0c, 0x0c, "Minimum Bet" ) PORT_DIPLOCATION("SW4:7,8") | |
| 6307 | 6307 | PORT_DIPSETTING( 0x0c, "0" ) |
| 6308 | 6308 | PORT_DIPSETTING( 0x08, "8" ) |
| 6309 | 6309 | PORT_DIPSETTING( 0x04, "16" ) |
| 6310 | 6310 | PORT_DIPSETTING( 0x00, "32" ) |
| 6311 | 6311 | PORT_BIT( 0xf0, IP_ACTIVE_LOW, IPT_UNUSED ) |
| 6312 | 6312 | |
| 6313 | PORT_START("DSW5") // phisically tied to ay8910 port A, but unused... | |
| 6314 | PORT_DIPNAME( 0x01, 0x01, "DSW5" ) PORT_DIPLOCATION("SW5:1") | |
| 6313 | PORT_START("DSW5") // phisically tied to ay8910 port A, but unused... | |
| 6314 | PORT_DIPNAME( 0x01, 0x01, "DSW5" ) PORT_DIPLOCATION("SW5:1") | |
| 6315 | 6315 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6316 | 6316 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6317 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6317 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:2") | |
| 6318 | 6318 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6319 | 6319 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6320 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6320 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:3") | |
| 6321 | 6321 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6322 | 6322 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6323 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6323 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:4") | |
| 6324 | 6324 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6325 | 6325 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6326 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 6326 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:5") | |
| 6327 | 6327 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 6328 | 6328 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6329 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6329 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:6") | |
| 6330 | 6330 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6331 | 6331 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6332 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6332 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:7") | |
| 6333 | 6333 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6334 | 6334 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6335 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6335 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:8") | |
| 6336 | 6336 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6337 | 6337 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6338 | 6338 | |
| 6339 | PORT_START("DSW6") // phisically tied to ay8910 port B, but unused... | |
| 6340 | PORT_DIPNAME( 0x01, 0x01, "DSW6" ) PORT_DIPLOCATION("SW6:1") | |
| 6339 | PORT_START("DSW6") // phisically tied to ay8910 port B, but unused... | |
| 6340 | PORT_DIPNAME( 0x01, 0x01, "DSW6" ) PORT_DIPLOCATION("SW6:1") | |
| 6341 | 6341 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6342 | 6342 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6343 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6343 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:2") | |
| 6344 | 6344 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6345 | 6345 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6346 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6346 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:3") | |
| 6347 | 6347 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6348 | 6348 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6349 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6349 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:4") | |
| 6350 | 6350 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6351 | 6351 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6352 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 6352 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:5") | |
| 6353 | 6353 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 6354 | 6354 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6355 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6355 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:6") | |
| 6356 | 6356 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6357 | 6357 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6358 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6358 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:7") | |
| 6359 | 6359 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6360 | 6360 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6361 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6361 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:8") | |
| 6362 | 6362 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6363 | 6363 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6364 | 6364 | INPUT_PORTS_END |
| 6365 | 6365 | |
| 6366 | 6366 | |
| 6367 | static INPUT_PORTS_START( crazybon ) | |
| 6367 | static INPUT_PORTS_START( crazybon ) // to analyze... | |
| 6368 | 6368 | PORT_START("IN0") |
| 6369 | 6369 | PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_1) PORT_NAME("IN0-1") |
| 6370 | 6370 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_2) PORT_NAME("IN0-2") |
| r31373 | r31374 | |
| 6416 | 6416 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_OTHER ) PORT_CODE(KEYCODE_8_PAD) PORT_NAME("IN4-8") |
| 6417 | 6417 | |
| 6418 | 6418 | PORT_START("DSW1") |
| 6419 | PORT_DIPNAME( 0x01, 0x01, "DSW1" ) | |
| 6419 | PORT_DIPNAME( 0x01, 0x01, "DSW1" ) PORT_DIPLOCATION("SW1:1") | |
| 6420 | 6420 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6421 | 6421 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6422 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6422 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:2") | |
| 6423 | 6423 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6424 | 6424 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6425 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6425 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:3") | |
| 6426 | 6426 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6427 | 6427 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6428 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6428 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:4") | |
| 6429 | 6429 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6430 | 6430 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6431 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 6431 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:5") | |
| 6432 | 6432 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 6433 | 6433 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6434 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6434 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:6") | |
| 6435 | 6435 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6436 | 6436 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6437 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6437 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:7") | |
| 6438 | 6438 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6439 | 6439 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6440 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6440 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW1:8") | |
| 6441 | 6441 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6442 | 6442 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6443 | 6443 | |
| 6444 | 6444 | PORT_START("DSW2") |
| 6445 | PORT_DIPNAME( 0x01, 0x01, "DSW2" ) | |
| 6445 | PORT_DIPNAME( 0x01, 0x01, "DSW2" ) PORT_DIPLOCATION("SW2:1") | |
| 6446 | 6446 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6447 | 6447 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6448 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6448 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:2") | |
| 6449 | 6449 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6450 | 6450 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6451 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6451 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:3") | |
| 6452 | 6452 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6453 | 6453 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6454 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6454 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:4") | |
| 6455 | 6455 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6456 | 6456 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6457 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 6457 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:5") | |
| 6458 | 6458 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 6459 | 6459 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6460 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6460 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:6") | |
| 6461 | 6461 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6462 | 6462 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6463 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6463 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:7") | |
| 6464 | 6464 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6465 | 6465 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6466 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6466 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW2:8") | |
| 6467 | 6467 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6468 | 6468 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6469 | 6469 | |
| 6470 | 6470 | PORT_START("DSW3") |
| 6471 | PORT_DIPNAME( 0x01, 0x01, "DSW3" ) | |
| 6471 | PORT_DIPNAME( 0x01, 0x01, "DSW3" ) PORT_DIPLOCATION("SW3:1") | |
| 6472 | 6472 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6473 | 6473 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6474 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6474 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:2") | |
| 6475 | 6475 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6476 | 6476 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6477 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6477 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:3") | |
| 6478 | 6478 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6479 | 6479 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6480 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6480 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:4") | |
| 6481 | 6481 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6482 | 6482 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6483 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 6483 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:5") | |
| 6484 | 6484 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 6485 | 6485 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6486 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6486 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:6") | |
| 6487 | 6487 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6488 | 6488 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6489 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6489 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:7") | |
| 6490 | 6490 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6491 | 6491 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6492 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6492 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW3:8") | |
| 6493 | 6493 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6494 | 6494 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6495 | 6495 | |
| 6496 | 6496 | PORT_START("DSW4-0") |
| 6497 | PORT_DIPNAME( 0x01, 0x01, "DSW4-0" ) | |
| 6497 | PORT_DIPNAME( 0x01, 0x01, "DSW4-0" ) PORT_DIPLOCATION("SW4:1") | |
| 6498 | 6498 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6499 | 6499 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6500 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6500 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:2") | |
| 6501 | 6501 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6502 | 6502 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6503 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6503 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:3") | |
| 6504 | 6504 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6505 | 6505 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6506 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6506 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:4") | |
| 6507 | 6507 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6508 | 6508 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6509 | 6509 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| r31373 | r31374 | |
| 6520 | 6520 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6521 | 6521 | |
| 6522 | 6522 | PORT_START("DSW4-1") |
| 6523 | PORT_DIPNAME( 0x01, 0x01, "DSW4-1" ) | |
| 6523 | PORT_DIPNAME( 0x01, 0x01, "DSW4-1" ) PORT_DIPLOCATION("SW4:5") | |
| 6524 | 6524 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6525 | 6525 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6526 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6526 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:6") | |
| 6527 | 6527 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6528 | 6528 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6529 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6529 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:7") | |
| 6530 | 6530 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6531 | 6531 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6532 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6532 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW4:8") | |
| 6533 | 6533 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6534 | 6534 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6535 | 6535 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) |
| r31373 | r31374 | |
| 6546 | 6546 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6547 | 6547 | |
| 6548 | 6548 | PORT_START("DSW5") |
| 6549 | PORT_DIPNAME( 0x01, 0x01, "DSW5" ) | |
| 6549 | PORT_DIPNAME( 0x01, 0x01, "DSW5" ) PORT_DIPLOCATION("SW5:1") | |
| 6550 | 6550 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6551 | 6551 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6552 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6552 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:2") | |
| 6553 | 6553 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6554 | 6554 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6555 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6555 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:3") | |
| 6556 | 6556 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6557 | 6557 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6558 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6558 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:4") | |
| 6559 | 6559 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6560 | 6560 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6561 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 6561 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:5") | |
| 6562 | 6562 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 6563 | 6563 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6564 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6564 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:6") | |
| 6565 | 6565 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6566 | 6566 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6567 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6567 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:7") | |
| 6568 | 6568 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6569 | 6569 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6570 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6570 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW5:8") | |
| 6571 | 6571 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6572 | 6572 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6573 | 6573 | |
| 6574 | 6574 | PORT_START("DSW6") |
| 6575 | PORT_DIPNAME( 0x01, 0x01, "DSW6" ) | |
| 6575 | PORT_DIPNAME( 0x01, 0x01, "DSW6" ) PORT_DIPLOCATION("SW6:1") | |
| 6576 | 6576 | PORT_DIPSETTING( 0x01, DEF_STR( Off ) ) |
| 6577 | 6577 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6578 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) | |
| 6578 | PORT_DIPNAME( 0x02, 0x02, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:2") | |
| 6579 | 6579 | PORT_DIPSETTING( 0x02, DEF_STR( Off ) ) |
| 6580 | 6580 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6581 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) | |
| 6581 | PORT_DIPNAME( 0x04, 0x04, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:3") | |
| 6582 | 6582 | PORT_DIPSETTING( 0x04, DEF_STR( Off ) ) |
| 6583 | 6583 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6584 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) | |
| 6584 | PORT_DIPNAME( 0x08, 0x08, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:4") | |
| 6585 | 6585 | PORT_DIPSETTING( 0x08, DEF_STR( Off ) ) |
| 6586 | 6586 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6587 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) | |
| 6587 | PORT_DIPNAME( 0x10, 0x10, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:5") | |
| 6588 | 6588 | PORT_DIPSETTING( 0x10, DEF_STR( Off ) ) |
| 6589 | 6589 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6590 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) | |
| 6590 | PORT_DIPNAME( 0x20, 0x20, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:6") | |
| 6591 | 6591 | PORT_DIPSETTING( 0x20, DEF_STR( Off ) ) |
| 6592 | 6592 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6593 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) | |
| 6593 | PORT_DIPNAME( 0x40, 0x40, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:7") | |
| 6594 | 6594 | PORT_DIPSETTING( 0x40, DEF_STR( Off ) ) |
| 6595 | 6595 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6596 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) | |
| 6596 | PORT_DIPNAME( 0x80, 0x80, DEF_STR( Unknown ) ) PORT_DIPLOCATION("SW6:8") | |
| 6597 | 6597 | PORT_DIPSETTING( 0x80, DEF_STR( Off ) ) |
| 6598 | 6598 | PORT_DIPSETTING( 0x00, DEF_STR( On ) ) |
| 6599 | 6599 | INPUT_PORTS_END |
| r31373 | r31374 | |
| 6620 | 6620 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* Coin A */ |
| 6621 | 6621 | |
| 6622 | 6622 | PORT_START("IN2") |
| 6623 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 6623 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Tied to GND and to the hidden switch that change games. (PC0+GND) -+-> PB0 */ | |
| 6624 | 6624 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6625 | 6625 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6626 | 6626 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r31373 | r31374 | |
| 6782 | 6782 | PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_COIN1 ) PORT_IMPULSE(2) /* Coin A */ |
| 6783 | 6783 | |
| 6784 | 6784 | PORT_START("IN2") |
| 6785 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) | |
| 6785 | PORT_BIT( 0x01, IP_ACTIVE_HIGH, IPT_SPECIAL ) /* Tied to GND and to the hidden switch that change games. (PC0+GND) -+-> (PB0|PB1) */ | |
| 6786 | 6786 | PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6787 | 6787 | PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| 6788 | 6788 | PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNKNOWN ) |
| r31373 | r31374 | |
| 7292 | 7292 | 3*16,16 cherries in game |
| 7293 | 7293 | 2*16,16 oranges and title girl in game |
| 7294 | 7294 | 1*16,16 nines in game |
| 7295 | */ | |
| 7295 | */ | |
| 7296 | 7296 | GFXDECODE_END |
| 7297 | 7297 | |
| 7298 | 7298 | |
| r31373 | r31374 | |
| 7758 | 7758 | |
| 7759 | 7759 | MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) |
| 7760 | 7760 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) |
| 7761 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) | |
| 7761 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed | |
| 7762 | 7762 | |
| 7763 | 7763 | MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0) |
| 7764 | 7764 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) |
| r31373 | r31374 | |
| 7808 | 7808 | |
| 7809 | 7809 | MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) |
| 7810 | 7810 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) |
| 7811 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) | |
| 7811 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed | |
| 7812 | 7812 | |
| 7813 | 7813 | MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0) |
| 7814 | 7814 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) |
| r31373 | r31374 | |
| 7858 | 7858 | |
| 7859 | 7859 | MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) |
| 7860 | 7860 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) |
| 7861 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) | |
| 7861 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed | |
| 7862 | 7862 | |
| 7863 | 7863 | MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0) |
| 7864 | 7864 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) |
| r31373 | r31374 | |
| 7907 | 7907 | |
| 7908 | 7908 | MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) |
| 7909 | 7909 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) |
| 7910 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) | |
| 7910 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed | |
| 7911 | 7911 | |
| 7912 | 7912 | MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0) |
| 7913 | 7913 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) |
| r31373 | r31374 | |
| 7957 | 7957 | |
| 7958 | 7958 | MCFG_DEVICE_ADD("ppi8255_0", I8255A, 0) |
| 7959 | 7959 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN0")) |
| 7960 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) | |
| 7960 | MCFG_I8255_IN_PORTB_CB(IOPORT("IN3")) //Player2 controls, confirmed | |
| 7961 | 7961 | |
| 7962 | 7962 | MCFG_DEVICE_ADD("ppi8255_1", I8255A, 0) |
| 7963 | 7963 | MCFG_I8255_IN_PORTA_CB(IOPORT("IN1")) |
| r31373 | r31374 | |
| 8723 | 8723 | MCFG_SPEAKER_STANDARD_MONO("mono") |
| 8724 | 8724 | |
| 8725 | 8725 | // MCFG_SOUND_ADD("aysnd", AY8910, AY_CLOCK) |
| 8726 | // | |
| 8727 | // | |
| 8728 | // MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW4")) | |
| 8729 | // MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) | |
| 8726 | // | |
| 8727 | // | |
| 8728 | // MCFG_AY8910_PORT_A_READ_CB(IOPORT("DSW4")) | |
| 8729 | // MCFG_AY8910_PORT_B_READ_CB(IOPORT("DSW3")) | |
| 8730 | 8730 | // MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.50) |
| 8731 | 8731 | MACHINE_CONFIG_END |
| 8732 | 8732 | |
| r31373 | r31374 | |
| 13231 | 13231 | 9800+ --> 3800+ |
| 13232 | 13232 | |
| 13233 | 13233 | */ |
| 13234 | // ROM_COPY( "maincpu", 0x1c000, 0x0000, 0x1000 ) /* src-dest-size ok */ | |
| 13235 | // ROM_COPY( "maincpu", 0x16000, 0x1000, 0x1000 ) /* src-dest-size ok */ | |
| 13236 | // ROM_COPY( "maincpu", 0x14000, 0x2000, 0x1000 ) /* src-dest-size ok */ | |
| 13237 | // ROM_COPY( "maincpu", 0x1a000, 0x3000, 0x1000 ) /* src-dest-size ok (some calls to high 5xxx appear here, maybe split in 0x800?) */ | |
| 13238 | // ROM_COPY( "maincpu", 0x15000, 0x4000, 0x1000 ) /* src-dest-size ok */ | |
| 13239 | // ROM_COPY( "maincpu", 0x11000, 0x6000, 0x1000 ) /* src-dest-size ok */ | |
| 13240 | // ROM_COPY( "maincpu", 0x13000, 0x8000, 0x1000 ) /* src-dest-size ok */ | |
| 13234 | // ROM_COPY( "maincpu", 0x1c000, 0x0000, 0x1000 ) /* src-dest-size ok */ | |
| 13235 | // ROM_COPY( "maincpu", 0x16000, 0x1000, 0x1000 ) /* src-dest-size ok */ | |
| 13236 | // ROM_COPY( "maincpu", 0x14000, 0x2000, 0x1000 ) /* src-dest-size ok */ | |
| 13237 | // ROM_COPY( "maincpu", 0x1a000, 0x3000, 0x1000 ) /* src-dest-size ok (some calls to high 5xxx appear here, maybe split in 0x800?) */ | |
| 13238 | // ROM_COPY( "maincpu", 0x15000, 0x4000, 0x1000 ) /* src-dest-size ok */ | |
| 13239 | // ROM_COPY( "maincpu", 0x11000, 0x6000, 0x1000 ) /* src-dest-size ok */ | |
| 13240 | // ROM_COPY( "maincpu", 0x13000, 0x8000, 0x1000 ) /* src-dest-size ok */ | |
| 13241 | 13241 | |
| 13242 | // ROM_COPY( "maincpu", 0x17000, 0x5000, 0x1000 ) /* src-dest-size */ | |
| 13243 | // ROM_COPY( "maincpu", 0x10000, 0x7000, 0x1000 ) /* src-dest-size */ | |
| 13244 | // ROM_COPY( "maincpu", 0x18000, 0x9000, 0x1000 ) /* src-dest-size */ | |
| 13245 | // ROM_COPY( "maincpu", 0x19000, 0xa000, 0x1000 ) /* src-dest-size */ | |
| 13246 | // ROM_COPY( "maincpu", 0x12000, 0xb000, 0x1000 ) /* src-dest-size */ | |
| 13247 | // ROM_COPY( "maincpu", 0x1b000, 0xc000, 0x1000 ) /* src-dest-size */ | |
| 13248 | // ROM_COPY( "maincpu", 0x1d000, 0xd000, 0x1000 ) /* src-dest-size */ | |
| 13249 | // ROM_COPY( "maincpu", 0x1e000, 0xe000, 0x1000 ) /* src-dest-size */ | |
| 13250 | // ROM_COPY( "maincpu", 0x1f000, 0xf000, 0x1000 ) /* src-dest-size */ | |
| 13242 | // ROM_COPY( "maincpu", 0x17000, 0x5000, 0x1000 ) /* src-dest-size */ | |
| 13243 | // ROM_COPY( "maincpu", 0x10000, 0x7000, 0x1000 ) /* src-dest-size */ | |
| 13244 | // ROM_COPY( "maincpu", 0x18000, 0x9000, 0x1000 ) /* src-dest-size */ | |
| 13245 | // ROM_COPY( "maincpu", 0x19000, 0xa000, 0x1000 ) /* src-dest-size */ | |
| 13246 | // ROM_COPY( "maincpu", 0x12000, 0xb000, 0x1000 ) /* src-dest-size */ | |
| 13247 | // ROM_COPY( "maincpu", 0x1b000, 0xc000, 0x1000 ) /* src-dest-size */ | |
| 13248 | // ROM_COPY( "maincpu", 0x1d000, 0xd000, 0x1000 ) /* src-dest-size */ | |
| 13249 | // ROM_COPY( "maincpu", 0x1e000, 0xe000, 0x1000 ) /* src-dest-size */ | |
| 13250 | // ROM_COPY( "maincpu", 0x1f000, 0xf000, 0x1000 ) /* src-dest-size */ | |
| 13251 | 13251 | |
| 13252 | ROM_COPY( "maincpu", 0x1c000, 0x0000, 0x0800 ) /* src-dest-size */ // #01 | |
| 13253 | ROM_COPY( "maincpu", 0x19800, 0x0800, 0x0800 ) /* src-dest-size */ // #02 | |
| 13254 | ROM_COPY( "maincpu", 0x16000, 0x1000, 0x0800 ) /* src-dest-size */ // #03 | |
| 13255 | ROM_COPY( "maincpu", 0x17800, 0x1800, 0x0800 ) /* src-dest-size */ // #04 | |
| 13256 | ROM_COPY( "maincpu", 0x14000, 0x2000, 0x0800 ) /* src-dest-size */ // #05 | |
| 13257 | ROM_COPY( "maincpu", 0x1c800, 0x2800, 0x0800 ) /* src-dest-size */ // #06 | |
| 13258 | ROM_COPY( "maincpu", 0x1a000, 0x3000, 0x0800 ) /* src-dest-size */ // #07 | |
| 13259 | ROM_COPY( "maincpu", 0x18800, 0x3800, 0x0800 ) /* src-dest-size */ // #08 | |
| 13260 | ROM_COPY( "maincpu", 0x10000, 0x4000, 0x0800 ) /* src-dest-size */ // #09 | |
| 13261 | ROM_COPY( "maincpu", 0x15000, 0x4800, 0x0800 ) /* src-dest-size */ // #10 | |
| 13262 | ROM_COPY( "maincpu", 0x14800, 0x5000, 0x0800 ) /* src-dest-size */ // #11 | |
| 13263 | ROM_COPY( "maincpu", 0x1a800, 0x5800, 0x0800 ) /* src-dest-size */ // #12 | |
| 13264 | ROM_COPY( "maincpu", 0x11000, 0x6000, 0x0800 ) /* src-dest-size */ // #13 | |
| 13265 | ROM_COPY( "maincpu", 0x11800, 0x6800, 0x0800 ) /* src-dest-size */ // #14 | |
| 13266 | ROM_COPY( "maincpu", 0x1b000, 0x7000, 0x0800 ) /* src-dest-size */ // #15 | |
| 13267 | ROM_COPY( "maincpu", 0x1f000, 0x7800, 0x0800 ) /* src-dest-size */ // #16 | |
| 13268 | ROM_COPY( "maincpu", 0x1f800, 0x8000, 0x0800 ) /* src-dest-size */ // #17 | |
| 13269 | ROM_COPY( "maincpu", 0x13800, 0x8800, 0x0800 ) /* src-dest-size */ // #18 | |
| 13270 | ROM_COPY( "maincpu", 0x19000, 0x9000, 0x0800 ) /* src-dest-size */ // #19 | |
| 13271 | ROM_COPY( "maincpu", 0x1b800, 0x9800, 0x0800 ) /* src-dest-size */ // #20 | |
| 13272 | ROM_COPY( "maincpu", 0x12000, 0xa000, 0x0800 ) /* src-dest-size */ // #21 | |
| 13273 | ROM_COPY( "maincpu", 0x10800, 0xa800, 0x0800 ) /* src-dest-size */ // #22 | |
| 13274 | ROM_COPY( "maincpu", 0x18000, 0xb000, 0x0800 ) /* src-dest-size */ // #23 | |
| 13275 | ROM_COPY( "maincpu", 0x12800, 0xb800, 0x0800 ) /* src-dest-size */ // #24 | |
| 13276 | ROM_COPY( "maincpu", 0x13000, 0xc000, 0x0800 ) /* src-dest-size */ // #25 | |
| 13252 | ROM_COPY( "maincpu", 0x1c000, 0x0000, 0x0800 ) /* src-dest-size */ // #01 | |
| 13253 | ROM_COPY( "maincpu", 0x19800, 0x0800, 0x0800 ) /* src-dest-size */ // #02 | |
| 13254 | ROM_COPY( "maincpu", 0x16000, 0x1000, 0x0800 ) /* src-dest-size */ // #03 | |
| 13255 | ROM_COPY( "maincpu", 0x17800, 0x1800, 0x0800 ) /* src-dest-size */ // #04 | |
| 13256 | ROM_COPY( "maincpu", 0x14000, 0x2000, 0x0800 ) /* src-dest-size */ // #05 | |
| 13257 | ROM_COPY( "maincpu", 0x1c800, 0x2800, 0x0800 ) /* src-dest-size */ // #06 | |
| 13258 | ROM_COPY( "maincpu", 0x1a000, 0x3000, 0x0800 ) /* src-dest-size */ // #07 | |
| 13259 | ROM_COPY( "maincpu", 0x18800, 0x3800, 0x0800 ) /* src-dest-size */ // #08 | |
| 13260 | ROM_COPY( "maincpu", 0x10000, 0x4000, 0x0800 ) /* src-dest-size */ // #09 | |
| 13261 | ROM_COPY( "maincpu", 0x15000, 0x4800, 0x0800 ) /* src-dest-size */ // #10 | |
| 13262 | ROM_COPY( "maincpu", 0x14800, 0x5000, 0x0800 ) /* src-dest-size */ // #11 | |
| 13263 | ROM_COPY( "maincpu", 0x1a800, 0x5800, 0x0800 ) /* src-dest-size */ // #12 | |
| 13264 | ROM_COPY( "maincpu", 0x11000, 0x6000, 0x0800 ) /* src-dest-size */ // #13 | |
| 13265 | ROM_COPY( "maincpu", 0x11800, 0x6800, 0x0800 ) /* src-dest-size */ // #14 | |
| 13266 | ROM_COPY( "maincpu", 0x1b000, 0x7000, 0x0800 ) /* src-dest-size */ // #15 | |
| 13267 | ROM_COPY( "maincpu", 0x1f000, 0x7800, 0x0800 ) /* src-dest-size */ // #16 | |
| 13268 | ROM_COPY( "maincpu", 0x1f800, 0x8000, 0x0800 ) /* src-dest-size */ // #17 | |
| 13269 | ROM_COPY( "maincpu", 0x13800, 0x8800, 0x0800 ) /* src-dest-size */ // #18 | |
| 13270 | ROM_COPY( "maincpu", 0x19000, 0x9000, 0x0800 ) /* src-dest-size */ // #19 | |
| 13271 | ROM_COPY( "maincpu", 0x1b800, 0x9800, 0x0800 ) /* src-dest-size */ // #20 | |
| 13272 | ROM_COPY( "maincpu", 0x12000, 0xa000, 0x0800 ) /* src-dest-size */ // #21 | |
| 13273 | ROM_COPY( "maincpu", 0x10800, 0xa800, 0x0800 ) /* src-dest-size */ // #22 | |
| 13274 | ROM_COPY( "maincpu", 0x18000, 0xb000, 0x0800 ) /* src-dest-size */ // #23 | |
| 13275 | ROM_COPY( "maincpu", 0x12800, 0xb800, 0x0800 ) /* src-dest-size */ // #24 | |
| 13276 | ROM_COPY( "maincpu", 0x13000, 0xc000, 0x0800 ) /* src-dest-size */ // #25 | |
| 13277 | 13277 | |
| 13278 | 13278 | ROM_REGION( 0x18000, "gfx1", 0 ) |
| 13279 | 13279 | ROM_LOAD( "cm89-tetri-7.u16", 0x00000, 0x8000, CRC(2f5c94bd) SHA1(d99bcaa788f8abf5c75b29572d53be109b20c4bb) ) |
| r31373 | r31374 | |
| 13328 | 13328 | Because of the dual amp, this might support it being a sound chip. |
| 13329 | 13329 | Probably tracing pin connections to the HX881 will confirm it. |
| 13330 | 13330 | |
| 13331 | ||
| 13331 | ||
| 13332 | 13332 | You can switch the games pulsing their respective hidden buttons. |
| 13333 | 13333 | |
| 13334 | 13334 | Hidden Switch: |
| r31373 | r31374 | |
| 14146 | 14146 | GAME( 198?, ladylinr, 0, ladylinr, ladylinr, driver_device, 0, ROT0, "TAB Austria", "Lady Liner", 0 ) |
| 14147 | 14147 | GAME( 198?, wcat3, 0, wcat3, lucky8, driver_device, 0, ROT0, "E.A.I.", "Wild Cat 3", GAME_NOT_WORKING ) |
| 14148 | 14148 | |
| 14149 | GAME( 1985, luckylad, 0, lucky8, luckylad, driver_device, 0, ROT0, "Wing Co., Ltd.", "Lucky Lady (Wing, encrypted)", GAME_NOT_WORKING ) | |
| 14149 | GAME( 1985, luckylad, 0, lucky8, luckylad, driver_device, 0, ROT0, "Wing Co., Ltd.", "Lucky Lady (Wing, encrypted)", GAME_NOT_WORKING ) // encrypted (see notes in rom_load)... | |
| 14150 | 14150 | GAME( 1991, megaline, 0, megaline, megaline, driver_device, 0, ROT0, "Fun World", "Mega Lines", GAME_NOT_WORKING ) |
| 14151 | GAME( 1990, bonusch, 0, bonusch, bonusch, driver_device, 0, ROT0, "Wing Co., Ltd.", "Bonus Chance (W-8)", GAME_NOT_WORKING ) | |
| 14151 | GAME( 1990, bonusch, 0, bonusch, bonusch, driver_device, 0, ROT0, "Wing Co., Ltd.", "Bonus Chance (W-8)", GAME_NOT_WORKING ) // M80C51F MCU | |
| 14152 | 14152 | |
| 14153 | 14153 | |
| 14154 | 14154 | GAMEL( 1993, bingowng, 0, bingowng, bingowng, driver_device, 0, ROT0, "Wing Co., Ltd.", "Bingo (set 1)", 0, layout_bingowng ) |
| r31373 | r31374 | |
| 14218 | 14218 | /* YEAR NAME PARENT MACHINE INPUT STATE INIT ROT COMPANY FULLNAME FLAGS */ |
| 14219 | 14219 | GAME( 198?, cmpacman, 0, cm, cmpacman, goldstar_state, cm, ROT0, "<unknown>", "Super Pacman (v1.2) + Cherry Master (Corsica, v8.31)", 0 ) /* need to press K to switch between games... */ |
| 14220 | 14220 | GAME( 198?, cmtetris, 0, cm, cmtetris, goldstar_state, cm, ROT0, "<unknown>", "Tetris + Cherry Master (Corsica, v8.01, set 1)", 0 ) /* need to press K/L to switch between games... */ |
| 14221 | GAME( 198?, cmtetrsa, 0, cm, cmtetris, goldstar_state, cm, ROT0, "<unknown>", "Tetris + Cherry Master (Corsica, v8.01, set 2)", GAME_NOT_WORKING) // seems banked... | |
| 14222 | GAME( 198?, cmtetrsb, 0, cm, cmtetris, goldstar_state, cm, ROT0, "<unknown>", "Tetris + Cherry Master (+K, Canada Version, encrypted)", GAME_NOT_WORKING) // different Tetris game | |
| 14221 | GAME( 198?, cmtetrsa, 0, cm, cmtetris, goldstar_state, cm, ROT0, "<unknown>", "Tetris + Cherry Master (Corsica, v8.01, set 2)", GAME_NOT_WORKING) // seems banked... | |
| 14222 | GAME( 198?, cmtetrsb, 0, cm, cmtetris, goldstar_state, cm, ROT0, "<unknown>", "Tetris + Cherry Master (+K, Canada Version, encrypted)", GAME_NOT_WORKING) // different Tetris game | |
| 14223 | 14223 | |
| 14224 | 14224 | /* other possible stealth sets: |
| 14225 | 14225 | - cmv4a ---> see the 1fxx zone. put a bp in 1f9f to see the loop. |
| r31373 | r31374 | |
|---|---|---|
| 322 | 322 | MCFG_KONAMICPU_LINE_CB(WRITE8(simpsons_state, banking_callback)) |
| 323 | 323 | |
| 324 | 324 | MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz) /* verified on pcb */ |
| 325 | MCFG_CPU_PROGRAM_MAP(z80_map) | |
| 325 | MCFG_CPU_PROGRAM_MAP(z80_map) /* NMIs are generated by the 053260 */ | |
| 326 | 326 | |
| 327 | 327 | MCFG_DEVICE_ADD("bank0000", ADDRESS_MAP_BANK, 0) |
| 328 | 328 | MCFG_DEVICE_PROGRAM_MAP(bank0000_map) |
| r31373 | r31374 | |
|---|---|---|
| 1411 | 1411 | PGM_68K_BIOS |
| 1412 | 1412 | ROM_LOAD16_WORD_SWAP( "p0600.322", 0x100000, 0x400000, CRC(7c78e5f3) SHA1(9b1e4bd63fb1294ebeb539966842273c8dc7683b) ) |
| 1413 | 1413 | //ROM_LOAD16_WORD_SWAP( "kovsh-v0104-u1.bin", 0x100000, 0x400000, CRC(4e2ba39b) SHA1(f3b5aa6f45cfd5a7f1e2a2e893d1652a3f23d6b8) ) // identical but the last 1MB is filled with 0xff instead of 0x00 |
| 1414 | ||
| 1414 | ||
| 1415 | 1415 | ROM_REGION( 0x4000, "prot", 0 ) /* ARM protection ASIC - internal rom */ |
| 1416 | 1416 | ROM_LOAD( "kovsh_v100_china.asic", 0x000000, 0x04000, CRC(0f09a5c1) SHA1(621b38c05f33277608d58b49822aebc930ae4870) ) |
| 1417 | 1417 |
| r31373 | r31374 | |
|---|---|---|
| 681 | 681 | MCFG_I8255_IN_PORTA_CB(READ8(ecoinf3_state, ppi8255_intf_a_read_a)) |
| 682 | 682 | MCFG_I8255_OUT_PORTA_CB(WRITE8(ecoinf3_state, ppi8255_intf_a_write_a_strobedat0)) |
| 683 | 683 | MCFG_I8255_IN_PORTB_CB(READ8(ecoinf3_state, ppi8255_intf_a_read_b)) |
| 684 | MCFG_I8255_OUT_PORTB_CB(WRITE8(ecoinf3_state, ppi8255_intf_a_write_b_strobedat1)) | |
| 684 | MCFG_I8255_OUT_PORTB_CB(WRITE8(ecoinf3_state, ppi8255_intf_a_write_b_strobedat1)) | |
| 685 | 685 | MCFG_I8255_IN_PORTC_CB(READ8(ecoinf3_state, ppi8255_intf_a_read_c)) |
| 686 | 686 | MCFG_I8255_OUT_PORTC_CB(WRITE8(ecoinf3_state, ppi8255_intf_a_write_c_strobe)) |
| 687 | 687 | |
| r31373 | r31374 | |
| 711 | 711 | |
| 712 | 712 | MCFG_DEVICE_ADD("ppi8255_e", I8255, 0) |
| 713 | 713 | MCFG_I8255_IN_PORTA_CB(READ8(ecoinf3_state, ppi8255_intf_e_read_a)) |
| 714 | MCFG_I8255_OUT_PORTA_CB(WRITE8(ecoinf3_state, ppi8255_intf_e_write_a_alpha_display)) | |
| 714 | MCFG_I8255_OUT_PORTA_CB(WRITE8(ecoinf3_state, ppi8255_intf_e_write_a_alpha_display)) // alpha display characters | |
| 715 | 715 | MCFG_I8255_IN_PORTB_CB(READ8(ecoinf3_state, ppi8255_intf_e_read_b)) |
| 716 | MCFG_I8255_OUT_PORTB_CB(WRITE8(ecoinf3_state, ppi8255_intf_e_write_b)) | |
| 716 | MCFG_I8255_OUT_PORTB_CB(WRITE8(ecoinf3_state, ppi8255_intf_e_write_b)) // not written at an appropriate time for it to be a 'send' address for the text | |
| 717 | 717 | MCFG_I8255_IN_PORTC_CB(READ8(ecoinf3_state, ppi8255_intf_e_read_c)) |
| 718 | MCFG_I8255_OUT_PORTC_CB(WRITE8(ecoinf3_state, ppi8255_intf_e_write_c)) | |
| 718 | MCFG_I8255_OUT_PORTC_CB(WRITE8(ecoinf3_state, ppi8255_intf_e_write_c)) // not written at an appropriate time for it to be a 'send' address for the text | |
| 719 | 719 | |
| 720 | 720 | MCFG_DEVICE_ADD("ppi8255_f", I8255, 0) |
| 721 | 721 | MCFG_I8255_IN_PORTA_CB(READ8(ecoinf3_state, ppi8255_intf_f_read_a)) |
| r31373 | r31374 | |
|---|---|---|
| 501 | 501 | /* sound hardware */ |
| 502 | 502 | MCFG_SOUND_MODIFY("ay2") |
| 503 | 503 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(timeplt_state, chkun_sound_w)) |
| 504 | ||
| 504 | ||
| 505 | 505 | MCFG_TC8830F_ADD("tc8830f", XTAL_512kHz) |
| 506 | 506 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.10) |
| 507 | 507 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 260 | 260 | |
| 261 | 261 | // 0xafb0 IC24 - lamps, 7segs |
| 262 | 262 | MCFG_DEVICE_ADD("ic24", I8255A, 0) |
| 263 | MCFG_I8255_OUT_PORTA_CB(WRITE8(aces1_state, ic24_write_a)) // 7segs | |
| 264 | MCFG_I8255_OUT_PORTB_CB(WRITE8(aces1_state, ic24_write_b)) // lamps | |
| 265 | MCFG_I8255_OUT_PORTC_CB(WRITE8(aces1_state, ic24_write_c)) // strobe | |
| 263 | MCFG_I8255_OUT_PORTA_CB(WRITE8(aces1_state, ic24_write_a)) // 7segs | |
| 264 | MCFG_I8255_OUT_PORTB_CB(WRITE8(aces1_state, ic24_write_b)) // lamps | |
| 265 | MCFG_I8255_OUT_PORTC_CB(WRITE8(aces1_state, ic24_write_c)) // strobe | |
| 266 | 266 | |
| 267 | 267 | // 0xafd0 IC25 - lamps, meters, reel comms (writes) |
| 268 | 268 | MCFG_DEVICE_ADD("ic25", I8255A, 0) |
| 269 | MCFG_I8255_OUT_PORTA_CB(WRITE8(aces1_state, ic25_write_a)) // extra lamps | |
| 270 | MCFG_I8255_OUT_PORTB_CB(WRITE8(aces1_state, ic25_write_b)) // meters, extra lamp select | |
| 271 | MCFG_I8255_OUT_PORTC_CB(WRITE8(aces1_state, ic25_write_c)) // reel write, extra lamp strobe | |
| 269 | MCFG_I8255_OUT_PORTA_CB(WRITE8(aces1_state, ic25_write_a)) // extra lamps | |
| 270 | MCFG_I8255_OUT_PORTB_CB(WRITE8(aces1_state, ic25_write_b)) // meters, extra lamp select | |
| 271 | MCFG_I8255_OUT_PORTC_CB(WRITE8(aces1_state, ic25_write_c)) // reel write, extra lamp strobe | |
| 272 | 272 | |
| 273 | 273 | // 0xafe0 IC37 - doors, coins, reel optics (reads) |
| 274 | 274 | MCFG_DEVICE_ADD("ic37", I8255A, 0) |
| 275 | MCFG_I8255_IN_PORTA_CB(READ8(aces1_state, ic37_read_a)) // extra lamps | |
| 276 | MCFG_I8255_IN_PORTB_CB(READ8(aces1_state, ic37_read_b)) // meters, extra lamp select | |
| 277 | MCFG_I8255_IN_PORTC_CB(READ8(aces1_state, ic37_read_c)) // reel write, extra lamp strobe | |
| 275 | MCFG_I8255_IN_PORTA_CB(READ8(aces1_state, ic37_read_a)) // extra lamps | |
| 276 | MCFG_I8255_IN_PORTB_CB(READ8(aces1_state, ic37_read_b)) // meters, extra lamp select | |
| 277 | MCFG_I8255_IN_PORTC_CB(READ8(aces1_state, ic37_read_c)) // reel write, extra lamp strobe | |
| 278 | 278 | |
| 279 | 279 | MCFG_DEFAULT_LAYOUT(layout_aces1) |
| 280 | 280 | |
| r31373 | r31374 | |
| 337 | 337 | ROM_END |
| 338 | 338 | |
| 339 | 339 | ROM_START( ac1cshtw ) // Cash Towers, same ROM as above, original machine apparently plays the same, reskinned machine? |
| 340 | ROM_REGION( 0x8000, "maincpu", 0 ) | |
| 341 | ROM_LOAD( "ctp1.bin", 0x0000, 0x8000, CRC(2fabb08f) SHA1(b737930e428f9258ab22394229c2b5039edf8f97) ) | |
| 340 | ROM_REGION( 0x8000, "maincpu", 0 ) | |
| 341 | ROM_LOAD( "ctp1.bin", 0x0000, 0x8000, CRC(2fabb08f) SHA1(b737930e428f9258ab22394229c2b5039edf8f97) ) | |
| 342 | 342 | ROM_END |
| 343 | 343 | |
| 344 | 344 |
| r31373 | r31374 | |
|---|---|---|
| 475 | 475 | required_shared_ptr<UINT32> m_rombase; |
| 476 | 476 | required_device<dcs_audio_device> m_dcs; |
| 477 | 477 | required_device<midway_ioasic_device> m_ioasic; |
| 478 | ||
| 478 | ||
| 479 | 479 | UINT16 m_nile_irq_state; |
| 480 | 480 | UINT16 m_ide_irq_state; |
| 481 | 481 | UINT32 m_pci_bridge_regs[0x40]; |
| r31373 | r31374 | |
| 1564 | 1564 | |
| 1565 | 1565 | /* the build the list of stuff */ |
| 1566 | 1566 | m_dynamic_count = 0; |
| 1567 | ||
| 1567 | ||
| 1568 | 1568 | /* DCS2 */ |
| 1569 | 1569 | base = m_nile_regs[NREG_DCS2] & 0x1fffff00; |
| 1570 | 1570 | if (base >= m_rambase.bytes()) |
| r31373 | r31374 | |
| 2265 | 2265 | MCFG_VOODOO_FBMEM(16) |
| 2266 | 2266 | MCFG_VOODOO_SCREEN_TAG("screen") |
| 2267 | 2267 | MCFG_VOODOO_CPU_TAG("maincpu") |
| 2268 | MCFG_VOODOO_VBLANK_CB(WRITELINE(vegas_state,vblank_assert)) | |
| 2268 | MCFG_VOODOO_VBLANK_CB(WRITELINE(vegas_state,vblank_assert)) | |
| 2269 | 2269 | MACHINE_CONFIG_END |
| 2270 | 2270 | |
| 2271 | 2271 | |
| r31373 | r31374 | |
| 2303 | 2303 | // Per driver configs |
| 2304 | 2304 | |
| 2305 | 2305 | static MACHINE_CONFIG_DERIVED( gauntleg, vegas ) |
| 2306 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2306 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2307 | 2307 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2308 | 2308 | MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d) |
| 2309 | 2309 | |
| r31373 | r31374 | |
| 2316 | 2316 | MACHINE_CONFIG_END |
| 2317 | 2317 | |
| 2318 | 2318 | static MACHINE_CONFIG_DERIVED( gauntdl, vegas ) |
| 2319 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2319 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2320 | 2320 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2321 | 2321 | MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d) |
| 2322 | 2322 | |
| r31373 | r31374 | |
| 2329 | 2329 | MACHINE_CONFIG_END |
| 2330 | 2330 | |
| 2331 | 2331 | static MACHINE_CONFIG_DERIVED( warfa, vegas250 ) |
| 2332 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2332 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2333 | 2333 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2334 | 2334 | MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0b5d) |
| 2335 | 2335 | |
| r31373 | r31374 | |
| 2342 | 2342 | MACHINE_CONFIG_END |
| 2343 | 2343 | |
| 2344 | 2344 | static MACHINE_CONFIG_DERIVED( tenthdeg, vegas ) |
| 2345 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2345 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2346 | 2346 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2347 | 2347 | MCFG_DCS2_AUDIO_POLLING_OFFSET(0x0afb) |
| 2348 | 2348 | |
| r31373 | r31374 | |
| 2355 | 2355 | MACHINE_CONFIG_END |
| 2356 | 2356 | |
| 2357 | 2357 | static MACHINE_CONFIG_DERIVED( roadburn, vegas32m ) |
| 2358 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DSIO, 0) | |
| 2358 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DSIO, 0) | |
| 2359 | 2359 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2360 | 2360 | MCFG_DCS2_AUDIO_POLLING_OFFSET(0) /* no place to hook :-( */ |
| 2361 | 2361 | |
| r31373 | r31374 | |
| 2368 | 2368 | MACHINE_CONFIG_END |
| 2369 | 2369 | |
| 2370 | 2370 | static MACHINE_CONFIG_DERIVED( nbashowt, vegasban ) |
| 2371 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2371 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2372 | 2372 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2373 | 2373 | |
| 2374 | 2374 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| r31373 | r31374 | |
| 2380 | 2380 | MACHINE_CONFIG_END |
| 2381 | 2381 | |
| 2382 | 2382 | static MACHINE_CONFIG_DERIVED( nbanfl, vegasban ) |
| 2383 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2383 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2384 | 2384 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2385 | 2385 | |
| 2386 | 2386 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| r31373 | r31374 | |
| 2392 | 2392 | MACHINE_CONFIG_END |
| 2393 | 2393 | |
| 2394 | 2394 | static MACHINE_CONFIG_DERIVED( sf2049 , denver ) |
| 2395 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0) | |
| 2395 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0) | |
| 2396 | 2396 | MCFG_DCS2_AUDIO_DRAM_IN_MB(8) |
| 2397 | 2397 | |
| 2398 | 2398 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| r31373 | r31374 | |
| 2404 | 2404 | MACHINE_CONFIG_END |
| 2405 | 2405 | |
| 2406 | 2406 | static MACHINE_CONFIG_DERIVED( sf2049se, denver ) |
| 2407 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0) | |
| 2407 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0) | |
| 2408 | 2408 | MCFG_DCS2_AUDIO_DRAM_IN_MB(8) |
| 2409 | 2409 | |
| 2410 | 2410 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| r31373 | r31374 | |
| 2416 | 2416 | MACHINE_CONFIG_END |
| 2417 | 2417 | |
| 2418 | 2418 | static MACHINE_CONFIG_DERIVED( sf2049te, denver ) |
| 2419 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0) | |
| 2419 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_DENVER, 0) | |
| 2420 | 2420 | MCFG_DCS2_AUDIO_DRAM_IN_MB(8) |
| 2421 | 2421 | |
| 2422 | 2422 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| r31373 | r31374 | |
| 2428 | 2428 | MACHINE_CONFIG_END |
| 2429 | 2429 | |
| 2430 | 2430 | static MACHINE_CONFIG_DERIVED( cartfury, vegasv3 ) |
| 2431 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2431 | MCFG_DEVICE_ADD("dcs", DCS2_AUDIO_2104, 0) | |
| 2432 | 2432 | MCFG_DCS2_AUDIO_DRAM_IN_MB(4) |
| 2433 | 2433 | |
| 2434 | 2434 | MCFG_DEVICE_ADD("ioasic", MIDWAY_IOASIC, 0) |
| r31373 | r31374 | |
|---|---|---|
| 238 | 238 | } |
| 239 | 239 | case 1: |
| 240 | 240 | { |
| 241 | //Reset 0x04, data 0x02, clock | |
| 241 | //Reset 0x04, data 0x02, clock | |
| 242 | 242 | m_vfd->por(data & 0x04); |
| 243 | 243 | m_vfd->data(data & 0x02); |
| 244 | 244 | m_vfd->sclk(data & 0x01); |
| r31373 | r31374 | |
|---|---|---|
| 16 | 16 | public: |
| 17 | 17 | wpc_dcs_state(const machine_config &mconfig, device_type type, const char *tag) |
| 18 | 18 | : driver_device(mconfig, type, tag), |
| 19 | maincpu(*this, "maincpu"), | |
| 20 | dcs(*this, "dcs"), | |
| 21 | rombank(*this, "rombank"), | |
| 22 | mainram(*this, "mainram"), | |
| 23 | nvram(*this, "nvram"), | |
| 24 | lamp(*this, "lamp"), | |
| 25 | out(*this, "out"), | |
| 26 | swarray(*this, "SW") | |
| 19 | maincpu(*this, "maincpu"), | |
| 20 | dcs(*this, "dcs"), | |
| 21 | rombank(*this, "rombank"), | |
| 22 | mainram(*this, "mainram"), | |
| 23 | nvram(*this, "nvram"), | |
| 24 | lamp(*this, "lamp"), | |
| 25 | out(*this, "out"), | |
| 26 | swarray(*this, "SW") | |
| 27 | 27 | { } |
| 28 | 28 | |
| 29 | 29 | DECLARE_WRITE8_MEMBER(bank_w); |
| r31373 | r31374 | |
| 293 | 293 | |
| 294 | 294 | static INPUT_PORTS_START( wpc_dcs ) |
| 295 | 295 | PORT_START("SW.0") |
| 296 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 297 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 298 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 299 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 300 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 301 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 302 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 303 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 296 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_START2) PORT_NAME("Launch button") | |
| 297 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 298 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_START1) PORT_NAME("Start button") | |
| 299 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Plumb bob tilt") | |
| 300 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 301 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left outlane") | |
| 302 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right return") | |
| 303 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Shooter lane") | |
| 304 | 304 | |
| 305 | 305 | PORT_START("SW.1") |
| 306 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 307 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 308 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 309 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 310 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 311 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 312 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 313 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 306 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Slam tilt") | |
| 307 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Coin door closed") PORT_TOGGLE PORT_CODE(KEYCODE_F1) | |
| 308 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 309 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 310 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 311 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left return") | |
| 312 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right outlane") | |
| 313 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 314 | 314 | |
| 315 | 315 | PORT_START("SW.2") |
| 316 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 317 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 318 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 319 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 320 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 321 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 322 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 323 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 316 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough eject") | |
| 317 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 1") | |
| 318 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 2") | |
| 319 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 3") | |
| 320 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Trough ball 4") | |
| 321 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Left popper") | |
| 322 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("Right popper") | |
| 323 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left top lane") | |
| 324 | 324 | |
| 325 | 325 | PORT_START("SW.3") |
| 326 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 327 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 328 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 329 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 330 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 331 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 332 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 333 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 326 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTI\"A\"N") | |
| 327 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MARTIA\"N\"") | |
| 328 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MAR\"T\"IN") | |
| 329 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MART\"I\"AN") | |
| 330 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L motor bank") | |
| 331 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C motor bank") | |
| 332 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R motor bank") | |
| 333 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right top lane") | |
| 334 | 334 | |
| 335 | 335 | PORT_START("SW.4") |
| 336 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 337 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 338 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 339 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 340 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 341 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 342 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 343 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 336 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left slingshot") | |
| 337 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right slingshot") | |
| 338 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left jet") | |
| 339 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Bottom jet") | |
| 340 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right jet") | |
| 341 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("\"M\"ARTIAN") | |
| 342 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("M\"A\"RTIAN") | |
| 343 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("MA\"R\"TIAN") | |
| 344 | 344 | |
| 345 | 345 | PORT_START("SW.5") |
| 346 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 347 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 348 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 349 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 350 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 351 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 352 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 353 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 346 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp enter") | |
| 347 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("C ramp enter") | |
| 348 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp enter") | |
| 349 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L ramp exit") | |
| 350 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R ramp exit") | |
| 351 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank down") | |
| 352 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Motor bank up") | |
| 353 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 354 | 354 | |
| 355 | 355 | PORT_START("SW.6") |
| 356 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 357 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 358 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 359 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 360 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 361 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 362 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 363 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 356 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop hi") | |
| 357 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Right loop lo") | |
| 358 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop hi") | |
| 359 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Left loop lo") | |
| 360 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("L saucer tgt") | |
| 361 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("R saucer tgt") | |
| 362 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Drop target") | |
| 363 | PORT_BIT(0x80, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Center trough") | |
| 364 | 364 | |
| 365 | 365 | PORT_START("SW.7") |
| 366 | ||
| 366 | PORT_BIT(0xff, IP_ACTIVE_HIGH, IPT_UNUSED) | |
| 367 | 367 | |
| 368 | 368 | PORT_START("DOOR") |
| 369 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 370 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 371 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 372 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 373 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 374 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 375 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 376 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 369 | PORT_BIT(0x01, IP_ACTIVE_HIGH, IPT_COIN1) PORT_NAME("Left coin chute") | |
| 370 | PORT_BIT(0x02, IP_ACTIVE_HIGH, IPT_COIN2) PORT_NAME("Center coin chute") | |
| 371 | PORT_BIT(0x04, IP_ACTIVE_HIGH, IPT_COIN3) PORT_NAME("Right coin chute") | |
| 372 | PORT_BIT(0x08, IP_ACTIVE_HIGH, IPT_COIN4) PORT_NAME("4th coin chute") | |
| 373 | PORT_BIT(0x10, IP_ACTIVE_HIGH, IPT_SERVICE1) PORT_NAME("Service credit/Escape") | |
| 374 | PORT_BIT(0x20, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Down/Down") PORT_CODE(KEYCODE_DOWN) | |
| 375 | PORT_BIT(0x40, IP_ACTIVE_HIGH, IPT_OTHER) PORT_NAME("Volume Up/Up") PORT_CODE(KEYCODE_UP) | |
| 376 | PORT_SERVICE_NO_TOGGLE(0x80, IP_ACTIVE_HIGH ) PORT_NAME("Begin test/Enter") | |
| 377 | 377 | |
| 378 | 378 | PORT_START("DSW") |
| 379 | 379 | PORT_DIPNAME(0x01,0x01,"Switch 1") PORT_DIPLOCATION("SWA:1") |
| r31373 | r31374 | |
| 407 | 407 | PORT_DIPSETTING(0xf0,"USA 2") |
| 408 | 408 | |
| 409 | 409 | PORT_START("FLIPPERS") |
| 410 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 411 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 412 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 413 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 414 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 415 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 416 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 417 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 410 | PORT_BIT(0x01, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper EOS") | |
| 411 | PORT_BIT(0x02, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("R Flipper Button") | |
| 412 | PORT_BIT(0x04, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper EOS") | |
| 413 | PORT_BIT(0x08, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("L Flipper Button") | |
| 414 | PORT_BIT(0x10, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 415 | PORT_BIT(0x20, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UR Flipper Button") | |
| 416 | PORT_BIT(0x40, IP_ACTIVE_LOW, IPT_UNUSED) | |
| 417 | PORT_BIT(0x80, IP_ACTIVE_LOW, IPT_OTHER) PORT_NAME("UL Flipper Button") | |
| 418 | 418 | |
| 419 | 419 | INPUT_PORTS_END |
| 420 | 420 |
| r31373 | r31374 | |
|---|---|---|
| 301 | 301 | |
| 302 | 302 | ROM_START(rota_115) |
| 303 | 303 | ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) |
| 304 | ROM_LOAD("v115-a.bin", 0x0000, 0x0800, CRC(474884b3) SHA1(b7919bf2e3a3897c1180373cccf88240c57b5645)) | |
| 305 | ROM_LOAD("v115-b.bin", 0x0800, 0x0800, CRC(8779fc6c) SHA1(df00f58d38b4eca68603247ae69009e13cfa31fb)) | |
| 306 | ROM_LOAD("v115-c.bin", 0x1000, 0x0800, CRC(54b420f9) SHA1(597bb9f8ad0b20babc696175e9fbcecf2d5d799d)) | |
| 304 | ROM_LOAD("v115-a.bin", 0x0000, 0x0800, CRC(474884b3) SHA1(b7919bf2e3a3897c1180373cccf88240c57b5645)) | |
| 305 | ROM_LOAD("v115-b.bin", 0x0800, 0x0800, CRC(8779fc6c) SHA1(df00f58d38b4eca68603247ae69009e13cfa31fb)) | |
| 306 | ROM_LOAD("v115-c.bin", 0x1000, 0x0800, CRC(54b420f9) SHA1(597bb9f8ad0b20babc696175e9fbcecf2d5d799d)) | |
| 307 | 307 | ROM_END |
| 308 | 308 | |
| 309 | 309 | ROM_START(rota_101) |
| 310 | 310 | ROM_REGION(0x10000, "maincpu", ROMREGION_ERASEFF) |
| 311 | ROM_LOAD("v101-a.bin", 0x0000, 0x0800, CRC(e89f3de6) SHA1(0b62220a24e176f2d7838da080b447a3df9ce05d)) | |
| 312 | ROM_LOAD("v101-b.bin", 0x0800, 0x0800, CRC(0690670b) SHA1(6399a7df707d644d0b7fe7b4fea6fb5091a9883d)) | |
| 313 | ROM_LOAD("v101-c.bin", 0x1000, 0x0800, CRC(c7e85638) SHA1(b59805d8b558ab8f5ea5b4b9261e862afca4b9d3)) | |
| 311 | ROM_LOAD("v101-a.bin", 0x0000, 0x0800, CRC(e89f3de6) SHA1(0b62220a24e176f2d7838da080b447a3df9ce05d)) | |
| 312 | ROM_LOAD("v101-b.bin", 0x0800, 0x0800, CRC(0690670b) SHA1(6399a7df707d644d0b7fe7b4fea6fb5091a9883d)) | |
| 313 | ROM_LOAD("v101-c.bin", 0x1000, 0x0800, CRC(c7e85638) SHA1(b59805d8b558ab8f5ea5b4b9261e862afca4b9d3)) | |
| 314 | 314 | ROM_END |
| 315 | 315 | |
| 316 | GAME(1978, rotation, 0, | |
| 316 | GAME(1978, rotation, 0, g627, g627, driver_device, 0, ROT0, "Midway", "Rotation VIII (v. 1.17)", GAME_MECHANICAL ) | |
| 317 | 317 | GAME(1978, rota_115, rotation, g627, g627, driver_device, 0, ROT0, "Midway", "Rotation VIII (v. 1.15)", GAME_MECHANICAL ) |
| 318 | 318 | GAME(1978, rota_101, rotation, g627, g627, driver_device, 0, ROT0, "Midway", "Rotation VIII (v. 1.01)", GAME_MECHANICAL ) |
| r31373 | r31374 | |
|---|---|---|
| 836 | 836 | /* sound hardware */ |
| 837 | 837 | MCFG_DEVICE_ADD("cage", ATARI_CAGE, 0) |
| 838 | 838 | MCFG_ATARI_CAGE_SPEEDUP(0x4fad) |
| 839 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(atarigt_state,cage_irq_callback)) | |
| 839 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(atarigt_state,cage_irq_callback)) | |
| 840 | 840 | MACHINE_CONFIG_END |
| 841 | 841 | |
| 842 | 842 | static MACHINE_CONFIG_DERIVED( primrage, atarigt ) |
| 843 | 843 | /* sound hardware */ |
| 844 | 844 | MCFG_DEVICE_ADD("cage", ATARI_CAGE, 0) |
| 845 | 845 | MCFG_ATARI_CAGE_SPEEDUP(0x42f2) |
| 846 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(atarigt_state,cage_irq_callback)) | |
| 846 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(atarigt_state,cage_irq_callback)) | |
| 847 | 847 | MACHINE_CONFIG_END |
| 848 | 848 | |
| 849 | 849 | static MACHINE_CONFIG_DERIVED( primrage20, atarigt ) |
| 850 | 850 | /* sound hardware */ |
| 851 | 851 | MCFG_DEVICE_ADD("cage", ATARI_CAGE, 0) |
| 852 | 852 | MCFG_ATARI_CAGE_SPEEDUP(0x48a4) |
| 853 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(atarigt_state,cage_irq_callback)) | |
| 853 | MCFG_ATARI_CAGE_IRQ_CALLBACK(WRITE8(atarigt_state,cage_irq_callback)) | |
| 854 | 854 | MACHINE_CONFIG_END |
| 855 | 855 | |
| 856 | 856 | /************************************* |
| r31373 | r31374 | |
| 1331 | 1331 | * |
| 1332 | 1332 | *************************************/ |
| 1333 | 1333 | |
| 1334 | GAME( 1994, tmek, 0, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v5.1, The Warlords)", GAME_UNEMULATED_PROTECTION ) | |
| 1335 | GAME( 1994, tmek51p, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v5.1, prototype)", GAME_UNEMULATED_PROTECTION ) | |
| 1336 | GAME( 1994, tmek45, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v4.5)", GAME_UNEMULATED_PROTECTION ) | |
| 1337 | GAME( 1994, tmek44, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v4.4)", GAME_UNEMULATED_PROTECTION ) | |
| 1338 | GAME( 1994, tmek20, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v2.0, prototype)", 0 ) | |
| 1334 | GAME( 1994, tmek, 0, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v5.1, The Warlords)", GAME_UNEMULATED_PROTECTION ) | |
| 1335 | GAME( 1994, tmek51p, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v5.1, prototype)", GAME_UNEMULATED_PROTECTION ) | |
| 1336 | GAME( 1994, tmek45, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v4.5)", GAME_UNEMULATED_PROTECTION ) | |
| 1337 | GAME( 1994, tmek44, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v4.4)", GAME_UNEMULATED_PROTECTION ) | |
| 1338 | GAME( 1994, tmek20, tmek, tmek, tmek, atarigt_state, tmek, ROT0, "Atari Games", "T-MEK (v2.0, prototype)", 0 ) | |
| 1339 | 1339 | GAME( 1994, primrage, 0, primrage, primrage, atarigt_state, primrage, ROT0, "Atari Games", "Primal Rage (version 2.3)", GAME_UNEMULATED_PROTECTION ) |
| 1340 | 1340 | GAME( 1994, primrage20, primrage, primrage20,primrage, atarigt_state, primrage, ROT0, "Atari Games", "Primal Rage (version 2.0)", GAME_UNEMULATED_PROTECTION ) |
| r31373 | r31374 | |
|---|---|---|
| 250 | 250 | MCFG_KONAMICPU_LINE_CB(WRITE8(rollerg_state, banking_callback)) |
| 251 | 251 | |
| 252 | 252 | MCFG_CPU_ADD("audiocpu", Z80, 3579545) |
| 253 | MCFG_CPU_PROGRAM_MAP(rollerg_sound_map) | |
| 253 | MCFG_CPU_PROGRAM_MAP(rollerg_sound_map) /* NMIs are generated by the 053260 */ | |
| 254 | 254 | |
| 255 | 255 | /* video hardware */ |
| 256 | 256 | MCFG_SCREEN_ADD("screen", RASTER) |
| r31373 | r31374 | |
|---|---|---|
| 579 | 579 | m_back_color = false; |
| 580 | 580 | |
| 581 | 581 | //if(!linecount) |
| 582 | // | |
| 582 | // logerror("%d %d %02x %02x %02x %02x %02x %02x %02x\n", x/8, y/8, charcode, lineattr, lten, rvv, vsp, gpa, hlgt); | |
| 583 | 583 | |
| 584 | 584 | for(i=0;i<8;i+=2) |
| 585 | 585 | { |
| r31373 | r31374 | |
| 603 | 603 | m_back_color = false; |
| 604 | 604 | |
| 605 | 605 | //if(!linecount) |
| 606 | // | |
| 606 | // logerror("%d %d %02x %02x %02x %02x %02x %02x %02x\n", x/8, y/8, charcode, lineattr, lten, rvv, vsp, gpa, hlgt); | |
| 607 | 607 | |
| 608 | 608 | for(i=0;i<8;i+=2) |
| 609 | 609 | { |
| r31373 | r31374 | |
|---|---|---|
| 1421 | 1421 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1422 | 1422 | |
| 1423 | 1423 | MCFG_SOUND_ADD("ay3", AY8910, 3579545) |
| 1424 | ||
| 1425 | ||
| 1424 | ||
| 1425 | ||
| 1426 | 1426 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(cinemat_state, sound_output_w)) |
| 1427 | 1427 | MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 0.25) |
| 1428 | 1428 | MACHINE_CONFIG_END |
| r31373 | r31374 | |
|---|---|---|
| 779 | 779 | machine().save().register_postload(save_prepost_delegate(FUNC(dcs_audio_device::sdrc_remap_memory), this)); |
| 780 | 780 | } |
| 781 | 781 | |
| 782 | ||
| 782 | ||
| 783 | 783 | //------------------------------------------------- |
| 784 | 784 | // dcs_audio_device - constructor |
| 785 | 785 | //------------------------------------------------- |
| r31373 | r31374 | |
| 911 | 911 | } |
| 912 | 912 | if (m_cpu != NULL && !m_cpu->started()) |
| 913 | 913 | throw device_missing_dependencies(); |
| 914 | ||
| 914 | ||
| 915 | 915 | m_program = &m_cpu->space(AS_PROGRAM); |
| 916 | 916 | m_data = &m_cpu->space(AS_DATA); |
| 917 | 917 | m_channels = 2; |
| r31373 | r31374 | |
| 1450 | 1450 | /* going high halts the CPU */ |
| 1451 | 1451 | if (state) |
| 1452 | 1452 | { |
| 1453 | // | |
| 1453 | // logerror("%s: DCS reset = %d\n", machine().describe_context(), state); | |
| 1454 | 1454 | |
| 1455 | 1455 | /* just run through the init code again */ |
| 1456 | 1456 | machine().scheduler().synchronize(timer_expired_delegate(FUNC(dcs_audio_device::dcs_reset),this)); |
| r31373 | r31374 | |
| 2444 | 2444 | { |
| 2445 | 2445 | } |
| 2446 | 2446 | |
| 2447 | ||
| 2447 | ||
| 2448 | 2448 | const device_type DCS2_AUDIO_2115 = &device_creator<dcs2_audio_2115_device>; |
| 2449 | 2449 | |
| 2450 | 2450 | //------------------------------------------------- |
| r31373 | r31374 | |
| 2509 | 2509 | { |
| 2510 | 2510 | return MACHINE_CONFIG_NAME( dcs2_audio_denver ); |
| 2511 | 2511 | } |
| 2512 | ||
| 2513 |
| r31373 | r31374 | |
|---|---|---|
| 384 | 384 | MCFG_DEVICE_PERIODIC_INT_DEVICE(DEVICE_SELF, midway_ssio_device, clock_14024, SSIO_CLOCK/2/16/10) |
| 385 | 385 | |
| 386 | 386 | MCFG_SOUND_ADD("ay0", AY8910, SSIO_CLOCK/2/4) |
| 387 | ||
| 388 | ||
| 387 | ||
| 388 | ||
| 389 | 389 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(midway_ssio_device, porta0_w)) |
| 390 | 390 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(midway_ssio_device, portb0_w)) |
| 391 | 391 | MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.33, 0) |
| 392 | 392 | |
| 393 | 393 | MCFG_SOUND_ADD("ay1", AY8910, SSIO_CLOCK/2/4) |
| 394 | ||
| 395 | ||
| 394 | ||
| 395 | ||
| 396 | 396 | MCFG_AY8910_PORT_A_WRITE_CB(WRITE8(midway_ssio_device, porta1_w)) |
| 397 | 397 | MCFG_AY8910_PORT_B_WRITE_CB(WRITE8(midway_ssio_device, portb1_w)) |
| 398 | 398 | MCFG_MIXER_ROUTE(ALL_OUTPUTS, DEVICE_SELF_OWNER, 0.33, 1) |
| r31373 | r31374 | |
|---|---|---|
| 104 | 104 | * Initialization |
| 105 | 105 | * |
| 106 | 106 | *************************************/ |
| 107 | ||
| 107 | ||
| 108 | 108 | const device_type ATARI_CAGE = &device_creator<atari_cage_device>; |
| 109 | 109 | |
| 110 | 110 | |
| r31373 | r31374 | |
| 581 | 581 | |
| 582 | 582 | WRITE32_MEMBER( atari_cage_device::speedup_w ) |
| 583 | 583 | { |
| 584 | ||
| 585 | 584 | space.device().execute().eat_cycles(100); |
| 586 | 585 | COMBINE_DATA(&m_speedup_ram[offset]); |
| 587 | 586 | } |
| r31373 | r31374 | |
|---|---|---|
| 211 | 211 | /* noise generator runs at 100kHz */ |
| 212 | 212 | UINT32 step = (100000 << 14) / CEM3394_SAMPLE_RATE; |
| 213 | 213 | UINT32 noise_counter = m_noise_position[chip]; |
| 214 | ||
| 214 | ||
| 215 | 215 | while (count--) |
| 216 | 216 | { |
| 217 | 217 | *buffer++ = m_poly17[(noise_counter >> 14) & POLY17_SIZE] << 12; |
| 218 | 218 | noise_counter += step; |
| 219 | 219 | } |
| 220 | ||
| 220 | ||
| 221 | 221 | /* remember the noise position */ |
| 222 | 222 | m_noise_position[chip] = noise_counter; |
| 223 | 223 | } |
| r31373 | r31374 | |
|---|---|---|
| 305 | 305 | |
| 306 | 306 | driver FD1094 SP plain SP enc PC plain PC enc States Used (majority one marked with asterisk, if known) |
| 307 | 307 | -------- -------- -------- -------- -------- -------- --------------------- |
| 308 | aceattac 317-0059 00000000 A711AF59 00000414 AF59AACD 00 12 17 31 45 90 FC* | |
| 309 | aceattaca 317-0060 00000000 A711AF59 00000400 AF59EADD 00 17 31 45 90 FC* | |
| 310 | altbeast5 317-0069 FFFFFF00 B2F7F299 00000400 CCDDEF58 00 0F 18 20 93* A7 D8 | |
| 311 | altbeastj1 317-0065 FFFFFF00 C9C5F299 00000400 CCDDECDD 00 09 12 67* 99 FC | |
| 312 | altbeastj3 317-0068 FFFFFF00 B2F7F299 00000400 CCDDEF58 00 0F 18 20 93* A7 D8 | |
| 313 | astorm 317-0154 FFFFFF00 B297F23F 00000400 BD5999DD 00 1F 48* 5F 66 ED | |
| 314 | astorm3 317-0148 FFFFFF00 ED9FF23F 00000400 FC58B9DC 00 06 36 50 CC D9* | |
| 315 | astormj 317-0146 FFFFFF00 ED8CF23F 00000400 FC58BC59 00 10 29* 44 CE DF | |
| 316 | astormu 317-0147 FFFFFF00 B297F23F 00000400 55334533 00 19 2D 46 58* DF | |
| 317 | bayroute 317-0116 00504000 5EB40000 00001000 5533A184 00 04* 11 18 | |
| 318 | bayroutej 317-0115 00504000 56150000 00001000 85948DCF 00 05* 12 16 | |
| 319 | bloxeed 317-0139 00000000 5D92A711 00001D38 BD59FFE8 00 49 53 55 56* DF | |
| 320 | bullet 317-0041 00000000 57355D96 00001882 8DDC8CF4 00 12 21 69* FE | |
| 321 | cltchitr 317-0176 00000000 A711A711 00000416 AF59EBCD 00 01* 80 FC | |
| 322 | cltchitrj 317-0175 00000000 5F94A711 00000416 AF59AFFB 00 03 19* 91 | |
| 323 | cotton 317-0181a 00204000 5DB20000 00000716 CCDD0716 00 0E* 73 | |
| 324 | cottonj 317-0179b 00204000 5DB20000 00000720 CCDD0720 00 0E* 73 | |
| 325 | cottonu 317-0180 00204000 5DB20000 00000716 A1840716 00 0E* 73 | |
| 326 | ddcrew 317-0190 00000000 AF595D92 00000408 BD59FD7F 00 07 16* 17 | |
| 327 | ddcrew1 317-0187 00000000 5F945D96 00000408 8DDCE758 00 04 07* 13 91 | |
| 328 | ddcrew2 317-0184 00000000 AF595D92 00000408 5533FD7F 00 07 12* 16 22 | |
| 329 | ddcrewj 317-0185 00000000 5F945D92 00000408 5533FD7F 00 06 07* 09 91 | |
| 330 | ddcrewu 317-0186 00000000 AF59A711 00000408 8DDCC381 00 01 07 5F 91* | |
| 331 | ddux 317-0096 00000000 5F94AF59 00000406 AF5987A0 00 21 28 70* D9 | |
| 332 | desertbr 317-0196 00000000 55335D92 00001838 5533F46A 00 3C 4A 82 DA* | |
| 333 | desertbrj 317-0194 00000000 55335D92 00001838 BD59E720 00 3C 4A 82 DA* | |
| 334 | eswat 317-0130 00000000 A711AF59 00000400 5533BC59 00 05 0C EC FA* | |
| 335 | eswatj 317-0128 00000000 A711AF59 00000400 55334735 00 55 63 CB* D5 | |
| 336 | eswatu 317-0129 00000000 5537AF59 00000400 55334735 00 0A 12 C3* CC | |
| 337 | exctleag 317-0079 00000000 5537AF59 00000410 83018384 00 02 39 4B 85 98 E5* | |
| 338 | fpoint 317-0127a 00000000 AF59AF59 00001A40 8DDC9960 00 15* 35 5F 82 DB | |
| 339 | fpoint1 317-0127a 00000000 AF59AF59 00001A40 8DDC9960 00 15* 35 5F 82 DB | |
| 340 | goldnaxe1 317-0110 FFFFFF00 ED62F2B9 00000400 AF59A785 00 19 2E 31 48* 5D | |
| 341 | goldnaxe3 317-0120 FFFFFF00 ED62F2B9 00000400 AF59A785 00 0A 0D 44 C7 EF* | |
| 342 | goldnaxej 317-0121 FFFFFF00 C9D6F2B9 00000400 AF59A785 00 12* 35 58 7A 9E | |
| 343 | goldnaxeu 317-0122 FFFFFF00 E53AF2B9 00000400 A184A196 00 03 51* 72 99 F6 | |
| 344 | hwchampj 317-0046 00000000 5D925D96 000008AC AF59AA41 00 8B* E3 | |
| 345 | lghost 317-0166 00000000 5F94A711 00000404 EE588241 00 A2 DC E0* | |
| 346 | lghostu 317-0165 00000000 AF59A711 00000404 EE58C340 00 56 C4 DE* | |
| 347 | mvp 317-0143 00000000 5F94A711 00000416 BD59DC5B 00 19* 20 88 98 | |
| 348 | mwalk 317-0159 FFFFFF00 C9C7F23F 00000400 5533BD7F 00 39 51* AA CC | |
| 349 | mwalkj 317-0157 FFFFFF00 B2F7F23F 00000400 5533BD7F 00 20 88 99 CF* | |
| 350 | mwalku 317-0158 FFFFFF00 C572F23F 00000400 8DDC8DDD 00 49* 90 C0 DE | |
| 351 | passsht 317-0080 00000000 AF59AF59 00003202 C2003923 00 11 52* 96 EE | |
| 352 | passshta 317-0074 00000000 AF59AF59 000031E4 C2003F8C 00 12* 47 83 A7 | |
| 353 | passshtj 317-0070 00000000 5D92AF59 000031E4 C2003F8C 00 12 59 83* FE | |
| 354 | pontoon 317-0153 00000000 A7115D92 00000E0C FC585979 00 19 70 DC* FC | |
| 355 | ryukyu 317-5023 00203800 AF49D30B 0000042E FC5863B5 00 DC* EF | |
| 356 | shinobi2 317-0049 FFFFFF00 C9C5F25F 00000400 AF598395 00 53 88 98 9B 9C* F1 | |
| 357 | sonicbom 317-0053 00000000 5735AF59 00001000 FC587133 00* | |
| 358 | suprleag 317-0045 00000000 A711AF59 0000108E BD59CE5B 00 12* 34 56 AB CD | |
| 308 | aceattac 317-0059 00000000 A711AF59 00000414 AF59AACD 00 12 17 31 45 90 FC* | |
| 309 | aceattaca 317-0060 00000000 A711AF59 00000400 AF59EADD 00 17 31 45 90 FC* | |
| 310 | altbeast5 317-0069 FFFFFF00 B2F7F299 00000400 CCDDEF58 00 0F 18 20 93* A7 D8 | |
| 311 | altbeastj1 317-0065 FFFFFF00 C9C5F299 00000400 CCDDECDD 00 09 12 67* 99 FC | |
| 312 | altbeastj3 317-0068 FFFFFF00 B2F7F299 00000400 CCDDEF58 00 0F 18 20 93* A7 D8 | |
| 313 | astorm 317-0154 FFFFFF00 B297F23F 00000400 BD5999DD 00 1F 48* 5F 66 ED | |
| 314 | astorm3 317-0148 FFFFFF00 ED9FF23F 00000400 FC58B9DC 00 06 36 50 CC D9* | |
| 315 | astormj 317-0146 FFFFFF00 ED8CF23F 00000400 FC58BC59 00 10 29* 44 CE DF | |
| 316 | astormu 317-0147 FFFFFF00 B297F23F 00000400 55334533 00 19 2D 46 58* DF | |
| 317 | bayroute 317-0116 00504000 5EB40000 00001000 5533A184 00 04* 11 18 | |
| 318 | bayroutej 317-0115 00504000 56150000 00001000 85948DCF 00 05* 12 16 | |
| 319 | bloxeed 317-0139 00000000 5D92A711 00001D38 BD59FFE8 00 49 53 55 56* DF | |
| 320 | bullet 317-0041 00000000 57355D96 00001882 8DDC8CF4 00 12 21 69* FE | |
| 321 | cltchitr 317-0176 00000000 A711A711 00000416 AF59EBCD 00 01* 80 FC | |
| 322 | cltchitrj 317-0175 00000000 5F94A711 00000416 AF59AFFB 00 03 19* 91 | |
| 323 | cotton 317-0181a 00204000 5DB20000 00000716 CCDD0716 00 0E* 73 | |
| 324 | cottonj 317-0179b 00204000 5DB20000 00000720 CCDD0720 00 0E* 73 | |
| 325 | cottonu 317-0180 00204000 5DB20000 00000716 A1840716 00 0E* 73 | |
| 326 | ddcrew 317-0190 00000000 AF595D92 00000408 BD59FD7F 00 07 16* 17 | |
| 327 | ddcrew1 317-0187 00000000 5F945D96 00000408 8DDCE758 00 04 07* 13 91 | |
| 328 | ddcrew2 317-0184 00000000 AF595D92 00000408 5533FD7F 00 07 12* 16 22 | |
| 329 | ddcrewj 317-0185 00000000 5F945D92 00000408 5533FD7F 00 06 07* 09 91 | |
| 330 | ddcrewu 317-0186 00000000 AF59A711 00000408 8DDCC381 00 01 07 5F 91* | |
| 331 | ddux 317-0096 00000000 5F94AF59 00000406 AF5987A0 00 21 28 70* D9 | |
| 332 | desertbr 317-0196 00000000 55335D92 00001838 5533F46A 00 3C 4A 82 DA* | |
| 333 | desertbrj 317-0194 00000000 55335D92 00001838 BD59E720 00 3C 4A 82 DA* | |
| 334 | eswat 317-0130 00000000 A711AF59 00000400 5533BC59 00 05 0C EC FA* | |
| 335 | eswatj 317-0128 00000000 A711AF59 00000400 55334735 00 55 63 CB* D5 | |
| 336 | eswatu 317-0129 00000000 5537AF59 00000400 55334735 00 0A 12 C3* CC | |
| 337 | exctleag 317-0079 00000000 5537AF59 00000410 83018384 00 02 39 4B 85 98 E5* | |
| 338 | fpoint 317-0127a 00000000 AF59AF59 00001A40 8DDC9960 00 15* 35 5F 82 DB | |
| 339 | fpoint1 317-0127a 00000000 AF59AF59 00001A40 8DDC9960 00 15* 35 5F 82 DB | |
| 340 | goldnaxe1 317-0110 FFFFFF00 ED62F2B9 00000400 AF59A785 00 19 2E 31 48* 5D | |
| 341 | goldnaxe3 317-0120 FFFFFF00 ED62F2B9 00000400 AF59A785 00 0A 0D 44 C7 EF* | |
| 342 | goldnaxej 317-0121 FFFFFF00 C9D6F2B9 00000400 AF59A785 00 12* 35 58 7A 9E | |
| 343 | goldnaxeu 317-0122 FFFFFF00 E53AF2B9 00000400 A184A196 00 03 51* 72 99 F6 | |
| 344 | hwchampj 317-0046 00000000 5D925D96 000008AC AF59AA41 00 8B* E3 | |
| 345 | lghost 317-0166 00000000 5F94A711 00000404 EE588241 00 A2 DC E0* | |
| 346 | lghostu 317-0165 00000000 AF59A711 00000404 EE58C340 00 56 C4 DE* | |
| 347 | mvp 317-0143 00000000 5F94A711 00000416 BD59DC5B 00 19* 20 88 98 | |
| 348 | mwalk 317-0159 FFFFFF00 C9C7F23F 00000400 5533BD7F 00 39 51* AA CC | |
| 349 | mwalkj 317-0157 FFFFFF00 B2F7F23F 00000400 5533BD7F 00 20 88 99 CF* | |
| 350 | mwalku 317-0158 FFFFFF00 C572F23F 00000400 8DDC8DDD 00 49* 90 C0 DE | |
| 351 | passsht 317-0080 00000000 AF59AF59 00003202 C2003923 00 11 52* 96 EE | |
| 352 | passshta 317-0074 00000000 AF59AF59 000031E4 C2003F8C 00 12* 47 83 A7 | |
| 353 | passshtj 317-0070 00000000 5D92AF59 000031E4 C2003F8C 00 12 59 83* FE | |
| 354 | pontoon 317-0153 00000000 A7115D92 00000E0C FC585979 00 19 70 DC* FC | |
| 355 | ryukyu 317-5023 00203800 AF49D30B 0000042E FC5863B5 00 DC* EF | |
| 356 | shinobi2 317-0049 FFFFFF00 C9C5F25F 00000400 AF598395 00 53 88 98 9B 9C* F1 | |
| 357 | sonicbom 317-0053 00000000 5735AF59 00001000 FC587133 00* | |
| 358 | suprleag 317-0045 00000000 A711AF59 0000108E BD59CE5B 00 12* 34 56 AB CD | |
| 359 | 359 | tetris1 317-0091 00000000 5D92AF59 00000410 AF59AE58 99 25 42 5B 68 FC |
| 360 | tetris2 317-0092 00000000 5735AF59 00000410 AF598685 00 10 52 74 97* FC | |
| 360 | tetris2 317-0092 00000000 5735AF59 00000410 AF598685 00 10 52 74 97* FC | |
| 361 | 361 | wb32 317-0085 FFFFFF7E B2F78997 00000500 AF590500 00 10 13 26 77 |
| 362 | wb33 317-0089 FFFFFF7E E5C78997 00000500 AF590500 00 23 40 52 71* | |
| 363 | wb34 317-0087 FFFFFF7E B2978997 00000500 AF590500 00 11* 64 69 82 | |
| 364 | wrestwar1 317-0090 00000000 5D96AF59 00000414 8301AE18 00 12* A7 AB CC F9 FC | |
| 365 | wrestwar2 317-0102 00000000 5D96AF59 00000414 EE588E5B 00 12* A7 AB CC F9 FC | |
| 366 | wwallyj 317-0197b 00000000 AF595D96 00000416 CCDDCE5B 00 16* 32 3F 43 | |
| 367 | wwallyja 317-0197a 00000000 AF595D96 00000416 CCDDCE5B 00 16* 32 3F 43 | |
| 362 | wb33 317-0089 FFFFFF7E E5C78997 00000500 AF590500 00 23 40 52 71* | |
| 363 | wb34 317-0087 FFFFFF7E B2978997 00000500 AF590500 00 11* 64 69 82 | |
| 364 | wrestwar1 317-0090 00000000 5D96AF59 00000414 8301AE18 00 12* A7 AB CC F9 FC | |
| 365 | wrestwar2 317-0102 00000000 5D96AF59 00000414 EE588E5B 00 12* A7 AB CC F9 FC | |
| 366 | wwallyj 317-0197b 00000000 AF595D96 00000416 CCDDCE5B 00 16* 32 3F 43 | |
| 367 | wwallyja 317-0197a 00000000 AF595D96 00000416 CCDDCE5B 00 16* 32 3F 43 | |
| 368 | 368 | |
| 369 | 369 | *****************************************************************************/ |
| 370 | 370 | |
| r31373 | r31374 | |
| 822 | 822 | UINT8 key_7a = BIT(mainkey,7) ^ BIT(gkey2,4); |
| 823 | 823 | |
| 824 | 824 | |
| 825 | if (val & 0x8000) // block invariant: val & 0x8000 != 0 | |
| 826 | { | |
| 827 | val = BITSWAP16(val, 15, 9,10,13, 3,12, 0,14, 6, 5, 2,11, 8, 1, 4, 7); | |
| 828 | ||
| 829 | if (!global_xor1) if (~val & 0x0800) val ^= 0x3002; // 1,12,13 | |
| 830 | if (~val & 0x0020) val ^= 0x0044; // 2,6 | |
| 831 | if (!key_1b) if (~val & 0x0400) val ^= 0x0890; // 4,7,11 | |
| 832 | if (!global_swap2) if (!key_0c) val ^= 0x0308; // 3,8,9 | |
| 833 | val ^= 0x6561; | |
| 834 | ||
| 835 | if (!key_2b) val = BITSWAP16(val,15,10,13,12,11,14,9,8,7,6,0,4,3,2,1,5); // 0-5, 10-14 | |
| 836 | } | |
| 837 | ||
| 838 | if (val & 0x4000) // block invariant: val & 0x4000 != 0 | |
| 839 | { | |
| 840 | val = BITSWAP16(val, 13,14, 7, 0, 8, 6, 4, 2, 1,15, 3,11,12,10, 5, 9); | |
| 841 | ||
| 842 | if (!global_xor0) if (val & 0x0010) val ^= 0x0468; // 3,5,6,10 | |
| 843 | if (!key_3a) if (val & 0x0100) val ^= 0x0081; // 0,7 | |
| 844 | if (!key_6a) if (val & 0x0004) val ^= 0x0100; // 8 | |
| 845 | if (!key_5b) if (!key_0b) val ^= 0x3012; // 1,4,12,13 | |
| 846 | val ^= 0x3523; | |
| 847 | ||
| 848 | if (!global_swap0b) val = BITSWAP16(val, 2,14,13,12, 9,10,11, 8, 7, 6, 5, 4, 3,15, 1, 0); // 2-15, 9-11 | |
| 849 | } | |
| 850 | ||
| 851 | if (val & 0x2000) // block invariant: val & 0x2000 != 0 | |
| 852 | { | |
| 853 | val = BITSWAP16(val, 10, 2,13, 7, 8, 0, 3,14, 6,15, 1,11, 9, 4, 5,12); | |
| 854 | ||
| 855 | if (!key_4a) if (val & 0x0800) val ^= 0x010c; // 2,3,8 | |
| 856 | if (!key_1a) if (val & 0x0080) val ^= 0x1000; // 12 | |
| 857 | if (!key_7a) if (val & 0x0400) val ^= 0x0a21; // 0,5,9,11 | |
| 858 | if (!key_4b) if (!key_0a) val ^= 0x0080; // 7 | |
| 859 | if (!global_swap0a) if (!key_6b) val ^= 0xc000; // 14,15 | |
| 860 | val ^= 0x99a5; | |
| 861 | ||
| 862 | if (!key_5b) val = BITSWAP16(val,15,14,13,12,11, 1, 9, 8, 7,10, 5, 6, 3, 2, 4, 0); // 1,4,6,10 | |
| 863 | } | |
| 825 | if (val & 0x8000) // block invariant: val & 0x8000 != 0 | |
| 826 | { | |
| 827 | val = BITSWAP16(val, 15, 9,10,13, 3,12, 0,14, 6, 5, 2,11, 8, 1, 4, 7); | |
| 864 | 828 | |
| 829 | if (!global_xor1) if (~val & 0x0800) val ^= 0x3002; // 1,12,13 | |
| 830 | if (~val & 0x0020) val ^= 0x0044; // 2,6 | |
| 831 | if (!key_1b) if (~val & 0x0400) val ^= 0x0890; // 4,7,11 | |
| 832 | if (!global_swap2) if (!key_0c) val ^= 0x0308; // 3,8,9 | |
| 833 | val ^= 0x6561; | |
| 834 | ||
| 835 | if (!key_2b) val = BITSWAP16(val,15,10,13,12,11,14,9,8,7,6,0,4,3,2,1,5); // 0-5, 10-14 | |
| 836 | } | |
| 837 | ||
| 838 | if (val & 0x4000) // block invariant: val & 0x4000 != 0 | |
| 839 | { | |
| 840 | val = BITSWAP16(val, 13,14, 7, 0, 8, 6, 4, 2, 1,15, 3,11,12,10, 5, 9); | |
| 841 | ||
| 842 | if (!global_xor0) if (val & 0x0010) val ^= 0x0468; // 3,5,6,10 | |
| 843 | if (!key_3a) if (val & 0x0100) val ^= 0x0081; // 0,7 | |
| 844 | if (!key_6a) if (val & 0x0004) val ^= 0x0100; // 8 | |
| 845 | if (!key_5b) if (!key_0b) val ^= 0x3012; // 1,4,12,13 | |
| 846 | val ^= 0x3523; | |
| 847 | ||
| 848 | if (!global_swap0b) val = BITSWAP16(val, 2,14,13,12, 9,10,11, 8, 7, 6, 5, 4, 3,15, 1, 0); // 2-15, 9-11 | |
| 849 | } | |
| 850 | ||
| 851 | if (val & 0x2000) // block invariant: val & 0x2000 != 0 | |
| 852 | { | |
| 853 | val = BITSWAP16(val, 10, 2,13, 7, 8, 0, 3,14, 6,15, 1,11, 9, 4, 5,12); | |
| 854 | ||
| 855 | if (!key_4a) if (val & 0x0800) val ^= 0x010c; // 2,3,8 | |
| 856 | if (!key_1a) if (val & 0x0080) val ^= 0x1000; // 12 | |
| 857 | if (!key_7a) if (val & 0x0400) val ^= 0x0a21; // 0,5,9,11 | |
| 858 | if (!key_4b) if (!key_0a) val ^= 0x0080; // 7 | |
| 859 | if (!global_swap0a) if (!key_6b) val ^= 0xc000; // 14,15 | |
| 860 | val ^= 0x99a5; | |
| 861 | ||
| 862 | if (!key_5b) val = BITSWAP16(val,15,14,13,12,11, 1, 9, 8, 7,10, 5, 6, 3, 2, 4, 0); // 1,4,6,10 | |
| 863 | } | |
| 864 | ||
| 865 | 865 | if (val & 0xe000) // block invariant: val & 0xe000 != 0 |
| 866 | 866 | { |
| 867 | val = BITSWAP16(val,15,13,14, 5, 6, 0, 9,10, 4,11, 1, 2,12, 3, 7, 8); | |
| 868 | ||
| 869 | val ^= 0x17ff; | |
| 870 | ||
| 867 | val = BITSWAP16(val,15,13,14, 5, 6, 0, 9,10, 4,11, 1, 2,12, 3, 7, 8); | |
| 868 | ||
| 869 | val ^= 0x17ff; | |
| 870 | ||
| 871 | 871 | if (!global_swap4) val = BITSWAP16(val, 15,14,13, 6,11,10, 9, 5, 7,12, 8, 4, 3, 2, 1, 0); // 5-8, 6-12 |
| 872 | 872 | if (!global_swap3) val = BITSWAP16(val, 13,15,14,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); // 15-14-13 |
| 873 | 873 | if (!global_swap2) val = BITSWAP16(val, 15,14,13,12,11, 2, 9, 8,10, 6, 5, 4, 3, 0, 1, 7); // 10-2-0-7 |
| 874 | 874 | if (!key_3b) val = BITSWAP16(val, 15,14,13,12,11,10, 4, 8, 7, 6, 5, 9, 1, 2, 3, 0); // 9-4, 3-1 |
| 875 | if (!key_2a) val = BITSWAP16(val, 13,14,15,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); // 13-15 | |
| 876 | ||
| 875 | if (!key_2a) val = BITSWAP16(val, 13,14,15,12,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); // 13-15 | |
| 876 | ||
| 877 | 877 | if (!global_swap1) val = BITSWAP16(val, 15,14,13,12, 9, 8,11,10, 7, 6, 5, 4, 3, 2, 1, 0); // 11...8 |
| 878 | 878 | if (!key_5a) val = BITSWAP16(val, 15,14,13,12,11,10, 9, 8, 4, 5, 7, 6, 3, 2, 1, 0); // 7...4 |
| 879 | 879 | if (!global_swap0a) val = BITSWAP16(val, 15,14,13,12,11,10, 9, 8, 7, 6, 5, 4, 0, 3, 2, 1); // 3...0 |
| 880 | 880 | } |
| 881 | ||
| 882 | val = BITSWAP16(val, 12,15,14,13,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); | |
| 883 | 881 | |
| 884 | if ((val & 0xb080) == 0x8000) val ^= 0x4000; | |
| 885 | if ((val & 0xf000) == 0xc000) val ^= 0x0080; | |
| 886 | if ((val & 0xb100) == 0x0000) val ^= 0x4000; | |
| 882 | val = BITSWAP16(val, 12,15,14,13,11,10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0); | |
| 887 | 883 | |
| 884 | if ((val & 0xb080) == 0x8000) val ^= 0x4000; | |
| 885 | if ((val & 0xf000) == 0xc000) val ^= 0x0080; | |
| 886 | if ((val & 0xb100) == 0x0000) val ^= 0x4000; | |
| 887 | ||
| 888 | 888 | // mask out opcodes doing PC-relative addressing, replace them with FFFF |
| 889 | 889 | if ((m_masked_opcodes_lookup[key_F][val >> 4] >> ((val >> 1) & 7)) & 1) |
| 890 | 890 | val = 0xffff; |
| r31373 | r31374 | |
|---|---|---|
| 22 | 22 | |
| 23 | 23 | ng_memcard_device::ng_memcard_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 24 | 24 | : device_t(mconfig, NG_MEMCARD, "NEOGEO Memory Card", tag, owner, clock, "ng_memcard", __FILE__), |
| 25 | | |
| 25 | device_image_interface(mconfig, *this) | |
| 26 | 26 | { |
| 27 | 27 | } |
| 28 | 28 | |
| r31373 | r31374 | |
| 63 | 63 | size_t ret = fread(m_memcard_data, 0x800); |
| 64 | 64 | if(ret != 0x800) |
| 65 | 65 | return IMAGE_INIT_FAIL; |
| 66 | ||
| 66 | ||
| 67 | 67 | return IMAGE_INIT_PASS; |
| 68 | 68 | } |
| 69 | 69 | |
| r31373 | r31374 | |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | bool ng_memcard_device::call_create(int format_type, option_resolution *format_options) |
| 77 | { | |
| 77 | { | |
| 78 | 78 | memset(m_memcard_data, 0, 0x800); |
| 79 | ||
| 79 | ||
| 80 | 80 | size_t ret = fwrite(m_memcard_data, 0x800); |
| 81 | 81 | if(ret != 0x800) |
| 82 | 82 | return IMAGE_INIT_FAIL; |
| 83 | ||
| 83 | ||
| 84 | 84 | return IMAGE_INIT_PASS; |
| 85 | 85 | } |
| 86 | 86 | |
| r31373 | r31374 | |
| 93 | 93 | WRITE8_MEMBER(ng_memcard_device::write) |
| 94 | 94 | { |
| 95 | 95 | m_memcard_data[offset] = data; |
| 96 | } | |
| No newline at end of file | ||
| 96 | } |
| r31373 | r31374 | |
|---|---|---|
| 209 | 209 | m_new_latch = 1; |
| 210 | 210 | } |
| 211 | 211 | m_shared_ram[offset] = data; |
| 212 | } | |
| No newline at end of file | ||
| 212 | } |
| r31373 | r31374 | |
|---|---|---|
| 225 | 225 | m_time_index(0), |
| 226 | 226 | m_time_just_written(0), |
| 227 | 227 | m_yearoffs(0), |
| 228 | m_time_write_timer(NULL) | |
| 228 | m_time_write_timer(NULL) | |
| 229 | 229 | { |
| 230 | 230 | memset(m_buffer,0,sizeof(m_buffer)); |
| 231 | 231 | memset(m_time_buf,0,sizeof(m_time_buf)); |
| 232 | 232 | memset(m_nvram,0,sizeof(m_nvram)); |
| 233 | 233 | memset(m_default_nvram,0,sizeof(m_default_nvram)); |
| 234 | ||
| 234 | ||
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | midway_serial_pic2_device::midway_serial_pic2_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source) : |
| r31373 | r31374 | |
| 241 | 241 | m_state(0), |
| 242 | 242 | m_index(0), |
| 243 | 243 | m_total(0), |
| 244 | m_nvram_addr(0), | |
| 244 | m_nvram_addr(0), | |
| 245 | 245 | m_time_index(0), |
| 246 | 246 | m_time_just_written(0), |
| 247 | 247 | m_yearoffs(0), |
| 248 | m_time_write_timer(NULL) | |
| 248 | m_time_write_timer(NULL) | |
| 249 | 249 | { |
| 250 | 250 | memset(m_buffer,0,sizeof(m_buffer)); |
| 251 | 251 | memset(m_time_buf,0,sizeof(m_time_buf)); |
| r31373 | r31374 | |
| 531 | 531 | } |
| 532 | 532 | |
| 533 | 533 | void midway_serial_pic2_device::nvram_read(emu_file &file) |
| 534 | { | |
| 534 | { | |
| 535 | 535 | file.read(m_nvram, sizeof(m_nvram)); |
| 536 | 536 | } |
| 537 | 537 | |
| 538 | void midway_serial_pic2_device::nvram_write(emu_file &file) | |
| 539 | { | |
| 538 | void midway_serial_pic2_device::nvram_write(emu_file &file) | |
| 539 | { | |
| 540 | 540 | file.write(m_nvram, sizeof(m_nvram)); |
| 541 | 541 | } |
| 542 | 542 | |
| r31373 | r31374 | |
| 608 | 608 | m_fifo_in(0), |
| 609 | 609 | m_fifo_out(0), |
| 610 | 610 | m_fifo_bytes(0), |
| 611 | m_fifo_force_buffer_empty_pc(0), | |
| 611 | m_fifo_force_buffer_empty_pc(0), | |
| 612 | 612 | m_cage(NULL), |
| 613 | 613 | m_dcs(NULL) |
| 614 | 614 | { |
| r31373 | r31374 | |
| 641 | 641 | |
| 642 | 642 | /* do we have a DCS2 sound chip connected? (most likely) */ |
| 643 | 643 | m_dcs = machine().device<dcs_audio_device>("dcs"); |
| 644 | m_has_dcs = (m_dcs != NULL); | |
| 644 | m_has_dcs = (m_dcs != NULL); | |
| 645 | 645 | m_cage = machine().device<atari_cage_device>("cage"); |
| 646 | 646 | m_has_cage = (m_cage != NULL); |
| 647 | ||
| 647 | ||
| 648 | 648 | m_dcs_cpu = m_dcs->subdevice("dcs2"); |
| 649 | 649 | if (m_dcs_cpu == NULL) |
| 650 | 650 | m_dcs_cpu = m_dcs->subdevice("dsio"); |
| r31373 | r31374 | |
| 665 | 665 | /* configure the fifo */ |
| 666 | 666 | if (m_has_dcs) |
| 667 | 667 | { |
| 668 | m_dcs->set_fifo_callbacks(read16_delegate(FUNC(midway_ioasic_device::fifo_r),this), | |
| 669 | read16_delegate(FUNC(midway_ioasic_device::fifo_status_r),this), | |
| 668 | m_dcs->set_fifo_callbacks(read16_delegate(FUNC(midway_ioasic_device::fifo_r),this), | |
| 669 | read16_delegate(FUNC(midway_ioasic_device::fifo_status_r),this), | |
| 670 | 670 | write_line_delegate(FUNC(midway_ioasic_device::fifo_reset_w),this)); |
| 671 | m_dcs->set_io_callbacks(write_line_delegate(FUNC(midway_ioasic_device::ioasic_output_full),this), | |
| 671 | m_dcs->set_io_callbacks(write_line_delegate(FUNC(midway_ioasic_device::ioasic_output_full),this), | |
| 672 | 672 | write_line_delegate(FUNC(midway_ioasic_device::ioasic_input_empty),this)); |
| 673 | 673 | } |
| 674 | 674 | fifo_reset_w(1); |
| r31373 | r31374 | |
|---|---|---|
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | |
| 139 | ||
| 139 | ADDRESS_MAP_START( pcat32_io_common, AS_IO, 32, pcat_base_state ) | |
| 140 | 140 | AM_RANGE(0x0000, 0x001f) AM_DEVREADWRITE8("dma8237_1", am9517a_device, read, write, 0xffffffff) |
| 141 | 141 | AM_RANGE(0x0020, 0x003f) AM_DEVREADWRITE8("pic8259_1", pic8259_device, read, write, 0xffffffff) |
| 142 | 142 | AM_RANGE(0x0040, 0x005f) AM_DEVREADWRITE8("pit8254", pit8254_device, read, write, 0xffffffff) |
| r31373 | r31374 | |
|---|---|---|
| 51 | 51 | v = v & 0xffffff; |
| 52 | 52 | if(v == cmp) |
| 53 | 53 | logerror("%s: Detected game id %03d\n", tag(), i); |
| 54 | } | |
| 54 | } | |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | 57 | WRITE8_MEMBER(wpc_pic_device::write) |
| r31373 | r31374 | |
|---|---|---|
| 606 | 606 | ---- ---x I2C data |
| 607 | 607 | */ |
| 608 | 608 | //if(data & 0x40) |
| 609 | // | |
| 609 | // popmessage("Muting sound, contact MAME/MESSdev"); | |
| 610 | 610 | break; |
| 611 | 611 | |
| 612 | 612 | case KART: |
| r31373 | r31374 | |
| 761 | 761 | case 0x18: return 0xff; // FDC latch B |
| 762 | 762 | case 0x40: return 0xff; // FDC latch A |
| 763 | 763 | case 0x50: return 0; //fdc type, new model returns 5 here |
| 764 | case 0x70: return 0x0F; | |
| 765 | case 0x74: return 0xFF; // unknown | |
| 764 | case 0x70: return 0x0F; | |
| 765 | case 0x74: return 0xFF; // unknown | |
| 766 | 766 | // case 0x78: /* joystick */ |
| 767 | 767 | // case 0x7c: |
| 768 | 768 | } |
| r31373 | r31374 | |
| 916 | 916 | visarea.max_y = (m_vidc_regs[VIDC_VBER] - m_vidc_regs[VIDC_VBSR]) * (m_vidc_interlace+1); |
| 917 | 917 | |
| 918 | 918 | //logerror("Configuring: htotal %d vtotal %d border %d x %d display %d x %d\n", |
| 919 | // m_vidc_regs[VIDC_HCR], m_vidc_regs[VIDC_VCR], | |
| 920 | // visarea.max_x, visarea.max_y, | |
| 921 | // m_vidc_regs[VIDC_HDER]-m_vidc_regs[VIDC_HDSR],m_vidc_regs[VIDC_VDER]-m_vidc_regs[VIDC_VDSR]+1); | |
| 919 | // m_vidc_regs[VIDC_HCR], m_vidc_regs[VIDC_VCR], | |
| 920 | // visarea.max_x, visarea.max_y, | |
| 921 | // m_vidc_regs[VIDC_HDER]-m_vidc_regs[VIDC_HDSR],m_vidc_regs[VIDC_VDER]-m_vidc_regs[VIDC_VDSR]+1); | |
| 922 | 922 | |
| 923 | 923 | /* FIXME: pixel clock */ |
| 924 | 924 | refresh = HZ_TO_ATTOSECONDS(pixel_rate[m_vidc_pixel_clk]*2) * m_vidc_regs[VIDC_HCR] * m_vidc_regs[VIDC_VCR]; |
| r31373 | r31374 | |
|---|---|---|
| 562 | 562 | WRITE_LINE_MEMBER( bfm_bd1_t::sclk ) { shift_clock(state); } |
| 563 | 563 | WRITE_LINE_MEMBER( bfm_bd1_t::data ) { m_data = state; } |
| 564 | 564 | |
| 565 | WRITE_LINE_MEMBER( bfm_bd1_t::por ) | |
| 565 | WRITE_LINE_MEMBER( bfm_bd1_t::por ) | |
| 566 | 566 | { |
| 567 | 567 | if (!state) |
| 568 | 568 | { |
| r31373 | r31374 | |
|---|---|---|
| 136 | 136 | { |
| 137 | 137 | gi_update(); |
| 138 | 138 | for(int i=0; i<gi_count; i++) { |
| 139 | // | |
| 139 | // fprintf(stderr, "gi[%d] = %d\n", i, gi_time[i]); | |
| 140 | 140 | gi_time[i] = 0; |
| 141 | 141 | } |
| 142 | 142 | } |
| r31373 | r31374 | |
|---|---|---|
| 938 | 938 | m_tx_tilemap->draw(screen, bitmap, cliprect, 0,0); |
| 939 | 939 | return 0; |
| 940 | 940 | } |
| 941 | ||
| 942 |
| r31373 | r31374 | |
|---|---|---|
| 110 | 110 | { |
| 111 | 111 | switch (param) |
| 112 | 112 | { |
| 113 | case K001005_LIGHT_R: m_light_r = value; break; | |
| 114 | case K001005_LIGHT_G: m_light_g = value; break; | |
| 115 | case K001005_LIGHT_B: m_light_b = value; break; | |
| 116 | case K001005_AMBIENT_R: m_ambient_r = value; break; | |
| 117 | case K001005_AMBIENT_G: m_ambient_g = value; break; | |
| 118 | case K001005_AMBIENT_B: m_ambient_b = value; break; | |
| 119 | case K001005_FOG_R: m_fog_r = value; break; | |
| 120 | case K001005_FOG_G: m_fog_g = value; break; | |
| 121 | case K001005_FOG_B: m_fog_b = value; break; | |
| 113 | case K001005_LIGHT_R: m_light_r = value; break; | |
| 114 | case K001005_LIGHT_G: m_light_g = value; break; | |
| 115 | case K001005_LIGHT_B: m_light_b = value; break; | |
| 116 | case K001005_AMBIENT_R: m_ambient_r = value; break; | |
| 117 | case K001005_AMBIENT_G: m_ambient_g = value; break; | |
| 118 | case K001005_AMBIENT_B: m_ambient_b = value; break; | |
| 119 | case K001005_FOG_R: m_fog_r = value; break; | |
| 120 | case K001005_FOG_G: m_fog_g = value; break; | |
| 121 | case K001005_FOG_B: m_fog_b = value; break; | |
| 122 | 122 | case K001005_FAR_Z: |
| 123 | 123 | { |
| 124 | 124 | UINT32 fz = value << 11; |
| r31373 | r31374 | |
| 896 | 896 | |
| 897 | 897 | void k001005_renderer::draw_scanline_2d_tex(INT32 scanline, const extent_t &extent, const k001005_polydata &extradata, int threadid) |
| 898 | 898 | { |
| 899 | // | |
| 899 | // int pal_chip = (extradata.texture_palette & 0x8) ? 1 : 0; | |
| 900 | 900 | k001006_device *k001006 = downcast<k001006_device*>(m_k001006); |
| 901 | 901 | |
| 902 | 902 | int tex_page = extradata.texture_page * 0x40000; |
| r31373 | r31374 | |
| 999 | 999 | |
| 1000 | 1000 | void k001005_renderer::draw_scanline_tex(INT32 scanline, const extent_t &extent, const k001005_polydata &extradata, int threadid) |
| 1001 | 1001 | { |
| 1002 | // | |
| 1002 | // int pal_chip = (extradata.texture_palette & 0x8) ? 1 : 0; | |
| 1003 | 1003 | k001006_device *k001006 = downcast<k001006_device*>(m_k001006); |
| 1004 | 1004 | |
| 1005 | 1005 | int tex_page = extradata.texture_page * 0x40000; |
| r31373 | r31374 | |
| 1259 | 1259 | case 0x000: // FIFO read, high 16 bits |
| 1260 | 1260 | { |
| 1261 | 1261 | //osd_printf_debug("FIFO_r0: %08X\n", m_fifo_read_ptr); |
| 1262 | UINT16 value = m_fifo[m_fifo_read_ptr] >> 16; | |
| 1262 | UINT16 value = m_fifo[m_fifo_read_ptr] >> 16; | |
| 1263 | 1263 | return value; |
| 1264 | 1264 | } |
| 1265 | 1265 | |
| r31373 | r31374 | |
| 1370 | 1370 | break; |
| 1371 | 1371 | } |
| 1372 | 1372 | |
| 1373 | case 0x100: | |
| 1373 | case 0x100: break; | |
| 1374 | 1374 | |
| 1375 | 1375 | case 0x101: break; // viewport x and width? |
| 1376 | 1376 | case 0x102: break; // viewport y and height? |
| r31373 | r31374 | |
| 1452 | 1452 | |
| 1453 | 1453 | void k001005_device::draw( bitmap_rgb32 &bitmap, const rectangle &cliprect ) |
| 1454 | 1454 | { |
| 1455 | m_renderer->draw(bitmap, cliprect); | |
| 1455 | m_renderer->draw(bitmap, cliprect); | |
| 1456 | 1456 | } |
| 1457 | 1457 | |
| 1458 | 1458 | void k001005_device::set_texel_chip(device_t &device, const char *tag) |
| 1459 | 1459 | { |
| 1460 | 1460 | downcast<k001005_device &>(device).m_k001006_tag = tag; |
| 1461 | } | |
| No newline at end of file | ||
| 1461 | } |
| r31373 | r31374 | |
|---|---|---|
| 1 | /* | |
| 2 | Excellent Systems Sprite chip | |
| 1 | /* | |
| 2 | Excellent Systems Sprite chip | |
| 3 | 3 | |
| 4 | 4 | is this original hw or a clone of something? |
| 5 | 5 | |
| r31373 | r31374 | |
| 50 | 50 | |
| 51 | 51 | /**************************************************************** |
| 52 | 52 | SPRITE DRAW ROUTINE |
| 53 | ||
| 53 | (8-bit) | |
| 54 | 54 | |
| 55 | 55 | Word | Bit(s) | Use |
| 56 | 56 | -----+-----------------+----------------- |
| r31373 | r31374 | |
| 71 | 71 | |
| 72 | 72 | void excellent_spr_device::aquarium_draw_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect, gfxdecode_device *gfxdecode, int y_offs ) |
| 73 | 73 | { |
| 74 | ||
| 75 | 74 | int offs, chain_pos; |
| 76 | 75 | int x, y, curx, cury; |
| 77 | 76 | UINT8 col, flipx, flipy, chain; |
| r31373 | r31374 | |
| 156 | 155 | UINT8 *spriteram = m_ram; |
| 157 | 156 | int offs, chain_pos; |
| 158 | 157 | int x, y, curx, cury; |
| 159 | // | |
| 158 | // int priority = 0; | |
| 160 | 159 | UINT8 col, flipx, flipy, chain; |
| 161 | 160 | UINT16 code; |
| 162 | 161 | |
| r31373 | r31374 | |
| 219 | 218 | } |
| 220 | 219 | #endif |
| 221 | 220 | } |
| 222 |
| r31373 | r31374 | |
|---|---|---|
| 34 | 34 | |
| 35 | 35 | void tecmo_mix_device::device_start() |
| 36 | 36 | { |
| 37 | ||
| 38 | ||
| 39 | ||
| 40 | ||
| 41 | ||
| 42 | ||
| 43 | 37 | } |
| 44 | 38 | |
| 45 | 39 | void tecmo_mix_device::device_reset() |
| r31373 | r31374 | |
| 133 | 127 | { |
| 134 | 128 | if (m_sprpri == (0 ^ m_revspritetile)) // behind all |
| 135 | 129 | { |
| 136 | ||
| 137 | 130 | if (fgpixel & 0xf) // is the fg used? |
| 138 | 131 | { |
| 139 | 132 | if (fgbln) |
| r31373 | r31374 | |
| 180 | 173 | } |
| 181 | 174 | else |
| 182 | 175 | { |
| 183 | // fg is used and blended with opaque sprite | |
| 176 | // fg is used and blended with opaque sprite | |
| 184 | 177 | dd[x] = paldata[fgpixel + m_fgblend_source] + paldata[sprpixel + m_spblend_comp]; |
| 185 | 178 | } |
| 186 | 179 | } |
| r31373 | r31374 | |
| 230 | 223 | { |
| 231 | 224 | // blended sprite over solid bg pixel |
| 232 | 225 | dd[x] = paldata[bgpixel + m_bgblend_comp] + paldata[sprpixel + m_spblend_source]; |
| 233 | // | |
| 226 | // dd[x] = rand(); | |
| 234 | 227 | } |
| 235 | ||
| 236 | ||
| 237 | 228 | |
| 229 | ||
| 230 | ||
| 238 | 231 | } |
| 239 | 232 | else |
| 240 | 233 | { |
| r31373 | r31374 | |
| 265 | 258 | { |
| 266 | 259 | // needs if bgpixel & 0xf check? |
| 267 | 260 | dd[x] = paldata[fgpixel + m_fgblend_source] + paldata[bgpixel + m_bgblend_comp]; |
| 268 | ||
| 261 | ||
| 269 | 262 | } |
| 270 | 263 | else |
| 271 | 264 | { |
| 272 | 265 | dd[x] = paldata[fgpixel + m_fgregular_comp]; |
| 273 | 266 | } |
| 274 | ||
| 267 | ||
| 275 | 268 | } |
| 276 | 269 | else if (bgpixel & 0x0f) |
| 277 | 270 | { |
| r31373 | r31374 | |
| 284 | 277 | } |
| 285 | 278 | } |
| 286 | 279 | } |
| 287 | } | |
| No newline at end of file | ||
| 280 | } |
| r31373 | r31374 | |
|---|---|---|
| 189 | 189 | m_pf2_colour_bank(0), |
| 190 | 190 | m_pf1_colourmask(0xf), |
| 191 | 191 | m_pf2_colourmask(0xf), |
| 192 | m_pf12_8x8_gfx_bank(0), | |
| 192 | m_pf12_8x8_gfx_bank(0), | |
| 193 | 193 | m_pf12_16x16_gfx_bank(0), |
| 194 | 194 | m_gfxdecode(*this), |
| 195 | 195 | m_palette(*this) |
| r31373 | r31374 | |
|---|---|---|
| 80 | 80 | m_ram(NULL), |
| 81 | 81 | m_ram_buffered(0), |
| 82 | 82 | m_gfxnum(0), |
| 83 | m_x_offset(0), | |
| 83 | m_x_offset(0), | |
| 84 | 84 | m_y_offset(0), |
| 85 | 85 | m_use_buffer(0), |
| 86 | 86 | m_gfxdecode(*this), |
| r31373 | r31374 | |
|---|---|---|
| 165 | 165 | void vulgus_state::draw_sprites(bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 166 | 166 | { |
| 167 | 167 | gfx_element *gfx = m_gfxdecode->gfx(2); |
| 168 | ||
| 168 | ||
| 169 | 169 | for (int offs = m_spriteram.bytes() - 4; offs >= 0; offs -= 4) |
| 170 | 170 | { |
| 171 | 171 | int code = m_spriteram[offs]; |
| r31373 | r31374 | |
| 174 | 174 | int sx = m_spriteram[offs + 3]; |
| 175 | 175 | bool flip = flip_screen() ? true : false; |
| 176 | 176 | int dir = 1; |
| 177 | ||
| 177 | ||
| 178 | 178 | if (sy == 0) |
| 179 | 179 | continue; |
| 180 | ||
| 180 | ||
| 181 | 181 | if (flip) |
| 182 | 182 | { |
| 183 | 183 | sx = 240 - sx; |
| r31373 | r31374 | |
|---|---|---|
| 153 | 153 | m_dblwidth(0), |
| 154 | 154 | m_gfxnum(0), |
| 155 | 155 | m_txnum(0), |
| 156 | m_x_offset(0), | |
| 156 | m_x_offset(0), | |
| 157 | 157 | m_y_offset(0), |
| 158 | m_text_xoffs(0), | |
| 158 | m_text_xoffs(0), | |
| 159 | 159 | m_text_yoffs(0), |
| 160 | m_flip_xoffs(0), | |
| 160 | m_flip_xoffs(0), | |
| 161 | 161 | m_flip_yoffs(0), |
| 162 | 162 | m_col_base(0), |
| 163 | 163 | m_gfxdecode(*this), |
| r31373 | r31374 | |
|---|---|---|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | if (enabled) |
| 134 | { | |
| 134 | { | |
| 135 | 135 | UINT32 flipx = (attributes & 1); |
| 136 | 136 | UINT32 flipy = (attributes & 2); |
| 137 | 137 | |
| r31373 | r31374 | |
| 183 | 183 | // this contains the blend bit and the priority bits, the spbactn proto uses 0x0300 for priority, spbactn uses 0x0030, others use 0x00c0 |
| 184 | 184 | color |= (source[attributes_word] & 0x03f0); |
| 185 | 185 | bitmap = &sprite_bitmap; |
| 186 | ||
| 187 | 186 | |
| 187 | ||
| 188 | 188 | for (row = 0; row < sizey; row++) |
| 189 | 189 | { |
| 190 | 190 | for (col = 0; col < sizex; col++) |
| r31373 | r31374 | |
| 198 | 198 | flipx, flipy, |
| 199 | 199 | sx, sy, |
| 200 | 200 | 0); |
| 201 | ||
| 201 | ||
| 202 | 202 | } |
| 203 | } | |
| 203 | } | |
| 204 | 204 | } |
| 205 | 205 | source += sourceinc; |
| 206 | 206 | } |
| r31373 | r31374 | |
| 214 | 214 | * byte bit usage |
| 215 | 215 | * --------+-76543210-+---------------- |
| 216 | 216 | 0 | xxxxx--- | bank / upper tile bits |
| 217 | | -----x-- | enable | |
| 218 | | ------x- | flip y | |
| 219 | | -------x | flip x | |
| 220 | 1 | xxxxxxxx | tile number (low bits) | |
| 221 | 2 | ------xx | size | |
| 222 | 3 | xx-------| priority | |
| 223 | | --x----- | upper y co-ord | |
| 224 | | ---x---- | upper x co-ord | |
| 225 | | ----xxxx | colour | |
| 226 | 4 | xxxxxxxx | ypos | |
| 227 | 5 | xxxxxxxx | xpos | |
| 228 | 6 | -------- | | |
| 229 | 7 | -------- | | |
| 217 | | -----x-- | enable | |
| 218 | | ------x- | flip y | |
| 219 | | -------x | flip x | |
| 220 | 1 | xxxxxxxx | tile number (low bits) | |
| 221 | 2 | ------xx | size | |
| 222 | 3 | xx-------| priority | |
| 223 | | --x----- | upper y co-ord | |
| 224 | | ---x---- | upper x co-ord | |
| 225 | | ----xxxx | colour | |
| 226 | 4 | xxxxxxxx | ypos | |
| 227 | 5 | xxxxxxxx | xpos | |
| 228 | 6 | -------- | | |
| 229 | 7 | -------- | | |
| 230 | 230 | |
| 231 | 231 | */ |
| 232 | 232 | |
| r31373 | r31374 | |
| 302 | 302 | * |
| 303 | 303 | * byte bit usage |
| 304 | 304 | * --------+-76543210-+---------------- |
| 305 | ||
| 306 | 305 | |
| 307 | 306 | |
| 307 | ||
| 308 | 308 | */ |
| 309 | 309 | |
| 310 | 310 | |
| r31373 | r31374 | |
| 326 | 326 | if (xpos >= 0x0300) xpos -= 0x0400; |
| 327 | 327 | |
| 328 | 328 | flags = spriteram[offs+4]; |
| 329 | ||
| 329 | ||
| 330 | 330 | int sizex = 1 << ((flags >> 0) & 3); |
| 331 | 331 | int sizey = 1 << ((flags >> 2) & 3); |
| 332 | 332 | |
| r31373 | r31374 | |
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | } | |
| No newline at end of file | ||
| 427 | } |
| r31373 | r31374 | |
|---|---|---|
| 31 | 31 | |
| 32 | 32 | void k001006_device::device_config_complete() |
| 33 | 33 | { |
| 34 | ||
| 35 | 34 | } |
| 36 | 35 | |
| 37 | 36 | //------------------------------------------------- |
| r31373 | r31374 | |
| 46 | 45 | |
| 47 | 46 | m_gfxrom = machine().root_device().memregion(m_gfx_region)->base(); |
| 48 | 47 | m_texrom = auto_alloc_array(machine(), UINT8, 0x800000); |
| 49 | ||
| 48 | ||
| 50 | 49 | preprocess_texture_data(m_texrom, m_gfxrom, 0x800000, m_tex_layout); |
| 51 | 50 | |
| 52 | 51 | save_pointer(NAME(m_pal_ram), 0x800*sizeof(UINT16)); |
| r31373 | r31374 | |
|---|---|---|
| 1283 | 1283 | |
| 1284 | 1284 | Dedicated input pins |
| 1285 | 1285 | |
| 1286 | pin 1 = I0; Input | |
| 1287 | pin 2 = I1; Input | |
| 1288 | pin 3 = I2; Input | |
| 1289 | pin 4 = I3; Input | |
| 1290 | pin 5 = I4; Input | |
| 1291 | pin 6 = I5; Input | |
| 1292 | pin 7 = I6; Input | |
| 1293 | pin 8 = I7; Input | |
| 1294 | pin 9 = I8; Input | |
| 1295 | pin 11 = I9; Input | |
| 1286 | pin 1 = I0; Input | |
| 1287 | pin 2 = I1; Input | |
| 1288 | pin 3 = I2; Input | |
| 1289 | pin 4 = I3; Input | |
| 1290 | pin 5 = I4; Input | |
| 1291 | pin 6 = I5; Input | |
| 1292 | pin 7 = I6; Input | |
| 1293 | pin 8 = I7; Input | |
| 1294 | pin 9 = I8; Input | |
| 1295 | pin 11 = I9; Input | |
| 1296 | 1296 | |
| 1297 | Programmable output pins | |
| 1297 | Programmable output pins | |
| 1298 | 1298 | |
| 1299 | pin 12 = B0; Combinatorial output | |
| 1300 | pin 13 = B1; Combinatorial output | |
| 1301 | pin 14 = B2; Combinatorial output | |
| 1302 | pin 15 = B3; Combinatorial output | |
| 1303 | pin 16 = B4; Combinatorial output | |
| 1304 | pin 17 = B5; Combinatorial output | |
| 1305 | pin 18 = B6; Combinatorial output | |
| 1306 | pin 19 = B7; Combinatorial output | |
| 1299 | pin 12 = B0; Combinatorial output | |
| 1300 | pin 13 = B1; Combinatorial output | |
| 1301 | pin 14 = B2; Combinatorial output | |
| 1302 | pin 15 = B3; Combinatorial output | |
| 1303 | pin 16 = B4; Combinatorial output | |
| 1304 | pin 17 = B5; Combinatorial output | |
| 1305 | pin 18 = B6; Combinatorial output | |
| 1306 | pin 19 = B7; Combinatorial output | |
| 1307 | 1307 | |
| 1308 | Output equations | |
| 1308 | Output equations | |
| 1309 | 1309 | |
| 1310 | !B7 = !I0 & !I1 & !I2 & !I3 & !I4 & !I5 & !I9 | |
| 1310 | !B7 = !I0 & !I1 & !I2 & !I3 & !I4 & !I5 & !I9 | |
| 1311 | 1311 | # I0 & !I1 & !I2 & !I3 & !I4 & !I5 & I9; |
| 1312 | !B6 = !I0 & !I1 & !I2 & !I3 & !I4 & !I5 & !I9 | |
| 1312 | !B6 = !I0 & !I1 & !I2 & !I3 & !I4 & !I5 & !I9 | |
| 1313 | 1313 | # I0 & !I1 & !I2 & !I3 & !I4 & !I5 & I9; |
| 1314 | !B5 = !I0 & !I1 & !I2 & !I3 & !I4 & I5 & !I9 | |
| 1314 | !B5 = !I0 & !I1 & !I2 & !I3 & !I4 & I5 & !I9 | |
| 1315 | 1315 | # I0 & !I1 & !I2 & !I3 & !I4 & I5 & I9; |
| 1316 | !B4 = !I0 & !I1 & !I2 & !I3 & !I4 & I5 & !I9 | |
| 1316 | !B4 = !I0 & !I1 & !I2 & !I3 & !I4 & I5 & !I9 | |
| 1317 | 1317 | # I0 & !I1 & !I2 & !I3 & !I4 & I5 & I9; |
| 1318 | !B3 = !I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & !I9 | |
| 1319 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & !I9 | |
| 1320 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & !I9 | |
| 1321 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & !I9 | |
| 1322 | # !I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & !I9 | |
| 1323 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & !I9 | |
| 1324 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & !I9 | |
| 1325 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & I8 & !I9 | |
| 1326 | # I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & I9 | |
| 1327 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & I9 | |
| 1328 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & I9 | |
| 1329 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & I9 | |
| 1330 | # I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & I9 | |
| 1331 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & I9 | |
| 1332 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & I9 | |
| 1318 | !B3 = !I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & !I9 | |
| 1319 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & !I9 | |
| 1320 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & !I9 | |
| 1321 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & !I9 | |
| 1322 | # !I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & !I9 | |
| 1323 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & !I9 | |
| 1324 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & !I9 | |
| 1325 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & I8 & !I9 | |
| 1326 | # I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & I9 | |
| 1327 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & I9 | |
| 1328 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & I9 | |
| 1329 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & I9 | |
| 1330 | # I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & I9 | |
| 1331 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & I9 | |
| 1332 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & I9 | |
| 1333 | 1333 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & I8 & I9; |
| 1334 | !B2 = !I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & !I9 | |
| 1335 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & !I9 | |
| 1336 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & !I9 | |
| 1337 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & !I9 | |
| 1338 | # !I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & !I9 | |
| 1339 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & !I9 | |
| 1340 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & !I9 | |
| 1341 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & I8 & !I9 | |
| 1342 | # I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & I9 | |
| 1343 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & I9 | |
| 1344 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & I9 | |
| 1345 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & I9 | |
| 1346 | # I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & I9 | |
| 1347 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & I9 | |
| 1348 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & I9 | |
| 1334 | !B2 = !I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & !I9 | |
| 1335 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & !I9 | |
| 1336 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & !I9 | |
| 1337 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & !I9 | |
| 1338 | # !I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & !I9 | |
| 1339 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & !I9 | |
| 1340 | # !I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & !I9 | |
| 1341 | # !I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & I8 & !I9 | |
| 1342 | # I0 & !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 & I9 | |
| 1343 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 & I9 | |
| 1344 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 & I9 | |
| 1345 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 & I9 | |
| 1346 | # I0 & !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 & I9 | |
| 1347 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 & I9 | |
| 1348 | # I0 & !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 & I9 | |
| 1349 | 1349 | # I0 & !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & I8 & I9; |
| 1350 | !B1 = !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 | |
| 1351 | # !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 | |
| 1352 | # !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 | |
| 1353 | # !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 | |
| 1354 | # !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 | |
| 1355 | # !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 | |
| 1356 | # !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 | |
| 1350 | !B1 = !I1 & !I2 & !I3 & I4 & !I5 & !I6 & !I7 & !I8 | |
| 1351 | # !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & !I8 | |
| 1352 | # !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & !I8 | |
| 1353 | # !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & !I8 | |
| 1354 | # !I1 & !I2 & I3 & !I4 & !I5 & !I6 & !I7 & I8 | |
| 1355 | # !I1 & I2 & !I3 & !I4 & !I5 & I6 & !I7 & I8 | |
| 1356 | # !I1 & I2 & I3 & !I4 & !I5 & !I6 & I7 & I8 | |
| 1357 | 1357 | # !I1 & I2 & !I3 & !I4 & !I5 & I6 & I7 & I8; |
| 1358 | 1358 | !B0 = I0 & I9; |
| 1359 | 1359 | |
| r31373 | r31374 | |
| 1582 | 1582 | |
| 1583 | 1583 | /* CPS1 board + extra support boards */ |
| 1584 | 1584 | |
| 1585 | {"kenseim", CPS_B_21_DEF, mapper_KNM10B }, | |
| 1585 | {"kenseim", CPS_B_21_DEF, mapper_KNM10B }, // wrong, need to convert equations from PAL | |
| 1586 | 1586 | |
| 1587 | 1587 | {0} /* End of table */ |
| 1588 | 1588 | }; |
| r31373 | r31374 | |
|---|---|---|
| 926 | 926 | save_item(NAME(m_flip)); |
| 927 | 927 | |
| 928 | 928 | // TRS01 TRS02 |
| 929 | save_item(NAME(m_sig30Hz)); | |
| 930 | save_item(NAME(m_blue_level)); | |
| 931 | save_item(NAME(m_cv1)); | |
| 932 | save_item(NAME(m_cv2)); | |
| 933 | save_item(NAME(m_vg1)); | |
| 934 | save_item(NAME(m_vg2)); | |
| 935 | save_item(NAME(m_vg3)); | |
| 936 | save_item(NAME(m_cv3)); | |
| 937 | save_item(NAME(m_cv4)); | |
| 929 | save_item(NAME(m_sig30Hz)); | |
| 930 | save_item(NAME(m_blue_level)); | |
| 931 | save_item(NAME(m_cv1)); | |
| 932 | save_item(NAME(m_cv2)); | |
| 933 | save_item(NAME(m_vg1)); | |
| 934 | save_item(NAME(m_vg2)); | |
| 935 | save_item(NAME(m_vg3)); | |
| 936 | save_item(NAME(m_cv3)); | |
| 937 | save_item(NAME(m_cv4)); | |
| 938 | 938 | |
| 939 | save_item(NAME(m_lfsr_5I)); | |
| 940 | save_item(NAME(m_grid_sig)); | |
| 941 | save_item(NAME(m_rflip_sig)); | |
| 942 | save_item(NAME(m_star_ff)); | |
| 943 | save_item(NAME(m_counter)); | |
| 944 | save_item(NAME(m_pixelcnt)); | |
| 945 | save_item(NAME(m_bg_bits)); | |
| 939 | save_item(NAME(m_lfsr_5I)); | |
| 940 | save_item(NAME(m_grid_sig)); | |
| 941 | save_item(NAME(m_rflip_sig)); | |
| 942 | save_item(NAME(m_star_ff)); | |
| 943 | save_item(NAME(m_counter)); | |
| 944 | save_item(NAME(m_pixelcnt)); | |
| 945 | save_item(NAME(m_bg_bits)); | |
| 946 | 946 | |
| 947 | 947 | } |
| 948 | 948 |
| r31373 | r31374 | |
|---|---|---|
| 153 | 153 | base++; |
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | ||
| 156 | ||
| 157 | 157 | cur_scanline = (cur_scanline+1) & 0x1f; |
| 158 | 158 | scanline_cb(cur_scanline == (firq_scanline & 0x1f)); |
| 159 | 159 | } |
| r31373 | r31374 | |
|---|---|---|
| 111 | 111 | // Unified k054338/K055555 BG color fill (see p.67) |
| 112 | 112 | void k054338_device::fill_backcolor(bitmap_rgb32 &bitmap, const rectangle &cliprect, const pen_t *pal_ptr, int mode) |
| 113 | 113 | { |
| 114 | if ((mode & 0x02) == 0) | |
| 114 | if ((mode & 0x02) == 0) // solid fill | |
| 115 | 115 | { |
| 116 | 116 | bitmap.fill(*pal_ptr, cliprect); |
| 117 | 117 | } |
| r31373 | r31374 | |
| 120 | 120 | UINT32 *dst_ptr = &bitmap.pix32(cliprect.min_y); |
| 121 | 121 | int dst_pitch = bitmap.rowpixels(); |
| 122 | 122 | |
| 123 | if ((mode & 0x01) == 0) | |
| 123 | if ((mode & 0x01) == 0) // vertical gradient fill | |
| 124 | 124 | { |
| 125 | 125 | pal_ptr += cliprect.min_y; |
| 126 | 126 | for(int y = cliprect.min_y; y <= cliprect.max_y; y++) |
| r31373 | r31374 | |
| 134 | 134 | dst_ptr += dst_pitch; |
| 135 | 135 | } |
| 136 | 136 | } |
| 137 | else | |
| 137 | else // horizontal gradient fill | |
| 138 | 138 | { |
| 139 | 139 | int width = cliprect.width() * sizeof(UINT32); |
| 140 | 140 | pal_ptr += cliprect.min_x; |
| r31373 | r31374 | |
|---|---|---|
| 1195 | 1195 | VIDEO_START_MEMBER(konamigx_state, konamigx_5bpp) |
| 1196 | 1196 | { |
| 1197 | 1197 | common_init(); |
| 1198 | ||
| 1198 | ||
| 1199 | 1199 | if (!strcmp(machine().system().name,"tbyahhoo")) |
| 1200 | 1200 | gx_tilemode = 1; |
| 1201 | 1201 | else if (!strcmp(machine().system().name,"crzcross") || !strcmp(machine().system().name,"puzldama")) |
| r31373 | r31374 | |
|---|---|---|
| 77 | 77 | m_foreground = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); |
| 78 | 78 | m_text_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 79 | 79 | |
| 80 | // m_background->set_transparent_pen(0); | |
| 81 | // m_foreground->set_transparent_pen(0); | |
| 80 | // m_background->set_transparent_pen(0); | |
| 81 | // m_foreground->set_transparent_pen(0); | |
| 82 | 82 | m_text_layer->set_transparent_pen(0); |
| 83 | 83 | |
| 84 | 84 | m_background->set_scrolldy(0, 33); |
| r31373 | r31374 | |
| 104 | 104 | m_foreground = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_fg_tile_info_raiga),this), TILEMAP_SCAN_ROWS, 16, 16, 64, 32); |
| 105 | 105 | m_text_layer = &machine().tilemap().create(m_gfxdecode, tilemap_get_info_delegate(FUNC(gaiden_state::get_tx_tile_info),this), TILEMAP_SCAN_ROWS, 8, 8, 32, 32); |
| 106 | 106 | |
| 107 | // m_background->set_transparent_pen(0); | |
| 108 | // m_foreground->set_transparent_pen(0); | |
| 107 | // m_background->set_transparent_pen(0); | |
| 108 | // m_foreground->set_transparent_pen(0); | |
| 109 | 109 | m_text_layer->set_transparent_pen(0); |
| 110 | 110 | |
| 111 | 111 | /* set up sprites */ |
| r31373 | r31374 | |
|---|---|---|
| 136 | 136 | case K051960_PLANEORDER_BASE: |
| 137 | 137 | device_gfx_interface::static_set_info(dev, gfxinfo); |
| 138 | 138 | break; |
| 139 | ||
| 139 | ||
| 140 | 140 | case K051960_PLANEORDER_MIA: |
| 141 | 141 | device_gfx_interface::static_set_info(dev, gfxinfo_reverse); |
| 142 | 142 | break; |
| 143 | ||
| 143 | ||
| 144 | 144 | case K051960_PLANEORDER_GRADIUS3: |
| 145 | 145 | device_gfx_interface::static_set_info(dev, gfxinfo_gradius3); |
| 146 | 146 | break; |
| 147 | ||
| 147 | ||
| 148 | 148 | default: |
| 149 | 149 | fatalerror("Unknown plane_order\n"); |
| 150 | 150 | } |
| r31373 | r31374 | |
| 166 | 166 | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| 167 | 167 | |
| 168 | 168 | m_ram = auto_alloc_array_clear(machine(), UINT8, 0x400); |
| 169 | ||
| 169 | ||
| 170 | 170 | // bind callbacks |
| 171 | 171 | m_k051960_cb.bind_relative_to(*owner()); |
| 172 | ||
| 172 | ||
| 173 | 173 | save_item(NAME(m_romoffset)); |
| 174 | 174 | save_item(NAME(m_spriteflip)); |
| 175 | 175 | save_item(NAME(m_readroms)); |
| r31373 | r31374 | |
|---|---|---|
| 128 | 128 | |
| 129 | 129 | m_text_videoram = auto_alloc_array(machine(), UINT8, 0x1000); |
| 130 | 130 | memset(m_text_videoram, 0x00, 0x1000); |
| 131 | ||
| 131 | ||
| 132 | 132 | save_pointer(NAME(m_text_videoram), 0x1000); |
| 133 | 133 | } |
| 134 | 134 | |
| r31373 | r31374 | |
| 150 | 150 | |
| 151 | 151 | m_text_videoram = auto_alloc_array(machine(), UINT8, 0x1000); |
| 152 | 152 | memset(m_text_videoram, 0x00, 0x1000); |
| 153 | ||
| 153 | ||
| 154 | 154 | save_pointer(NAME(m_text_videoram), 0x1000); |
| 155 | 155 | } |
| 156 | 156 |
| r31373 | r31374 | |
|---|---|---|
| 377 | 377 | create_tilemaps(machine()); |
| 378 | 378 | |
| 379 | 379 | finalize_init(machine()); |
| 380 | ||
| 380 | ||
| 381 | 381 | // bind callbacks |
| 382 | 382 | m_k056832_cb.bind_relative_to(*owner()); |
| 383 | 383 | } |
| r31373 | r31374 | |
| 2572 | 2572 | { |
| 2573 | 2573 | return(m_layer_association); |
| 2574 | 2574 | } |
| 2575 |
| r31373 | r31374 | |
|---|---|---|
| 965 | 965 | { |
| 966 | 966 | int gfx_index; |
| 967 | 967 | UINT32 total; |
| 968 | ||
| 968 | ||
| 969 | 969 | static const gfx_layout spritelayout = /* System GX sprite layout */ |
| 970 | 970 | { |
| 971 | 971 | 16,16, |
| r31373 | r31374 | |
| 1013 | 1013 | long i; |
| 1014 | 1014 | UINT16 *alt_k055673_rom; |
| 1015 | 1015 | int size4; |
| 1016 | ||
| 1016 | ||
| 1017 | 1017 | /* find first empty slot to decode gfx */ |
| 1018 | 1018 | for (gfx_index = 0; gfx_index < MAX_GFX_ELEMENTS; gfx_index++) |
| 1019 | 1019 | if (m_gfxdecode->gfx(gfx_index) == 0) |
| 1020 | 1020 | break; |
| 1021 | 1021 | assert(gfx_index != MAX_GFX_ELEMENTS); |
| 1022 | ||
| 1022 | ||
| 1023 | 1023 | alt_k055673_rom = (UINT16 *)machine().root_device().memregion(m_memory_region)->base(); |
| 1024 | ||
| 1024 | ||
| 1025 | 1025 | /* decode the graphics */ |
| 1026 | 1026 | switch (m_plane_order) |
| 1027 | 1027 | { |
| r31373 | r31374 | |
| 1042 | 1042 | *d++ = *s1++; |
| 1043 | 1043 | *d++ = *s2++; |
| 1044 | 1044 | } |
| 1045 | ||
| 1045 | ||
| 1046 | 1046 | total = size4 / 128; |
| 1047 | 1047 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout, 5); |
| 1048 | 1048 | break; |
| 1049 | ||
| 1049 | ||
| 1050 | 1050 | case K055673_LAYOUT_RNG: |
| 1051 | 1051 | total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16/2); |
| 1052 | 1052 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout2, 4); |
| 1053 | 1053 | break; |
| 1054 | ||
| 1054 | ||
| 1055 | 1055 | case K055673_LAYOUT_LE2: |
| 1056 | 1056 | total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16); |
| 1057 | 1057 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout3, 8); |
| 1058 | 1058 | break; |
| 1059 | ||
| 1059 | ||
| 1060 | 1060 | case K055673_LAYOUT_GX6: |
| 1061 | 1061 | total = machine().root_device().memregion(m_memory_region)->bytes() / (16*16*6/8); |
| 1062 | 1062 | konami_decode_gfx(machine(), m_gfxdecode, m_palette, gfx_index, (UINT8 *)alt_k055673_rom, total, &spritelayout4, 6); |
| 1063 | 1063 | break; |
| 1064 | ||
| 1064 | ||
| 1065 | 1065 | default: |
| 1066 | 1066 | fatalerror("Unsupported layout\n"); |
| 1067 | 1067 | } |
| 1068 | ||
| 1068 | ||
| 1069 | 1069 | if (VERBOSE && !(m_palette->shadows_enabled())) |
| 1070 | 1070 | popmessage("driver should use VIDEO_HAS_SHADOWS"); |
| 1071 | ||
| 1071 | ||
| 1072 | 1072 | m_z_rejection = -1; |
| 1073 | 1073 | m_gfx = m_gfxdecode->gfx(gfx_index); |
| 1074 | 1074 | m_objcha_line = CLEAR_LINE; |
| 1075 | 1075 | m_ram = auto_alloc_array(machine(), UINT16, 0x1000/2); |
| 1076 | ||
| 1076 | ||
| 1077 | 1077 | memset(m_ram, 0, 0x1000); |
| 1078 | 1078 | memset(m_kx46_regs, 0, 8); |
| 1079 | 1079 | memset(m_kx47_regs, 0, 32); |
| 1080 | ||
| 1080 | ||
| 1081 | 1081 | machine().save().save_pointer(NAME(m_ram), 0x800); |
| 1082 | 1082 | machine().save().save_item(NAME(m_kx46_regs)); |
| 1083 | 1083 | machine().save().save_item(NAME(m_kx47_regs)); |
| r31373 | r31374 | |
| 1258 | 1258 | offset <<= 1; |
| 1259 | 1259 | return (k053247_reg_word_r( space, offset + 1, 0xffff) | k053247_reg_word_r( space, offset, 0xffff) << 16); |
| 1260 | 1260 | } |
| 1261 |
| r31373 | r31374 | |
|---|---|---|
| 1 | /* This is the tilemap chip used by Grand Striker, Tecmo World Cup '94 and V Goal Soccer for the backgrounds | |
| 1 | /* This is the tilemap chip used by Grand Striker, Tecmo World Cup '94 and V Goal Soccer for the backgrounds | |
| 2 | 2 | |
| 3 | the actual line scroll / zoom is not properly understood | |
| 3 | the actual line scroll / zoom is not properly understood | |
| 4 | 4 | |
| 5 | 5 | interestingly the chip seems to require doubled up ROMs (2 copies of each ROM) to draw just the single layer. |
| 6 | 6 | |
| r31373 | r31374 | |
| 38 | 38 | |
| 39 | 39 | void mb60553_zooming_tilemap_device::device_reset() |
| 40 | 40 | { |
| 41 | ||
| 42 | 41 | } |
| 43 | 42 | |
| 44 | 43 | |
| r31373 | r31374 | |
| 119 | 118 | |
| 120 | 119 | void mb60553_zooming_tilemap_device::reg_written( int num_reg) |
| 121 | 120 | { |
| 122 | ||
| 123 | 121 | switch (num_reg) |
| 124 | 122 | { |
| 125 | 123 | case 0: |
| r31373 | r31374 | |
| 338 | 336 | { |
| 339 | 337 | return m_lineram[offset]; |
| 340 | 338 | } |
| 341 | ||
| 342 | ||
| 343 |
| r31373 | r31374 | |
|---|---|---|
| 52 | 52 | UINT32 nitedrvr_state::screen_update_nitedrvr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 53 | 53 | { |
| 54 | 54 | bitmap.fill(0, cliprect); |
| 55 | ||
| 55 | ||
| 56 | 56 | // don't wrap playfield |
| 57 | 57 | rectangle clip = cliprect; |
| 58 | 58 | if (clip.max_y > 31) clip.max_y = 31; |
| r31373 | r31374 | |
|---|---|---|
| 46 | 46 | UINT16 sprpixel = (sd2[x]); |
| 47 | 47 | //UINT16 sprpri = (sprpixel >> 8) & 3; |
| 48 | 48 | UINT16 sprpri = (sprpixel >> 9) & 1; // only upper priority bit matters on the bootleg hw? |
| 49 | ||
| 49 | ||
| 50 | 50 | sprpixel &= 0xff; |
| 51 | 51 | |
| 52 | 52 | if (sprpixel & 0xf) |
| r31373 | r31374 | |
| 55 | 55 | dd[x] = sprpixel; |
| 56 | 56 | } |
| 57 | 57 | |
| 58 | // | |
| 58 | // UINT16 sprbln = (sprpixel >> 10) & 1; // we handle 'blending' from the original as a simple on/off flicker in the bootleg sprite function, I don't think the bootleg hw can blend | |
| 59 | 59 | } |
| 60 | 60 | } |
| 61 | 61 | } |
| r31373 | r31374 | |
|---|---|---|
| 243 | 243 | |
| 244 | 244 | ***************************************************************************/ |
| 245 | 245 | |
| 246 | TILE_GET_INFO_MEMBER(k051316_device::get_tile_info) | |
| 247 | { | |
| 246 | TILE_GET_INFO_MEMBER(k051316_device::get_tile_info) | |
| 247 | { | |
| 248 | 248 | int code = m_ram[tile_index]; |
| 249 | 249 | int color = m_ram[tile_index + 0x400]; |
| 250 | 250 | int flags = 0; |
| 251 | ||
| 251 | ||
| 252 | 252 | m_k051316_cb(&code, &color, &flags); |
| 253 | ||
| 253 | ||
| 254 | 254 | SET_TILE_INFO_MEMBER(0, |
| 255 | code, | |
| 256 | color, | |
| 257 | flags); | |
| 255 | code, | |
| 256 | color, | |
| 257 | flags); | |
| 258 | 258 | } |
| 259 | 259 | |
| 260 | 260 |
| r31373 | r31374 | |
|---|---|---|
| 220 | 220 | m_videoram2_F = &m_ram[0x4000]; |
| 221 | 221 | m_videoram2_A = &m_ram[0x4800]; |
| 222 | 222 | m_videoram2_B = &m_ram[0x5000]; |
| 223 | ||
| 223 | ||
| 224 | 224 | m_tilemap[0] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info0),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 225 | 225 | m_tilemap[1] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info1),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 226 | 226 | m_tilemap[2] = &machine().tilemap().create(*this, tilemap_get_info_delegate(FUNC(k052109_device::get_tile_info2),this), TILEMAP_SCAN_ROWS, 8, 8, 64, 32); |
| 227 | ||
| 227 | ||
| 228 | 228 | m_tilemap[0]->set_transparent_pen(0); |
| 229 | 229 | m_tilemap[1]->set_transparent_pen(0); |
| 230 | 230 | m_tilemap[2]->set_transparent_pen(0); |
| 231 | ||
| 231 | ||
| 232 | 232 | // bind callbacks |
| 233 | 233 | m_k052109_cb.bind_relative_to(*owner()); |
| 234 | ||
| 234 | ||
| 235 | 235 | save_pointer(NAME(m_ram), 0x6000); |
| 236 | 236 | save_item(NAME(m_rmrd_line)); |
| 237 | 237 | save_item(NAME(m_romsubbank)); |
| r31373 | r31374 | |
| 292 | 292 | else /* Punk Shot and TMNT read from 0000-1fff, Aliens from 2000-3fff */ |
| 293 | 293 | { |
| 294 | 294 | assert (m_char_size != 0); |
| 295 | ||
| 295 | ||
| 296 | 296 | int code = (offset & 0x1fff) >> 5; |
| 297 | 297 | int color = m_romsubbank; |
| 298 | 298 | int flags = 0; |
| r31373 | r31374 | |
|---|---|---|
| 97 | 97 | m_flipscreen(0), |
| 98 | 98 | m_gfxnum(0), |
| 99 | 99 | m_txnum(0), |
| 100 | m_bg_xoffs(0), | |
| 100 | m_bg_xoffs(0), | |
| 101 | 101 | m_bg_yoffs(0), |
| 102 | 102 | m_bg_flip_yoffs(0), |
| 103 | 103 | m_has_fg0(1), |
| r31373 | r31374 | |
|---|---|---|
| 9 | 9 | |
| 10 | 10 | /* |
| 11 | 11 | neosprite_base_device::neosprite_base_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 12 | : device_t(mconfig, NEOGEO_SPRITE_BASE, "Neogeo Sprites", tag, owner, clock, "neospritebase", __FILE__), | |
| 13 | m_bppshift(4) | |
| 12 | : device_t(mconfig, NEOGEO_SPRITE_BASE, "Neogeo Sprites", tag, owner, clock, "neospritebase", __FILE__), | |
| 13 | m_bppshift(4) | |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | 16 | } |
| r31373 | r31374 | |
| 20 | 20 | : device_t(mconfig, type, "Neogeo Sprites", tag, owner, clock, "neosprite", __FILE__), |
| 21 | 21 | m_bppshift(4) |
| 22 | 22 | { |
| 23 | ||
| 24 | 23 | } |
| 25 | 24 | |
| 26 | 25 | void neosprite_base_device::device_start() |
| 27 | 26 | { |
| 28 | ||
| 29 | 27 | m_videoram = auto_alloc_array(machine(), UINT16, 0x8000 + 0x800); |
| 30 | 28 | m_videoram_drawsource = m_videoram; |
| 31 | 29 | |
| r31373 | r31374 | |
| 235 | 233 | int gfx_offset = ((code << 5) | (scanline & 0x07)) & addr_mask; |
| 236 | 234 | |
| 237 | 235 | const pen_t *char_pens; |
| 238 | ||
| 236 | ||
| 239 | 237 | char_pens = &m_pens[code_and_palette >> 12 << m_bppshift]; |
| 240 | 238 | |
| 241 | 239 | |
| r31373 | r31374 | |
| 355 | 353 | { |
| 356 | 354 | y = 0x200 - (y_control >> 7); |
| 357 | 355 | x = m_videoram_drawsource[0x8400 | sprite_number] >> 7; |
| 358 | ||
| 356 | ||
| 359 | 357 | zoom_y = (zoom_control & 0xff); |
| 360 | 358 | |
| 361 | 359 | zoom_x = (zoom_control >> 8) & 0x0f; |
| r31373 | r31374 | |
| 430 | 428 | |
| 431 | 429 | /* compute offset in gfx ROM and mask it to the number of bits available */ |
| 432 | 430 | int gfx_base = ((code << 8) | (sprite_y << 4)) & m_sprite_gfx_address_mask; |
| 433 | ||
| 434 | 431 | |
| 432 | ||
| 435 | 433 | line_pens = &m_pens[attr >> 8 << m_bppshift]; |
| 436 | 434 | |
| 437 | 435 | |
| r31373 | r31374 | |
| 656 | 654 | neosprite_regular_device::neosprite_regular_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock) |
| 657 | 655 | : neosprite_base_device(mconfig, tag, owner, clock, NEOGEO_SPRITE_REGULAR) |
| 658 | 656 | { |
| 659 | ||
| 660 | 657 | } |
| 661 | 658 | |
| 662 | 659 | |
| r31373 | r31374 | |
| 675 | 672 | { |
| 676 | 673 | fatalerror("please use power of 2 region sizes with neosprite_base_device to ensure masking works correctly"); |
| 677 | 674 | } |
| 678 | ||
| 675 | ||
| 679 | 676 | m_sprite_gfx_address_mask = mask; |
| 680 | 677 | } |
| 681 | 678 | |
| r31373 | r31374 | |
| 683 | 680 | { |
| 684 | 681 | const UINT8* src = m_region_sprites + (((romaddr &~0xff)>>1) | (((romaddr&0x8)^0x8)<<3) | ((romaddr & 0xf0) >> 2)); |
| 685 | 682 | const int x = romaddr & 0x7; |
| 686 | ||
| 683 | ||
| 687 | 684 | const UINT8 gfx = (((src[0x3] >> x) & 0x01) << 3) | |
| 688 | (((src[0x1] >> x) & 0x01) << 2) | | |
| 689 | (((src[0x2] >> x) & 0x01) << 1) | | |
| 690 | (((src[0x0] >> x) & 0x01) << 0); | |
| 685 | (((src[0x1] >> x) & 0x01) << 2) | | |
| 686 | (((src[0x2] >> x) & 0x01) << 1) | | |
| 687 | (((src[0x0] >> x) & 0x01) << 0); | |
| 691 | 688 | |
| 692 | 689 | if (gfx) |
| 693 | 690 | *dst = line_pens[gfx]; |
| r31373 | r31374 | |
| 753 | 750 | { |
| 754 | 751 | const UINT8* src = m_region_sprites + (((romaddr &~0xff)) | (((romaddr&0x8)^0x8)<<4) | ((romaddr & 0xf0) >> 1)); |
| 755 | 752 | const int x = romaddr & 0x7; |
| 756 | ||
| 757 | const UINT8 gfx = (((src[0x7] >> x) & 0x01) << 7) | | |
| 753 | ||
| 754 | const UINT8 gfx = (((src[0x7] >> x) & 0x01) << 7) | | |
| 758 | 755 | (((src[0x6] >> x) & 0x01) << 6) | |
| 759 | 756 | (((src[0x5] >> x) & 0x01) << 5) | |
| 760 | 757 | (((src[0x4] >> x) & 0x01) << 4) | |
| r31373 | r31374 | |
| 774 | 771 | |
| 775 | 772 | m_videoram_buffer = auto_alloc_array(machine(), UINT16, 0x8000 + 0x800); |
| 776 | 773 | m_videoram_drawsource = m_videoram_buffer; |
| 777 | ||
| 774 | ||
| 778 | 775 | memset(m_videoram_buffer, 0x00, (0x8000 + 0x800) * sizeof(UINT16)); |
| 779 | 776 | |
| 780 | 777 | } |
| r31373 | r31374 | |
| 787 | 784 | inline void neosprite_midas_device::draw_fixed_layer_2pixels(UINT32*&pixel_addr, int offset, UINT8* gfx_base, const pen_t* char_pens) |
| 788 | 785 | { |
| 789 | 786 | UINT8 data; |
| 790 | ||
| 787 | ||
| 791 | 788 | data = ((gfx_base[(offset * 2)+0] & 0x0f)<<0) | ((gfx_base[(offset * 2)+1] & 0x0f)<<4); |
| 792 | 789 | if (data) |
| 793 | 790 | *pixel_addr = char_pens[data]; |
| r31373 | r31374 | |
| 806 | 803 | UINT32 mask = get_region_mask(m_region_sprites, m_region_sprites_size); |
| 807 | 804 | m_sprite_gfx_address_mask = mask; |
| 808 | 805 | } |
| 809 |
| r31373 | r31374 | |
|---|---|---|
| 188 | 188 | UINT8 *pri = &pri_bitmap.pix8(y); |
| 189 | 189 | UINT32 *tmapcolor = &dest_bmp.pix32(y); |
| 190 | 190 | |
| 191 | ||
| 191 | ||
| 192 | 192 | int x, x_index = x_index_base; |
| 193 | 193 | for( x=sx; x<ex; x++ ) |
| 194 | 194 | { |
| r31373 | r31374 | |
| 279 | 279 | */ |
| 280 | 280 | |
| 281 | 281 | /* Sprite global disable bit - can't be, it's set in lockload calibration menu where the targets are sprites */ |
| 282 | // if (dragngun_sprite_ctrl&0x40000000) | |
| 283 | // return; | |
| 282 | // if (dragngun_sprite_ctrl&0x40000000) | |
| 283 | // return; | |
| 284 | 284 | |
| 285 | 285 | for (offs = 0;offs < 0x800;offs += 8) |
| 286 | 286 | { |
| r31373 | r31374 | |
| 316 | 316 | colour = spritedata[offs+6]&0x1f; |
| 317 | 317 | |
| 318 | 318 | int priority = (spritedata[offs + 6] & 0x60) >> 5; |
| 319 | ||
| 320 | 319 | |
| 321 | ||
| 322 | 320 | |
| 323 | // printf("%02x\n", priority); | |
| 324 | ||
| 321 | ||
| 322 | ||
| 323 | // printf("%02x\n", priority); | |
| 324 | ||
| 325 | 325 | if (priority == 0) priority = 7; |
| 326 | 326 | else if (priority == 1) priority = 7; // set to 1 to have the 'masking effect' with the dragon on the dragngun attract mode, but that breaks the player select where it needs to be 3, probably missing some bits.. |
| 327 | 327 | else if (priority == 2) priority = 7; |
| r31373 | r31374 | |
| 415 | 415 | ypos+=zoomy<<4; |
| 416 | 416 | } |
| 417 | 417 | } |
| 418 | ||
| 418 | ||
| 419 | 419 | for (int y = cliprect.min_y; y <= cliprect.max_y; y++) |
| 420 | 420 | { |
| 421 | 421 | UINT32 *src = &temp_bitmap.pix32(y); |
| r31373 | r31374 | |
| 434 | 434 | } |
| 435 | 435 | |
| 436 | 436 | } |
| 437 |
| r31373 | r31374 | |
|---|---|---|
| 718 | 718 | { |
| 719 | 719 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 720 | 720 | int d = (dst & 0xffffff) / 4; |
| 721 | for (int i = 0; i < length; i += 4) | |
| 721 | for (int i = 0; i < length; i += 4) | |
| 722 | 722 | { |
| 723 | 723 | UINT32 w; |
| 724 | 724 | if (byteswap) { |
| r31373 | r31374 | |
| 735 | 735 | { |
| 736 | 736 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 737 | 737 | int d = (dst & 0xffffff) / 4; |
| 738 | for (int i = 0; i < length; i += 4) | |
| 738 | for (int i = 0; i < length; i += 4) | |
| 739 | 739 | { |
| 740 | 740 | UINT32 w; |
| 741 | 741 | if (byteswap) { |
| r31373 | r31374 | |
| 768 | 768 | void model3_state::real3d_texture_fifo_dma(UINT32 src, int length, int byteswap) |
| 769 | 769 | { |
| 770 | 770 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 771 | for (int i = 0; i < length; i += 4) | |
| 771 | for (int i = 0; i < length; i += 4) | |
| 772 | 772 | { |
| 773 | 773 | UINT32 w; |
| 774 | 774 | if (byteswap) { |
| r31373 | r31374 | |
| 786 | 786 | { |
| 787 | 787 | address_space &space = m_maincpu->space(AS_PROGRAM); |
| 788 | 788 | int d = (dst & 0xffffff) / 4; |
| 789 | for (int i = 0; i < length; i += 4) | |
| 789 | for (int i = 0; i < length; i += 4) | |
| 790 | 790 | { |
| 791 | 791 | UINT32 w; |
| 792 | 792 | if (byteswap) { |
| r31373 | r31374 | |
|---|---|---|
| 128 | 128 | m_fg_tilemap->draw(screen, m_tile_bitmap_fg, cliprect, 0, 0); |
| 129 | 129 | |
| 130 | 130 | m_mixer->mix_bitmaps(screen, bitmap, cliprect, m_palette, &m_tile_bitmap_bg, &m_tile_bitmap_fg, (bitmap_ind16*)0, &m_sprite_bitmap); |
| 131 | ||
| 131 | ||
| 132 | 132 | return 0; |
| 133 | 133 | } |
| 134 | 134 |
| r31373 | r31374 | |
|---|---|---|
| 53 | 53 | : device_t(mconfig, PC080SN, "Taito PC080SN", tag, owner, clock, "pc080sn", __FILE__), |
| 54 | 54 | m_ram(NULL), |
| 55 | 55 | m_gfxnum(0), |
| 56 | m_x_offset(0), | |
| 56 | m_x_offset(0), | |
| 57 | 57 | m_y_offset(0), |
| 58 | 58 | m_y_invert(0), |
| 59 | 59 | m_dblwidth(0), |
| r31373 | r31374 | |
|---|---|---|
| 175 | 175 | { |
| 176 | 176 | m_pri_cb.bind_relative_to(*owner()); |
| 177 | 177 | m_col_cb.bind_relative_to(*owner()); |
| 178 | ||
| 178 | ||
| 179 | 179 | m_alt_format = 0; |
| 180 | 180 | m_pixmask = 0xf; |
| 181 | 181 | m_raw_shift = 4; // set to 8 on tattass / nslashers for the custom mixing (because they have 5bpp sprites, and shifting by 4 isn't good enough) |
| r31373 | r31374 | |
|---|---|---|
| 196 | 196 | if (!m_bg15_bitmap[0].valid()) |
| 197 | 197 | return; |
| 198 | 198 | |
| 199 | int select = m_bg15_select[ 0 ]; | |
| 200 | int scroll = m_bg15_scroll[ 0 ]; | |
| 199 | int select = m_bg15_select[ 0 ]; | |
| 200 | int scroll = m_bg15_scroll[ 0 ]; | |
| 201 | 201 | |
| 202 | int screen = select & 0x1f; | |
| 203 | int flip = select & 0x20; | |
| 202 | int screen = select & 0x1f; | |
| 203 | int flip = select & 0x20; | |
| 204 | 204 | |
| 205 | int scrollx = (scroll >> 0) & 0xff; | |
| 206 | int scrolly = (scroll >> 8) & 0xff; | |
| 205 | int scrollx = (scroll >> 0) & 0xff; | |
| 206 | int scrolly = (scroll >> 8) & 0xff; | |
| 207 | 207 | |
| 208 | 208 | if (!flip) |
| 209 | 209 | { |
| r31373 | r31374 | |
| 222 | 222 | |
| 223 | 223 | for (int y = cliprect.min_y; y <= cliprect.max_y; y++) |
| 224 | 224 | { |
| 225 | if (!flip) srcbitmap = &m_bg15_bitmap[screen].pix16( (y - scrolly) & 0xff ); | |
| 226 | else srcbitmap = &m_bg15_bitmap[screen].pix16( 255 - ((y - scrolly) & 0xff) ); | |
| 225 | if (!flip) srcbitmap = &m_bg15_bitmap[screen].pix16( (y - scrolly) & 0xff ); | |
| 226 | else srcbitmap = &m_bg15_bitmap[screen].pix16( 255 - ((y - scrolly) & 0xff) ); | |
| 227 | 227 | |
| 228 | 228 | dstbitmap = &bitmap.pix32(y); |
| 229 | 229 | |
| r31373 | r31374 | |
| 231 | 231 | { |
| 232 | 232 | UINT16 pix; |
| 233 | 233 | |
| 234 | if (!flip) pix = srcbitmap[ (x - scrollx) & 0xff ]; | |
| 235 | else pix = srcbitmap[ 255 - ((x - scrollx) & 0xff) ]; | |
| 234 | if (!flip) pix = srcbitmap[ (x - scrollx) & 0xff ]; | |
| 235 | else pix = srcbitmap[ 255 - ((x - scrollx) & 0xff) ]; | |
| 236 | 236 | |
| 237 | 237 | dstbitmap[x] = pal[pix]; |
| 238 | 238 | } |
| r31373 | r31374 | |
|---|---|---|
| 233 | 233 | m_ctrl(NULL), |
| 234 | 234 | m_linectrl(NULL), |
| 235 | 235 | m_wrap(0), |
| 236 | m_xoff(0), | |
| 236 | m_xoff(0), | |
| 237 | 237 | m_yoff(0) |
| 238 | 238 | { |
| 239 | 239 | } |
| r31373 | r31374 | |
|---|---|---|
| 10 | 10 | UINT32 gstriker_state::screen_update_gstriker(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| 11 | 11 | { |
| 12 | 12 | bitmap.fill(m_mixerregs1[8]&0x07ff, cliprect); // complete guess, causes green behind test grid in twc94 and blue behind title screen on gstriker |
| 13 | ||
| 13 | ||
| 14 | 14 | popmessage("%04x %04x %04x %04x %04x %04x %04x %04x | %04x %04x %04x %04x %04x %04x %04x %04x", m_mixerregs1[0],m_mixerregs1[1],m_mixerregs1[2],m_mixerregs1[3],m_mixerregs1[4],m_mixerregs1[5],m_mixerregs1[6],m_mixerregs1[7], m_mixerregs1[8],m_mixerregs1[9],m_mixerregs1[10],m_mixerregs1[11],m_mixerregs1[12],m_mixerregs1[13],m_mixerregs1[14],m_mixerregs1[15] ); |
| 15 | // | |
| 15 | // popmessage("%04x %04x %04x %04x %04x %04x %04x %04x | %04x %04x %04x %04x %04x %04x %04x %04x", m_mixerregs2[0],m_mixerregs2[1],m_mixerregs2[2],m_mixerregs2[3],m_mixerregs2[4],m_mixerregs2[5],m_mixerregs2[6],m_mixerregs2[7], m_mixerregs2[8],m_mixerregs2[9],m_mixerregs2[10],m_mixerregs2[11],m_mixerregs2[12],m_mixerregs2[13],m_mixerregs2[14],m_mixerregs2[15] ); | |
| 16 | 16 | |
| 17 | 17 | m_spr->set_pal_base( (m_mixerregs1[0]&0xf000)>>8 ); |
| 18 | 18 | m_bg->set_pal_base( (m_mixerregs1[1]&0xf000)>>8 ); |
| r31373 | r31374 | |
|---|---|---|
| 143 | 143 | m_dblwidth(0), |
| 144 | 144 | m_gfxnum(0), |
| 145 | 145 | m_txnum(0), |
| 146 | m_x_offset(0), | |
| 146 | m_x_offset(0), | |
| 147 | 147 | m_y_offset(0), |
| 148 | m_flip_xoffs(0), | |
| 148 | m_flip_xoffs(0), | |
| 149 | 149 | m_flip_yoffs(0), |
| 150 | m_flip_text_xoffs(0), | |
| 150 | m_flip_text_xoffs(0), | |
| 151 | 151 | m_flip_text_yoffs(0), |
| 152 | 152 | m_multiscrn_xoffs(0), |
| 153 | 153 | m_multiscrn_hack(0), |
| r31373 | r31374 | |
|---|---|---|
| 327 | 327 | |
| 328 | 328 | m_bg_tilemap->configure_groups(*m_gfxdecode->gfx(0), 31); |
| 329 | 329 | m_bg_tilemap->set_scroll_cols(36); |
| 330 | ||
| 330 | ||
| 331 | 331 | save_item(NAME(m_scroll)); |
| 332 | 332 | } |
| 333 | 333 |
| r31373 | r31374 | |
|---|---|---|
| 1328 | 1328 | logerror(" %08X", data[wordnum]); |
| 1329 | 1329 | logerror("%s", suffix); |
| 1330 | 1330 | } |
| 1331 |
| r31373 | r31374 | |
|---|---|---|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
| 130 | /* Palette: | |
| 131 | 0x0000..0x1fff sprite palettes (0x10 sets of 0x100 colors) | |
| 130 | /* Palette: | |
| 131 | 0x0000..0x1fff sprite palettes (0x10 sets of 0x100 colors) | |
| 132 | 132 | |
| 133 | 0x2000..0x3fff polygon palette bank0 (0x10 sets of 0x200 colors) | |
| 134 | (in starblade, some palette animation effects are performed here) | |
| 133 | 0x2000..0x3fff polygon palette bank0 (0x10 sets of 0x200 colors) | |
| 134 | (in starblade, some palette animation effects are performed here) | |
| 135 | 135 | |
| 136 | ||
| 136 | 0x4000..0x5fff polygon palette bank1 (0x10 sets of 0x200 colors) | |
| 137 | 137 | |
| 138 | ||
| 138 | 0x6000..0x7fff polygon palette bank2 (0x10 sets of 0x200 colors) | |
| 139 | 139 | |
| 140 | The polygon-dedicated color sets within a bank typically increase in | |
| 141 | intensity from very dark to full intensity. | |
| 140 | The polygon-dedicated color sets within a bank typically increase in | |
| 141 | intensity from very dark to full intensity. | |
| 142 | 142 | |
| 143 | Probably the selected palette is determined by most significant bits of z-code. | |
| 144 | This is not yet hooked up. | |
| 145 | */ | |
| 143 | Probably the selected palette is determined by most significant bits of z-code. | |
| 144 | This is not yet hooked up. | |
| 145 | */ | |
| 146 | 146 | |
| 147 | 147 | |
| 148 | 148 | UINT32 namcos21_state::screen_update_namcos21(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect) |
| r31373 | r31374 | |
|---|---|---|
| 168 | 168 | |
| 169 | 169 | void nemesis_state::create_palette_lookups() |
| 170 | 170 | { |
| 171 | ||
| 171 | // driver is 74LS09 (AND gates with open collector) | |
| 172 | 172 | |
| 173 | 173 | static const res_net_info nemesis_net_info = |
| 174 | 174 | { |
| r31373 | r31374 | |
|---|---|---|
| 228 | 228 | // should be smaller and mirrored like m32 I guess |
| 229 | 229 | m_priority = auto_alloc_array(machine(), UINT8, 0x40000); |
| 230 | 230 | ms32_rearrange_sprites(machine(), "gfx1"); |
| 231 | ||
| 231 | ||
| 232 | 232 | save_item(NAME(m_flipscreen_old)); |
| 233 | 233 | save_pointer(NAME(m_priority), 0x40000); |
| 234 | 234 | } |
| r31373 | r31374 | |
| 254 | 254 | // should be smaller and mirrored like m32 I guess |
| 255 | 255 | m_priority = auto_alloc_array(machine(), UINT8, 0x40000); |
| 256 | 256 | ms32_rearrange_sprites(machine(), "gfx1"); |
| 257 | ||
| 257 | ||
| 258 | 258 | save_item(NAME(m_flipscreen_old)); |
| 259 | 259 | save_pointer(NAME(m_priority), 0x40000); |
| 260 | 260 | } |
| r31373 | r31374 | |
|---|---|---|
| 67 | 67 | { |
| 68 | 68 | const pen_t *pen_base = m_palette->pens() + m_palette_bank + (m_screen_shadow ? 0x2000 : 0); |
| 69 | 69 | m_sprgen->set_pens(pen_base); |
| 70 | m_bg_pen = pen_base + 0xfff; | |
| 70 | m_bg_pen = pen_base + 0xfff; | |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | |
| r31373 | r31374 | |
| 104 | 104 | m_palette->set_pen_color(offset, |
| 105 | 105 | m_palette_lookup[r][dark], |
| 106 | 106 | m_palette_lookup[g][dark], |
| 107 | m_palette_lookup[b][dark]); | |
| 107 | m_palette_lookup[b][dark]); // normal | |
| 108 | 108 | |
| 109 | 109 | m_palette->set_pen_color(offset + 0x2000, |
| 110 | 110 | m_palette_lookup[r][dark+2], |
| r31373 | r31374 | |
| 147 | 147 | |
| 148 | 148 | void neogeo_state::video_reset() |
| 149 | 149 | { |
| 150 | ||
| 151 | 150 | } |
| 152 | 151 | |
| 153 | 152 | |
| r31373 | r31374 | |
| 274 | 273 | } |
| 275 | 274 | } |
| 276 | 275 | } |
| 277 | ||
| 278 |
| r31373 | r31374 | |
|---|---|---|
| 67 | 67 | |
| 68 | 68 | void report_bad_cast(const std::type_info &src_type, const std::type_info &dst_type) |
| 69 | 69 | { |
| 70 | printf("Error: bad downcast<> or device<>. Tried to convert a %s to a %s, which are incompatible.\n", | |
| 71 | src_type.name(), dst_type.name()); | |
| 72 | throw; | |
| 70 | printf("Error: bad downcast<> or device<>. Tried to convert a %s to a %s, which are incompatible.\n", | |
| 71 | src_type.name(), dst_type.name()); | |
| 72 | throw; | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | struct options_entry oplist[] = |
| r31373 | r31374 | |
|---|---|---|
| 243 | 243 | UINT8 *_dest = reinterpret_cast<UINT8 *>(dest); |
| 244 | 244 | |
| 245 | 245 | for (int chdlba = 0; chdlba < lenlba; chdlba++) |
| 246 | { | |
| 246 | { | |
| 247 | 247 | // find current frame's track number |
| 248 | 248 | int tracknum = m_toc->numtrks; |
| 249 | 249 | for (int track = 0; track < m_toc->numtrks; track++) |
| Previous | 199869 Revisions | Next |