Skip to content

Commit

Permalink
FreeJ2ME: Add a few more common-ish resolutions to the list
Browse files Browse the repository at this point in the history
This commit also removes 96x96, as there is no phone running this
to my knowledge.

As for the added resolutions, they are:

101x80  (in place of 104x80, which no phone seems to use either)
130x130 (Some Siemens C-Series)
128x142 (Some Sagem my-Series phones)
132x176 (Siemens CX65)
176x204 (Motorola V-Series)
208x320 (Sony Ericsson P-Series)
240x432 (Sony Ericsson Aino)
240x480 (LG KF700)
640x480 (Nokia E6-00)

Of course, there are still some less conventional screens in the
wild, but many of them are either mostly covered by what we already
have, or are seen in feature phones that don't sport MIDP support
at all.
  • Loading branch information
AShiningRay committed Sep 28, 2024
1 parent ee65762 commit ed3219a
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 12 deletions.
26 changes: 19 additions & 7 deletions src/libretro/freej2me_libretro.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,26 @@ struct retro_core_option_v2_definition core_options[] =
"vphone_settings",
{
{ "96x65", NULL },
{ "96x96", NULL },
{ "104x80", NULL },
{ "101x80", NULL },
{ "128x128", NULL },
{ "132x176", NULL },
{ "130x130", NULL },
{ "128x142", NULL },
{ "128x160", NULL },
{ "132x176", NULL },
{ "176x204", NULL },
{ "176x208", NULL },
{ "176x220", NULL },
{ "208x208", NULL },
{ "208x320", NULL },
{ "240x320", NULL },
{ "320x240", NULL },
{ "240x400", NULL },
{ "240x432", NULL },
{ "240x480", NULL },
{ "352x416", NULL },
{ "360x640", NULL },
{ "640x360", NULL },
{ "640x480", NULL },
{ "480x800", NULL },
{ "800x480", NULL },
{ NULL, NULL },
Expand Down Expand Up @@ -339,20 +345,26 @@ struct retro_core_option_definition core_options_v1 [] =
"Not all J2ME games run at the same screen resolution. If the game's window is too small, or has sections of it cut off, try increasing or decreasing the internal screen resolution.",
{
{ "96x65", NULL },
{ "96x96", NULL },
{ "104x80", NULL },
{ "101x80", NULL },
{ "128x128", NULL },
{ "132x176", NULL },
{ "130x130", NULL },
{ "128x142", NULL },
{ "128x160", NULL },
{ "132x176", NULL },
{ "176x204", NULL },
{ "176x208", NULL },
{ "176x220", NULL },
{ "208x208", NULL },
{ "208x320", NULL },
{ "240x320", NULL },
{ "320x240", NULL },
{ "240x400", NULL },
{ "240x432", NULL },
{ "240x480", NULL },
{ "352x416", NULL },
{ "360x640", NULL },
{ "640x360", NULL },
{ "640x480", NULL },
{ "480x800", NULL },
{ "800x480", NULL },
{ NULL, NULL },
Expand Down Expand Up @@ -548,7 +560,7 @@ static const struct retro_variable vars[] =
{
{ /* Screen Resolution */
"freej2me_resolution",
"Phone Resolution (Core Restart required); 96x65|96x96|104x80|128x128|132x176|128x160|176x208|176x220|208x208|240x320|320x240|240x400|352x416|360x640|640x360|480x800|800x480"
"Phone Resolution (Core Restart required); 240x320|96x65|101x80|128x128|130x130|128x142|128x160|132x176|176x204|176x208|176x220|208x208|208x320|320x240|240x400|240x432|240x480|352x416|360x640|640x360|640x480|480x800|800x480"
},
{ /* Screen Rotation */
"freej2me_rotate",
Expand Down
6 changes: 2 additions & 4 deletions src/org/recompile/freej2me/AWTGUI.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,6 @@ public final class AWTGUI
private final int newInputKeycodes[] = Arrays.copyOf(inputKeycodes, inputKeycodes.length);

final Choice resChoice = new Choice();
final String[] supportedRes = new String[] {"96x65","96x96","104x80","128x128","132x176","128x160","176x208","176x220",
"208x208", "240x320", "320x240", "240x400", "352x416", "360x640", "640x360" ,"480x800", "800x480"};

Label totalMemLabel = new Label("Total Mem: 000000000 KB");
Label freeMemLabel = new Label("Free Mem : 000000000 KB");
Expand Down Expand Up @@ -809,7 +807,7 @@ private void buildMenuBar()
debugMenu.add(dumpGraphicsData);
debugMenu.add(showMemoryUsage);

for(int i = 0; i < supportedRes.length; i++) { resChoice.add(supportedRes[i]); }
for(int i = 0; i < config.supportedResolutions.length; i++) { resChoice.add(config.supportedResolutions[i]); }

phoneType.add(stdLayout);
phoneType.add(nokiaLayout);
Expand Down Expand Up @@ -881,7 +879,7 @@ public boolean accept(File dir, String name)

filename = filePicker.getFile();
jarfile = new File(filePicker.getDirectory()+File.separator+filePicker.getFile()).toURI().toString();

if(filename == null) { System.out.println("JAR Loading was cancelled"); }
else { loadJarFile(jarfile, true); }
}
Expand Down
4 changes: 3 additions & 1 deletion src/org/recompile/freej2me/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public class Config
private String configPath = "";
private String configFile = "";

public final String[] supportedResolutions = {"96x65","101x80","128x128","130x130","128x142","128x160","132x176","176x204","176x208","176x220","208x208","208x320","240x320","320x240","240x400","240x432","240x480","352x416","360x640","640x360","640x480","480x800","800x480"};

public Runnable onChange;

HashMap<String, String> settings = new HashMap<String, String>(4);
Expand All @@ -67,7 +69,7 @@ public Config()

menu = new ArrayList<String[]>();
menu.add(new String[]{"Resume Game", "Display Size", "Sound", "Limit FPS", "Phone", "Rotate", "MIDI", "Max MIDI Streams", "Exit"}); // 0 - Main Menu
menu.add(new String[]{"96x65","96x96","104x80","128x128","132x176","128x160","176x208","176x220", "208x208", "240x320", "320x240", "240x400", "352x416", "360x640", "640x360" ,"480x800", "800x480"}); // 1 - Size
menu.add(supportedResolutions); // 1 - Size
menu.add(new String[]{"Quit", "Main Menu"}); // 2 - Restart Notice
menu.add(new String[]{"On", "Off"}); // 3 - sound
menu.add(new String[]{"Standard", "Nokia", "Siemens","Motorola", "SonyEricsson"}); // 4 - Phone
Expand Down

0 comments on commit ed3219a

Please sign in to comment.