#136606 - magicdanw - Fri Aug 03, 2007 4:37 am
Hi! This is my first post here. I'm a Java programmer who would like to get into DS programming. I found a program called Java4gba: http://www.torlus.com/index.php?2004/01/05/25-java4gba---a-java-virtual-machine-for-gba
It lets you program in Java for the Gameboy Advance, but there's no input methods. I'd like to try to expose the functions found in libnds and PAlib as Java methods, but first I need to figure out how to make nds roms with Java4gba. Emulators see the compiled roms as gba roms, and they crash if I prepend ndsloader.bin. Does anyone know how to convert a gba rom into an nds rom, or what the differences are between them?
#136613 - felix123 - Fri Aug 03, 2007 7:31 am
You cannot just convert a GBA program into a DS program. You need to rewrite the code.
_________________
Nintendo DS homebrew on Wikipedia
#136615 - magicdanw - Fri Aug 03, 2007 8:14 am
Ok. I'm now trying to figure out how to do that. I have the source code for the program, and I'm trying to first compile it as it is, but I'm having some difficulty. First of all, the makefile required GCC, which I find odd because it should be built with DevKitAdvanced or DevKitPro. Anyway, I downloaded GCC for Windows, and now it's giving an error because it needs linux library files, which of course won't work with Windows. Any idea why it's using GCC instead of DevKit?
#136616 - Ant6n - Fri Aug 03, 2007 8:31 am
devkitarm is a modified version of gcc (targeted for arm, with some gba/ds specs, linker scripts, tools)
#136618 - magicdanw - Fri Aug 03, 2007 9:21 am
I see. I've also gotten a bit further. By using a gba makefile from DevKitPro, I can start compiling. However, it hits an error in a file that uses ifdef commands. As far as I can tell, the compiler isn't registering properly that I'm compiling for GBA, so the ifdef GBA code never runs, causing an error later on. In the compiler options being used, the only instance I see of GBA is -ffast-math GBA, and the compiler complains that GBA isn't a file name, so I guess the architecture is being set wrong or not at all. Where does the GBA architecture get set?
#136659 - Quirky - Fri Aug 03, 2007 5:00 pm
I'd start with a newer version of Java. The Java4gba release is not clearly licensed and may even be illegal.
The "phoneme" release seems to be the updated version of the java4gba JVM - https://phoneme.dev.java.net/downloads_page.html - and it is GPL. They have changed to using C++ so there are no ifdefs. You need to implement certain functions (not sure which, the documentations on what's needed is not too hot). However, the build system is really confusing, but if you could get it to build for the DS and maybe create classes that exposed palib from Java code it'd be quite cool!
#136668 - magicdanw - Fri Aug 03, 2007 6:08 pm
Well, you're right about the build system being confusing :(
I'm trying to build under cygwin, but I get
Code: |
Checking for build-time classes to compile ...
d
/usr/bin/bash: c:devkitPromsysphoneme_advanced_mr2cdcsrcsharejavavmclassessunmis
cbuildlinux-arm-generic.btclasses.list: command not found
make: *** [../../build/linux-arm-generic/./btclasses/sun/misc/TimeStamps.class]
Error 127 |
and then it quits. Everything up until then looks ok (as in, no errors or warnings). Any idea what this means?
#136687 - tepples - Fri Aug 03, 2007 9:26 pm
Try changing the \ characters in path names to / characters.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#136880 - magicdanw - Mon Aug 06, 2007 2:28 am
I'm using the default makefile and settings, which use / characters in path names. I see what you mean, that the \ characters in the pathname were removed, but I searched the entire phoneme folder and no files contain the text "devkitpro," so I don't know where the makefile is getting the path from, or why it's in Windows instead of Unix format...
#136905 - josath - Mon Aug 06, 2007 10:27 am
It took me about an hour to get this working on NDS, it was fairly simple, the code is very portable. I'll see about packing it up and releasing it, but it's not too useful right now since there's no input, and the only output is via text console. (ie. you cannot access any DS hardware, and Java being what it is, you can't just directly write to the HW registers.)