www.digitalmars.com         C & C++   DMDScript  

D.gnu - linux-powerpc trouble

reply Marcel Unbehaun <frostworks gmx.de> writes:
All in all gdc works very good on my " ppc 7447/7457, altivec supported CHRP
Pegasos2 GNU/Linux",
but one error always comes back:
I'm trying to build the famous aba-games on my machine - several build/work
good.
But all those which use a routine in "barrage.d" to initialize bulletml crash
at the same part:

http://paste.dprogramming.com/dpknqggs.php

As I don't know how long my pasted entry above exists (?) - I better paste a
copy here, too:

-------------
  public static BulletMLParserTinyXML* getInstance(char[] dirName, char[]
fileName) {
    if (!parser[dirName][fileName]) {
      char[] barrageName = dirName ~ "/" ~ fileName;
      Logger.info("Loading BulletML: " ~ barrageName);
      parser[dirName][fileName] =
        BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/"
~ barrageName));
      BulletMLParserTinyXML_parse(parser[dirName][fileName]);
    }
    return parser[dirName][fileName];
  }


This is a part from barrage.d from ABA-games Val&Rick.
I built it with 3.4.5& gdc-0.19
It also exists in other games & they all crash in this region on a linux-powerpc
system! (torustrooper, tumikifighter, (mu-cade))
The problems in similar non-aba games from http://homepage2.nifty.com/isshiki/
maybe have the same reason:
these games (GradleUnsion, z-lock) build, but either shots, or enemies are
missing
Parsec47 uses a similar routine to handle bulletml, but there it works.
Valgrind prints this line as 1st error:
   if (!parser[dirName][fileName]) {

Would be great if someone could look into this...
--------------

Thanks a lot for attention!

friendly,
Marcel "frostwork" Unbehaun
Nov 23 2006
parent reply Carlos Santander <csantander619 gmail.com> writes:
Marcel Unbehaun escribió:
 All in all gdc works very good on my " ppc 7447/7457, altivec supported CHRP
 Pegasos2 GNU/Linux",
 but one error always comes back:
 I'm trying to build the famous aba-games on my machine - several build/work
good.
 But all those which use a routine in "barrage.d" to initialize bulletml crash
 at the same part:
 
 http://paste.dprogramming.com/dpknqggs.php
 
 As I don't know how long my pasted entry above exists (?) - I better paste a
 copy here, too:
 
 -------------
   public static BulletMLParserTinyXML* getInstance(char[] dirName, char[]
 fileName) {
     if (!parser[dirName][fileName]) {
       char[] barrageName = dirName ~ "/" ~ fileName;
       Logger.info("Loading BulletML: " ~ barrageName);
       parser[dirName][fileName] =
         BulletMLParserTinyXML_new(std.string.toStringz(BARRAGE_DIR_NAME ~ "/"
 ~ barrageName));
       BulletMLParserTinyXML_parse(parser[dirName][fileName]);
     }
     return parser[dirName][fileName];
   }
 
 
 This is a part from barrage.d from ABA-games Val&Rick.
 I built it with 3.4.5& gdc-0.19
 It also exists in other games & they all crash in this region on a
linux-powerpc
 system! (torustrooper, tumikifighter, (mu-cade))
 The problems in similar non-aba games from http://homepage2.nifty.com/isshiki/
 maybe have the same reason:
 these games (GradleUnsion, z-lock) build, but either shots, or enemies are
missing
 Parsec47 uses a similar routine to handle bulletml, but there it works.
 Valgrind prints this line as 1st error:
    if (!parser[dirName][fileName]) {
 
I haven't looked at the code, but if either parser or parser[dirName] are AAs, maybe you should change that line to a "in" expression (or a couple of them.)
 Would be great if someone could look into this...
 --------------
 
 Thanks a lot for attention!
 
 friendly,
 Marcel "frostwork" Unbehaun
-- Carlos Santander Bernal
Nov 23 2006
parent reply Marcel Unbehaun <frostworks gmx.de> writes:
Hi!

Thanks a lot for the fast reply!
Would you please give an example of what you mean?
I forgot to mention that I can't program :(
friendly,
Marcel
Nov 23 2006
parent reply Carlos Santander <csantander619 gmail.com> writes:
Marcel Unbehaun escribió:
 Hi!
 
 Thanks a lot for the fast reply!
 Would you please give an example of what you mean?
 I forgot to mention that I can't program :(
 friendly,
 Marcel
Again, I have not seen the code, but I think this might solve your problem. Basically, you have this line: if (!parser[dirName][fileName]) Change it to: if (! (fileName in parser[dirName])) If it compiles, fine. If it doesn't, that means my assumption is wrong. If it compiles, see if your program works now. If it doesn't, it means that a further look to the code is needed. -- Carlos Santander Bernal
Nov 23 2006
parent reply Marcel Unbehaun <frostworks gmx.de> writes:
Thanks for detailed explanation!
The changed code compiles but unfortunately it still crashes
in the same line. :(
Nov 23 2006
parent reply Marcel Unbehaun <frostworks gmx.de> writes:
I just found s.th. which maybe mighty be interesting:
Before the pasted function there's a line
"if (getExt(fileName) != "xml")"
When I comment out this the game crashes later in the process:
at texture.d:28
The first lines there are
 public static SDL_Surface* loadBmp(char[] name) {
    if (surface[name]) {
      return surface[name];
    } else {
      char[] fileName = imagesDir ~ name;

The crashing line 28 is "if (surface[name]) {".
When I comment out the if-else routine, the game loads till the title screen
(when starting to play it crashes, probably as of missing bulletml-stuff)
Nov 23 2006
parent Marcel Unbehaun <frostworks gmx.de> writes:
To close this thread in case some other powerpc people are trying this:
i successfully built all aba-games but mu-cade on linux-powerpc.
(tumiki is unfinished though atm - i.e. the boss-routine doesn't like to work
yet).
i'll release my changes soon...
Jan 10 2007