Hello everyone, I am a former moderator of this page, and a friend of brokenhyperlink, who moderates it at the moment. I've been asked to write this guide to help out newcomers. This will hopefully cover the basics and some more when it comes to feature phone gaming and emulation.
Basic Info
While the rules may not be the most clear about it for the sake of brevity, but this game (especially part one) and actually various other games had many versions of it for different devices. For example you could have versions for Nokia phones, Samsung phones and so on; and Nokia and Samsung themselves had many different models with some versions of the game made for those.
The phones also had screens of different screen resolutions, and due to lack of proper graphical scaling, 2D game developers had to make a ton of versions not only for the different phones with their hardware and Java implementations, but also different sets of graphics for varying screen sizes. It must've been awful to develop for, but that's besides the point.
In addition, J2ME is now an outdated platform, and the Sonic games (with the exception of Sonic Runners Adventure) are no longer sold. This means that if you didn't buy the game when it was available, you would have to rely on JAR copies from the internet for this purpose, and the nature of the beast is that many of those were either uploaded in modified form by the person who dumped it (mostly original JAR file but with credit to that person inserted somewhere), or it's possible to find the original JAR, but it's amongst a bunch of modified versions of it. It's best if you make sure the version you're using is either unmodified or modified by the dumper; in addition, one of the other guides has info on allowed and banned versions.
How to get the correct game resolution for J2ME
Open the JAR file with 7-Zip and look for "ifone.png" or "glu.png". Its resolution is the intended resolution of the game in the vast majority of instances, except for a few minor cases like the 176x204 Motorola versions. This is noteworthy, as JAR copies from the internet aren't always labeled correctly.
And with that being said, let's go on to the emu configuration. The emulators that exist are as you would expect for the type of platform J2ME is that nobody cares about, but I would say they're workable still.
KEmulator nnmod / nnx64 (for computers running Java)
Website: https://nnproject.cc/kem/
KEmulator was originally a project by the Chinese developer Wu Liang in the 2000s, who at some point entered a partnership with Gameloft to have a version of it used as their internal dev tool, and later on sold the entire project presumably also to them, ending its original development. Later on, developer Shinovon decompiled it and made a modded version with various improvements.
Start KEmulator.exe and the window should pop up. You can resize the window with - and + on the numpad. First off, select View -> Options and make sure that on the "Custom" tab, the Max FPS setting is set to 30 for this game. Make sure the screen width and height is set to the intended resolution of the game. Let everything else on this tab remain default, though if you need to play a Siemens or Motorola version, you will need to select one from the "device select" drop-down (it will set the keycodes as needed for those).
The "KeyMap" tab allows you to rebind keys. Do not select "enable key cache". The "SysFont" tab allows you to change the font and its size. We recommend to leave it default, but I don't think it affects any property of the game's speed in this specific game. The "System" tab mostly has KEmulator debugging stuff, although you can turn on "AWT smooth drawing" for anti-aliasing on some things.
On the "CoreAPI" tab I usually have the vibration setting enabled, which is a slight window shake feature when the phone vibrates. This game, however, doesn't use vibration to my knowledge.
The "Records" tab is the save file manager, which is useful if something breaks. "Network" and "Media" are miscellaneous settings that are not required to be looked at for this game.
Now you can select "Load jar" (in the Midlet menu) or just drag it onto the window.
Please make sure that "FPS Counter" (not to be confused with FPS Mode!) is on when playing the game.
J2ME Loader (for Android)
GitHub page: https://github.com/nikita36078/J2ME-Loader
Play Store: https://play.google.com/store/apps/details?id=ru.playsoftware.j2meloader
F-Droid: https://f-droid.org/app/ru.playsoftware.j2meloader
This is an emu/implementation for Android that runs Java ME games on Android's Java virtual machine. I have noticed a music playback issue from testing in which it's loud and some instruments don't play, but otherwise it's functional.
Press the + button in the corner and the file picker will pop up, then select the JAR that you need. After a brief "conversion" prompt it will be installed in the list.
Long-tapping on the game will pop up a menu from which you can go into the settings. There you can set the resolution, turn on the FPS counter and limit the FPS. The option to change the device keycode preset (in case you need to play a Siemens or Motorola version) is counter-intuitively placed in the input section.
I don't use this emulator much, so I can't really guide you on all its intricacies.
FreeJ2ME-Plus (for Windows and Linux)
GitHub page: https://github.com/TASEmulators/freej2me-plus
Latest build: https://nightly.link/TASEmulators/freej2me-plus/workflows/ant/devel
This emu/implementation uses largely the same approach as KEmulator. While in some ways not as complete as KEmulator nnmod, it's nevertheless a very good open-source emu for playing games on PC. This emulator is available as standalone or for RetroArch (both require a Java Runtime installation).
The easiest way to get this one running is if you have Java 8 from https://www.java.com/ installed in the system as the default Java, extract freej2me.jar into an empty folder and double-click it. Select "File -> Open jar/jad". Using the menus, you will be able to configure the emulator. Set the resolution, FPS limit (30) and phone keycodes as needed, close the emu and restart it again with the game in order to apply the settings. Like KEmulator nnmod, you can resize the window with the - and + keys on the numpad.
iDKDoJa 5.1 v3.13 (for Windows to play the DoJa versions)
JDK (required for installation): https://mega.nz/file/x9dFVJqY#kVYE-T4L3QOmjEwdu8tVZegKwEMsp6oYPVDAaa7UmHY
Locale Emulator (for proper font rendering): https://xupefei.github.io/Locale-Emulator/
This one is a bit complicated, but here are the instructions:
Install JDK so that the installer doesn't complain, and that you can run the GUI of the emulator. In the installer, select English, Custom Installation and uncheck "Eclipse plugin" if you don't need it. Select yes or no when it asks you whether you want to associate .JAM files with the emulator.
If your Windows installation isn't English, you have to go to "C:\iDKDoJa5.1\lib\i18n" and rename "string_en.cat" to match your language code.
Install Locale Emulator, we aren't using it yet though.
Obtain the game files from the place that has it. Put the .JAM and .JAR file into "C:\iDKDoJa5.1\apps\gametitle\bin" and the .SP file into "C:\iDKDoJa5.1\apps\gametitle\sp", where "gametitle" has to be exactly the same as the filenames of the .JAM, .JAR and .SP files.
Go to "C:\iDKDoJa5.1\bin" and open "doja.exe". In the program that opens, select "Edit -> Application Environment Setup...", on the "ALL" tab set "Heap size" to 32767, and on the "Sound configuration" tab set "Playing mode" to "Visual playing mode" (it won't sound pretty that way, but it also won't lag).
Relaunch doja.exe with Locale Emulator by right-clicking doja.exe and selecting "Locale Emulator" -> "Run in Japanese". Select on the top bar "P" -> "O", select the Sonic game and press "Run". The game will start in the other window with the correct locale.
Melange (for Android to play the BREW versions)
Download: https://deltacxx.insomnia247.nl/projects/brewemu/
It's advised to use the latest version - the leaderboard requires v1.1.3 at minimum, as it was released the same day as v1.1.2, which fixed a notable key-mashing bug.
In order to install it on the newest Android versions, you have to use adb (from Google's platform-tools package) on your PC, with the phone in "USB debugging" mode, running the command:
adb install --bypass-low-target-sdk-block Melange_v1.1.3.apk
If you aren't sure what any of this means, please google it or something, if I had described everything, it'd blow up this guide completely. The latest BlueStacks should still be able to install the APK directly.
Once it's installed, don't disconnect the phone from the PC, as writing the config file is easiest done there. Create a text file called "breConfig.toml" (note that there's no W in that filename), and paste this in there:
width=240
height=320
Save the file, run the emu, and it should create a folder in the phone's memory called "MelangeBREW", with a "sys" subfolder. Transfer the file to "/MelangeBREW/sys/". For 176x204 versions, it would have to be the respective width and height.
Next up, obtain the game from the place that has it. A version of the game should come in the form of a .mif file with the game's ID number, and a folder that has the same filename as the .mif file, which generally contains 3 files: "data.ggz", "sonic.mod" and "sonic.sig". Now, make the folder "/MelangeBREW/mif/" and paste the .mif file in there, and make the folder "/MelangeBREW/mod/" and paste the corresponding folder there. Launch Melange, and hopefully you'll see the game in the list. If you still don't have the game in the list or it crashes, try removing "sonic.sig", as it only exists for copy protection, and isn't required for playing the game on the emu or on a phone with a patched firmware.
There is still a bug in the emu that can randomly crash the game whilst it's running, but it remains to be seen how severe the issue is.
Brief Real Hardware Guide
If you really wanna do this, then you'll not only need the phone and a functional battery for it, but also the charger (some phones charge off of microUSB, not to be confused with USB-C, while others use proprietary chargers) and preferably a Bluetooth device when using a J2ME phone to sideload the games. All of the J2ME phones listed below have TV-out, meaning you can connect an 3.5mm jack to RCA composite cable to the phone (2.5mm for the 6220) and plug it into a capture card.
BREW and DoJa phones are more complicated. For BREW phones, you will need to flash the patched firmware on the phone using the data cable ( https://lpcwiki.miraheze.org/wiki/Running_unsigned_code_on_BREW_devices ), and then also use the data cable to sideload the games. For DoJa phones, you will need a specially modified data cable that you can either re-solder from an ordinary "FOMA data cable" or buy an already modified one (there are third-party stores selling those, but they're few and far between, however an acquaintance of mine is planning to open a store to sell new batches) - see https://docs.google.com/document/d/1iELxocYKh-hDV6hk7SYsnb7AHU1j1JkgolC6kz61PA8/edit for instructions on those.
Here are the recommended phones for each platform. Bold means these are the best ones. Note that the leaderboard no longer accepts BREW runs on any 320x240 versions.
J2ME: Nokia 6710s Navigator, Nokia 6720 Classic, Nokia N86 8MP, Nokia N85, Nokia N79, Nokia 6220 Classic (240x320).
BREW: Casio C781 G'zOne Ravine 2 (240x320), Samsung SPH-M270 Entro (128x160), LG VX5600 Accolade, LG VN150 Revere (176x220), LG VN530 Octane, LG VX9100 enV2, LG VX9200 enV3, LG VX10000 Voyager (320x240).
DoJa: Panasonic P-01F, Panasonic P-01G, Panasonic P-01H (480x854).