NES Emulator with Java plugin support?

Discuss technical or other issues relating to programming the Nintendo Entertainment System, Famicom, or compatible systems. See the NESdev wiki for more information.

Moderator: Moderators

Post Reply
joshcough
Posts: 3
Joined: Sun Oct 30, 2022 5:04 pm

NES Emulator with Java plugin support?

Post by joshcough »

Hi All,

I'm looking for an NES emulator that I can write plugins in Java for (Scala really, but doesn't matter). I stumbled upon Nintaco, but I can't seem to get it to work on my M1 mac at all, and it does not look like it is really being maintained/updated any longer.

My question is ... are there any options of I want to do this? (NES with java plugins on M1 mac).

I don't need anything fancy. I was writing a simple AI in Lua using fceux, but I just don't feel like writing in Lua anymore. I need a type system.

Thanks.

-Josh
blackbird
Posts: 4
Joined: Thu Jun 02, 2022 9:04 pm

Re: NES Emulator with Java plugin support?

Post by blackbird »

I don't know of a Java-based emulator, but could you set up a simple TCP server using LuaSocket (which seems built into FCEUX, as well as Mesen). Then you can write Java code and communicate with the emulator via network commands.
joshcough
Posts: 3
Joined: Sun Oct 30, 2022 5:04 pm

Re: NES Emulator with Java plugin support?

Post by joshcough »

I thought of that too, but that only comes packaged with fceux on windows, and I've been unable to get it to work on my mac.
Oziphantom
Posts: 1565
Joined: Tue Feb 07, 2017 2:03 am

Re: NES Emulator with Java plugin support?

Post by Oziphantom »

NES emulator for the Mac.. that is going to be limited choice
NES emulator for an M1 Mac.. even more limited choice
Java on a Mac, Apple hates java and will uninstall if for you every OS update.
Java on an M1 Mac.. now you are pushing it
Java being a viable language somebody wants to use or touch for scripting.. we maybe on a PPC mac.
So sadly I feel this is an overlap of 0.

I get the pain with LUA though..
For these "modern new age mysticism languages that ignored all the bad things about the old languages to discover why we had them the hard way" LUA, Python, PERL, Ruby et al I recommend going back to "type last" naming conventions. i.e

objectsLIST
timerLONG
countINT
scaleFLOAT
nameLookupDIC

etc, it helps. also a hint of Hungarian Notation ( which is type first ) for
FMyFunc
CMyClass

I find it really does help.
User avatar
RJM
Posts: 55
Joined: Mon Jul 27, 2020 11:56 am
Location: Rzeszów, Poland

Re: NES Emulator with Java plugin support?

Post by RJM »

I did a bit of research since you said you're really after types.
There seems to be this project called teal.

Looks like a typed version of LUA, similar to what typescript does for JS.

You might be able to load it from Mesen emulator script, using this method.

If it does not work, the entire library is in a single file, so worst case scenario you can make it part of your AI script.


A word on developing for NES on Mac. I also like this OS and use it for development in my daily job.

Since circa Catalina I was no longer able to run neither Mesen nor FCEUX on them,
as Apple dropped support for 32bit apps, effectively killing WINE, which I used to run them.

After that, I fully transitioned to Windows with all NES development.
I recommend you to do the same ( Linux will also be fine, I use it sometimes ).
Most of the tools you'll find for NES dev are for Windows.
joshcough
Posts: 3
Joined: Sun Oct 30, 2022 5:04 pm

Re: NES Emulator with Java plugin support?

Post by joshcough »

Thanks all! I figured this out!

While I can't actually use my keyboard when using Nintaco on my M1 mac, I can just use the controller api, and that works! Since I'm just writing an AI, I'm not actually using the controller myself. So I get to use a modern language (Scala) and I get my types, and I get to program on my laptop. It's a great day!
Post Reply