Author Topic: Khavi: Java on the Prizm  (Read 64564 times)

0 Members and 1 Guest are viewing this topic.

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Java on the Prizm
« Reply #15 on: April 13, 2011, 05:25:41 pm »
I wonder how fast would Java be on the Prizm. Could a game like Nightmare be possible?

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Java on the Prizm
« Reply #16 on: April 16, 2011, 04:54:48 am »
This code just keeps growing :P

Trying to write an interpreter in Assembly really gives you an appreciation for why they're so large.
« Last Edit: April 16, 2011, 04:55:17 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Java on the Prizm
« Reply #17 on: April 16, 2011, 04:58:12 am »
This code just keeps growing :P

Trying to write an interpreter in Assembly really gives you an appreciation for why they're so large.

That's likely, it's a Java interpreter for a calculator :P

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Java on the Prizm
« Reply #18 on: April 17, 2011, 08:30:03 pm »
I re-wrote a good portion of the initialization code to accommodate the Java Native Interface. It now handles both the .class format and the .sh3 format that I wrote awhile back. Packet based formats are significantly more difficult to parse, though  :-\
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Java on the Prizm
« Reply #19 on: April 17, 2011, 09:01:25 pm »
I hope it fits on-calc, lol. :P

Offline jnesselr

  • King Graphmastur
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2270
  • Rating: +81/-20
  • TAO == epic
    • View Profile
Re: Java on the Prizm
« Reply #20 on: April 17, 2011, 11:01:50 pm »
Yeah, I can see in the readme: "You can only make 2 kb games.  Each game must include a 1.9kb header."

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Java on the Prizm
« Reply #21 on: April 17, 2011, 11:31:30 pm »
Well, 1.97kb, but close enough :P

In reality, the area available for program use will probably be on the order of 100 kb. That's what the OS will handle and I don't really want to throw Flash management into the JVM (in addition to the garbage collector, JNI, threading, etc) in order to get more.
« Last Edit: April 17, 2011, 11:33:22 pm by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline willrandship

  • Omnimagus of the Multi-Base.
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2953
  • Rating: +98/-13
  • Insert sugar to begin programming subroutine.
    • View Profile
Re: Java on the Prizm
« Reply #22 on: April 17, 2011, 11:34:19 pm »
Does the SH3 have anything like Jazzelle in its CPU? That would help a lot.

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Java on the Prizm
« Reply #23 on: April 17, 2011, 11:45:36 pm »
Nope, there's nothing like Jazelle.
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Java on the Prizm
« Reply #24 on: April 21, 2011, 12:13:52 am »
Do you mean calculator Java games will be limited to 2 KB? ???

Offline AngelFish

  • Is this my custom title?
  • Administrator
  • LV12 Extreme Poster (Next: 5000)
  • ************
  • Posts: 3242
  • Rating: +270/-27
  • I'm a Fishbot
    • View Profile
Re: Java on the Prizm
« Reply #25 on: April 21, 2011, 12:24:36 am »
No, that was a joke. They'll be limited to declaring 100 KB or so of usable memory during runtime. The actual program can be whatever size will fit in memory.
« Last Edit: April 21, 2011, 12:25:08 am by Qwerty.55 »
∂²Ψ    -(2m(V(x)-E)Ψ
---  = -------------
∂x²        ℏ²Ψ

Offline DJ Omnimaga

  • Clacualters are teh gr33t
  • CoT Emeritus
  • LV15 Omnimagician (Next: --)
  • *
  • Posts: 55943
  • Rating: +3154/-232
  • CodeWalrus founder & retired Omnimaga founder
    • View Profile
    • Dream of Omnimaga Music
Re: Java on the Prizm
« Reply #26 on: April 21, 2011, 12:25:17 am »
Phew. :P And 100 KB seems good at least.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Java on the Prizm
« Reply #27 on: April 21, 2011, 10:18:03 am »
Now are we talking about 100 kb of executable, data, or executable and data. Remember that for the executable we can run that from flash which would give a possible size of several MB's and the heap looks like a promising area to keep data at 128 kB. There's also the system and add-in stack which for the most part are empty and combined are at a size of 1 MB. Also if it is not being used by anything the back buffer is a lot of ram.

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: Java on the Prizm
« Reply #28 on: April 21, 2011, 11:27:53 am »
Does the SH3 have anything like Jazzelle in its CPU? That would help a lot.

Not sure of how helpful that is, nobody has made Java on the NSpire yet and it has jazelle. Perhaps it's not Jazelle's problem and the nspire's.

Nice to see this progressing Qwerty.55.

Offline z80man

  • Casio Traitor
  • LV8 Addict (Next: 1000)
  • ********
  • Posts: 977
  • Rating: +85/-3
    • View Profile
Re: Java on the Prizm
« Reply #29 on: April 21, 2011, 03:25:43 pm »
Does the SH3 have anything like Jazzelle in its CPU? That would help a lot.

Not sure of how helpful that is, nobody has made Java on the NSpire yet and it has jazelle. Perhaps it's not Jazelle's problem and the nspire's.

Nice to see this progressing Qwerty.55.
how Jazelle works is that it executes the simple Java bytecode instructions in hardware just like they were any other CPU instruction, and then for the more complex instructions that are not implemented in hardware, Jazelle will pass off the instruction to the JVM to execute. Unfortunately the SH4A does not include Jazelle so we can't use it. I believe the current layout of our JVM for the Prizm is that several instructions are translated to machine code at a time and then that block is executed. That prevents all of the branches that would be done if you executed the instructions one at at  a time. 

List of stuff I need to do before September:
1. Finish the Emulator of the Casio Prizm (in active development)
2. Finish the the SH3 asm IDE/assembler/linker program (in active development)
3. Create a partial Java virtual machine  for the Prizm (not started)
4. Create Axe for the Prizm with an Axe legacy mode (in planning phase)
5. Develop a large set of C and asm libraries for the Prizm (some progress)
6. Create an emulator of the 83+ for the Prizm (not started)
7. Create a well polished game that showcases the ability of the Casio Prizm (not started)