(Topic ID: 232695)

WPC Emulator in your Browser

By neophob

5 years ago


Topic Heartbeat

Topic Stats

You

Linked Games

No games have been linked to this topic.

    Topic Gallery

    View topic image gallery

    Screenshot 2020-04-21 at 22.56.53 (resized).png
    oblivion_ui.jpg
    2 (resized).png
    1 (resized).png
    bitmap (resized).PNG
    There are 71 posts in this topic. You are on page 1 of 2.
    20
    #1 5 years ago

    Hi all

    I just released a new version of the WPC-EMU - that emulates the Williams Pinball Machine in your browser. All available ROM's are runnable (except "The Pinball Circus" - as I could not find a dump).

    https://neophob.github.io/wpc-emu/

    Enjoy!

    #2 5 years ago

    Very cool - nicely done.

    #3 5 years ago

    Nice!

    #4 5 years ago

    Freaking impressive. Very nice work.

    #5 5 years ago

    An ingenious idea with a nice layout. Can't get it to run in Google Chrome, however.

    #6 5 years ago

    Wow, I probably played with this for a solid 20 minutes. I always felt PinMAME's switch matrix input lacked the ability to really influence game events because there was no way to keep switches pressed down (to lock a ball, for example). This makes it easy! It works for me in Chromium (based on Chrome) but the sound does not work. The emulator doesn't work at all in Internet Explorer. I haven't tested any other browsers.

    This is fantastic, for people who want to rip or record DMD animations this is absolutely perfect to trigger specific events!

    #7 5 years ago

    Fantastic work! Looking forward to the debugger interface and more playfields being added.

    Works fine in Firefox.

    #8 5 years ago
    Quoted from Quench:

    Fantastic work! Looking forward to the debugger interface and more playfields being added.
    Works fine in Firefox.

    Yes, runs good in Firefox but no sound there either (perhaps sound is still a WIP).

    Haven't tried it in Microsoft Edge.

    #9 5 years ago

    That is amazing, what are all the extra dmd frames at the bottom? are these internal dmd buffers used by the dev to create the final rendering? if so very cool.

    #10 5 years ago

    Is this PinMAME based or completely new?

    #11 5 years ago

    Bump for this awesome emulator!

    #12 5 years ago

    Goddamn this is awesome!

    #13 5 years ago

    Any chance of getting an option to upload custom roms to this?

    #14 5 years ago

    Being able to save a machine's configuration/setup -- perhaps as browser cookies -- would rule BIG time.

    #15 5 years ago
    Quoted from SonicZone:

    Being able to save a machine's configuration/setup -- perhaps as browser cookies -- would rule BIG time.

    Agreed!

    #16 5 years ago

    has any one got audio working on this? looks like it should support wpc audio but i just get a few dings at the start and nothing else.

    #17 5 years ago
    Quoted from russdx:

    has any one got audio working on this? looks like it should support wpc audio but i just get a few dings at the start and nothing else.

    From the github link - sound emulation isn't complete:

    Sound Board
    ~ load pre DCS sound ROM files ✓
    ~ load DCS sound ROM files ✗
    ~ Bank Switching ✓
    ~ Resample audio to 44.1khz ½
    ~ emulate 6809 CPU ✓
    ~ emulate YM2151 FM Generator ½
    ~ emulate HC-55536 CVSD ✗ (speech synth)
    ~ emulate MC6821 PIA ✓
    ~ emulate DAC ✓

    Quoted from Crash:

    Is this PinMAME based or completely new?

    It looks new - but appears to have used existing emulation as a reference.

    #18 5 years ago

    .

    #19 5 years ago

    Thanks for all the replies! I try to answer the open questions.

    Quoted from Crash:

    Wow, I probably played with this for a solid 20 minutes. I always felt PinMAME's switch matrix input lacked the ability to really influence game events because there was no way to keep switches pressed down (to lock a ball, for example). This makes it easy! It works for me in Chromium (based on Chrome) but the sound does not work. The emulator doesn't work at all in Internet Explorer. I haven't tested any other browsers.
    This is fantastic, for people who want to rip or record DMD animations this is absolutely perfect to trigger specific events!

    Thanks, sound is currently not emulated, I work on that. I ignore Internet Explorer - but it should work on all current browsers including stock iOS.

    Quoted from Quench:

    Fantastic work! Looking forward to the debugger interface and more playfields being added.
    Works fine in Firefox.

    I'm looking for contributors on this project, feel free to open a pull request on https://github.com/neophob/wpc-emu. Adding new playfields and adding lamp positions should be pretty easy (really, it is easy ) - just take a look at the game entry "client/scripts/hurricane.js". Let me know if something is unclear, I'll update the readme to clarify thing...

    Quoted from Crash:

    Is this PinMAME based or completely new?

    I used PinMame and FreeWPC as source to get information, but the emulator itself is written from scratch.

    Quoted from russdx:

    That is amazing, what are all the extra dmd frames at the bottom? are these internal dmd buffers used by the dev to create the final rendering? if so very cool.

    This shows the internal ram of the DMD board, each of those ram pages are toggled to create the different brightness of the LED output

    Quoted from lurch:

    Any chance of getting an option to upload custom roms to this?

    Let me know what you need, are you talking about different ROM versions or other homebrew ROMs?

    Quoted from SonicZone:

    Being able to save a machine's configuration/setup -- perhaps as browser cookies -- would rule BIG time.

    you mean to store the whole state of the pinball machine? or are you talking about the switch state?

    Quoted from pinballsp:

    Interesting your project, congratulations, hope soon work the sound to can test all.
    I suggest add trigger to play external customized sounds (WAV in SD card), output for real DMD or at least serial output data similar to pinmame to work with real DMD.
    In your hardware notes you say about use Teensy, Arduino or ESP32, I suggest NXP RT1020, its the microcontroller for the future Teensy 4, a very powerful Cortex M7 500 Mhz and cheaper than Kinetis used in Teensy 3.5/3.6. With one RT1020, can run a real multicolor DMD and control all input/output for switches and power outputs, may be even can play external sounds.
    For input hardware, instead of opto couplers, you can use level adapter buffers like the HEF4050.

    My plan is to synchronise a real pinball machine with the emulator - to validate the emulator works correct. I wrote already a firmware for the esp32 board - as I can use web bluetooth. thats definitive easier than using a serial connection and works "out of the box" with a recent browser.

    Currently I'm looking for a payable WPC pin in Switzerland - let me know if you want to support this project

    #20 5 years ago
    Quoted from neophob:

    Quoted from lurch:
    Any chance of getting an option to upload custom roms to this?

    Let me know what you need, are you talking about different ROM versions or other homebrew ROMs?

    I was thinking homebrew. It would be sweet to be able to load roms into this for testing. Ive been playing around with a Roadshow rom, but have no real place to test it other than to burn it and see what happens.

    Not a big deal though, i dont want you killing yourself to implement that.

    #21 5 years ago

    .

    #22 5 years ago
    Quoted from lurch:

    I was thinking homebrew. It would be sweet to be able to load roms into this for testing. Ive been playing around with a Roadshow rom, but have no real place to test it other than to burn it and see what happens.
    Not a big deal though, i dont want you killing yourself to implement that.

    probably the easiest way would be check out the github repo and add it locally, let me know if you need help

    #23 5 years ago
    Quoted from pinballsp:

    The wireless connection can be a problem in electromagnetically noisy environments, such as a real pinball machine. You can have many problems of loss of communication or failure in the transmission of data, personally I think the best thing is a wired communication, either by Serial port or USB.
    I can collaborate in the design, programming and manufacturing of hardware compatible with your software. For example, a controller that receives/send data from/to your software, to process the inputs/outputs, that also controls a multicolor real DMD. And a sound system with a digital amplifier in class D and a WAV sound player that store sound files in SD card to allow that user can customize the machine with his own sounds that replace the originals.
    Basically they are the improvements that I have commented to you, that imply that your software send the information of the frames of the DMD (in the same way that now it does it pinmame), and that send also information to trigger external sounds. That in addition to the exchange of input/output data, between software and hardware.

    I use the simplest solution for now (BLE) - as it *should* work thanks to frequency hopping, but I'll know once I've implemented it...

    about the DMD output - thats a nice idea, also because color DMD animation is also on my TODO list. What output format does pinmame use? raw dmd frames send out via REST? serial?

    #24 5 years ago

    .
     

    #25 5 years ago
    Quoted from pinballsp:

    The wireless connection can be a problem in electromagnetically noisy environments, such as a real pinball machine. You can have many problems of loss of communication or failure in the transmission of data, personally I think the best is a wired communication, either by Serial port or USB.
    I can collaborate in the design, programming and manufacturing of hardware compatible with your software. For example, a controller that receives/send data from/to your software, to process the inputs/outputs, that also manages a multicolor real DMD, and a sound system with a digital amplifier in class D and a WAV sound player that store sound files in SD card to allow that user can customize the machine with his own sounds that replace the originals. This board can also include the power output with MOSFET to replace totally the original WPC boards by one "all in one" board.
    Basically they are the improvements that I have commented to you, that imply that your software send the information of the frames of the DMD (in the same way that now it does it pinmame), and that send also information to trigger external sounds. That in addition to the exchange of input/output data, between software and hardware.

    if wireless is such an issue why did you stick wifi modules on all of your boards??? couple years ago you was telling us wireless inside the pinball was the perfect solution and you was goin to have a wireless topper etc...... yet now its bad?

    also if it was such a bad idea products like pinstadium would just not work.

    #26 5 years ago
    Quoted from neophob:you mean to store the whole state of the pinball machine? or are you talking about the switch state?

    Game adjustment+bookkeeping menu data. In other words, what the game's batteries or NVRAM board drop-in replacements for batteries would normally retain between power cycles. Sorry if I wasn't clear on that.

    #27 5 years ago
    Quoted from SonicZone:

    Game adjustment+bookkeeping menu data. In other words, what the game's batteries or NVRAM board drop-in replacements for batteries would normally retain between power cycles. Sorry if I wasn't clear on that.

    thanks for clarify! good point to persist the nvram (https://github.com/neophob/wpc-emu/issues/22)

    #28 5 years ago
    Quoted from neophob:

    thanks for clarify! good point to persist the nvram (https://github.com/neophob/wpc-emu/issues/22)

    could also use local browser storage, js as nice api for it.

    #29 5 years ago

    -removed: Fake/duplicate accounts are not allowed on Pinside.-

    #30 5 years ago
    Quoted from Sicko_Fual:

    -removed: Fake/duplicate accounts are not allowed on Pinside.-

    thanks for the heads up
    about storing/dumping DMD frames, I created https://github.com/neophob/wpc-emu/issues/20. Thats a generic approach, it could be used to dump the frames but also to send the frames to an external (color) DMD. let me know if you have more input.

    #31 5 years ago
    Quoted from neophob:

    thanks for the heads up
    about storing/dumping DMD frames, I created https://github.com/neophob/wpc-emu/issues/20. Thats a generic approach, it could be used to dump the frames but also to send the frames to an external (color) DMD. let me know if you have more input.

    could there be a simple start/stop record button and then just save the frames out as json or a simple txt file? could be really simple.

    #32 5 years ago
    Quoted from russdx:

    could there be a simple start/stop record button and then just save the frames out as json or a simple txt file? could be really simple.

    I could, but then its hard to export those data from the browser.
    I guess I'll implement the generic solution, but add a simple tool to dump the frames as example

    #33 5 years ago
    Quoted from neophob:

    thanks for the heads up
    about storing/dumping DMD frames, I created https://github.com/neophob/wpc-emu/issues/20. Thats a generic approach, it could be used to dump the frames but also to send the frames to an external (color) DMD. let me know if you have more input.

    Sorry for having raised some expectations I can’t fullfill...

    Im just a moron hanging around here with a fake account and some basic knowledge about trustworthy people.

    Russdx made a good suggestion. The normal way Pin2dmd works is storing the frames in a text file. It gets zipped and can be imported into Pin2dmd editor.

    For now the biggest issue is to get complete dumps which could be solved with your browser project.

    #34 5 years ago
    Quoted from neophob:

    I could, but then its hard to export those data from the browser.
    I guess I'll implement the generic solution, but add a simple tool to dump the frames as example

    i use this solution alot at work, it basically downloads any file you want from js from any browser ie the frame data in any format you want a quick easy way to get data out of js apps.

    example
    https://codepen.io/davidelrizzo/pen/cxsGb

    #35 5 years ago
    Quoted from russdx:

    i use this solution alot at work, it basically downloads any file you want from js from any browser ie the frame data in any format you want a quick easy way to get data out of js apps.
    example
    https://codepen.io/davidelrizzo/pen/cxsGb

    well thats the pure download, which is not the problem. its more the caching that needs to be done UNTIL you download the frames. one frame need approx 1600 bytes. if i assume 10 fps on average thats 16k per second or more or less 1MB per minute.
    one option is to restrict the maximal record time to 1 minute, would that make sense? or how do you rip those dmd frames?

    I just want to understand how you work before I implement something useless...

    #36 5 years ago
    Quoted from neophob:

    well thats the pure download, which is not the problem. its more the caching that needs to be done UNTIL you download the frames. one frame need approx 1600 bytes. if i assume 10 fps on average thats 16k per second or more or less 1MB per minute.
    one option is to restrict the maximal record time to 1 minute, would that make sense? or how do you rip those dmd frames?
    I just want to understand how you work before I implement something useless...

    Does not make sense to me. The goal is to have every possible animation recorded. Currently this is done on a real pinball machine with the glass off and rolling the ball by hand to trigger all events with dmd scenes. The same method is used with vpin except that you guide the ball with the mouse pointer.

    #37 5 years ago
    Quoted from lucky1:

    Does not make sense to me. The goal is to have every possible animation recorded. Currently this is done on a real pinball machine with the glass off and rolling the ball by hand to trigger all events with dmd scenes. The same method is used with vpin except that you guide the ball with the mouse pointer.

    what do you suggest make sense: longer time? record a specific animation (using a start/stop button)? something else?

    #38 5 years ago

    Here we go, I just release v0.8.10 (https://neophob.github.io/wpc-emu/) - major change is the ability to save and load one state of each game.

    let me know if you find some issues. It tested it rather good, but looking for feedback

    #39 5 years ago

    Wooow very very nice @neophob!

    #40 5 years ago
    Quoted from neophob:

    what do you suggest make sense: longer time? record a specific animation (using a start/stop button)? something else?

    Record with a start stop button is a good idea.

    #41 5 years ago

    v0.8.11 released, I added a "MIDNIGHT MADNESS" button to set the pinball time to 23:59:45. This allows to enjoy some fancy madness mode

    #42 5 years ago

    v0.8.14 released (https://neophob.github.io/wpc-emu/). major new feature is a DMD animation exporter (raw format).

    I'm looking for some feedback if the animation exporter is usable or if there any issues. Would be great to get some feedback.

    Cheers

    #43 5 years ago

    Anybody had time to play around with the DMD ripper? I'm wondering if its usable..

    #44 5 years ago

    I loaded the .raw file in to Tile Molester (bitmap viewer) and got this:

    bitmap (resized).PNGbitmap (resized).PNG

    It's the Hurricane logo. Not sure if it's supposed to look this way viewed in a two color (1 bit per pixel) format.

    #45 5 years ago

    The dump itself is working fine but it is hard to find and trigger the switch sequences by hand. Maybe simulating a ball running through a ramp which triggers the enter ramp and shortly after the made ramp switches would be helpful. Something like grouping switches together. Also when the dump is running you can save the file when the buffer is full but continue to record and save the next file without the header. That way you will end up with a sequence of raw files which could be joined together using something like copy /b

    #46 5 years ago
    Quoted from Crash:

    I loaded the .raw file in to Tile Molester (bitmap viewer) and got this:
    [quoted image]
    It's the Hurricane logo. Not sure if it's supposed to look this way viewed in a two color (1 bit per pixel) format.

    thanks - it's not a raw image data but a raw dmd frame dump (header, 3x raw and unshaded dmd image frame).

    Quoted from lucky1:

    The dump itself is working fine but it is hard to find and trigger the switch sequences by hand. Maybe simulating a ball running through a ramp which triggers the enter ramp and shortly after the made ramp switches would be helpful. Something like grouping switches together. Also when the dump is running you can save the file when the buffer is full but continue to record and save the next file without the header. That way you will end up with a sequence of raw files which could be joined together using something like copy /b

    I see. Currently this logic part is not implemented, but on the roadmap. that should solve some issues with starting some pins too

    #47 5 years ago
    Quoted from neophob:

    I see. Currently this logic part is not implemented, but on the roadmap. that should solve some issues with starting some pins too

    Maybe make these sequences configurable in the table config files. That way you could also simulate bumpers etc.

    For the dump you could also add a merge routine for the files already stored on the harddisk when the dump is stopped and maybe pause the game during the save routine that no frames are lost.

    #48 5 years ago
    Quoted from neophob:

    thanks - it's not a raw image data but a raw dmd frame dump (header, 3x raw and unshaded dmd image frame).

    how do you open the raw file? on my side I got this from editor and dmd extractor:

    Whait is it supposed to be? a set of pictures, txt files with 1, 2, 3... ?

    thanks

    1 (resized).png1 (resized).png2 (resized).png2 (resized).png
    #49 5 years ago

    With the pin2dmd editor you can load it as a recording. Larger files should be gzipped.
    You can lookup the fileformat in the pinmame source (core.c I think)

    #50 5 years ago

    Holly crap this is cool

    There are 71 posts in this topic. You are on page 1 of 2.

    Reply

    Wanna join the discussion? Please sign in to reply to this topic.

    Hey there! Welcome to Pinside!

    Donate to Pinside

    Great to see you're enjoying Pinside! Did you know Pinside is able to run without any 3rd-party banners or ads, thanks to the support from our visitors? Please consider a donation to Pinside and get anext to your username to show for it! Or better yet, subscribe to Pinside+!


    This page was printed from https://pinside.com/pinball/forum/topic/wpc-emulator-in-your-browser?hl=lucky1 and we tried optimising it for printing. Some page elements may have been deliberately hidden.

    Scan the QR code on the left to jump to the URL this document was printed from.