#jsmess 2018-03-02,Fri

↑back Search

Time Nickname Message
02:48 🔗 azakai has joined #jsmess
02:48 🔗 azakai has quit IRC (Client Quit)
02:49 🔗 azakai has joined #jsmess
03:42 🔗 fraveydan has joined #jsmess
03:43 🔗 fraveydan has left
03:43 🔗 fraveydan has joined #jsmess
03:45 🔗 fraveydan has left
03:46 🔗 sixfiveoh has joined #jsmess
03:47 🔗 sixfiveoh is now known as oscar
03:48 🔗 oscar Ah, I had forgotten about IRC nick restrictions. Been too long.
03:48 🔗 oscar Anyway, this is Dave (@6502_ftw), I'll be back in a moment after I park a car in the rain.
04:08 🔗 oscar OK, now I'm back.
04:08 🔗 oscar Let's talk about Lua/emulators/disks/flipping.
04:10 🔗 gamingrob has quit IRC (Read error: Connection reset by peer)
04:10 🔗 Ipggi has quit IRC (Write error: Connection reset by peer)
04:10 🔗 mattl has quit IRC (Read error: Connection reset by peer)
04:10 🔗 Vito` has quit IRC (Write error: Connection reset by peer)
04:10 🔗 Ctrl-S___ has quit IRC (Write error: Connection reset by peer)
04:11 🔗 bai oscar: ah, you mean the mame disk swap thing?
04:11 🔗 oscar Yes!
04:11 🔗 bai cool!
04:11 🔗 bai I haven't really dug into the lua system yet so I don't know what's possible
04:11 🔗 gamingrob has joined #jsmess
04:12 🔗 gamingrob has quit IRC (Connection closed)
04:12 🔗 hook54321 has quit IRC (Ping timeout: 366 seconds)
04:12 🔗 oscar Aside from having *used* the emulator on archive.org, and having used MAME since forever almost solely to play Defender, I don't have much familiarity with what's needed and what's lacking.
04:12 🔗 hook54321 has joined #jsmess
04:13 🔗 oscar But Jason said Lua was needed, and I can Lua pretty well and have embedded it in various engines before.
04:13 🔗 oscar So I thought... maybe?
04:15 🔗 oscar Anyway, if anyone has thoughts on what's required, or can at least point me to which fork of what is used on the Archive, I'll be glad to bang on it a bit after figuring out what's missing.
04:16 🔗 oscar I mean, OBVIOUSLY it's JSMESS. But I feel like that's saying "it's computers".
04:18 🔗 bai let's see. I know there's a section somewhere in the MAME docs about how to use the lua scripting engine
04:18 🔗 bai http://docs.mamedev.org/techspecs/luaengine.html
04:19 🔗 oscar Well, right. Is there a pointer somewhere to what version/fork is being used?
04:20 🔗 oscar Yes, I'm being lazy, largely because I am getting The Look from my wife because I am not in bed, and it is not The Fun Look.
04:20 🔗 bai the hard part is going to be figuring out which API functiont o call, I'm not sure if any of it is really documented, this page seems to basically say "you can use lua's introspection functionality to figure out the API" :)
04:20 🔗 bai afaik we're on the latest MAME version, db48x or SketchCow would know specifics but we just did a big round of upgrades
04:20 🔗 bai official builds, no fork
04:21 🔗 bai jsmess as a project doesn't really exist as a separate project now, it was all merged back in and is part of the main MAME project
04:21 🔗 oscar Undocumented is fine; I can read machine code OK, but we have source here. :-)
04:22 🔗 oscar OK, that's good to know. No special integrations or external shells for the Archive stuff, then.
04:22 🔗 oscar The rest of it I should be able to back out of how the Archive page loads it all.
04:22 🔗 bai there's a wrapper, Emularity, and then some archive.org-specific code to actually present it in their UI
04:23 🔗 oscar Ah, Emularity, right. That rings a bell.
04:23 🔗 bai so at some point we'll probably have to figure out how to make emularity secify a custom lua script, do some interface for disk management, etc
04:23 🔗 bai specify*
04:24 🔗 oscar Right.
04:25 🔗 oscar Ooh, BrowserFS. That name gets my infosec senses all tingly.
04:28 🔗 oscar OK, so at least Emularity has some pretty decent examples in repo.
04:29 🔗 oscar I assume we need similar function for DOS games with DOSBox? Or are those still done via MAME?
04:34 🔗 bai yeah dosbox has its own separate mechanism for doing this
04:34 🔗 bai I think in that one you feed it the disk names ahead of time and then there's a key you can press to switch between them
04:36 🔗 bai one other approach is that you can actually export the underlying functions from dosbox/mame and expose them to the JS, so hypothetically speaking if there's function map_drive_from_file(drivename, path), you could export that function and call it directly from js
04:36 🔗 bai with mame we think that the LUA approach is more flexible, assuming all that underlying stuff is exposed in a way that lets us do what we need
04:37 🔗 oscar Right, so looking into MAME, it looks like they semi-automatically map the internals to Lua, which is handy.
04:38 🔗 oscar I'm trying to see what their mechanisms are, but browsing in Github is a little slower than having it locally, so I'll probably look more at that later.
04:39 🔗 oscar But you can do things like read memory with "manager:machine().devices[":maincpu"].spaces["program"]:read_i8(0xC000)", so hopefully others should be easy.
04:40 🔗 bai yeah, that's what I was hoping, so it's just a matter of finding the right native calls to make
04:40 🔗 oscar Do you know if there's an easy way to fire up the Lua console on the web app?
04:40 🔗 oscar One can always be hooked in, obviously, but if there's something existing, so much the better.
04:43 🔗 bai not sure
04:46 🔗 oscar Looking at how the CLI app does it, it looks like it expects Lua print() to just work and similar, so maybe I'll have to play around with that... not sure how it might react to the debug console in the browser, but that might do a thing.
04:47 🔗 bai yeah, I guess that's the first question, how do we get in the door :D
04:47 🔗 oscar The entire console is actually implemented as a single Lua script, which is pretty fantastic.
04:47 🔗 oscar https://github.com/mamedev/mame/blob/master/plugins/console/init.lua
04:55 🔗 oscar Hm, OK. Well, plenty to look at, but I gotta get to bed. I'll check out more over the next few days.
05:00 🔗 oscar Thanks for the pointers! I'll keep the chat open in case anyone else has anything.
05:06 🔗 bai cool, yeah lemme know if you have any other questions. welcome to the project!
06:23 🔗 DFJustin oscar: https://github.com/mamedev/mame/blob/master/src/frontend/mame/luaengine.cpp
12:05 🔗 zino has quit IRC (Read error: Operation timed out)
12:07 🔗 zino has joined #jsmess
13:16 🔗 oscar Oh yeah, I already dug into the luaengine files.
14:41 🔗 db48x oscar: welcome!
14:41 🔗 oscar Thanks!
17:21 🔗 zino has quit IRC (Read error: Operation timed out)
17:38 🔗 zino has joined #jsmess
18:27 🔗 zino has quit IRC (Read error: Operation timed out)
18:27 🔗 zino has joined #jsmess
23:21 🔗 azakai has quit IRC (Ping timeout: 255 seconds)
23:30 🔗 SNDTST has joined #jsmess
23:30 🔗 fzzzy_ has quit IRC (Read error: Connection reset by peer)
23:33 🔗 azakai has joined #jsmess
23:34 🔗 SNDTST I followed SketchCow to this channel about helping with Emularity, but I'm confused how Lua is involved in getting this working. Is there some overview document that I can chew though to see if I can help?

irclogger-viewer