More actions
(Created page with "{{#seo: |title= (Other emulators) - GameBrew |title_mode=append |image=java4gba2.png |image_alt=Java4gba }} {{Infobox GBA Homebrews |title=Java4gba |image=java4gba2.png |descr...") |
m (Text replacement - "type=Other emulators" to "type=Other Emulators") |
||
(9 intermediate revisions by the same user not shown) | |||
Line 7: | Line 7: | ||
{{Infobox GBA Homebrews | {{Infobox GBA Homebrews | ||
|title=Java4gba | |title=Java4gba | ||
|image= | |image=java4gba02.png | ||
|description=A a Java Virtual Machine for GBA. | |description=A a Java Virtual Machine for GBA. | ||
|author=Torlus | |author=Torlus | ||
|lastupdated=2004/01/05 | |lastupdated=2004/01/05 | ||
|type=Other | |type=Other Emulators | ||
|version=2004 | |version=2004 | ||
|license=Mixed | |license=Mixed | ||
|download=https://dlhb.gamebrew.org/gbahomebrews/java4gba.7z | |download=https://dlhb.gamebrew.org/gbahomebrews/java4gba.7z | ||
|website=https://torlus.github.io/ | |website=https://torlus.github.io/ | ||
|source=java4gba.7z | |source=https://dlhb.gamebrew.org/gbahomebrews/java4gba.7z | ||
}} | }} | ||
Java4gba is an early port of KVM, Sun's Java Virtual Machine, part of CLDC 1.1 RI. | Java4gba is an early port of KVM, Sun's Java Virtual Machine, part of CLDC 1.1 RI. | ||
Line 29: | Line 29: | ||
If you are unfamiliar with J2ME (Java 2 Micro Edition), here is a small explanation about its architecture (roughly). | If you are unfamiliar with J2ME (Java 2 Micro Edition), here is a small explanation about its architecture (roughly). | ||
KVM <------------ CLDC 1.1 <------------------ MIDP 2.0 <------------------ Java Game | KVM <------------ CLDC 1.1 <------------------ MIDP 2.0 <------------------ Java Game | ||
| | | | | | | | | | ||
the virtual limited set of more advanced set running on top | the virtual limited set of more advanced set running on top | ||
machine java classes of classes featuring of MIDP | machine java classes of classes featuring of MIDP | ||
graphics, sound... | graphics, sound... | ||
Some details about this port: | |||
Some details about this port : | |||
* It has been compiled with "ROMizing" option, which means that all CLDC classes are already in the VM, so you don't need to add them in your GBFS file (see about GBFS below). | * It has been compiled with "ROMizing" option, which means that all CLDC classes are already in the VM, so you don't need to add them in your GBFS file (see about GBFS below). | ||
* It has been compiled with KNI and float support, but the float support is broken. I still haven't tested the KNI part. | * It has been compiled with KNI and float support, but the float support is broken. I still haven't tested the KNI part. | ||
Line 44: | Line 43: | ||
* In the code, almost all architecture-related stuff has been isolated. That means that it has basic implementations for about everything that you would expect from your operating system, or C library (memory allocation, file system...) functions. That also means that you can virtually port it on every kind of architecture. | * In the code, almost all architecture-related stuff has been isolated. That means that it has basic implementations for about everything that you would expect from your operating system, or C library (memory allocation, file system...) functions. That also means that you can virtually port it on every kind of architecture. | ||
Some functions come from code of Justin Armstrong's [[JaysOS]]. | Some functions come from code of Justin Armstrong's [[JaysOS GBA|JaysOS]]. | ||
The main difference between Java4gba and JaysOS is that JaysOS provides underlying functions allowing multiple programs (C or Waba ones) to run. Here Java4gba is only the Java Virtual Machine. | The main difference between Java4gba and JaysOS is that JaysOS provides underlying functions allowing multiple programs (C or Waba ones) to run. Here Java4gba is only the Java Virtual Machine. | ||
===About GBFS=== | ===About GBFS=== | ||
GBFS is a GBA file system implementation by Damian Yerrick. Basically, you create an archive containing your classes files, with the gbfs.exe tool provided, and you just append it to the kvm.bin file, to create your ROM (see the examples.bat file). So the basic steps to test your own Java programs are: | |||
Compile them with a java compiler, example: | Compile them with a java compiler, example: | ||
javac OneClass.java | |||
javac OtherClass.java | |||
javac MyMainClass.java | |||
Create a GBFS archive with the .class files generated. The first class in the GBFS archive must be the one that contains the "main" function (protoype: public static void main(String [] args)), example: | |||
gbfs.exe MyGBFSArchive.gbfs MyMainClass.class OneClass.class OtherClass.class | |||
gbfs.exe MyGBFSArchive.gbfs MyMainClass.class OneClass.class OtherClass.class | |||
Finally append to the "kvm.bin" file, the GBFS archive you've just created, into a new file that will be your final ROM, example: | Finally append to the "kvm.bin" file, the GBFS archive you've just created, into a new file that will be your final ROM, example: | ||
copy /b kvm.bin + MyGBFSArchive.gbfs MyJavaROM.bin | copy /b kvm.bin + MyGBFSArchive.gbfs MyJavaROM.bin | ||
Important note - GBFS has some limitations : | Important note - GBFS has some limitations: | ||
* The file names should not exceed 23 characters (".class" extension included) | * The file names should not exceed 23 characters (".class" extension included). | ||
* There is no support for directories. | * There is no support for directories. | ||
Line 79: | Line 75: | ||
* Author's website - [https://web.archive.org/web/20050405075314/http://torlus.com/index.php?GBA http://torlus.com/index.php?GBA] (archived) | * Author's website - [https://web.archive.org/web/20050405075314/http://torlus.com/index.php?GBA http://torlus.com/index.php?GBA] (archived) | ||
* GitHub - https://torlus.github.io/ | * GitHub - https://torlus.github.io/ | ||
Latest revision as of 06:05, 10 Mayıs 2024
Java4gba | |
---|---|
General | |
Author | Torlus |
Type | Other Emulators |
Version | 2004 |
License | Mixed |
Last Updated | 2004/01/05 |
Links | |
Download | |
Website | |
Source | |
Java4gba is an early port of KVM, Sun's Java Virtual Machine, part of CLDC 1.1 RI.
KVM is the Java VM you may find in mobile phones for running "Java games". This small work is only about CLDC, which means that there is nothing about graphics, sound, or whatever. You can only do some plain console output.
However, it brings to GBA almost all Java interesting features like Exceptions, Threading, Monitors. You will find some examples that illustrate these Java features.
Just reteun the examples.bat script to build some example ROMs (you don't necessarily need a Java compiler, but it is recommended, especially if you want to play with the VM.
User guide
If you are unfamiliar with J2ME (Java 2 Micro Edition), here is a small explanation about its architecture (roughly).
KVM <------------ CLDC 1.1 <------------------ MIDP 2.0 <------------------ Java Game | | | | the virtual limited set of more advanced set running on top machine java classes of classes featuring of MIDP graphics, sound...
Some details about this port:
- It has been compiled with "ROMizing" option, which means that all CLDC classes are already in the VM, so you don't need to add them in your GBFS file (see about GBFS below).
- It has been compiled with KNI and float support, but the float support is broken. I still haven't tested the KNI part.
- The VM heap size is 64K.
- It uses GBFS, a GBA file system implementation by Damian Yerrick.
- JAR support has been compiled in, but at the moment, you can't use it (see below).
- The class verifier was disabled, which unexpectedly fails (even on "standard" platforms) when verifying some classes that perfectly works. I'll try to dig a bit around that.
- In the code, almost all architecture-related stuff has been isolated. That means that it has basic implementations for about everything that you would expect from your operating system, or C library (memory allocation, file system...) functions. That also means that you can virtually port it on every kind of architecture.
Some functions come from code of Justin Armstrong's JaysOS.
The main difference between Java4gba and JaysOS is that JaysOS provides underlying functions allowing multiple programs (C or Waba ones) to run. Here Java4gba is only the Java Virtual Machine.
About GBFS
GBFS is a GBA file system implementation by Damian Yerrick. Basically, you create an archive containing your classes files, with the gbfs.exe tool provided, and you just append it to the kvm.bin file, to create your ROM (see the examples.bat file). So the basic steps to test your own Java programs are:
Compile them with a java compiler, example:
javac OneClass.java javac OtherClass.java javac MyMainClass.java
Create a GBFS archive with the .class files generated. The first class in the GBFS archive must be the one that contains the "main" function (protoype: public static void main(String [] args)), example:
gbfs.exe MyGBFSArchive.gbfs MyMainClass.class OneClass.class OtherClass.class
Finally append to the "kvm.bin" file, the GBFS archive you've just created, into a new file that will be your final ROM, example:
copy /b kvm.bin + MyGBFSArchive.gbfs MyJavaROM.bin
Important note - GBFS has some limitations:
- The file names should not exceed 23 characters (".class" extension included).
- There is no support for directories.
Credits
External links
- Author's website - http://heliscar.com/greg/
- Author's website - http://torlus.com/index.php?GBA (archived)
- GitHub - https://torlus.github.io/