#jsmess 2017-10-26,Thu

↑back Search

Time Nickname Message
04:11 πŸ”— SketchCow I'll be right over
04:11 πŸ”— SketchCow <airsiren>
04:14 πŸ”— db48x heh
04:19 πŸ”— taisel has joined #jsmess
05:28 πŸ”— taisel has quit IRC (Quit: Leaving)
05:33 πŸ”— icculus has joined #jsmess
05:34 πŸ”— icculus hello, Jason Scott sent me.
05:35 πŸ”— bai oh man, bringing in the big guns :D
05:36 πŸ”— bai welcome
05:37 πŸ”— icculus hi. :)
05:38 πŸ”— bai so how much do you know about what's going on in here? I'm more than happy to get you up to speed
05:38 πŸ”— icculus Jason said there was some sort of MAME-vs-Emscripten issue, and I should come get technical details from the fine folk in this channel.
05:38 πŸ”— icculus Something about it using 100% CPU for no good reason
05:39 πŸ”— bai yeah, so it's been working pretty solid for a while now, but we want it faster and yeah, less cpu burning when idle
05:39 πŸ”— bai MAME is built using the standard game loop architecture, a tight loop executing as fast as possible, with some calls to a sleep wrapper which calls the appropriate sleep function for the platform
05:40 πŸ”— bai to control timing of machine chips and ultimately frame output
05:41 πŸ”— bai but with emscripten...well, how much do you know about that whole thing, specifically its async handler?
05:41 πŸ”— icculus I’ve gotten a few games running with Emscripten: https://icculus.org/ut99-emscripten/ and some stuff on playonjump.com
05:41 πŸ”— icculus So I’m pretty familiar
05:43 πŸ”— bai cool, yeah I figured. so, we've modified MAME's main game loop to use emscripten_set_main_loop, and as it is now we basically have it hardcoded to assume 60fps, and to advance the machine's internal emulation clock by the appopriate number of ticks
05:44 πŸ”— bai https://github.com/mamedev/mame/blob/master/src/emu/machine.cpp#L1321-L1360
05:45 πŸ”— bai using that code, the cpu profile looks like this https://i.imgur.com/80HgKvk.png
05:46 πŸ”— bai because scheduler->timeslice();
05:46 πŸ”— bai oops
05:46 πŸ”— bai because scheduler->timeslice() is where all the sleep() magic happens for timing
05:47 πŸ”— bai and on the emscripten platform it's just doing the naive while (Date.now() < t) {} style sleep implementation
05:47 πŸ”— icculus So this is just burning the entire ~16 milliseconds, returning so the framebuffer can swap, and then starting again, 60 times a second
05:47 πŸ”— bai yup
05:48 πŸ”— icculus This should be solvable, then.
05:48 πŸ”— bai now, I've got an experimental branch which tries to handle it a bit more intelligently - if the system is asked to sleep() for longer than the amount of time left in this frame, it basically stops processing until the next emcripten main loop call
05:49 πŸ”— bai this ends up looking like this https://i.imgur.com/YEEbT9b.png - much cleaner
05:49 πŸ”— bai but it introduces some timing issues
05:50 πŸ”— icculus How long are these sleeps intended to be, generally?
05:50 πŸ”— bai because I did it in a pretty hacky way while trying to work through some theories, and my feeble brain turns to mush when I try to consider the delicate timing balance of a system like this
05:50 πŸ”— icculus are they…five milliseconds or like 50 milliseconds?
05:51 πŸ”— bai let me refresh myself on the code. I think the mame functions themselves are in something insane like picoseconds
05:56 πŸ”— DFJustin attoseconds
05:59 πŸ”— bai that's right
06:00 πŸ”— bai sorry dealing with space issues on my vm. I guess a stock ubuntu install chews right through 12 now
06:00 πŸ”— bai 12 gigs*
06:02 πŸ”— icculus no worries
06:03 πŸ”— icculus the more direct question: where do I build this from? Is it on mamedev/mame, or is this a separate fork elsewhere?
06:03 πŸ”— bai it's all part of the official release now, except for my hacks
06:04 πŸ”— icculus ok, I’m going to poke at it in the morning, then, and hopefully I’ll make some progress.
06:04 πŸ”— bai sweet
06:04 πŸ”— bai I'll dig up my own patches by then to give you a starting point of where in the codebase you'll want to poke things
06:05 πŸ”— icculus for now, though, I’m going to sleep. I’ll idle in this channel though, in case anyone wants me to hear any details.
06:05 πŸ”— icculus ok, that’s great, thank you!
06:05 πŸ”— bai sounds good, looking forward to seeing what we can come up with
06:05 πŸ”— bai been a long-standing issue
06:45 πŸ”— Vito` Haha
06:45 πŸ”— Vito` I think my internet is a closed loop now
06:46 πŸ”— Vito` I need new circles, everyone I know ends up in here
06:54 πŸ”— bai all roads lead to #jsmess
07:24 πŸ”— SketchCow I never stop
07:24 πŸ”— SketchCow You said we needed people, I got people
07:26 πŸ”— SketchCow icculus: Bai is the main person who was trying this but he got super busy because his company needs him
07:27 πŸ”— SketchCow icculus: DFJustin has worked in MAME a long time, he can help. A pile of other people are here and can help as well: azakai is the maintainer of Emscripten, db48x has done a bunch of work with all this, and Vito` and devesine also have done massive work in the past.
12:46 πŸ”— icculus has quit IRC (icculus)
13:30 πŸ”— icculus has joined #jsmess
15:15 πŸ”— icculus omg, this thing takes forever to build. Emulate less hardware next time! lol
15:56 πŸ”— icculus has quit IRC (icculus)
15:57 πŸ”— icculus has joined #jsmess
15:57 πŸ”— icculus has quit IRC (Client Quit)
15:57 πŸ”— icculus has joined #jsmess
15:58 πŸ”— icculus has quit IRC (Client Quit)
16:58 πŸ”— SketchCow How's it going for you?
17:05 πŸ”— db48x :)
17:07 πŸ”— SketchCow On my side, I've been ripping CD-ROMs all morning.
17:07 πŸ”— SketchCow Someone sent me 500
17:08 πŸ”— db48x nice
17:32 πŸ”— SketchCow Yeah, it's going to kick ass to get these up
17:33 πŸ”— SketchCow Then it's time to sort them, and maybe consider breaking some out into emulated chunks.
17:49 πŸ”— icculus has joined #jsmess
18:47 πŸ”— icculus_ has joined #jsmess
18:49 πŸ”— SketchCow By the way, the latest podcast episode is about Emulation
18:49 πŸ”— SketchCow (and a demo I like that's an emulator)
18:50 πŸ”— icculus has quit IRC (Read error: Operation timed out)
18:50 πŸ”— icculus_ is now known as icculus
18:51 πŸ”— icculus has quit IRC (Client Quit)
19:31 πŸ”— icculus has joined #jsmess
19:31 πŸ”— icculus Uh, is it normal to not be able to link this in 16 gigabytes of RAM? https://gist.github.com/rcgordon/d57e1e3fb504cb698edb091543bda27b
19:31 πŸ”— icculus This was just a git clone, then CC=emcc make
19:31 πŸ”— icculus which might totally be the wrong way to do this
19:33 πŸ”— bai icculus: oh, yeah you generally don't want to do a full build of all systems
19:34 πŸ”— bai we normally do a build per system
19:34 πŸ”— icculus oh
19:38 πŸ”— bai I think what you want is something like "emmake make SOURCES=src/mame/drivers/pacman.cpp"
19:40 πŸ”— icculus yeah, that builds much quicker. :)
19:49 πŸ”— bai finding the right source file for the system you're targeting is a bit of black magic, mame has a -listsource file but it's....well....it's just dumb and wrong half the time :D
19:49 πŸ”— bai eg, "mame -listsource pacman" tells you the source is "pacman.c" when really it's "src/mame/drivers/pacman.cpp"
19:50 πŸ”— bai (plus you need a native build to do it, too)
19:55 πŸ”— db48x yea, I really want better automation there
20:07 πŸ”— icculus has quit IRC (icculus)
20:08 πŸ”— SketchCow Oops, h's gone
20:08 πŸ”— SketchCow we killed him
20:08 πŸ”— SketchCow this seems promising
20:31 πŸ”— azakai has quit IRC (Quit: Ex-Chat)
21:57 πŸ”— DFJustin -listsource should always be correct although it doesn't specify src/mame/drivers/
21:57 πŸ”— DFJustin if there's a mismatch, the mame in your path may be out of date
22:07 πŸ”— azakai has joined #jsmess
23:07 πŸ”— icculus has joined #jsmess
23:11 πŸ”— bai hmm, I suppose that's not impossible, I might have a system-installed binary version
23:12 πŸ”— bai wonder when they switched from .c to .cpp
23:13 πŸ”— * db48x recommends running "type mame"
23:15 πŸ”— bai yeah, it's definitely a system install, just not sure how old we're talking :D
23:22 πŸ”— icculus has quit IRC (icculus)

irclogger-viewer