GP32 converting java to work with gp32


harminoff

Still Fresh
Joined
Jun 11, 2003
Messages
41
ive seen some games that say they were made in java, but run on the gp32, is this done with c, and how?
 
Well java is almost a c++ so if you keep to the traditional c code you can convert from java and back to c, with a few modifications.
 
jlebrech posted on Jul 5 2003 said:
Well java is almost a c++ so if you keep to the traditional c code you can convert from java and back to c, with a few modifications.
how do i mod it? i dont know jack sh*t about c
 
Last edited by a moderator:
Java usually compiles to bytecode, wich is run in a platform-dependant runtime (java virtual machine). If you want java to run on a gp32, you'll need a runtime for gp32, and guess what? There's a waba port! :) I'm not sure how good it is and what it'll run, so you'll have to find that out for yourself.

About C, well, converting java code to C is next to impossible. The syntax is very alike, but that's where all the similarities end. For instance, C uses explicit memory management instead of garbage collection, wich means you'll have to free any memory you allocate on the heap and make sure you don't create memory leaks that will crash your program. Also, Java is an object oriented language and C isn't. There's C++, wich is an extended version of C wich supports object oriented programming (classes), but if you're a beginning programmer who knows some java it's best to forget about object oriented programming (wich isn't all that important for writing simple GP32 programs and games) and learn C. If you already know Java you'll just need to learn a few new rules and tricks but you'll probably become a better programmer because of it.

C is much, much closer to the hardware than Java, and gives you a better understanding of what's going on under the hood. I reccomend using devkitadvance (get it at http://devkitadv.sourceforge.net/) plus and the GP32 patch from CHN (http://chn.roarvgm.com/#gp32). This should hook you up with a working development environment.

Good luck,

/Inopia
 
Back
Top