Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news


  

Author Topic: MAMEInterop SDK v1.3 Released for Developers  (Read 16586 times)

0 Members and 1 Guest are viewing this topic.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
MAMEInterop SDK v1.3 Released for Developers
« on: February 08, 2007, 07:06:14 am »
MAMEInterop SDK v1.3
====================

Developed by [headkaze / R Belmont / Howard Casto / MAME Team]

[Description]

The MAMEInterop SDK is a collection of source code projects to facilitate writing applications that communicate with MAME using its built in output system developed by the MAME Team.

The communication with MAME is achieved by using MAME32.dll (x86) or MAME64.dll (x64). The dll(s) are originally based off the ledutil.c code example included in the MAME archive with additional code added for network communication. It demonstrates reading outputs from MAME using the Windows messaging system using a hidden window or more recently network output on localhost port 8000.

[Enable Output]

To enable MAME's output you will need to edit your mame.ini file with the following line:

#
# OSD OUTPUT OPTIONS
#
output                    windows

NOTE: Alternatively you can set this value to 'network' to use the network output system

[Source Code]

It contains source code projects for the following languages:

- C#
- C++
- Delphi
- VB6
- VB.NET

[Example Outputs]

Run digdug while one of the source code example exe's are running and you will see the outputs display in the app's TextBox. When you select Player1/Player2 coin buttons, digdug flashes the led's for Player1/Player2 start buttons.

The output looks like this:

mame_start
id 0 = 'digdug'
id 12346 = 'led0' <-- Player 1 Coin button is pressed
update_state: id=12346 (led0)  state=1
update_state: id=12346 (led0)  state=0
update_state: id=12346 (led0)  state=1
update_state: id=12346 (led0)  state=0
update_state: id=12346 (led0)  state=1
update_state: id=12346 (led0)  state=0
update_state: id=12346 (led0)  state=1
update_state: id=12346 (led0)  state=0
id 12345 = 'led1' <-- Player 2 Coin button is pressed
update_state: id=12345 (led1)  state=1
update_state: id=12346 (led0)  state=1
update_state: id=12345 (led1)  state=0
update_state: id=12346 (led0)  state=0
update_state: id=12345 (led1)  state=1
update_state: id=12346 (led0)  state=1
update_state: id=12345 (led1)  state=0
update_state: id=12346 (led0)  state=0
mame_stop

If you run the ledutil.exe program that comes with Mame it will make the LED outputs of digdug flash your Numlock and Capslock keys. Essentially it is mapping the LED outputs to the keyboard's LED's. For example this output could be re-directed to a LEDWiz device instead.

Other examples include Terminator 2's recoil and Afterburners Force Feedback. (Not Implemented yet.)
Outputs on real arcade games currently supported in Mame range from simple status LEDs that were on the pcb of the game, rank lamps, solenoids, motors, speedomoters, segmented displays and basically anything you can think of.  If you know of a game that had some sort of output and that output is not implemented in Mame, you need to track down as much info on the game as possible and either fix the driver or send it to the attention of one of the MAME developers so they can hopefully add support. Note that real schematics would be necessary, as simply knowning an output exists isn't enough.

[Supported Games]

They include but are not limited to:

- Any game that flashed the coin lights before the output upgrade.
- Gorf
- Prop cycle
- Beatmania / HiphopMania Games
- Lunar Lander
- All Para Para and Keyboardmania games.

[Supported ROMs]

These are total approximations for Mame 0.111

- 1477 ROMs support led outputs
- 33 ROMs support lamp outputs
- 31 ROMs support digit outputs

[ledx]

1941, 1941j, 1944, 1944j, 19xx, 19xxa, 19xxh, 19xxj, 19xxjr1, 3stooges, 3wonders, 3wonderu, 4in1, 7jigen, 8ball, 8ball1, 8bpm, abaseb, abaseb2, abscam, aceattaa, aceattac, acitya, afighter, agallet, agentx1, agentx2, agentx3, agentx4, ajax, ajaxj, alexkid1, alexkidd, alibaba, alienar, alienaru, aliensy1, aliensy2, aliensy3, aliensyn, alphaona, alphaone, altair, altbeaj1, altbeaj3, altbeas2, altbeas4, altbeas5, altbeasj, altbeast, animaljr, aquarush, ar_airh, ar_bios, ar_bowl, ar_dart, ar_fast, ar_ldrb, ar_ldrba, ar_ninj, ar_rdwr, ar_sdwr, ar_socc, ar_spot, ar_sprg, ar_xeon, arcadia, area88, argusg, armchm2o, armchmp2, armora, armorap, armorar, armwar, armwara, armwarr1, armwaru, astdelu1, astdelu2, astdelux, asterock, asteroi1, asteroib, asteroid, asteroid, astrocde, atarifb, atarifb, atarifb1, atarifb4, atarisy1, atomicp, aurail, aurail1, aurailj, avalnche, avalnche, avsp, avspa, avsph, avspj, avspu, azurian, bagmanmc, balsente, baraduka, barrier, batcir, batcira, batcirj, batman2, battles, bayrout1, bayroute, bayroutj, bayrtbl1, bayrtbl2, beastf, bezerk, bigbucks, bigrun, bladestl, bladestl, bladstle, blast30, blaster, blastkit, blkhole, bloods11, bloods21, bloods22, bloodstm, bm1stmix, bm2ndmix, bm2ndmxa, bm4thmix, bm5thmix, bm6thmix, bmcompm2, bmcompmx, bmcorerm, bmdct, bodyslam, bombbee, bongo, bosco, boscomd, boscomdo, boscoo, boscoo2, botss, boxer, boxingb, brickzn, brickzn3, bsktball, bssoccer, bubbles, bubblesp, bubblesr, buckrog, buckrogn, buggychl, buggychl, buggycht, bullet, bullsdrt, burglarx, bwcasino, bwidow, canyon, canyonp, captcomj, captcomm, captcomu, cascade, casino5, castfant, catacomb, catapult, caterplr, cave, cawing, cawingj, cawingr1, cawingu, cbdash, cbnj, cbtime, cburnrb2, cburnrub, ccastle1, ccastle2, ccastle3, ccastlef, ccastleg, ccastlep, ccastles, ccastles, cdiscon1, centipd2, centipdb, centiped, centiped, centtime, cexplore, cfghtice, cflyball, cgraplop, cgraplp2, checkmaj, checkman, chewing, chikij, choko, chwy, cidelsa, cinemat, cischeat, cischeat, clapapa, clapapa2, cloak, cloakfr, cloakgr, cloaksp, clocknch, cloud9, cluckypo, cmissnx, cnights2, cnightst, colony7, colony7a, commsega, copsnrob, cosmos, cotton, cottong, cottonj, cottonu, cppicf, cppicf2, cprobowl, cprogolf, cprosocc, cps1, cps2, cptennis, crater, crush, crush2, crush3, crush4, csclub, cscluba, csclubh, csclubj, cscrtry, cscrtry2, cshift, csuperas, csweetht, cterrani, ctisland, ctislnd2, ctislnd3, ctornado, ctrpllrp, ctsttape, curvebal, cutieq, cvs, cworld2j, cybots, cybotsj, cybotsu, czeroize, dacholer, daimakai, daiskiss, darkwar, dazzler, dcs, ddenlovr, ddonpach, ddonpchj, ddsom, ddsoma, ddsomb, ddsomj, ddsomjr1, ddsomr1, ddsomr2, ddsomr3, ddsomu, ddsomur1, ddtod, ddtoda, ddtodh, ddtodj, ddtodjr1, ddtodr1, ddtodu, ddtodur1, ddux, ddux1, dduxbl, dealer, decocass, defcmnd, defence, defender, defendg, defendw, defense, defndjeu, deltrace, demndrgn, demoderm, demon, destroyr, destryer, devilfsg, devstor2, devstor3, devstors, dfeveron, digdug, digdug2, digdug2o, digduga1, digdugat, digdugb, diggerc, dimahoo, dingo, dingoe, dino, dinoj, dinou, djmain, dkongjrm, dominos, donpachi, donpachk, donpacjp, donpackr, draco, dragoona, dragoonj, dragrace, dragrace, dremshpr, drgnbstr, drgpunch, drivedge, drivfrcb, drivfrcg, drivfrcp, dstlk, dstlka, dstlku, dstlkur1, dumpmtmt, dunkshot, dynax, dynwar, dynwarj, dzigzag, eagle, eagle2, eagle3, ebases, ecofghta, ecofghtr, ecofghtu, eggor, ehrgeiz, ehrgeiza, endurob2, endurobl, enduror, enduror1, eolith, epos, esb, esprade, espradej, espradeo, eswat, eswatbl, eswatj, eswatu, exctleag, exodus, eyes, eyes2, eyeszac, f15se, f15se21, f1gpstar, f1gpstr2, fantazia, fantjour, fantzon1, fantzone, feversos, ffight, ffightj, ffightj1, ffightu, ffightua, fgtlayer, findout, firebeas, firetrk, flyball, forgottn, fort2b, fort2ba, fpoint, fpoint1, fpointbj, fpointbl, frogg, funkyfig, g13knd, gaelco3d, gaia, galaga, galaga3, galaga3a, galaga3m, galagamf, galagamk, galagamw, galagao, galap1, galap4, galapx, galaxiaj, galaxian, gallag, galmidw, galmidwo, galturbo, gaplus, gaplusa, gapluso, garuka, gatsbee, geebee, geebeeg, genpeitd, gepoker, gepoker1, gepoker2, gepoker3, getrivia, gghost, ggreats2, ghlpanic, ghouls, ghoulsu, gigawing, gimeabrk, gmahou, gmgalax, gokuparo, goldbug, goldnabl, goldnax1, goldnax2, goldnax3, goldnaxe, goldnaxj, goldnaxu, golgo13, gorf, gorfpgm1, gorkans, gottlieb, gravitar, gravitr2, gravp, greatgun, gridlee, grobda, grobda2, grobda3, grudge, gs4002, gs4002a, gt101c, gt101c1, gt102b, gt102c, gt102c1, gt102c2, gt102c3, gt103, gt103a, gt103a1, gt103a2, gt103a3, gt103a4, gt103aa, gt103ab, gt103asx, gt2k, gt2ks100, gt2kt500, gt3d, gt3dl191, gt3dl192, gt3ds192, gt3dt211, gt3dt231, gt3dv14, gt3dv15, gt3dv16, gt3dv17, gt3dv18, gt5, gt507uk, gt97, gt97s121, gt97t240, gt97v120, gt97v121, gt97v122, gt98, gt98s100, gt98t303, gt98v100, gt99, gt99s100, gt99t400, gtclassc, gtclassp, gtcls100, gteikob2, gteikokb, gteikoku, gtroyal, gtsuprem, gutangtn, guwange, gwinga, gwingj, hanakanz, hanamai, hangly, hangly2, hangly3, hangon, harddrb5, harddrb6, harddrc1, harddrcb, harddrcg, harddrg4, harddriv, harddriv, harddrj6, harddrv1, harddrv2, harddrv3, harddrvb, harddrvc, harddrvg, harddrvj, hardhea2, hardhead, hardhedb, hardyard, hardyd10, harem, hattrick, hdrivaip, hdrivair, heartatk, hero, hexpool, hidctch2, hidctch3, hidnctch, hkagerou, hmcompm2, hmcompmx, hnkochou, hnoridur, hopmappy, hotchase, hotdogst, hotmemry, hunchbak, hunchbkg, huncholy, hwchamp, igmo, inca, indytem2, indytem3, indytem4, indytemc, indytemd, indytemp, inferno, insector, irobot, itech32, jackrab2, jackrabs, jackrabt, jantouki, jin, joust, joust2, joustr, joustwr, joyman, jumpbug, jumpbugb, jumpshot, jumpshtp, jungler, junglers, jyangoku, kaitei, kaiteik, kickboy, kingbalj, kingball, kngtmare, knights, knightsj, knightsu, kod, kodb, kodj, kodu, konamigx, kopunch, korokoro, korosuke, krull, ladybugg, landbrk, landbrka, lbgrande, le2, le2j, le2u, levers, liberat2, liberatr, lizwiz, llander, llander1, lockon, locomotn, logger, lostwrld, lottofun, luctoday, lunarba1, lunarbat, m075, mach3, magworm, mainev2p, mainevt, mainevto, majxtal7, maketrax, maketrxb, mappy, mappyj, marble, marble2, marble3, marble4, maxrpm, maya, mayday, maydaya, maydayb, mazerbla, mazerbla, mazinger, mbomberj, mbombrd, mbombrdj, mbrush, mcnpshnt, mcr3, mdhorse, megadon, megaman, megaman2, megamn2a, mercs, mercsj, mercsu, mercsua, merit, meteorts, metmqstr, metrocra, metrocrs, mhavoc, mhavoc2, mhavocp, mhavocrv, micro3d, milliped, millpac, minigol2, minigolf, missile, missile2, mjangels, mjchuuka, mjdchuka, mjdialq2, mjelct3, mjelct3a, mjelctrn, mjfriday, mjleague, mjmyster, mjreach1, mmatrix, mmatrixj, mmpanic, montecar, monymony, moonal2, moonal2b, moonaln, mooncrgx, mooncrs2, mooncrs3, mooncrsa, mooncrsb, mooncrsg, mooncrst, mooncrsu, moonqsr, motos, mpangj, mplanets, mplanuk, mrdrillr, mrtnt, mschamp, msh, msha, mshb, mshh, mshj, mshjr1, mshu, mshutlj2, mshuttle, mshuttlj, mshvsf, mshvsfa, mshvsfa1, mshvsfb, mshvsfb1, mshvsfh, mshvsfj, mshvsfj1, mshvsfj2, mshvsfu, mshvsfu1, mspacmab, mspacman, mspacmat, mspacmbe, mspacmnf, mspacpls, msword, mswordj, mswordr1, mswordu, mtwins, mvp, mvpj, mvsc, mvsca, mvscar1, mvscb, mvsch, mvscj, mvscjr1, mvscu, myqbert, mysticm, mzrblzra, namcos12, namcos86, nametune, navarone, nb1413m3, nemo, nemoj, neruton, nettoqc, newpuc2, newpuc2b, newpuckx, nhidctch, nitedrvr, nitedrvr, nmaster, nmouse, nmouseb, nrallyx, nstocker, nwarr, nwarrb, nwarrh, omega, omegrace, omni, opengol2, opengolf, orbit, orbitron, othunder, othundrj, othundu, othunduo, otwalls, outline, overdriv, ozon1, pacapp, pacapp2, pacappsp, pacgal, pacheart, pacland, pacland2, pacland3, paclandm, pacman, pacmanbl, pacmanf, pacmod, pacnchmp, pacnpal, pacnpal2, pacplus, paintrlr, pairs, pairsa, pang3, pang3j, passht4b, passsht, passshta, passshtb, passshtj, pckeybrd, peterpak, pfghtj, pgear, pgearr1, phozon, phrcraze, phrcrazs, piranha, piranhah, piranhao, pisces, piscesb, pitboss, playball, plegendj, plegends, pnickj, polepos, polepos1, polepos2, poleposa, poleps2a, poleps2b, ponpoko, ponpokov, poolshrk, pop_hh, porky, portrait, portrait, portrata, powerdrv, profpac, progear, progeara, progearj, ptblank2, puckman, puckmana, puckmanf, puckmanh, puckmod, punisher, punishrj, punishru, puzldama, puzzlekg, pwrins2j, pwrinst2, pzloop2j, qad, qadj, qb3, qbert, qberta, qbertjp, qbertqub, qberttst, qbtrktst, qndream, qtono2, quantum, quantum1, quantump, quart2, quart21, quartet, quartet1, quiz, quiz211, quiz365, quiz365t, quizchq, quizchql, quiztvqq, qwak, raccoon, racedcb4, racedcg4, racedrb1, racedrb4, racedrc1, racedrc2, racedrc4, racedrcb, racedrcg, racedrg1, racedrg4, racedriv, racedrv1, racedrv2, racedrv3, racedrv4, racedrvb, racedrvc, racedrvg, racinfrc, racknrol, radarzn1, radarznt, radarzon, radikalb, raiders, rallyx, rallyxm, rampage, rampage2, rcasino, rckman2j, rckmanj, reactor, redufo, reelfun, rescraid, rescrdsa, revenger, ringdest, ringohja, riotcity, ripoff, roadblc1, roadblcg, roadblg1, roadblg2, roadbls1, roadbls2, roadbls3, roadblsc, roadblsg, roadblst, roadrun1, roadrun2, roadrunn, robby, robotron, robotryo, rockclim, rockmanj, rocktrv2, roishtar, rongrngg, rongrong, rranger, rthunder, rthundro, runaway, rungun2, rushhero, ryukyu, sailormn, sailormo, salmndr2, sarge, sbrkout, scorpnmc, scramblb, screwloo, scudhamm, sdi, sdib, sdibl, seawolf2, segahang, segas16a, segas16b, sentetst, sextriv1, sextriv2, sexyparo, sf2, sf2accp2, sf2ce, sf2cej, sf2ceua, sf2ceub, sf2ceuc, sf2eb, sf2hf, sf2j, sf2ja, sf2jc, sf2koryu, sf2m1, sf2m2, sf2m3, sf2m4, sf2m5, sf2m6, sf2m7, sf2rb, sf2rb2, sf2red, sf2t, sf2tj, sf2ua, sf2ub, sf2ud, sf2ue, sf2uf, sf2ui, sf2uk, sf2v004, sf2yyc, sfa, sfa2, sfa3, sfa3b, sfa3r1, sfar1, sfar2, sfar3, sfau, sfootbal, sftm, sftm110, sftm111, sftmj, sfz2a, sfz2aa, sfz2ab, sfz2ah, sfz2aj, sfz2b, sfz2br1, sfz2h, sfz2j, sfz2n, sfz3a, sfz3ar1, sfz3j, sfz3jr1, sfz3jr2, sfza, sfzb, sfzbr1, sfzh, sfzj, sfzjr1, sfzjr2, sgemf, sgemfa, sgemfh, shangupb, sharrier, sharrir1, shinobi, shinobi1, shinobi2, shinobi3, shinobi4, shinobl, shootbul, shpeng, shrike, shufshot, sinista1, sinista2, sinistar, sjryuko, sjryuko1, skybase, skydiver, skykid, skykidd, skykiddo, skykiddx, skykido, skyraid, skyraidr, slamdnk2, slammast, slammasu, smbomb, smbombr1, smooncrs, snakepit, snakjack, snapper, soccer, soccersa, soccersj, soccerss, solarq, sonicbom, sos, soulclba, soulclbb, soulclbc, soulclbr, spacbat2, spacbatt, spacduel, spacefrt, spaceftr, spacewar, spacezap, sparkman, spctbird, spdball, speedfrk, speedup, spf2t, spf2ta, spf2xj, spiker, splat, sprglbpg, sprglobp, sprint1, sprint2, sprint2a, sprint4, sprint4a, sprmatkd, sprtmtch, spyhunt, sqbert, sranger, srangerb, srangerw, ssf2, ssf2a, ssf2ar1, ssf2j, ssf2jr1, ssf2jr2, ssf2t, ssf2ta, ssf2tb, ssf2tbj, ssf2tbr1, ssf2tu, ssf2tur1, ssf2u, ssf2xj, sshot137, sshot139, stankatk, starcas, starcas1, starcase, starcasp, starcrus, starfght, starfigh, stargate, stargrds, starhawk, starshp1, starshpp, startrkd, starwar1, starwars, steelta1, steeltag, steeltal, steeltap, stellcas, stocker, stompin, streakng, strider, striderj, stridrja, stridrua, strtdriv, stunrn2e, stunrn3e, stunrun, stunrun0, stunrun2, stunrun3, stunrun4, stunrun5, stunrune, stunrunj, stunrunp, subroc3d, subs, suna16, suna8, sunaq, sundance, superbik, superbug, superbwl, superg, supergx, superpac, superpcm, suprglob, suprleag, suprmatk, surfplnt, swarm, sws99, sxevious, system16, tactcan2, tactcian, tailg, tankbatt, tazzmang, tbyahhoo, tekken3, tekken3a, tekken3b, tektagt, tektagta, tektagtb, tektagtc, tempest, tempest1, tempest2, tempest3, temptube, tenkomoj, tenkomor, tetris, tetris1, tetris2, tetris3, tetrisbl, theglob, theglob2, theglob3, theglobp, ticket, tictac, timek131, timekill, timesca1, timescan, tkmmpzdm, todruaga, todruago, toggle, tokkae, tomcatsw, topracer, topracra, topracrb, tornado1, tornado2, toryumon, tourtab2, tourtabl, tourtabl, triplhnt, triplhnt, triviabb, triviaes, triviag1, triviag2, triviasp, triviayp, trvchlng, trvwhzha, trvwhzho, trvwhzii, trvwhziv, trvwhzva, trvwhzve, trvwziii, tshoot, tst_galx, tturf, tturfbl, tturfu, tunhunt, tunhuntc, turbo, turboa, turbob, turbotag, tylz, typhoon, uballoon, uecology, ultratnk, unico, uniwars, unsquad, uopoko, uopokoj, usg182, usg185, usg252, usg32, usg82, usg83, usg83x, usgames, usvsthem, vampj, vampja, vampjr1, vanvan, vanvanb, vanvank, varth, varthj, varthr1, varthu, vhunt2, vhunt2r1, vhuntj, vhuntjr1, vhuntjr2, victorba, victory, videopin, vidvince, vpool, vsav, vsav2, vsava, vsavh, vsavj, vsavu, vsnetsca, vsnetscj, vsnetscr, vsnetscu, vsnetseb, wallst, warlords, warofbug, warpwar2, warpwarp, warpwarp, warpwarr, warrior, wb3, wb31, wb32, wb33, wb34, wb3bbl, wcbowl, wcbowldx, wcbwl12, wcbwl140, wcbwl15, wcbwl161, wcbwl165, wecleman, wecleman, wildplt, williams, willow, willowj, willowje, winspike, winspikj, wizwarz, wndrmomo, wof, wofa, wofj, wofu, wolfpack, wolfpack, wonder3, woodpek, woodpeka, wotw, wotwc, wow, wrestwa1, wrestwa2, wrestwar, xevios, xevious, xeviousa, xeviousb, xeviousc, xmcota, xmcotaa, xmcotah, xmcotaj, xmcotaj1, xmcotajr, xmcotau, xmvsf, xmvsfa, xmvsfar1, xmvsfb, xmvsfh, xmvsfj, xmvsfjr1, xmvsfjr2, xmvsfr1, xmvsfu, xmvsfur1, xtheball, yarunara, zaccaria, zero, zero2, zeropnt, zeropnt2, zeropnta, zerotime, zigzag, zigzag2, zoom909

[lampx]

bctvidbs, bigdeal, bigdealb, cardline, connect4, crmaze, crmazea, crmazeb, cuoreuno, elephfam, elephfmb, funworld, jokercrd, jollycrd, jolycdab, jolycdae, jolycdat, jolycdcr, jolycdit, magiccrd, mating, matinga, maxaflex, mf_achas, mf_bdash, mf_brist, mf_flip, mpu4, royalcdb, royalcdc, royalcrd, skiltrek, turnover

[digitx]

bctvidbs, buckrog, buckrogn, connect4, crmaze, crmazea, crmazeb, dlair, dlaira, dlairb, dlairc, dlaird, dlaire, dlairf, grchamp, mating, matinga, maxaflex, mf_achas, mf_bdash, mf_brist, mf_flip, mpu4, skiltrek, sspeedr, subroc3d, turbo, turboa, turbob, turnover, zoom909

[Useful Hardware Interfaces]

To be added later.

[Release Dates]

27-3-2018 - 1.3 - Finalized network output support / added support for inputs (pause)
5-8-2016 - 1.2 - Added support for network output
20-12-2007 - 1.1 - Fixed a few issues
8-2-2007 - 1.0 - First Release

[Credits]

- General Info and Support [Howard Casto]
- Network patches [R Belmont]
- MAME32.dll / MAME64.dll [headkaze / MAME Team]
- C# [headkaze]
- C++ [headkaze]
- Delphi [headkaze]
- VB6 [headkaze / Howard Casto]
- VB.NET [headkaze]

[Contacts]

Howard Casto (MAMEInterop SDK Manager/Developer): hcasto@gmail.com
headkaze (MAMEInterop SDK Developer): headkaze@gmail.com

--------------------------------------

Download MAMEInterop SDK v1.3
« Last Edit: March 27, 2018, 04:48:07 pm by headkaze »

loadman

  • Wiki Contributor
  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4298
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: MameInterop SDK v1.0 Released for Developers
« Reply #1 on: February 08, 2007, 07:52:04 am »
:applaud: Nice work  :notworthy:

Will be sure at this to the upcoming Mala LedWiz V2 plugin  :applaud:

and I'm sure other FE/Plug-in Devs will support this

It can only be a good thing to and more authenticity to some games in various ways

I encorage anyone with the appropriate knowledge to dig a little deeper than 'Dig Dug' going forward   ;)



Havok

  • Keeper of the __Blue_Stars___
  • Trade Count: (+17)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4505
  • No law or ordinance is mightier than understanding
Re: MameInterop SDK v1.0 Released for Developers
« Reply #2 on: February 08, 2007, 08:39:25 am »
Nice work - this has a lot of potential...

 :cheers:

2600

  • Trade Count: (+7)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1630
  • I want my own arcade controls!
Re: MameInterop SDK v1.0 Released for Developers
« Reply #3 on: February 08, 2007, 08:51:11 am »
This certainly makes things easier.

Also add Q-bert to the list.

headkaze, I've noticed you've asked for source code for dll's quite a few times. 
Any chance you are going to post the source code for your dll?


edge

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 368
  • LEDWiz ($45). Mala ($0). Bling Bling (PRICELESS).
    • Edgemods
Re: MameInterop SDK v1.0 Released for Developers
« Reply #4 on: February 08, 2007, 09:28:22 am »
Nice job guys.   :cheers:

Opens up so many possibilties.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #5 on: February 08, 2007, 06:49:01 pm »
This certainly makes things easier.

Also add Q-bert to the list.

headkaze, I've noticed you've asked for source code for dll's quite a few times. 
Any chance you are going to post the source code for your dll?



I've only ever asked for the source code to the ledwiz.dll because MikeQ stopped developing PowerMame. I don't know what you mean by a few times other than that.

I'm not going to release the source code for Mame.dll, but Howard will have a copy incase I fall of the face of the Earth so updates can continue. The reason is I want any problems or bugs for the dll to be reported to me so I can make the update to the dll and release a new version of the SDK. That way everyone will get the fix. There is the likelyhood that I release the dll source code and someone will make changes or fixes and not let me know. This way there is a central place and everyone can benefit from any improvements. That being said if you really need the source you can PM me in private.

There are two versions of the dll BTW, one for VB6 and one for the other languages. I wrote a separate one for VB6 because I wanted it to be easy to use, so I did all the Unicode conversions of the strings in the dll before sending them to the host application.

I didn't miss QBert, if you take a look at the readme.txt included in the archive I have a full list of ROMs and the supported outputs.
« Last Edit: February 08, 2007, 10:03:00 pm by headkaze »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #6 on: February 09, 2007, 04:13:02 am »
I just realised that gorf isn't listed as having lamp outputs but it does. The lists I have are probably innacurate I just went through each driver searching for outputs, then put them into a small util to output ROM names that use the same source file. So there are probably ROMs missing from the list, sorry about that.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #7 on: February 09, 2007, 08:40:10 pm »
Ok I guess we are greenlit then.  :)

Just wanted to make a statement to go along with keadkaze's:

First off I have no clue why I got so much credit.  Other than pestering Aaron to finally add output support I didn't do much.  Remember kids, sometimes pitty can work for you.  ;)

The dll implementation hk did is no small thing.  While setting up the mame connection via code isn't impossible (I managed to do it, so it couldn't be THAT hard.), it does require rather hi-level coding ability.  This kit means that anybody that can write a ledwiz app or something to that degree is going to be able to handle communcations with mame.  Heck, we found out via trial and error that the communcation method out-right doesn't work in vb, so a dll written in C was pretty much required for that. 


I've been volunteered to kind of keep track of the project.  While not as involving as say, controls.dat, it's still going to be some work.  In the next couple of weeks I'll be releasing an app based on our example source that will be used both to retrieve outputs from mame and write ini files based on those outputs ... oh it'll do stuff with em too.  ;)

The sdk is the main thing, and it's essentially done, but there are some further steps I want to do as sort of a supplement.  First off, because we are sometimes dealing with "dangerous" output devices like solenoids, we want each individual game to have a config file.  That doesn't mean there won't be a default file to set most of your games, but we want to make sure that the qbert knocker isn't used as a light in other games, for example or else the solenoid would get burned out.  I'm going to write a standardized file for this.  It's going to be very short, sweet, and to the point.  My app will make them automatically when a game is ran, taking care of 90% of the output games.  There are games, however which have a jumble of dozens of outputs, which we will need to go into and comment about the different ones.  Turbo comes to mind, it has something like 40 outputs!!!

As for what to do with the outputs....  we want to standardize that as well.  Nothing complex, it's just that, let's say the user wants to bind the first coin light to the first output on their ledwiz.  We want to have a certain syntax to write turning on that output to be used in the ini file.  We want to try to use that same syntax for every application any of us make, so again, it'll make things easier on the user.  Again, this isn't going to be anything overly complex, I'll make it nice and to the point. I'll also post ideas about it right here.  I want us to all generally agree upon this stuff. 

Lastly, my app is going to be open source, just like the examples.  I WANT people to add new stuff to it.  I WANT it to be ported to other languages.  Think of this as a mini-mame dev situation.  I want to see the app on linux, macos x ect.... I'm gonna do it in vb because I can code it quicker, but it'd be nice if we could get some people to head up a C build and pretty much a build for every langauge we've talked about.   Of course, if you have a C build then pretty much anything can be done with it porting-wise. 

About dlls and stuff.  Neither of us have any problems with close-source dlls, however, if you want "output device x" to be supported in the sdk and in my app, you need to get somebody to explain the interface and post us some examples, or better yet have them do it and release the source. 

Right now, this is what I, personally intend to add:

parallel port outputs
ledwiz outputs
keyboard leds (maybe not, as they are rather useless and you can use the ledutil for them). 
wiimote outputs (rumble, leds and sound)
Force feedback (via directx)

If anybody wants something else added they'll need to help out.


I want to also add serial port support but I'm rather dumb about serial communication so I would need help.  On top of that we want it to be generic enough to allow for different hardware interfaces (for example I'll handle the parallel interface via allowing direct data communication, not as a "turn on pin 1" function). 

Thats it for now, watch this space carefully in the upcoming days, and developers/users that want to help out please either post here or contact one of us privately. 

Also remember to thank Aaron and hk when you get the chance.  ;)
« Last Edit: February 09, 2007, 08:43:47 pm by Howard_Casto »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #8 on: February 10, 2007, 05:43:06 pm »
Ok guys, my app has the ability to write ini files now.
Since digdug is fairly simple, I'll post the ini here and explain the format and what is going on.

digdug.ini
Code: [Select]
[Output]
led0=
led1=
[Id2String]
12346=led0
12345=led1

That's it?  Yep pretty much.  First let me explain what is going on.  See mame sends you a state update when an output changes, but it doesn't send the name of the output, rather it sends a id number.  In this case 12346(led0) and 12345(led1).  Once the first change has occured, you can send the id number back to mame and it'll give you the real name, in this case led0 and led1.  When you constantly call for the name it slows things down, so we setup a buffer (as seen in the sdk examples).  The id2String section of the ini file takes things one step further by saving the number/string relationship so that it never has to be called again.  So basically this section helps out developers and users should never have to bother with it. 

Now the [Output] section above it would be where we bind the outputs to devices, like the ledwiz.  You'll note they are blank.  When the app makes an ini it sets up all the options, but it doesn't fill in the values.  This is for safety reasons. 


Now since it'd be a real pain in the butt to setup each individual game's outputs, we also have a default file.

default.ini
Code: [Select]
[Output]
led0=lw 1 1
led1=lw 1 2
led2=lw 1 3
led3=lw 1 4


Note there isn't an id2string section as id numbers are unique to each game.  I put led0-led4 as examples because these are the coin lights for mame 90% of the time.  The commands I binded them to are fictional, but as you can see setting up mame to liight the coin lights would be fairly trivial.  The app automatically sets up blank entries for outputs in the defualt.ini, so the user doesn't have to guess what is available to them.  I might set this up as an option though as your default.ini gets filled up fairly quickly, turbo, for example, has 35 outputs!!!


I don't want to clutter things up, so in my next post I'll explain the proposed command structure.

« Last Edit: February 10, 2007, 05:44:46 pm by Howard_Casto »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #9 on: February 10, 2007, 06:03:30 pm »
Ok now for the commands you can bind the outputs to. 

I don't want to get into specific commands, but rather how I would like to see them structured. 


Commands will be in this format:

device/function name port#/device# data

So giving a completely made-up example, to bind the first pin of the first ledwiz to led0 you would type.

Code: [Select]
led0=lw 1 1 %s%
"lw" is the name I made up to represent a ledwiz, 1 represents the first out 16 possible ledwizzes, the second 1 represents the first output pin and %s% represents the state data.  See with this we can switch it on and off with the same command  as %s% will be either 0 or 1. 

You might want to use a rgb led though and this would require dedicated on and off states and multiple calls to set the three pins.  Well we can do that by expanding upon the output command.

To just throw out and example:
Code: [Select]
led0=lwc 1 1 48,lwc 1 2 0,lwc 1 3 0|lwc 1 1 48, lwc 1 2 48, lwc 1 3 48
Ok this is going to have the led be red (48,0,0) when it's off and white(48,48,48) when it's on. 
Note the lwc command, again this is fictional, but we'd want to set the intensity, not just turn the led on and off.  There are three off commands, seperated by commas, followed by a seperator bar and the three on commands.  So basically the app would split the commands by "|" and each slot would be for that value.  In this case we have the value 0 (stuff to the left of the bar) and value 1 (stuff to the right of the bar.)

There are instances where a output can be more than 0 or 1, in those instances we can just add more bars and more commands. 

It's a little complicated, but for simple stuff like turning on and off lights it'll be easy.  Also remember that this is just what we PRINT to the ini file, so anybody can jump in and make a nice gui where you can make things more user friendly. 

Some notes about the physical syntax:

Each part of the command is seperated by a single space.
There are no brackets or groupings allowed (this will speed up parse time)
Obviously commands can't contain commas or bars, as they are used for grouping.

Again I want to keep this neat so I can edit later, in the next post I'll explain some optional "extra" additions to the ini format.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #10 on: February 10, 2007, 06:16:29 pm »
Ok looking back at our ini example from a post ago. 

digdug.ini
Code: [Select]
[Output]
led0=
led1=
[Id2String]
12346=led0
12345=led1


Ok that is gonna do ya 90% of the time, but you might need some setup and shutdown commands depending upon the interface. 

for that we manually add:
Code: [Select]
[General]
onstart=
onstop=
onchange=
[Output]
led0=
led1=
[Id2String]
12346=led0
12345=led1


So we've now got a general section with "onstart" "onstop" and "onchange".  In these three entries you can put any command you would normally put in regular output entries.  Obviously onstart is called whenever the game starts and onstop when the game exits. 


The entry "onchange", however, is more of a future-proofing thing.  On change will be sent whenever ANY output in the game changes it's state.  Why would this be useful?  Mame has quite a few games with segmented displays.  Usually they are in mame as individual digits, rather that the whole scoreboard.  Since interfaces with a segmented display on the pc generally communicate via a line of text, implementation of communicating with these displays would require buffering.  Basically you'd change the individual digit by updating the buffer on an individual output change and after ANY change you'd print the entire buffer (every output) to the device.  So basically it's just there in case we need it later on. 

Again these are put in manually and seldom if ever used.  Unless you have some funky hardware you want to use you'll never have to worry about those.

Alright, that's all I have for now, questions, comments or suggestions would be appreciated before I finalize everything.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #11 on: February 10, 2007, 07:26:33 pm »
I'm just curious if an ini file is necessary at all. Since weve added in name caching we only have to call the get_name_from_id function once to get a name from a new id. Will there realy be a noticeable slowdown using the current method without an ini file? The ini file will certainly help by being able to lookup exactly what outputs a game has though.

I still prefer having one big ini file for the lot, but this is okay :)

BTW The output system in Mame wouldn't exist without you, and neither would MameInterop so I don't think there is any more credit than credit is due.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #12 on: February 10, 2007, 08:34:05 pm »
It's not necessary, but it's helpful. 

Let's say you want to turn all the lights off on startup.  Well you don't know what lights are available unless you have an ini with all the outputs. 

Turbo is particularly taxing on the system.  The game drops to about 5-10 fps for the first minute or so while all the names are being polled.  That is a worst case scenario though.  I've yet to run into another game with more than 5 or 6 outputs. 

2600

  • Trade Count: (+7)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1630
  • I want my own arcade controls!
Re: MameInterop SDK v1.0 Released for Developers
« Reply #13 on: February 11, 2007, 08:21:05 am »
I'd recommend not putting the id in an ini file like that.  It's possible that the id could change between releases.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #14 on: February 11, 2007, 12:01:31 pm »
If it changes between releases then the application will note a new id number and fix it.  It is extremely unlikely that the id numbers would ever change anyway because they don't have to be in any particular order.  If a new output is found then it'd just be tacked on by the developer unless some major cleanup takes place, which I don't see happening. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #15 on: February 11, 2007, 04:59:40 pm »
Ok I've started implementing commands and here is what I came up with. 

First off, our device string will only be three characters long... this just makes for quick parsing and I figure if operating system file extensions can get away with only three characters, why not us?

I went ahead and started with the led wiz.

The first command is "lwp" and it does exactly what the command does with the ledwiz script syntax, set the power level of the output. 

The format is lwp device# output# intensity

So an example would be:

"lwp 1 01 48"  which would set the intensity of output 1 on ledwiz 1 to 48

Also we have "lws" which sets the on/off state, again just like in ledwiz scripts.

The fomat is lws device# output# state.

An example would be:

"lws 1 01 %s%" which would set the on/off state to the current on/off state of whatever mame output it's binded to.

Finally we have "lwc" (ledwiz colors) which stands for the rgb command in ledwiz scripts.

The format is lwc device# starting_output# R_intensity G_intensity B_intensity.

So an example would be:

"lwc 1 01 48 0 0" which would turn the rgb led hooked to outputs 1 2 and 3 red.

So to recap we have:

lwp=ledwiz power level
lws=ledwiz on/off state
lwc=ledwiz rgb state/color

I'm doing different ledwiz functions as seperate "devices" because the syntax required to set these commands all involve commas, which aren't allowed.  I really don't have any plans to add bank/all output support, but once I release the program somebody else can add em as the function is fairly straight forward.

Future commands I'm working on:

lpt=raw lpt communication.... send the port number followed by raw data you want sent to the pins.

lpe=easy lpt communication... send the port number followed by the data pin you wish to turn on/off

ser=serial communication... I won't implement this personally, but I can leave a space in the function and reserve the key name

wii=wiimote communication... won't be implemented for some time, but drivers/apis are finally popping up.

dff=direct-input force feedback.. send the controller id# followed by the motor# and the state.  Mame doesn't do anything complicated with force feedback, so simple on/off pulses should do.  Things like mapping and recorded actions won't be supported.  (Or at least I won't implement it myself). 

p.s. I'm considering removing the id recording since everyone seems to be so against it.  Also all of the multiple commands per state change and different commands for different states stuff is in place and working fine.  As a test I setup my start buttons to be white when "off" and red when "on".  The ledwiz ocx seemed a little slow keeping up (I'll be switching to a dll soon hopefully.) but the actual functions worked perfectly. 
« Last Edit: February 11, 2007, 05:02:23 pm by Howard_Casto »

loadman

  • Wiki Contributor
  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4298
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: MameInterop SDK v1.0 Released for Developers
« Reply #16 on: February 11, 2007, 06:48:25 pm »
I might just add the dig dug stuff my own way for now (just for fun)

But I will jump on board with this later

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #17 on: February 12, 2007, 10:17:20 pm »
I looked into force feedback support yesterday....

Apparently you have to create an effect before you can send any data.  That's a real pain in the butt because it means you have to initalize the effect upon startup.  Because of this I'll probably take back what I said about force feedback and allow users to define effects.  I'll just look for effect files in a folder and load either an default effect file or one named after the rom.  They aren't hard to make if you download the m$ force feedback tool.  Also something that might be useful I forgot about is the ability to bind a button to an effect in di.  Terminator 2's recoil, for example is partiall mechanical.  I believe how it works is the gun itself has a board that controls the ratcheting recoil and the board just turns it on/off instead of rapidly firing the board.  So the effect could be binded to the fire button upon startup and then muted via the state (assuming someone ever hooks up the mame river.)

I'll probably go ahead and hookup the parallel port functions as they are a breeze to do.  Force feedback might take all week. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #18 on: February 13, 2007, 01:58:09 am »
Ok I started implementation of force feedback.  It's a real pain in the butt.

You can only access force feedback actuators if you aquire the device in exclusive mode.  Which means that mame can't access the device.  I'm working on a work-around though.  Regardless of this, the force feedback does indeed work.  I just setup a generic constant rumble that is loaded upon mame_start to any force feedback devices. 

the format as-is is

dff joystick# #state #duration of effect. 

I had to add duration, becuase if you want to use the rumble motor in place of a solenoid, mame turns it on and off far too quickly for you to feel anything.  Also since setting it up with the %s% flag would turn it off immediately regardless of the duration the user sets, I had to resort to some trickery. 

we now also have the function:

nll

which is a blank function that doesn't do anything. 

So for a game with a knocker that you want to use a rumble motor for, you can set the script for off to nothing, and the script for on to a rumble with a duration. 

The script for qbert I made looks like this, for example:

knocker0=nll |dff 1 1 50

So when the knocker is off it doesn't do anything and when it is on it fires a 50 millisecond rumble on device 1. 


It works fairly well, but obviously there are still a lot of things to sort out. 

I'll also add a fff (force feedback from file) command as it's fairly easy to implement now the the basic structure is in place. 

I still need to figure out a good way to initalize the force feedback stuff.  Probably the fastest way would be to allow the user to set it manually with the "onstart" entry in the ini file.  That'd definately need a wizard of some sorts though because it's complicated for the average user to do. 


I'll still add the lpt stuff tomorrow... it's easy.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #19 on: February 13, 2007, 02:09:26 pm »
Ok, I've thankfully figured out the force feedback exclusive mode issue.

Apparently two different applications CAN both have a joystick in exclusive mode.  Unfortunately, when mame starts up, if the game uses a joystick it "unbinds" all joysticks with it's own joystick init.  The solution to our problem was farly simple.  Instead of starting up my force feedback code upon mame start, I start it upon the first state change that uses force feedback.  It works flawlessly.  I can control the rumble motors and mame can still use the controls on the joystick.

So forcefeedback, the long sought after feature for mame, will be a reality!!! 

I still have some cleanup code to do, but that was the only major hurdle in this project.  Expect a test release sometime this weekend followed by a release of the source code if no major bugs are found.

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #20 on: February 13, 2007, 10:02:08 pm »
Nice work Howard, good to see some practical uses for the output system being implemented. BTW How do you know which joystick to send the FF to, or do the output numbers make that clear?

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #21 on: February 13, 2007, 10:39:39 pm »
Well it's just like oldschool 9x programming....

You open up gamepads in the control panel.  Whatever order the gamepads are in is the id number, starting with 0.  When the user wants to fire up a certain pad you just send that joysticks id number.  Of course there are all kinds of checks/error handling in place to make sure the joystick specified actually exists and actually has a rumble motor.  Now I could have went with using the guid (internal device name) but it leads to issues if you have multiple pads of the same type, which most people will have.  Since you'd need to know the guid and the idnumber, it kind of defeats the purpose. 


So basically the same crappy way mame does it.  It sucks because if you re-arrange gamepads then it'll effect your scripts.  I don't think it's a big deal though because if it is sent to the wrong stick the worst that can happen is.. well nothing.

I've went ahead and made the application into a proper taskbar app.  It has a little over 6100k of a footprint and uses 0.0% of the processor when in idle mode so I think it'll be fine for just throwing a shortcut in the startup folder and leaving it on all the time.  With more efficient code I could probably get that footprint down a little, but considering I still haven't added all the functions in, it'll average out the same. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #22 on: February 13, 2007, 11:44:05 pm »
Ok, I swiped my j5 output code and now we have three more devices/functions.

lpe port# pin# state

Which is the "easy mode" lpt interface.  You can straight wire up to 8 leds to the parallel port's 8 data pins.  This function allows you to set the state of an individual pin.  The port number can be 1 or 2, representing lpt1 and lpt2.  So if you can hunt up a cheap parallel port card to add a second port you have 16 "free" inputs.  No fancy 40 dollar device necessary!

lpt port# data

Which is the "hard mode" lpt interface.  It's intended as a stop-gap in case somebody comes out with some crazy parallel-port driven interface.  (I know a few already exist.)  You can send raw integer data (remember to convert first!) to the parallel port of your choice. 

Also we have:

kbd key# state

This sets the keyboard leds by pressing the appropriate key.  The key number can be 1-3.  1 is numlock, 2 is caps lock and 3 is scroll lock.  Unlike mame, my function actually checks to see the current state of the keys, instead of randomly pressing the keys, hoping they'll stay in sync.  So you can be assured that setting capslock to 1 will actually light capslock, and not turn it off if it is already on.  My method is only 1 of the 3 used in ledutil.  If you needed the other methods to work, sorry for your luck as they aren't very efficient and I can't get the current light state from them.  This one is more "primative" but it tends to get the job done regardless of if you are on 9x/xp and if you have a usb or ps2 keyboard. 

We are getting close as most of the functions I wanted to implement are in place. 

I need to add code to read the onstart/onstop/onchange ini entires and do a ton of cleanup, but things are on track. 

I'll look into wiimote support tomorrow. I know a c++ dll has been released, but I don't know how well it handles the rumble motor and leds.  Speaker support would be nice as well.  There's this game called Dragon gun where the guns had speakers on them and they talked to you!  It'd be nice if some helpful mame dev could add the option to pump that data through the output system so I could pump it into a wiimote. 

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #23 on: February 14, 2007, 10:38:33 pm »
Ok, I added support for the "MameStart" "MameStop" and "StateChange" entries. 

They are actually quite handy, even for non-advanced use.  I have the ledwiz hooked up to my start buttons (and nothing else atm), for example.  I put commands in the MAMESTART to turn them white, so they light up even if the game doesn't have coin lights.  I don't want them burning all the time though, so I put in commands to turn them off in MAMESTOP.  Works really well.  I haven't tested statechange, but it should work well as well. 

I also went ahead and implemented some buffers for advanced useage. 

There are 10, text-based buffers you can access via script. 

You have:

sbf buffer# text

That allows you to initially set the buffer up with a template.  It can be of any length, but can't have commas or spaces.  I understood that spaces would be important though, so you can use underscores and they will be converted internally. 

Now that in of itself isn't particularly useful, but you also have:

ibf buffer# position character

This lets to replace a single character in your already setup buffer with something else.  This can include the current state using the "%s%" flag for the character entry. 

You can send buffer data to any other command, by using "%b1%" through "%b10%" in the scripts.  So if the advanced parallel port communication needs a buffer now you have one. 


Also if someone wants to add text-based lcd support, we now have a way to take all the individual states and put them into a text string, which could be sent to the device on state change. 

Again, pretty advanced stuff that most people aren't going to use, but it ensures some future-proofing of the application.

p.s.  wiimote support isn't looking good.  The current methods to interact don't have good error handling and I don't want to add code that'll crash the app if the wiimote isn't present.  So it'll wait for now.  I could add a function to press keys and then a user could use something like glovepie to bind those keys to rumble/leds on the wiimotes.  It's kind of hackish though so I'll have to think on it.


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #24 on: February 14, 2007, 11:00:05 pm »
Ok I caved.....

id2string is gone.  I hadn't hooked it up yet (it just writes it atm, doesn't read it) and I haven't noticed any real speed issues, so there isn't any point in wasting time setting it up.  It'll make the ini files smaller too.

I think I will make the general options auto-generate though as they seem to be pretty handy.  (See above.) 


I'm still on schedule for a weekend test release. 

In the mean-time can anyone help me with the following:

I need a copy of m$'s force feedback effect tool.  I can't seem to find it on msdn anymore.

I would like some details on adding support for those text-based lcds that generally run on the parallel/serial port.  I used to code for them, but it's been a while.  I just need a solution that'll work in xp.

What about other devices?  I haven't heard anyone chime in to say "please support device x" yet.  As far as light controls go, I've only added support for the ledwiz.  I know there are others out there.

youki

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 1612
  • Atomic Front End Creator
    • Atomic Front End
Re: MameInterop SDK v1.0 Released for Developers
« Reply #25 on: February 15, 2007, 04:40:27 am »
Quote
What about other devices?  I haven't heard anyone chime in to say "please support device x" yet.  As far as light controls go, I've only added support for the ledwiz.  I know there are others out there.

Mala hardware?


Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #26 on: February 15, 2007, 07:59:04 am »
Well yeah, that's one, but I don't know it's official name, nor do I have a dll or anything to interface with it. 

I know there was a parallel port based one that somebody did ages ago.  And there's the pinmame hardware interface, which could be used as well (I can probably find info on that one.)

Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • I'm a llama!
Re: MameInterop SDK v1.0 Released for Developers
« Reply #27 on: February 15, 2007, 09:18:51 am »
For the parallel port interface keep in mind:

1) The parallel port under XP is protected and just writing to the port doesn't do anything. There's a special DLL that the Daphne devs wrote for a Dragon's Lair scoreboard that uses the the parallel port that "unlocks it".

2) You may need to send several values to the parallel port for each event.
I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #28 on: February 15, 2007, 02:10:46 pm »
For the parallel port interface keep in mind:

1) The parallel port under XP is protected and just writing to the port doesn't do anything. There's a special DLL that the Daphne devs wrote for a Dragon's Lair scoreboard that uses the the parallel port that "unlocks it".

2) You may need to send several values to the parallel port for each event.

I use inpout32.dll for the parallel port, which works in xp.  As I said above I've setup buffers which can be used to store data and then once the data has been built it can be sent to the parallel port.  Ragardless, the scripting system allows for multiple events to be fired upon each script change.


Come on now man, this is me we're talking about.  I don't make rookie mistakes like that.  ;)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #29 on: February 15, 2007, 11:54:48 pm »
Looking back, that response might have came off as me being rude.  I didn't mean it that way, sorry Budda.


Didn't you make one of said "crazy parallel port interfaces"?  Parallel port communication is in place already, send me some specs and I can add dedicated functions for it. 

I did some testing on the buffers to make sure they are working properly.  So far so good. 

I'd really like to add support for text-based lcds though.  I'll see if I can look into that.  It's suprising how many games had segmented displays and how many aaron has implemented.  There might be a use for those ugly things afterall.  ;)


I was thinking about serial communication and what might be useful (besides the obvious) and I thought perhaps sending files via the port might be a good idea.  Everybody wants to magically build a secondary display out of an old laptop and while that isn't possible, it is possible to setup a tiny app that you can send pictures to via serial com.  Marquees, ranks lights, ect could be controlled and sent through the port.  It seems like a lot of work though, so I don't see it happening before this weekend. 


Buddabing

  • Wiki Master
  • Trade Count: (0)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 1845
  • I'm a llama!
Re: MameInterop SDK v1.0 Released for Developers
« Reply #30 on: February 16, 2007, 12:16:24 am »
Yes, I designed a board that uses a crazy parallel port interface. If it will work with this SDK that'll be one less thing I have to worry about.

And you weren't being rude, you were being Howard. :)


I have changed my nickname to "Cakemeister". Please do not PM the Buddabing account because I do not check it anymore.

Please read the wiki!

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #31 on: February 16, 2007, 01:29:33 am »
I have written a dll called CommIO.dll that allows you to communicate to the com port. E-mail me if your interested  Howard. It should cover any com port communication necessary.

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #32 on: February 16, 2007, 05:15:38 pm »
Yeah, I'll get in contact with you both later this weekend. 

In the meantime, I've noticed a few mame-related bugs I want to make note of publically incase I lose my notes. 

Prop Cycle (propcycl) has it's outputs hooked up backwards.  Led0 should be Fan0 and vice-versa

Atari basketball(bsktball) has something odd mangled in with the led0 output.  It appears both in the ledutil and in the sdk debug to be solid on upon bootup, but it's actually modulating on and off at an incredibly fast speed.  It ends up filling the window message buffer with calls and crashing any program trying to do anything more than read the state.  I know this to be an error because led0 is player 1 start light, so why would it be blinking if no coins are inserted?  And if it is supposed to be blinking why wasn't player 2 start blinking? Blocking off led0 makes player 2 start (led1) behave normally, so the problem is isolated to that output.

Those are it so far.  I think the reason they were never caught is because we are the first to actually do anything with the outputs.  ;)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #33 on: February 16, 2007, 06:21:30 pm »
I exerimented with something a little out there today. 

I made a dual screen test app that'll let you put mame-style artwork files (that are controlled by the outputs of course) on a second screen.  It's real rough and basic, laid out almost exactly like mame's artwork system.  They'll be a function to load a DIS (display) file at a user specified position on the screen(s) and then a function to turn various images in the file on and off.  I can't see this being incredibly useful as most games with scoreboards are vertical (and thus have the lights in the cropped bezel) but hey you never know.  Also I'm told mame recently added support for games without displays.  Maybe this might be handy for that?

This won't make it into tomorrow's release, but I thought I would mention it. 

loadman

  • Wiki Contributor
  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4298
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: MameInterop SDK v1.0 Released for Developers
« Reply #34 on: February 16, 2007, 09:50:00 pm »
Quote
What about other devices?  I haven't heard anyone chime in to say "please support device x" yet.  As far as light controls go, I've only added support for the ledwiz.  I know there are others out there.

Mala hardware?

Quote
Posted by: Howard_Casto  Posted on: Yesterday at 07:59:04 
Insert Quote 
Well yeah, that's one, but I don't know it's official name, nor do I have a dll or anything to interface with it.   


That would be cool for me as I use that.

It is basically a IO-Warrior 40 with 32 Pins.

Other users have put this chip in a Led-Wiz which effectively makes it act the same as mala hardware

I have written code for it myself.. Pretty easy.

There is a SDK it contains the iowkit.dll and all files needed for access with C/C++, Delphi, Visual Basic 6 or Visual Basic .net.
The source for the DLL is provided as "Visual Studio 2005" project.

http://www.codemercs.com/Downloads/SDK.zip

« Last Edit: February 16, 2007, 09:58:47 pm by loadman »

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #35 on: February 17, 2007, 05:38:28 am »
You are going to have to find me more than that.  For a sdk, there is very little documentation. 

Granted there's a simple io example I can look at to figure out how to operate leds, but it doesn't tell me the possible values or anything. 

Also a compiled version of the dll would be nice.  I haven't re-installed 2k5 yet.  ;)

loadman

  • Wiki Contributor
  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4298
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: MameInterop SDK v1.0 Released for Developers
« Reply #36 on: February 17, 2007, 05:45:21 am »
You are going to have to find me more than that.  For a sdk, there is very little documentation. 

Granted there's a simple io example I can look at to figure out how to operate leds, but it doesn't tell me the possible values or anything. 

Also a compiled version of the dll would be nice.  I haven't re-installed 2k5 yet.  ;)

No Worries...  I'll get on it

EDIT:

There is a compiled version of the dll pakaged with the SDK. I only mentioned that you could get the source for DLL in case you wanted to look at it. I will post a link to what you need
« Last Edit: February 17, 2007, 05:50:10 pm by loadman »

headkaze

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 2942
  • 0x2b|~0x2b?
Re: MameInterop SDK v1.0 Released for Developers
« Reply #37 on: February 17, 2007, 05:58:24 am »
Those are it so far.  I think the reason they were never caught is because we are the first to actually do anything with the outputs.  ;)

It's nice pioneering into the unknown. I added basic MameInterop support to my LEDWiz plugin a little while ago (only led0 and led1 support so far). It will be interesting to see what else can be done with this. I'm looking forward to see what you've come up with Howard, although it will be in VB6 no doubt.

I've also talked to Randy about writing a global solution for controlling the LEDWiz (using a server type app along with Mike's ledwiz.dll). Basically like what has been done with MameInterop but for the LEDWiz. I'm not sure I'll find the time, but if I do I will do a sort of LEDWiz SDK for the scene. I guess it depends alot though since 3 FE's have added proprietry support for the LEDWiz, so I'm not sure if it's necessary. What do you think about using Windows Messaging for controlling a LEDWiz basically like how Mame's output system works? Do you think it will be fast enough for LEDWiz output? It would have been nice to come up with a global solution before all the FE's did their own thing.

Also a compiled version of the dll would be nice.  I haven't re-installed 2k5 yet.  ;)

Time to install Vistual Studio Express 2005 methinks ;)

Howard_Casto

  • Idiot Police
  • Trade Count: (+1)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 16481
  • Your Post's Soul is MINE!!! .......Again??
    • The Dragon King
Re: MameInterop SDK v1.0 Released for Developers
« Reply #38 on: February 17, 2007, 09:08:04 am »
Well I know nobody wants to hear what I think, but imho adding internalized support for the ledwiz in a fe is rather stupid and useless.  All it does is add more things to maintain when the same thing could be accomplished via command line calls.  Whenver randy updates the dll/ocx all the users are sitting on their hands until the fe dev gets around to updating the code. Also what exactly would you do with it fe-wise? Granted I know that most people  use their ledwizzes for nothing more than a way to light up their cp buttons with some blinky effects, but I can sell em 5 bucks worth of kit that'll do that and it wouldn't even have to be hooked up to a computer. :)

Where it's at is lighting up different color-coded layouts (like j5 and the other cp viewers) and messing with mame's outputs as then you are actually doing something useful with the ability to control multiple lights/motors/ect on the fly.

The only thing a fe can do really is use animations for when idle in the fe and various transition effects.  That's all well and good, but the can be done with a simple call to the command line utility.  Or better yet, a command line app that isn't dependant upon the ledwiz software.

Really the fe's with built in support need to take it out in leu of a more generic solution.  I'm not trying to tell anybody how to code, but when you do a big project like a fe, you want to use as few dlls as possible as it just bloats your code and just makes it more complicated to manage.  After 4 years the dk beta now has a whole two dlls and it's driving me crazy because I can't get rid of them.  I wonder about people that don't bat an eye at using 10 or 20. 

I'm throwing all these dlls, ect in this hooking app so that I don't have to elsewhere.  It's going to be a god-awful mess dll wize, but it'll be worth it because this app is nothing but dlls, so there's not really any code to bloat.  :)


But enough ranting..... 

I don't think windows messaging would be fast enough.  All mame does is pump out the values of data used in real life scenarios (like a flashing light) and it seems to lag a little sometimes.  I can only imagine if you actually had to do something and wait for it to finish. It would work, but only if you aren't doing manual animation.  I'm not sure a server app would be a good idea for anything other than sending animation files.  Where the ledwiz needs that delay for the usb chipset issue every millisecond counts.  At least if you are doing anything advanced with it.  For a fe it'd be fine though since, as I complained above, you would really only want to send different layout files in a fe. I say make it command-line based, but that's just me. 

loadman

  • Wiki Contributor
  • Trade Count: (+3)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 4298
  • Cocktail Cab owner and MaLa FE developer
    • MaLa
Re: MameInterop SDK v1.0 Released for Developers
« Reply #39 on: February 17, 2007, 06:20:53 pm »
You are going to have to find me more than that.  For a sdk, there is very little documentation. 

Granted there's a simple io example I can look at to figure out how to operate leds, but it doesn't tell me the possible values or anything. 

Also a compiled version of the dll would be nice.  I haven't re-installed 2k5 yet.  ;)
When you have downloaded the SDK from the link in my earlier post:

A compiled version of the DLL can be found here:
SDK\Windows\library_1_5\source\Release

Good Simple examples can be found here:
SDK\Windows\Samples\Simple IO ( Turn a led on, turn a led off EASY :-)    )

Documentation
SDK\Documentation (EG AN1 is for a LED matrix but just switching one one is easier)

If you are serious I can lend you a MaLa Led Controller. (I have an extra one I use for testing) Just PM me an address to send it

Cheers

Load

  
 

Sitemap 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31