PDA

View Full Version : Zplet J2ME



GPF
August 24th, 2004, 11:09
Don't know if the Ngage plays J2ME but I have ported the Z Machine emulator with MiniZork to J2ME from the ZPlet java applet. Works great in the j2me emulator, only show the first screen on my cell phone, an LG 1300C.

I still have a lot of work to do on it but its kind of cool seeing it on a cell phone.

Troy

wraggster
August 24th, 2004, 11:12
anyone with an Ngage wanna try this and verify it works :)

Nice port btw

wraggster
August 24th, 2004, 11:15
scratch that comment :(

yep i should read properly first :P

wraggster
August 24th, 2004, 12:46
Developing Applications for the N-Gage
There are two types of development that can occur for an N-Gage machine—J2ME development and cartridge game development. If you want to develop a game or other application that can be downloaded, you'll want to use J2ME. The N-Gage supports J2ME by using Java MIDP. It is no surprise that the device also supports the Series 60 SDK and UI. Series 60 is one of Nokia's primariy development platforms for mobile and wireless devices. You can learn more about J2ME and MIDP by checking out C. Enrique Ortiz's article The J2ME Mobile Information Device Profile 2.0.

wraggster
August 25th, 2004, 11:11
Yes J2ME stuff works on the N-Gage :)

GPF
August 25th, 2004, 11:43
Cool.

Well I got it working on my phone, I had to implement a More function so that when the screen fills up, it waits for you to press a key and then clears the screen and continues.

Its still hardcoded for my phone, so I need to figure out how to calculate the screen height and width so its not hardcoded.

Troy

wraggster
August 25th, 2004, 11:49
Cant wait :)

ill post news once a preview release (or whatever) is out :)

GPF
September 7th, 2004, 16:31
I rearranged the items on the Form, so the TextField now comes before the StringItem and I removed the [more] function, so now you can scroll the whole page of information on the screen. And it works on my LG 1300C phone. I need to buy a serial/usb cable, it probably cost me $15 to test it on the phone :)

http://s101533388.onlinehome.us/GPF/Z2me.jpg

I have since also found that there was a sourceforge project for Zplet and have ported it to j2me, and called it Z2me :) , I have only tested it on the emulator so far, but it supports save and restore, but with the minizork.z3 file in the jar its 64k in size obfusicated. So I will probably need to do some optimization to get it running faster and smaller.

Once that is done, I need to figure out the licenses for how I can release it.

Troy

vinniet
November 11th, 2004, 10:33
Hello ... I would like to test the program on RIM Blackberry pager. Is it available for me to test, even if it is alpha.

Thanks,

Vinnie
([email protected])

GPF
November 11th, 2004, 10:41
I sent you a PM with the link to the latest alpha version.

Troy

vinniet
November 11th, 2004, 12:37
Yes it does run and I get the begining of zork but I can not type anything. If I press the wheel I have the options, enter, select, and exit. If I press enter I get the prompt, "I Beg your pardon?" but again can not type.

I brought zplet into the blackberry emulator and it worked the same. Any idea why I can not use the keyboard?

Thanks,

Vinnie

GPF
November 11th, 2004, 12:54
yeah its hardcoded right now, to map cellphone numbers to letters. Since the blackberry has a keyboard I don't know if the number keys would work?

I'll have to rewrite the entry code, so that if it gets letters it uses them instead of mapping.

Troy

vinniet
November 11th, 2004, 13:19
I have tried numbers but nothing that I type will show up. Except for pushing the wheel and selecting ENTER is the only key that I can get working. There is the room location scrolling on the bottom. I can use the wheel to look forward or back thru the log. Except when I press enter and I get "Beg your pardon" it clears the screen and I loose history.

Like I said before I have setup the emulator so I can try anything safely.

Thanks again,

Vinnie

vinniet
November 11th, 2004, 13:51
CORRECTION ... it works!!

Sorry ... I looked at the pictures and noticed that input line is at the top. I then scrolled to the top, I was actually there, and typed in a command and it works. Only limitation is that it keeps clearing the screen after each command so I loose history. Is there a way to stop that??

Another small anoyance is that you can not use enter on the keyboard, you have to press the wheel and select enter.

Also save and restore failed. Not sure if they work on the phone. I tried to test this out with microemulator and it did not work at all. Not sure if that is not compient. What emulator do you use??

Vinnie

GPF
November 11th, 2004, 14:37
I accidently sent the links to my very first port. I have since re-ported the Jplet from sourceforge which has save/restore support.

Troy

vinniet
November 11th, 2004, 14:45
Yes I see it looks much nicer but I can not use the keyboard. I have to press number to type letters. The last port actually worked better in that reguard.

Also since I do not have any soft keys I do not see a way to change enter something. I do not know what that maps to in a blackberry.

Vinnie

krowstrife
November 13th, 2004, 13:06
hi yes me Ngage expert of this site is back hahahahaahaha, nice work man really good app congrat GPF

i am just kidding i am not that vain

GPF
November 13th, 2004, 14:26
Yes I see it looks much nicer but I can not use the keyboard. *I have to press number to type letters. *The last port actually worked better in that reguard.

Also since I do not have any soft keys I do not see a way to change enter something. *I do not know what that maps to in a blackberry.

Vinnie

I now have the blackberry emulator set up so I will take a look at making it work for it, hopefully next week.

Troy

GPF
November 16th, 2004, 14:07
OK I got the keyboard working in the blackberry emulator.

trackwheel up and down should scroll through the screen history, right seems to bring up the menu which you can view the about screen.

Now it just needs to be tested on a real blackberry, which I don't own -send me one please :)

Troy

Mikem42
January 21st, 2005, 17:32
OK I got the keyboard working in the blackberry emulator.

trackwheel up and down should scroll through the screen history, right seems to bring up the menu which you can view the about screen.

Now it just needs to be tested on a real blackberry, which I don't own -send me one please :)

Troy

Im looking for a zmachine emulator for my 7200 :-)

Did you release the source/binaries anywhere? I checked the zplet sourceforge site, but there hasn't been an update since 2001...

- Mike

GPF
January 21st, 2005, 21:17
yeah I have tried to contact the original author and haven't been able to about releasing my version.

I just have been really busy and haven't released it yet except to private beta testers. I finally got my own sourceforge.net site for my dreamcast stuff. so either eventually i will upload it there or eventually get another sourceforge site for my j2me coding.

Troy

Mikem42
February 5th, 2005, 00:49
That's certainly understandable. While I'm not a overly proficient programmer, I am a rather good tester, so if you need any help, I'm quite motivated to lend a hand :-)

- Mike

Gandev
February 9th, 2005, 21:22
Hey it will be pleasure to me to help you with the testing.PM me the beta please!

Gandev
February 9th, 2005, 21:26
Hey it will be pleasure to me to help you with the testing.PM me the beta please!

GPF
February 10th, 2005, 06:33
ok Mikem42 and Gandev , i sent you both a PM.

Troy

Mikem42
February 11th, 2005, 03:09
Got it. Maybe I'm just not up on my IF, but what should the save/restore situation be (i.e. how do I save/restore)?

Also, I hacked up a quick .alx file for easy loading if anybody else needs it


<loader version="1.0">
<application id="Z2me">
<name >
Z2me
</name>
<description >
Z2me beta
</description>
<version >
1.0
</version>
<vendor >
beta
</vendor>
<copyright >
Unknown
</copyright>
<fileset Java="1.5">
<directory >
</directory>
<files >
blackberryZ2me.cod
blackberryZ2me.cso
blackberryZ2me.rapc
</files>
</fileset>
</application>
</loader>

GPF
February 11th, 2005, 07:53
thanks but whats an .alx file is it blackberry specific?

the saving and loading is done, by typing save and to load type restore. it only has support for one save file right now.

Troy

Gandev
February 11th, 2005, 14:31
I tried it, but actually I can't figure out what to do.After minizork was started I tried to write something, but there are no letters, but numbers.And when I press C the text can not be deleted :(

Gandev
February 11th, 2005, 14:39
And I have just visited your site and I saw some great projects.Do you have any other projects for cellphones.If only I can play Flashback on my N-gage...... ;)

GPF
February 11th, 2005, 17:09
I tried it, but actually I can't figure out what to do.After minizork was started I tried to write something, but there are no letters, but numbers.And when I press C the text can not be deleted :(

what type of cellphone are you using it on? The standard J2me version has only been tested on the LG1300C and then I made a special Blackberry port to account for the keyboard instead of number pad for text entry.


And I have just visited your site and I saw some great projects.Do you have any other projects for cellphones.If only I can play Flashback on my N-gage...... ;)

Thats the only thing I have written for cellphones for now, I need to get a better phone. No fun, developing software I cant play :)

Troy

Mikem42
February 11th, 2005, 22:43
Good news - found the original author and he approves use:

On Feb 10, 2005, at 9:29 PM, Miller, Mike F wrote:

> Hi, I'm writing on behalf of a developer who has a basic port of your
> rather nice zplet code to the j2me platform. We would like release it
> to
> a wide audience (mostly for playing IF on cellphones like the RIM
> blackberry), but wanted to double check with you that you have no
> objections to this noncommercial use of your code.
>
> Note: if you aren't the right Matthew Rossotto, I apologize for this
> cryptic email. Google isn't necessarily the best way to find people :-)
>
I'm the right person. ZPlet is open-source, licensed under the
Artistic License, so provided you follow the terms of that license,
it's fine.

In response to other questions - an alx file is the file that the blackberry software loader uses to get the metadata (like .cod file information, app descriptions, etc.) for loading new applications onto the blackberry.

I've found some minor UI issues. Should we discuss them here, or move this discussion to the sourceforge zplet site?

- Mike

GPF
February 11th, 2005, 23:09
Good news - found the original author and he approves use:

On Feb 10, 2005, at 9:29 PM, Miller, Mike F wrote:

> Hi, I'm writing on behalf of a developer who has a basic port of your
> rather nice zplet code to the j2me platform. We would like release it
> to
> a wide audience (mostly for playing IF on cellphones like the RIM
> blackberry), but wanted to double check with you that you have no
> objections to this noncommercial use of your code.
>
> Note: if you aren't the right Matthew Rossotto, I apologize for this
> cryptic email. Google isn't necessarily the best way to find people :-)
>
I'm the right person. * ZPlet is open-source, licensed under the
Artistic License, so provided you follow the terms of that license,
it's fine.

In response to other questions - an alx file is the file that the blackberry software loader uses to get the metadata (like .cod file information, app descriptions, etc.) for loading new applications onto the blackberry.

I've found some minor UI issues. Should we discuss them here, or move this discussion to the sourceforge zplet site?

- Mike

Well awesome. I guessing that the artistic license is similiar to GPL?

I think we can continue the discussion here, I should probably create my own sourceforge Z2me site for my code.

Thanks for contacting the author, I wasn't able to find his email before that worked :)

Troy

Mikem42
February 12th, 2005, 00:04
Troy, why don't we bring your changes into a branch on the existing sourceforge project. Should be simpler, it's already set up and that would keep all the variants of the code in the same place.

Anyway, after a little playing around with the app, it seems fairly solid although there might be some occasional odd behavior, but I haven't managed to pin anything down in that department yet. I've got a few comment/suggestions for UI improvements. I'm employed as a hardware validator, so finding problems and such is second nature, and I'll mention things that probably don't bother other people. I'll even mention things that don't actually bother me :-)

For save/restore, can we put those options in the menu so that they are quickly accessable? Or, since there is only one slot anyway, would it be possible to do a "save on exit/restore on start" with a "start over" option in the menu?
Performance seemed a little sluggish - was it compiled with optimizations turned on?
Not having a curser for command line editing is mildly disappointing
On long descriptions, there's no indication that there is more text lower than the input prompt.
On long descriptions, the top 2 lines (at least on my 7280's screen) are old text, not new text - one from the previous description + the just entered command
Would it be possible to change the background color of the command text entry area or possibly bold the font on the command text area to make it easier to read and detect typos?

Those are the quickie things that I noticed so far. As you can tell they are all pretty minor UI enhancement kind of things.

- Mike

GPF
February 13th, 2005, 05:17
Troy, why don't we bring your changes into a branch on the existing sourceforge project. Should be simpler, it's already set up and that would keep all the variants of the code in the same place.

Anyway, after a little playing around with the app, it seems fairly solid although there might be some occasional odd behavior, but I haven't managed to pin anything down in that department yet. I've got a few comment/suggestions for UI improvements. I'm employed as a hardware validator, so finding problems and such is second nature, and I'll mention things that probably don't bother other people. I'll even mention things that don't actually bother me :-)

For save/restore, can we put those options in the menu so that they are quickly accessable? Or, since there is only one slot anyway, would it be possible to do a "save on exit/restore on start" with a "start over" option in the menu?
Performance seemed a little sluggish - was it compiled with optimizations turned on?
Not having a curser for command line editing is mildly disappointing
On long descriptions, there's no indication that there is more text lower than the input prompt.
On long descriptions, the top 2 lines (at least on my 7280's screen) are old text, not new text - one from the previous description + the just entered command
Would it be possible to change the background color of the command text entry area or possibly bold the font on the command text area to make it easier to read and detect typos?

Those are the quickie things that I noticed so far. As you can tell they are all pretty minor UI enhancement kind of things.

- Mike

which version are you running? the Z2me version or the Blackberry version?

Mikem42
February 15th, 2005, 02:45
I think I'm using the blackberry version. I'm running the blackberryZ2me.cod file off the site that you sent to me in the personal message. Is that not the right one?

- Mike

GPF
February 15th, 2005, 05:06
I think I'm using the blackberry version. I'm running the blackberryZ2me.cod file off the site that you sent to me in the personal message. Is that not the right one?

- Mike


No thats fine, it just there are 2 different code bases for the 2 different ports. Since my cellphone an LG 1300C doesn't have a keyboard , you have to use the number pad to enter characters, I added a little T9 type interface so as you start typing a word, it looks it up in the zcode dictionary and tries to do automatic word detection instead of having to press each letter up to 3 or 4 times for each letter. and also uses the 1 key for all of the different directions. etc.

In the blackberry version I hacked that all out so I could get the keyboard working. I am not that familiar with that code though I hacked it together pretty quick and its been awhile since Iv looked at it. I'v been pretty busy lately so hopefully Ill get the code uploaded somewhere soon, so others can hack away with it if I dont get to it quickly :)

Troy

vinniet
February 17th, 2005, 18:14
Hi Troy,

Do you need help setting up a sourceforge project? Can I help in that area. I would like to see this project move forward. My Blackberry is now upgraded to MIDLET v2 and would like to see if we can put games larger then 64K.

Thanks,

Vinnie

GPF
June 2nd, 2005, 23:05
Z2me - Z Machine 3, ZCode Interpreter for J2ME
Version 0.1.0
http://gpf.dcemu.co.uk
[email protected]

Copyright (c) 2004 Troy Davis
All Rights Reserved
Licensed under the The Artistic License

Credits:
===================
Z2me is based in part on the Zplet ZCode interpreter by Matthew T. Russotto
More information may be found at http://sourceforge.net/projects/zplet/
and the complete Zplet code can be downloaded from there as well.

RandomAccessFile class from Firth Software
from http://www.firthsoftware.co.uk/RandomAccessFile.jsp

AdventureCanvas from Paul Rowland
from http://www.geocities.com/wirelessjava2002/adventure/

FastText input from Markku Korsumäki , I ported it to J2ME
from http://koti.mbnet.fi/korsu/ft.html

Thanks to everyone on j2me.org who answered my questions as I am learning j2me.


===================
Z2me is a ZCode interpreter for the J2ME environment.
ZCode is the intermediate language that was designed
and used by the original Infocom text adventure games.
Using Z2me, it is possible to package and play a large
variety of interactive fiction on your J2ME mobile device.

Z2me is shipped with the public domain game "MiniZork". This
is a demo version of the original Infocom Zork game. Refer to
http://gpf.dcemu.co.uk for more information about Z2me.

What's New
==========
- Initial release

Features
========
- J2ME MIDP 1.0 or greater, should run on most devices that have enough memory.
- Should run most Z-code programs of versions 3.
- Text completion(Z9) - can be enabled/disabled through menu.
- About screen through menu.
- Save/Restore support for 1 save file.
- key 1 , cycles through all of the directions (NORTH, SOUTH, etc)
- key 0 , cycles through some commands I frequently use. ( ',' , AGAIN , WAIT, AND)
- key * , cycles through the Z9 completed words
- UP/DOWN arrow keys scroll the screen.
- LEFT/RIGHT cycle through the last 10 commands.

Also a different Z3 zcode format file can be added to the jar file(remove minizork.z3 first) and then update the "Zfile" user defined property with the name of the new Z3 file in the jad file. Remembering to watch the file size of the jar depending on your cellphone limitations.

What's Missing
==============
- Multiple save/restore slots


Prerequisites
=============
- J2ME MIDP 1.0 capable device
- Enough memory to load the jar, load the zcode and host the heap.
The amount of memory will vary tremendously from one Z-Code game to the next.

Getting Started
===============
Install the JAR and JAD file to your mobile device.




Disclaimer
==========
Z2me is provided as-is. There is no warranty or guarantee that Z2me will work as advertised and
that it won't cause your mobile device any harm.

I hope you enjoy Z2me.

Midp1.0 version
===============
http://gpf.dcemu.co.uk/Z2me.jad
http://gpf.dcemu.co.uk/Z2me.jar

Source code
http://gpf.dcemu.co.uk/Z2me_src.rar

BlackBerry Version
===============
http://gpf.dcemu.co.uk/blackberryZ2me.alx
http://gpf.dcemu.co.uk/blackberryZ2me.cod
http://gpf.dcemu.co.uk/blackberryZ2me.cso
http://gpf.dcemu.co.uk/blackberryZ2me.rapc
http://gpf.dcemu.co.uk/blackberryZ2me.jad
http://gpf.dcemu.co.uk/blackberryZ2me.jar

Source code
http://gpf.dcemu.co.uk/blackberryZ2me_src.rar



Let me know how everything works or if you get it to work on other phones etc.

Thanks,
Troy

Mikem42
October 5th, 2005, 02:50
Hey, it's been a while, but I tried out the latest version posted to Troy's website and it works OK, but I'm not having much luck with using an alternate .z3 file. After some trials and reading up over at other forums (http://www.blackberryforums.com/showthread.php?t=762) I got a .cod file created, but when I load it, the normal Z icon doesn't appear. Has anyone had any luck swaping out .z3 files?

- Mike

wryun
January 15th, 2007, 07:41
Or maybe this message is better here (posted in the news thread by accident): Was hacking around with this, fixing up some UI issues and making it work 'nicer' on my MIDP 2 phone. Would it be better me to just put them somewhere, or would you like to upload them on your site?

GPF
January 15th, 2007, 17:44
Or maybe this message is better here (posted in the news thread by accident): Was hacking around with this, fixing up some UI issues and making it work 'nicer' on my MIDP 2 phone. Would it be better me to just put them somewhere, or would you like to upload them on your site?

Yeah, reminds me I should have posted my MIDP2 version long time ago lol.

Send it to me in email/pm and I'll post your version on my site if you like.

Troy(GPF)

powser
March 11th, 2007, 16:30
I'm still hoping to see a midp2 version of this! :)

GPF
April 5th, 2007, 00:39
Here is a midp 2.0 version improvement done by wryun.

I got it like 2 month ago and keep forgetting to update my site with it, so I am uploaded to this post so others can use it.

jad, jar and midp2 src are located in the zip file.

Sorry for the delay.

Troy(GPF)

Glex
April 26th, 2009, 15:56
zork on my cellphone
w00t!

S'Gues_
February 20th, 2010, 16:16
Can anybody reupload Z2meMidp2.zip to any filehosting server please?

Added:
Thanks for fixing the link above (or whatever's been fixed)!