Announcement: Be excellent to each other.


Caravel Forum : Caravel Boards : Development : DROD for GP2X
New Topic New Poll Post Reply
Poster Message
Hal9000
Level: Goblin
Rank Points: 16
Registered: 05-14-2007
IP: Logged
icon DROD for GP2X (0)  
Hello,

I am trying to port DROD-TCB to GP2X, a linux based handheld video game console.

I already managed to recompile all needed libraries and DROD itself, but I am now facing a runtime problem.

I get these error message:

drod: Assertion error in line 1227 of /home/julien/dev/drod-arm/DRODLib/DbBase.cpp: "dwNewMessageTextLen == WCSlen(pwczNewMessageText)"

Then:

Problem Starting DROD: DO olntla eti ie hti ed. r lsn te plctost aemr eoyaalbe I' lopsil htflsaemsigo orpe,adrisaln RDwudfxti rbe.DO ' a ucagrcran ihesdn labsi.Esyzd emrdate plctospu vi lsd éor ipnbe I s us osbeqedsfcir aqeto oetcrops t

(yes, it is a silly error message)

The error number (dwMessageID) is 466.

Could anyone who has a deep knowledge of the DROD code help me?

Thanks!
05-21-2007 at 09:57 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Neathro
Level: Delver
Avatar
Rank Points: 41
Registered: 04-24-2007
IP: Logged
icon Re: DROD for GP2X (0)  
Try mrimer.
Or possibly erik.
Or Mattcrampy.

____________________________
This is not a signature, it is a
collection of randomly selected
words. Teaspoon.
05-21-2007 at 10:30 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Stefan
Level: Smitemaster
Avatar
Rank Points: 2119
Registered: 05-25-2004
IP: Logged
icon Re: DROD for GP2X (+3)  
Hal9000 wrote:
Problem Starting DROD: DO olntla eti ie hti ed. r lsn te plctost aemr eoyaalbe I' lopsil htflsaemsigo orpe,adrisaln RDwudfxti rbe.DO ' a ucagrcran ihesdn labsi.Esyzd emrdate plctospu vi lsd éor ipnbe I s us osbeqedsfcir aqeto oetcrops t
That error message seems to be missing every other character in it (it seems to start with "DROD couldn't load ..."). Probably some string being misinterpreted as a WSTRING (the assertion error would also suggest something of the sort), or something like that...
The error number (dwMessageID) is 466.
This is the error for "Could not load resources". Are you supplying the program with data (the .dats)? The data files needed to run the program are not included in the source package.

You could try running the program with the environment variables "DROD_3_0_RES_PATH" and "DROD_3_0_DAT_PATH" pointing to the location of your game data (copied from one of the official distributions).

Edit: Also, have you applied the patches trick posted in the source thread?

Another edit: The full error message is "DROD couldn't load certain files that it needs. Try closing other applications to make more memory available. It's also possible that files are missing or corrupted, and reinstalling DROD would fix this problem." followed by "DROD n'a pas pu charger certains fichiers dont il a besoin. Essayez de fermer d'autres applications pour avoir plus de mémoire disponible. Il est aussi possible que des fichiers manquent ou soient corrompus, et réinstaller DROD fixerait ce problème."

Edit 3: Another thought that comes to mind would be that the WCHAR has a different length on your platform. sizeof(WCHAR) should be 2 (WCHAR is an unsigned short), so if it's 4 for some reason, the above could also happen (I think).

Oh yeah, DISCLAIMER: I'm not in any shape or form a C++ developer, let alone a cross-platform one. I do know my way around the DROD code, though.

Edit 4: trick would be the man to ask, I think. He's the one who ported DROD to Linux.

____________________________
0.099³

[Last edited by Stefan at 05-22-2007 12:55 AM]
05-21-2007 at 11:34 PM
View Profile Send Private Message to User Show all user's posts This architect's holds Quote Reply
trick
Level: Legendary Smitemaster
Rank Points: 2580
Registered: 04-12-2003
IP: Logged
icon Re: DROD for GP2X (+1)  
Well, the first thing I'd do is getting the error message to show properly. Try commenting out loading of error text from the DB and make it fall back to the defaults (in DisplayInitErrorMessage in Main.cpp), which will convert from ASCII to UCS-2 (little endian) and then back to ASCII if text can't be loaded from the DB, so it's a good test to see if the Unicode stuff works. Look at Wchar.h, Wchar.cpp and CharTraits.h in BackEndLib, and look in the debugger at how WCHAR strings look in memory. For text converted from ASCII, it should be ASCII char, zero, ASCII char, zero, etc.

Anyways, I'm not sure if it's worth it trying to get this to run on the GP2X in the first place. The GP2X has 64 mb ram, and only 32 mb of that is available to pure Linux apps like DROD. That's probably not enough to run DROD without some serious hacking, at least for JtRH and TCB :(. Even if it was, the GP2X is only 200mhz (well, it's got two 200mhz cpus, but only one is available for pure Linux apps), and that might be a tad slow for this implementation.. AE might have a better chance of working though.


[Last edited by trick at 05-22-2007 02:17 PM]
05-22-2007 at 01:21 PM
View Profile Send Private Message to User Send Email to User Show all user's posts Quote Reply
Hal9000
Level: Goblin
Rank Points: 16
Registered: 05-14-2007
IP: Logged
icon Re: DROD for GP2X (+3)  
It works!

There is no sound, no control, but I can run DROD and see the demo running on my GP2X!

Many thanks to Stefan, who were right on its diagnostic: shorts were 4 bytes on my system, I had to change a compiler flag.

OK, to be honest, my result is not that good: As trick said, 32 meg is not enough to run DROD without some hacks. To make it work, I had to use a part of my SD card as swap memory, which can only be a temporary solution, because it is known to dramatically reduce life time of SD cards. Furthermore, and probably because of the use of swap, the game is very slow on startup.

However, I think it is a very promising result. I will now work on the reduction of DROD memory consumption. As trick said, GP2X has 32MO of memory, plus 32 MO of "upper memory", not usable by the OS (no MMU).

Here is what I plan to do:
- Remove all dependancies which are not needed in this version.
- Switch all surfaces to 16bpp. The GP2X display can only do 16 bpp anyway.
- Use a hacked version of SDL to load all Surfaces into the upper memory (works only in 16 bpp)

Any idea to save some memory would be much appreciated.


[Last edited by Hal9000 at 05-22-2007 09:34 PM]
05-22-2007 at 09:23 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Hal9000
Level: Goblin
Rank Points: 16
Registered: 05-14-2007
IP: Logged
icon Re: DROD for GP2X (+3)  
After some attempt to find a solution to the lack of memory problem, I have (temporarily?) given up the port of TCB, and started porting DROD-AE.

And it works fine! I have adapted the interface and the graphic output, and the game is really nice and enjoyable on the console.

To handle the low resolution of the screen (320x240), I have included several graphic mode: a fullscreen one, where the original graphics are shrinked by a factor 2, and two "virtual screen" modes, where only a part (50% or 75%) of the drod screen is visible. Switching from one mode to another, or moving the visible part of the visual screen can be done during the game with one key stroke.

These screenshots illustrate both full-screen and virtual-screen modes:

http://julien.carme.free.fr/drod1.jpg
http://julien.carme.free.fr/drod2.jpg

I will release this version very soon on a GP2X dedicated website. I hope some of you will have the opportunity to try it.
And I am sure that it will make a part of the GP2X community join the DROD community.

06-10-2007 at 03:55 PM
View Profile Send Private Message to User Show all user's posts Quote Reply
Ezlo
Level: Smitemaster
Avatar
Rank Points: 1214
Registered: 01-08-2006
IP: Logged
icon Re: DROD for GP2X (0)  
Cool! I have a friend who has a GP2X. Maybe with this he'll finally try DROD. Congratulations on a successful porting! :)
06-10-2007 at 04:34 PM
View Profile Send Private Message to User Send Email to User Show all user's posts This architect's holds Quote Reply
New Topic New Poll Post Reply
Caravel Forum : Caravel Boards : Development : DROD for GP2X
Surf To:


Forum Rules:
Can I post a new topic? No
Can I reply? No
Can I read? Yes
HTML Enabled? No
UBBC Enabled? Yes
Words Filter Enable? No

Contact Us | CaravelGames.com

Powered by: tForum tForumHacks Edition b0.98.8
Originally created by Toan Huynh (Copyright © 2000)
Enhanced by the tForumHacks team and the Caravel team.