Would you like to play Nokia (J2ME) games on Retropie?
-
@pjft The timing of this was awesome. I just finished PS by your help and @recompile ended up getting is working. I am of the opinion that pair programming is freaking awesome. It is way faster than if a single person were to do it. I will mostly archive these conversations in a README file once this is nearing an alpha release.
-
@hex said in Would you like to play Nokia (J2ME) games on Retropie?:
I also had a question about how audio will be handled. Will Java take care of it?
I don't know. I haven't even tried to properly implement audio yet. I would assume that it can be done on the java side.
@hex said in Would you like to play Nokia (J2ME) games on Retropie?:
Do you need joystick and mouse ? Considering no mobile phone had that.
Believe it or not, some games used a touchscreen. Doom II RPG isn't playable without it. Of course, it's the only game I know that requires it, so it's not exactly a priority.
As for joystick, I expect most people will want to play with their controller.
@hex said in Would you like to play Nokia (J2ME) games on Retropie?:
Some special key codes are >256
Not really a big deal to send a short instead of a byte. As long as it's consistent, it doesn't really matter. An int for type and an int for code if you want to really go wild.
I'm out for a few hours. I have to go earn a living.
-
@recompile I have updated the source code to have separate threads for Streaming (frames) and Capturing (keys).
C communicates all keyboard events over stdout as an (int) key code followed by
\n
Key codes can be found here : https://wiki.libsdl.org/SDLKeycodeLookupIf F4 is received, C terminates cleanly. C also communicates that it received F4 by sending -1 as key code.
Another way to terminate C is to close its stdin. This tells C to terminate cleanly.
Is this sufficient?
To compile :
g++ -lSDL2 -lpthread -o sdl_interface sdl_interface.cpp
-
This post is deleted! -
@hex We'll need both keydown and keyup events.
-
@recompile Missed that. Will make changes and updoad new file.
Also how do you want the key up down difference? Your choice.
KEY 1 <-- Pressed
KEY 0 <-- lifted -
@hex It doesn't really matter as long as I can tell the difference. A flag like that before the code should be just fine.
-
@recompile I have updated the code. Syntax is
KEY CODE\n
KEY = 1 : Down / 0 : Up
CODE -> As provided in url above -
I guess back to you.
http://drichardson-shared.s3.amazonaws.com/freej2me-rpi.jarI get a black screen and a mouse pointer.
-
This is great!
It's like witnessing the birth of a new emulator (not exactly, but close enough).Keep up the momentum guys!
-
@recompile is there a syntax for that? I am getting an Array out of bounds exception
Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at org.recompile.freej2me.RetroPie.<init>(RetroPie.java:64) at org.recompile.freej2me.RetroPie.main(RetroPie.java:22)
-
Yes, I'd love to play these mobile games on my RetroPie. And you probably know what my next splash screen might be...
wink -
@hex You need to pass a jar.
java -jar freej2me-rpi.jar file:/home/pi/RetroPie/roms/j2me/ShadoWalker.jar 240 320
-
@recompile I have created a sample Java file in the dropbox folder. I have it working with "Broadcaster.java". Can you test it. That might point to the error. Let me know if this is sufficient.
Please download and recompile sdl_interface.cpp too
javac Broadcaster.java && java -classpath . Broadcaster 16 9
16 x 9 Grid size
-
@hex Again, just a black screen and a mouse pointer.
-
@recompile Shouldnt be happening. Let me post a video. Then you can compare.
-
@hex said in Would you like to play Nokia (J2ME) games on Retropie?:
Shouldnt be happening.
I know. I can't see anything wrong with your example, and it works for you.
The only difference I can see is that I'm running it on a pi3 and, iirc, you're running it on a pi0. Though I don't see why that would make a difference here.
Do you get any output when you run freej2me-rpi?
-
@recompile Here is the video of things that should be happening. Grid changes for every key press.
Are you by any chance running on Wayland?
-
@recompile I am running it on Linux. Probably that might be a difference. I am heading out so I will test in on Pi3 in an hour or so. Since I know that it is working, the rest is platform dependent and should work out well.
As you can see from the Java code i am sending over 4 bytes (ARGB) per pixel over stream Scalling is excellent and as expected. There is also a smooth scaling version. Can try that out too.
-
@hex said in Would you like to play Nokia (J2ME) games on Retropie?:
Are you by any chance running on Wayland?
No, I'm running it on RetroPie 4.2 on my pi3. No X11, Xorg, Mir, or Wayland
I compiled sdl_interface.cpp on there as well, copying it to /usr/bin. I ran freej2me-rpi and your example on that same setup, and got the same result both times -- a black screen and a mouse pointer.
From what I can see, J is sending to C. I can even capture an error trying to write to the stream after I kill C with F4.
Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.
Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.