Views: 26,024,524 Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search 06-20-25 07:39 AM
Guest:

0 users reading Mechanism for Communcation between Game and External Software | 1 bot

Main - General - Mechanism for Communcation between Game and External Software Hide post layouts | New reply


TrueBlue
Posted on 06-10-25 12:19 AM (rev. 2 of 06-10-25 12:21 AM) Link | #7769
Does melonDS currently have any method to communicate between the running game and external software?

If not, I am willing to contribute and implement one. I have an idea, but I would like confirmation that it is valid before putting in the work in implementing it. The method is rather simple. It would be a packet based system, where external programs would connect to the emulator via UDP (on localhost, most likely). A part of the 32-bit address space, (maybe something like addresses in 0x0C00 0000 -- 0x0C7F FFFF) would be reserved for this communication. In these regions, there would be a protocol where the game would lay out two FIFO queues and two memory spaces, one FIFO+memory space for sent packets, and one for received packets. Then, new sent packets are read by the emulator and sent via UDP, and new received packets are placed in memory by the emulator. More details if needed.

I have already looked into the source code of the emulator, and I should be able to do most of the legwork, but I will need some help in some parts (eg. with the region timings).

PS (unrelated): on my computer (Manjaro), g++ fails to compile the emulator, stating an internal compiler error, so I use clang++ instead. Would this cause any issues?

Generic aka RSDuck
Posted on 06-10-25 02:17 AM Link | #7770
While this could be useful for some things it also sounds a bit like a security hole. That probably needs to be addressed in some way. Another thing to consider is Lua scripting support: https://github.com/melonDS-emu/melonDS/pull/1671 which we want to eventually merge and which can probably fulfil many similar tasks.

Also you need to pull in latest changes to fix the build issue.


____________________
Take me to your heart / never let me go!

"clearly you need to mow more lawns and buy a better pc" - Hydr8gon

TrueBlue
Posted on 06-10-25 02:26 AM (rev. 2 of 06-10-25 03:21 AM) Link | #7771
Regarding security hole: if we have that it needs to be manually enabled, as well as requiring support both from the ROM and from the external software, then there theoretically shouldn't be any security issue. (this is not taking into account implementation error)

Probably Lua scripting support would do what I need, though. Didn't know about that.

Finally, the internal compiler error with gcc is happening with the latest code of the master branch of the github repository.


Update: I've had a look at the Lua implementation. It currently doesn't have any means of interfacing with external programs. It also seems quite limited, though I understand it is currently early in development. I think I might implement my idea to see if it works, and then I'll look into sending a pull request later.

Generic aka RSDuck
Posted on 06-10-25 05:27 AM Link | #7772
https://www.lua.org/pil/8.2.html lua has loading DLLs which provide Lua functions from C included. Also gcc version might play a role too.

____________________
Take me to your heart / never let me go!

"clearly you need to mow more lawns and buy a better pc" - Hydr8gon

TrueBlue
Posted on 06-10-25 06:14 AM Link | #7773
Thanks! That should work, though I'll probably continue with this on my fork, since I already started and now I'm interested in the technical difficulty of implementing it.


Main - General - Mechanism for Communcation between Game and External Software Hide post layouts | New reply

Page rendered in 0.059 seconds. (2048KB of memory used)
MySQL - queries: 30, rows: 88/88, time: 0.050 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.