#jsmess 2017-10-26,Thu

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)

WhoWhatWhen
SketchCowI'll be right over
<airsiren>
[04:11]
db48xheh [04:14]
***taisel has joined #jsmess [04:19]
.............. (idle for 1h9mn)
taisel has quit IRC (Quit: Leaving) [05:28]
icculus has joined #jsmess [05:33]
icculushello, Jason Scott sent me. [05:34]
baioh man, bringing in the big guns :D
welcome
[05:35]
icculushi. :) [05:37]
baiso 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]
icculusJason said there was some sort of MAME-vs-Emscripten issue, and I should come get technical details from the fine folk in this channel.
Something about it using 100% CPU for no good reason
[05:38]
baiyeah, so it's been working pretty solid for a while now, but we want it faster and yeah, less cpu burning when idle
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
to control timing of machine chips and ultimately frame output
but with emscripten...well, how much do you know about that whole thing, specifically its async handler?
[05:39]
icculusI’ve gotten a few games running with Emscripten: https://icculus.org/ut99-emscripten/ and some stuff on playonjump.com
So I’m pretty familiar
[05:41]
baicool, 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
https://github.com/mamedev/mame/blob/master/src/emu/machine.cpp#L1321-L1360
using that code, the cpu profile looks like this https://i.imgur.com/80HgKvk.png
because scheduler->timeslice();
oops
because scheduler->timeslice() is where all the sleep() magic happens for timing
and on the emscripten platform it's just doing the naive while (Date.now() < t) {} style sleep implementation
[05:43]
icculusSo this is just burning the entire ~16 milliseconds, returning so the framebuffer can swap, and then starting again, 60 times a second [05:47]
baiyup [05:47]
icculusThis should be solvable, then. [05:48]
bainow, 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
this ends up looking like this https://i.imgur.com/YEEbT9b.png - much cleaner
but it introduces some timing issues
[05:48]
icculusHow long are these sleeps intended to be, generally? [05:50]
baibecause 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]
icculusare they…five milliseconds or like 50 milliseconds? [05:50]
bailet me refresh myself on the code. I think the mame functions themselves are in something insane like picoseconds [05:51]
DFJustinattoseconds [05:56]
baithat's right
sorry dealing with space issues on my vm. I guess a stock ubuntu install chews right through 12 now
12 gigs*
[05:59]
icculusno worries
the more direct question: where do I build this from? Is it on mamedev/mame, or is this a separate fork elsewhere?
[06:02]
baiit's all part of the official release now, except for my hacks [06:03]
icculusok, I’m going to poke at it in the morning, then, and hopefully I’ll make some progress. [06:04]
baisweet
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:04]
icculusfor now, though, I’m going to sleep. I’ll idle in this channel though, in case anyone wants me to hear any details.
ok, that’s great, thank you!
[06:05]
baisounds good, looking forward to seeing what we can come up with
been a long-standing issue
[06:05]
......... (idle for 40mn)
Vito`Haha
I think my internet is a closed loop now
I need new circles, everyone I know ends up in here
[06:45]
baiall roads lead to #jsmess [06:54]
....... (idle for 30mn)
SketchCowI never stop
You said we needed people, I got people
icculus: Bai is the main person who was trying this but he got super busy because his company needs him
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.
[07:24]
................................................................ (idle for 5h19mn)
***icculus has quit IRC (icculus) [12:46]
......... (idle for 44mn)
icculus has joined #jsmess [13:30]
...................... (idle for 1h45mn)
icculusomg, this thing takes forever to build. Emulate less hardware next time! lol [15:15]
......... (idle for 41mn)
***icculus has quit IRC (icculus)
icculus has joined #jsmess
icculus has quit IRC (Client Quit)
icculus has joined #jsmess
icculus has quit IRC (Client Quit)
[15:56]
............. (idle for 1h0mn)
SketchCowHow's it going for you? [16:58]
db48x:) [17:05]
SketchCowOn my side, I've been ripping CD-ROMs all morning.
Someone sent me 500
[17:07]
db48xnice [17:08]
..... (idle for 24mn)
SketchCowYeah, it's going to kick ass to get these up
Then it's time to sort them, and maybe consider breaking some out into emulated chunks.
[17:32]
.... (idle for 16mn)
***icculus has joined #jsmess [17:49]
............ (idle for 58mn)
icculus_ has joined #jsmess [18:47]
SketchCowBy the way, the latest podcast episode is about Emulation
(and a demo I like that's an emulator)
[18:49]
***icculus has quit IRC (Read error: Operation timed out)
icculus_ is now known as icculus
icculus has quit IRC (Client Quit)
[18:50]
......... (idle for 40mn)
icculus has joined #jsmess [19:31]
icculusUh, is it normal to not be able to link this in 16 gigabytes of RAM? https://gist.github.com/rcgordon/d57e1e3fb504cb698edb091543bda27b
This was just a git clone, then CC=emcc make
which might totally be the wrong way to do this
[19:31]
baiicculus: oh, yeah you generally don't want to do a full build of all systems
we normally do a build per system
[19:33]
icculusoh [19:34]
baiI think what you want is something like "emmake make SOURCES=src/mame/drivers/pacman.cpp" [19:38]
icculusyeah, that builds much quicker. :) [19:40]
baifinding 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
eg, "mame -listsource pacman" tells you the source is "pacman.c" when really it's "src/mame/drivers/pacman.cpp"
(plus you need a native build to do it, too)
[19:49]
db48xyea, I really want better automation there [19:55]
***icculus has quit IRC (icculus) [20:07]
SketchCowOops, h's gone
we killed him
this seems promising
[20:08]
..... (idle for 23mn)
***azakai has quit IRC (Quit: Ex-Chat) [20:31]
.................. (idle for 1h26mn)
DFJustin-listsource should always be correct although it doesn't specify src/mame/drivers/
if there's a mismatch, the mame in your path may be out of date
[21:57]
***azakai has joined #jsmess [22:07]
............. (idle for 1h0mn)
icculus has joined #jsmess [23:07]
baihmm, I suppose that's not impossible, I might have a system-installed binary version
wonder when they switched from .c to .cpp
[23:11]
db48xdb48x recommends running "type mame" [23:13]
baiyeah, it's definitely a system install, just not sure how old we're talking :D [23:15]
***icculus has quit IRC (icculus) [23:22]

↑back Search ←Prev date Next date→ Show only urls(Click on time to select a line by its url)