Coder Social home page Coder Social logo

squirreljme / squirreljme Goto Github PK

View Code? Open in Web Editor NEW
212.0 212.0 21.0 117.8 MB

SquirrelJME is a Java ME 8 Virtual Machine for embedded and Internet of Things devices. It has the ultimate goal of being 99.9% compatible with the Java ME standard.

Home Page: https://squirreljme.cc/

License: Mozilla Public License 2.0

Java 86.84% Shell 0.32% C 9.40% Jasmin 0.81% Makefile 0.01% C++ 1.75% Dockerfile 0.02% HTML 0.01% CMake 0.71% Ruby 0.01% Lua 0.07% Python 0.05%
c compiler embedded iot j2me j2me-platform java java-me javame jvm libretro native ratufacoat retroarch squirreljme

squirreljme's Introduction

SquirrelJME

SquirrelJME is a Java ME 8 Virtual Machine for embedded and Internet of Things devices. It has the ultimate goal of being 99.9% compatible with the Java ME standard.

This project is purely written in Java, with a small secondary C project, and is very easy to port to different hardware. For running on native hardware, a compiler handles the conversion of Java byte code to machine code (in an intermediate format). Any system specific APIs are accessed via standardized system calls that handle the logic the compiler cannot provide. An execution engine which is written in C, it offers a lightweight method of code execution.

Additionally, there is a port of SquirrelJME to RetroArch which enables the ability to play older J2ME software and games designed for flip-phones.

  • Copyright (C) 2013-2024 Stephanie Gawroriski [email protected]
  • "SquirrelJME" and "Lex" are trademarked by Stephanie Gawroriski 2016-2024
  • Lex and The SquirrelJME Logo were illustrated by...

Please support me on Patreon!

Dedicated to Emily (1998-2020), the developer of Mu, you will not be forgotten. Rest in peace.

Dedicated to Near (1983-2021), the developer of Higan, Ares, etc., may your soul rest in peace. You will not be forgotten.

I am currently searching for employment! Check out my LinkedIn!

SquirrelJME utilizes Install4J for cross-platform installers, you can read more about it and check out their product page at:

Badges:

  • Checks and Quality
    • CircleCI
    • Code Climate Maintainability Code Climate technical debt
    • Docker Build
    • RetroArch Core
  • Social and Community
    • Discord
    • Twitter
  • Downloads and Activity
    • Commit Activity
    • Docker Pulls
    • SourceForge Downloads
  • Donations
    • Liberapay

Information:

Repository

  • Online repository (HTTPS, Tor (A), Tor (B))
  • SquirrelJME uses fossil http://fossil-scm.org/.
  • The repository may be cloned using Fossil:
    • One of these commands:
      • fossil clone -u http://squirreljme.cc/ squirreljme.fossil
      • fossil clone -u https://squirreljme.cc/ squirreljme.fossil
      • fossil clone -u http://vzwveldr7djnlpg7ujslaqre632htbl3unkmfbltpgumevw63jn47dad.onion/ squirreljme.fossil
      • fossil clone -u http://hrkzpyi33og6j5z3anfpjuqkawvkw4kxyasrp64elg3i6dffihmdhxad.onion/ squirreljme.fossil
      • fossil clone -u http://squirrelmfbf2udn.onion/ squirreljme.fossil
    • mkdir squirreljme
    • cd squirreljme
    • fossil open ../squirreljme.fossil
  • Alternatively via GitHub:
    • git clone https://github.com/SquirrelJME/SquirrelJME
    • cd SquirrelJME
  • Alternatively via repo.or.cz:
    • git clone https://repo.or.cz/SquirrelJME.git
    • cd SquirrelJME
  • Trunk Source Snapshot (Main website or fossil serve only):

Links

Goals

  • To be small - Smaller programs are easier to maintain and are usually simpler.
  • To be fast - With the potential of AOT/JIT, systems that do not normally have a port of an existing virtual machine will usually only have an interpreter.
  • To be compatible - So that existing Java ME 8 applications can run on this virtual machine, along with J2ME applications when required. This has the added bonus of allowing one to use older software to catalog for preservation.
  • To compile once and run anywhere - Current and up to date Java implementations are limited only to a few select systems (Solaris, Linux, BSD, Mac OS X, and Windows). Java ME 8 as of this writing only supports the FRDM-K64F (dropped), STM32429I-EVAL, Raspberry Pi, Intel Galileo Gen2 (preview), and STM 32F746G DISCOVERY (preview) all of which are either out of date or discontinued by their manufacturers. There are multitudes of devices that support J2ME, however that is horribly out of date when compared with the Java that is used today (J2ME is equal to Java 1.4 which was released in 2002).

Donations

You may donate to SquirrelJME to which would be used by the author to keep the web server online, the purchasing of new hardware/software, and for the purchasing of food items for consumption.

Important Statements

JAVA AND ALL OTHER RELATED TRADEMARKS AND COPYRIGHTS ARE OWNED BY ORACLE CORPORATION http://www.oracle.com/.

SQUIRRELJME IS NEITHER PRODUCED BY, ENDORSED BY, NOR SUPPORTED BY ORACLE CORPORATION.

ALL SOURCE CODE IS WRITTEN BY MYSELF WITH FUNCTIONALITY DETERMINED BY THE DOCUMENTED APIS AND RUN-TIME BEHAVIOR. I HAVE NOT LOOKED AT THE SOURCE CODE FOR OTHER IMPLEMENTATIONS, NEITHER FREE SOFTWARE NOR PROPRIETARY IMPLEMENTATIONS. ESSENTIALLY SQUIRRELJME IS A CLEAN-ROOM IMPLEMENTATION OF THE DESIGN OF JAVA ME 8. THE IMPLEMENTATIONS OF THE JAVA ME 8 APIS AND ASSOCIATED JSRS/JEPS IS CONSIDERED BY MYSELF (STEPHANIE GAWRORISKI) TO BE IN THE FAIR USE.

THIS SOFTWARE IS INCOMPLETE AND IN ITS CURRENT STATE IS NOT CURRENTLY 100% COMPATIBLE WITH JAVA ME 8. THERE ARE CURRENTLY NO STABLE RELEASED VERSIONS OF THIS SOFTWARE. AS SUCH THE FIRST MAJOR VERSION RELEASE WILL BE WHEN IT IS COMPATIBLE SO AS TO NOT VIOLATE POTENTIAL LICENSES, AND IF POSSIBLE BE VERIFIED WITH ANY APPLICABLE TCKS (SO IT WOULD BE AN "OFFICIAL" IMPLEMENTATION).

squirreljme's People

Contributors

elsandosgrande avatar squirreljmeautomation avatar webgeek1234 avatar xerthesquirrel avatar yoshisuga avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

squirreljme's Issues

Long PNG Load Times

The load times for PNG images is a bit slow and could probably be optimized.

This can be seen in SpringCoat with the following trace regarding PNGReader.parse(): The error code BK1q changed to BK2c in a newer version.

BK1q or BK2c
Thread #4: Thread-3
    at cc/squirreljme/runtime/lcdui/image/PNGReader.__unfilter:(Ljava/io/InputStream;)[B @ 191 [BALOAD] (PNGReader.java:670)
    at cc/squirreljme/runtime/lcdui/image/PNGReader.parse:()Ljavax/microedition/lcdui/Image; @ 728 [INVOKESPECIAL] (PNGReader.java:249)

Gradius (Konami Mobile US) does not work

This is software has a number of quirks and incorrectness that will make it not work with standard conforming virtual machines. From what I have heard, this JAR was intended to be a demo that ran on the Konami website.

I have observed it doing the following:

  • Uses 1.0 for microedition-configuration and 2.0 for microedition-profile. These are version only things and it should be CLDC-1.0 and MIDP-2.0.
  • It performs a platformRequest("hjoja"), not sure what this does but it likely activates something.
    • If false is returned then MIDletStateChangeException is thrown.
    • Otherwise it will continue execution. It should be noted that if true IS returned then the application must exit before the request can be made. But the game just continues at this point, normally though ConnectionNotFoundException is thrown if it is not supported.

Issues with SquirrelJME: #55

Game menu doesn't scroll

Once you have more games in libs, then the display can show, the screen doesn't show them in any way.

DataInputStream/DataOutputStream modified UTF-8 has incorrect encoding

The modified UTF-8 that these methods read and write are not done so correctly and will result in compatibility issues outside of ASCII.

The length of the string in characters is read/written where it should be the number of bytes used to represent the modified UTF-8 stream. This will work for ASCII but will break if NUL or anything higher than character 127 is used.

Third-Party Support: Aplix JBlend

Support for Aplix JBlend.

Note that there is no real information on what JBlend is, it seems to be just a JVM that they made which "Utilizes JBlend Technology". They mention the use of ARM's Jazelle. I have a feeling that it is just a JVM which does some kind of native code compilation or optimization of Java byte code, so similar to SquirrelJME in a way.

I did however discover stub API in an unrelated library and as such I added stubs to SquirrelJME accordingly.

Related:

Compiler confusion on jvmLoadString()+DoNothing/Drop+jvmLoadString().

Using compiler generated jvmLoadString() and then either doing nothing (just assigning it to a variable) or calling Assembly.objectToPointer(str) on it, followed by another jvmLoadString() makes the value for a function call incorrect as it confuses the compiler.

In Fossil checkout:

repository:   /home/stephanie/squirreljme/../squirreljme.fossil
local-root:   /home/stephanie/squirreljme/
config-db:    /home/stephanie/.fossil
checkout:     e77018c3eaf4037377542b8b5d04ff62b7e52e28 2019-06-14 15:37:53 UTC
parent:       895f1a5e6bc724ba43736633e296d08756980c16 2019-06-14 15:01:44 UTC
tags:         trunk
comment:      Add configuration ROM to RatufaCoat; Correct potential memory leak in RatufaCoat; Implement Java instruction write
              types in RatufaCoat (user: stephanie.gawroriski)

Java code:

/**
	* Entry point for the bootstrap.
	*
	* @param __rambase The base RAM address.
	* @param __ramsize The size of RAM.
	* @param __rombase Base address of the ROM (for offset calculation).
	* @param __romsize The size of ROM.
	* @param __confbase The configuration memory base.
	* @param __confsize The configuration memory size.
	* @since 2019/05/25
	*/
static final void __start(int __rambase, int __ramsize,
	int __rombase, int __romsize, int __confbase, int __confsize)
{
	// Initialize the RAM links to setup dirty bits and initialize the
	// last block of memory with anything that remains. This makes it so
	// the RAM is actually useable.
	Allocator.__initRamLinks(__rambase, __ramsize);
	
	// Test
	todo.DEBUG.code('S', 'T', Assembly.objectToPointer("Hello?"));
	
	// Debug
	todo.DEBUG.note("Hello adorable and cute squirrels!");
	todo.DEBUG.note("Basic formatting too: %s!", "Neat!");
	
	Assembly.breakpoint();
	throw new todo.TODO();
}

Results in:

Al 0000001e    // Allocate length
Ap 00104960   // Allocation pointer
NA 00104960  // New array pointer
Al 00000020
Ap 00104988 // String "Hello?"
NE 00104988 // New instance pointer for String "Hello?"
Nc 00100c1c  // New instance class: String:
Al 00000024
Ap 001049b0
NA 001049b0
GC 00104960 // Garbage collect pointer
Ga 00000001 // Garbage collected array
Af 00104960 // Allocation free
Al 0000003a
Ap 001049dc
NA 001049dc
Al 00000020
Ap 00104960
NE 00104960
Nc 00100c1c
Al 0000005c
Ap 00104a20
NA 00104a20
GC 001049dc
Ga 00000001
Af 001049dc
Al 00000018
Ap 00104960
NA 00104960  // todo.DEBUG.note's __args (before call)
Nf 00104960   // todo.DEBUG.note's __fmt (within DEBUG.note)
Na 00104960  // todo.DEBUG.note's __args (within DEBUG.note)
Call trace:
    <unknown>.<unknown> @1005E4h (:0 J0@0)
    todo/DEBUG.note:(Ljava/lang/String;[Ljava/lang/Object;)V @4F100E91h (:90 J182@46)
    cc/squirreljme/jvm/Bootstrap.__start:(IIIIII)V @4F1154C7h (:52 J184@15)

Exception in thread "main" cc.squirreljme.vm.VMException: AE09 <unknown>.<unknown> @1005E4h (:0 J0@0)
        at cc.squirreljme.vm.summercoat.NativeCPU.run(NativeCPU.java:184)
        at cc.squirreljme.vm.summercoat.NativeCPU.run(NativeCPU.java:155)
        at cc.squirreljme.vm.summercoat.SummerCoatFactory.createVM(SummerCoatFactory.java:362)
        at cc.squirreljme.vm.VMFactory.main(VMFactory.java:226)
        at cc.squirreljme.builder.support.vm.VMMain.main(VMMain.java:163)
        at cc.squirreljme.builder.support.BuilderFactory.launch(BuilderFactory.java:325)
        at cc.squirreljme.builder.support.BuilderFactory.run(BuilderFactory.java:468)
        at cc.squirreljme.builder.entry.BuilderMain.main(BuilderMain.java:39)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at cc.squirreljme.runtime.javase.Main.main(Main.java:175)
Caused by: cc.squirreljme.vm.VMException: AE0a 66
        at cc.squirreljme.vm.summercoat.NativeCPU.runWithoutCatch(NativeCPU.java:306)
        at cc.squirreljme.vm.summercoat.NativeCPU.run(NativeCPU.java:168)
        ... 12 more

Code comparison dump:

    L  49   :   String qx = "Hello?";
    >N@  8: DEBUG_POINT:[49, 18, 5]              <=>J@  5: @5#LDC~:[Hello?]                     <
    >N@  9: LOAD_POOL:[Hello?, 23]               <|
    >N@ 10: LOAD_POOL:[STATIC+cc/squirreljme/jvm/<|
     JVMFunction::jvmLoadString(I)Ljava/lang/Stri |
     ng;, 24]                                     |
    >N@ 11: LOAD_POOL:[cc/squirreljme/jvm/JVMFunc<|
     tion, 7]                                     |
    >N@ 12: INVOKE:[24, R[23]]                   <|
    >N@ 13: COPY:[1, 15]                         <|
    >N@ 14: DEBUG_POINT:[49, 58, 7]              <=>J@  7: @7#ASTORE~:[6]                       <
    >N@ 15: IF_ICMP_EQUALS:[15, 0, ->@17]        <|
    >N@ 16: ATOMIC_INT_INCREMENT:[15, 4]         <|
    >N@ 17: COPY:[15, 14]                        <|
    L  52   :   todo.DEBUG.note("Hello adorable and cute squirrels!");
    >N@ 18: DEBUG_POINT:[52, 18, 9]              <=>J@  9: @9#LDC~:[Hello adorable and cute squi<
                                                  |>rrels!]                                     <
    >N@ 19: LOAD_POOL:[Hello adorable and cute sq<|
     uirrels!, 23]                                |
    >N@ 20: LOAD_POOL:[STATIC+cc/squirreljme/jvm/<|
     JVMFunction::jvmLoadString(I)Ljava/lang/Stri |
     ng;, 24]                                     |
    >N@ 21: LOAD_POOL:[cc/squirreljme/jvm/JVMFunc<|
     tion, 7]                                     |
    >N@ 22: INVOKE:[24, R[23]]                   <|
    >N@ 23: COPY:[1, 15]                         <|
    >N@ 24: DEBUG_POINT:[52, 3, 11]              <=>J@ 11: @11#ICONST_0~:[]                     <
    >N@ 25: INTEGER_OR_CONST:[0, 0, 16]          <|
    >N@ 26: DEBUG_POINT:[52, 189, 12]            <=>J@ 12: @12#ANEWARRAY~:[java/lang/Object]    <
    >N@ 27: LOAD_POOL:[[Ljava/lang/Object;, 23]  <|
    >N@ 28: LOAD_POOL:[STATIC+cc/squirreljme/jvm/<|
     JVMFunction::jvmNewArray(II)I, 24]           |
    >N@ 29: LOAD_POOL:[cc/squirreljme/jvm/JVMFunc<|
     tion, 7]                                     |
    >N@ 30: INVOKE:[24, R[23, 16]]               <|
    >N@ 31: COPY:[1, 16]                         <|
    >N@ 32: IF_ICMP_NOT_EQUALS:[3, 0, ->@214]    <|
    >N@ 33: DEBUG_POINT:[52, 184, 15]            <=>J@ 15: @15#INVOKESTATIC~:[method todo/DEBUG:<
                                                  |>:note(Ljava/lang/String;[Ljava/lang/Object;)<
                                                  |>V]                                          <
    >N@ 34: COPY:[16, 23]                        <|
    >N@ 35: LOAD_POOL:[STATIC+todo/DEBUG::note(Lj<|
     ava/lang/String;[Ljava/lang/Object;)V, 24]   |
    >N@ 36: LOAD_POOL:[todo/DEBUG, 7]            <|
    >N@ 37: INVOKE:[24, R[15, 16]]               <|
    >N@ 38: IF_ICMP_EQUALS:[23, 0, ->@44]        <|
    >N@ 39: ATOMIC_INT_DECREMENT_AND_GET:[24, 23,<|
      4]                                          |
    >N@ 40: IF_ICMP_NOT_EQUALS:[24, 0, ->@44]    <|
    >N@ 41: LOAD_POOL:[STATIC+cc/squirreljme/jvm/<|
     JVMFunction::jvmGarbageCollectObject(I)V, 25 |
     ]                                            |
    >N@ 42: LOAD_POOL:[cc/squirreljme/jvm/JVMFunc<|
     tion, 7]                                     |
    >N@ 43: INVOKE:[25, R[23]]                   <|
    >N@ 44: IF_ICMP_NOT_EQUALS:[3, 0, ->@220]    <|
    L  53   :   todo.DEBUG.note("Basic formatting too: %s!", "Neat!");
    >N@ 45: DEBUG_POINT:[53, 18, 18]             <=>J@ 18: @18#LDC~:[Basic formatting too: %s!] <
    >N@ 46: LOAD_POOL:[Basic formatting too: %s!,<|

AOT Compilation fails for shaded JAR

Performing AOT compilation on the shaded JAR does not work because it seems that the shaded directory layout is picked for classes. Fixing may require a dash in the path or changing the extension of class files.

stephanie@oaktree:/tmp/sx$ jaotc squirreljme-javase.jar 
Error: java.lang.NoClassDefFoundError: net/multiphasicapps/zip/streamwriter/__TOCEntry__ (wrong name: __squirreljme/zip/net/multiphasicapps/zip/streamwriter/__TOCEntry__)
java.lang.NullPointerException
        at [email protected]/jdk.tools.jaotc.Main.run(Main.java:136)
        at [email protected]/jdk.tools.jaotc.Main.run(Main.java:102)
        at [email protected]/jdk.tools.jaotc.Main.main(Main.java:81)

PNG Decoding Issues

The Paeth filter in PNG images is not correct and results in an image where parts of it are not decoded properly, thus causing color corruption. This gets far worse over time when UP, AVG, and PAETH filters are used.

What is read is the following:
image

It should be:
image

Exception does not seem to propogate up the stack?

In the stack trace below, a NoSuchElementException is thrown by List.removeFirst() which should be caught in the calling method, however it is not caught.

Fossil: b4b480147862e0c01b5133aef94e040da364c877
Git: Approx. 898ca3b

DBUG0 csv.VMResourceAccess::open (:149) -- rAS(cldc-compact.test.jar, util/TestServiceLoader.in) = true
TODO1 js.AccessController::checkPermission @ 18h (:36) -- Check permission: ("java.util.PropertyPermission" "util.TestServiceLoader.1")
DBUG1 jl.Throwable::<init> @ 2Ah (:136) -- new Throwable(`NSEE`)
java.util.NoSuchElementException: NSEE
  at java/lang/Exception.<init>:(Ljava/lang/String;)V @ 2 (Exception.java:40)
  at java/lang/RuntimeException.<init>:(Ljava/lang/String;)V @ 2 (RuntimeException.java:39)
  at java/util/NoSuchElementException.<init>:(Ljava/lang/String;)V @ 2 (NoSuchElementException.java:38)
  at java/util/LinkedList.removeFirst:()Ljava/lang/Object; @ 13 (LinkedList.java:363)
  at java/util/LinkedList.poll:()Ljava/lang/Object; @ 1 (LinkedList.java:276)
  at java/util/ServiceLoader$__FreshIterator__.hasNext:()Z @ 29 (ServiceLoader.java:287)
  at util/TestServiceLoader.test:()V @ 12 (TestServiceLoader.java:36)
  at net/multiphasicapps/tac/TestRunnable.__runTest:([Ljava/lang/Object;)Ljava/lang/Object; @ 16 (TestRunnable.java:43)
  at net/multiphasicapps/tac/__CoreTest__.runTest:([Ljava/lang/String;)V @ 250 (__CoreTest__.java:123)
  at net/multiphasicapps/tac/__CoreTest__.startApp:()V @ 5 (__CoreTest__.java:285)
  at java/lang/Thread.__start:()V @ 173 (Thread.java:658)
util.TestServiceLoader: FAIL
        RV ExceptionThrown NoResult
        TH throwable:java.util.NoSuchElementException,java.lang.RuntimeException,Exception,Throwable:NSEE NoExceptionThrown
        again-utildserviceloaderdimplsdcomfortabledrey ! null string:A\_very\_comfortable\_drey!
        again-utildserviceloaderdimplsdcutesquirrels ! null string:Cute\_squirrels!
        again-utildserviceloaderdimplsdstashtheacorns ! null string:Stash\_all\_the\_acorns!
        cache-utildserviceloaderdimplsdcomfortabledrey ! null string:A\_very\_comfortable\_drey!
        cache-utildserviceloaderdimplsdcutesquirrels ! null string:Cute\_squirrels!
        cache-utildserviceloaderdimplsdstashtheacorns ! null string:Stash\_all\_the\_acorns!
        init-utildserviceloaderdimplsdcomfortabledrey ! null string:A\_very\_comfortable\_drey!
        init-utildserviceloaderdimplsdcutesquirrels ! null string:Cute\_squirrels!
        init-utildserviceloaderdimplsdstashtheacorns ! null string:Stash\_all\_the\_acorns!

Armageddon Agents does not work

The game Armageddon Agents does not work.

Currently it seems that it tries creating a Command with no short label which throws a NullPointerException.

Stack trace and deep dive pending.

Java 7 Support has a Time-Limit

As per JEP 182 (https://openjdk.java.net/jeps/182) the official compiler is removing support for -source and -target to compile for older releases of Java.

Java 7 support should have already been removed but it seems any patches or changes did not make Java 11's release and it seems there have been adjustments to it. See https://bugs.openjdk.java.net/browse/JDK-8173605. This mentions that support for Java 6 is being removed in Java 12, which means Java 7 will be removed in Java 13. So since SquirrelJME pretty much is Java 7, this means that you will be unable to compile and compile for SquirrelJME due to a lack of a compiler. Java 11 is a LTS release and it will be around for awhile, but eventually that will be supplanted as well.

Robuzzle doesn't accept input

The game slowly draws a blue background and then a letter selection for name input. You can move through the letters, but you cannot select them or anything.
robuzzle_log.txt
robuzzle.jar MD5: 37018ca96d592eda198c7dd2cc268ff1

RetroArch build crashes

OS: Windows 10 1903 (OS build 18362.207)
Environment: RetroArch 1.7.7
Core: squirreljme_libretro.dll (7/7/19)

Starting SquirrelJME from within RetroArch results in a crash.

This happens when I select Start Core after selecting SquirrelJME.
This also happens when I navigate to my content directory, select a .jar, then select SquirrelJME.

image

Log output:

[libretro INFO] Okay.
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Using firmware class path!
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Initializing task 1 (1)...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Finding class cc/squirreljme/runtime/launcher/ui/MidletMain...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Scanning for cc/squirreljme/runtime/launcher/ui/MidletMain.class...
[INFO] [GL debug (Low, API, Performance)]: API_ID_REDUNDANT_FBO performance warning has been generated. Redundant state change in glBindFramebuffer API call, FBO 0, "", already bound.
[INFO] [GL debug (Low, API, Performance)]: API_ID_REDUNDANT_FBO performance warning has been generated. Redundant state change in glBindFramebuffer API call, FBO 0, "", already bound.
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Determining ClassInfo layout...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Scanning for java/lang/Object.class...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Scanning for cc/squirreljme/jvm/ClassInfo.class...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] JVM execution failure: fffffff0 0000de00
[INFO] [GL debug (Low, API, Performance)]: API_ID_REDUNDANT_FBO performance warning has been generated. Redundant state change in glBindFramebuffer API call, FBO 0, "", already bound.
[INFO] [GL debug (Low, API, Performance)]: API_ID_REDUNDANT_FBO performance warning has been generated. Redundant state change in glBindFramebuffer API call, FBO 0, "", already bound.
[INFO] Environ GET_LOG_INTERFACE.
[libretro ERROR] SquirrelJME JVM Exec Error: -12/fffffff4 4841033/0049de49
[libretro ERROR] Execution now unpredictable!```

Libretro Execution Failure

Attempting to load any Java ME jar file using the libretro implementation results in an execution failure.

Log:

xxxs-MacBook-Pro:~ xxx$ /Applications/RetroArch.app/Contents/MacOS/RetroArch -L "/Users/xxx/Documents/RetroArch/cores/squirreljme_libretro.dylib" "/Users/xxx/Downloads/BilliardBerzerkMidlet.jar"
...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] SquirrelJME Run-Time 0.3.0
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] VM: SquirrelJME RatufaCoat 0.3.0
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] (C) Stephanie Gawroriski
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] RAM/ROM (bytes): 16777216/12874564
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] 
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Initializing task manager...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Okay.
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] 
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Creating initial task...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Scanning 57 libraries...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Okay.
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Using firmware class path!
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Initializing task 1 (1)...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Finding class cc/squirreljme/runtime/launcher/ui/MidletMain...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Initializing class info cc/squirreljme/runtime/launcher/ui/MidletMain...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Searching for ClassInfo...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Finding class cc/squirreljme/jvm/ClassInfo...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] Initializing class info cc/squirreljme/jvm/ClassInfo...
[INFO] Environ GET_LOG_INTERFACE.
[libretro INFO] JVM execution failure: fffffff0 0000a000
[INFO] Environ GET_LOG_INTERFACE.
[libretro ERROR] SquirrelJME JVM Exec Error: -12/fffffff4 5351798/0051a976
[libretro ERROR] Execution now unpredictable!

Implement correct `flush()` behavior for `HTTPConnection`

Currently for HTTPConnection, flush() does nothing and the data is only sent on close(). This is incorrect as there must be a connection made on the first flush and the headers sent and such. This of course needs a slight change because content-length cannot be specified if data can be split between multiple flushes.

RetroArch: Flip phone overlay

Cross referencing: libretro/common-overlays#39

A new overlay for flip phone device emulation is needed (currently by SquirrelJME). Note that any overlays for ColecoVision, Intellivision, and Atari Jaguar systems will not work here due to lack of information on buttons and the number of available buttons.

Specifically the following keys are required:

  • Up
  • Down
  • Left
  • Right
  • Select
  • Soft 1 (Top-left button)
  • Soft 2 (Top-right button)
  • Talk/Call (vertical green phone facing left)
  • End/Hangup (horizontal red phone facing down)
  • Camera
  • Back
  • Speaker
  • Volume Up
  • Volume Down
  • 1 ๐Ÿ–‚ or 1 โžฟ (Voicemail)
  • 2 ABC
  • 3 DEF
  • 4 GHI
  • 5 JKL (tactile aid)
  • 6 MNO
  • 7 PQRS
  • 8 TUV
  • 9 WXYZ
  • * Shift (Star, Shift)
  • One of these pairs:
    • Space on zero:
      • 0 + โฃ (Zero, Plus, Space)
      • # (Pound)
    • Space on pound:
      • 0 + (Zero, Plus)
      • # โฃ (Pound, Space)

This can be seen in the following picture of a Kyocera Dura XT:
image

Antilly does not render anything

Antilly does not render anything (blank screen) and the draw routine just throws NullPointerException.

Seen in fossil 39a60ad562382d3169155a7c06f9dcd2644ef1d7.

Technical:

Antilly stores pre-cached Images into static Image[] b.q which is initialized in b(). b() loads an input stream which also contains image data contained within it in with DataInputStream. It will load a chunk of data from the stream then will call Image.createImage(byte[], int, int). This loads an image which is then returned and then stored into the array. The paint(Graphics) method calls b.c(int) which just returns an index from the static array Image[] q which is in class b.

It is possible the stream DataInputStream reads from has a flaw (possible resources maybe high bytes are handled incorrectly?), the constructor is never properly called, or something is missing in the JAR.

Stack trace as follows:

java.lang.NullPointerException: BK2l
  at java/lang/Exception.<init>:(Ljava/lang/String;)V @2 (Exception.java:40)
  at java/lang/RuntimeException.<init>:(Ljava/lang/String;)V @2 (RuntimeException.java:39)
  at java/lang/NullPointerException.<init>:(Ljava/lang/String;)V @2 (NullPointerException.java:38)
  at d.paint:(Ljavax/microedition/lcdui/Graphics;)V @49 (JAX:-1)
  at javax/microedition/lcdui/Canvas.__draw:(Lcc/squirreljme/runtime/lcdui/ui/UIPersist;Lcc/squirreljme/runtime/lcdui/ui/UIStack;Lcc/squirreljme/runtime/lcdui/ui/UIStack;Ljavax/microedition/lcdui/Graphics;)V @76 (Canvas.java:705)
  at javax/microedition/lcdui/__LCDUIProbe__.draw:(Lcc/squirreljme/runtime/lcdui/ui/UIDrawable;Lcc/squirreljme/runtime/lcdui/ui/UIPersist;Lcc/squirreljme/runtime/lcdui/ui/UIStack;Lcc/squirreljme/runtime/lcdui/ui/UIStack;Ljavax/microedition/lcdui/Graphics;)V @10 (__LCDUIProbe__.java:35)
  at cc/squirreljme/runtime/lcdui/ui/UIStack.render:(Lcc/squirreljme/runtime/lcdui/ui/UIPersist;Lcc/squirreljme/runtime/lcdui/ui/UIStack;Ljavax/microedition/lcdui/Graphics;)V @285 (UIStack.java:261)
  at cc/squirreljme/runtime/lcdui/ui/UIStack.render:(Lcc/squirreljme/runtime/lcdui/ui/UIPersist;Lcc/squirreljme/runtime/lcdui/ui/UIStack;Ljavax/microedition/lcdui/Graphics;)V @296 (UIStack.java:267)
  at javax/microedition/lcdui/Display.__doRepaint:(IIII)V @76 (Display.java:1229)
  at javax/microedition/lcdui/__EventCallback__.paintDisplay:(IIIII)V @10 (__EventCallback__.java:109)
  at <unknown>.<unknown> @0

Incomplete Bootloader (SummerCoat/RatufaCoat/RetroArch failing)

The bootloader is currently incomplete in SquirrelJME which causes SummerCoat, RatufaCoat, and RetroArch builds of SquirrelJME unable to start the virtual machine. This is a a continuing work in progress as the bootstrap progresses. The layer which communicates to your operating system is currently mostly complete and should work just fine.

The ROM in progress is currently here: https://multiphasicapps.net/uv/auto/squirreljme-summercoatrom.zip.

The following image shows this:

image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.