forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problems building snes9xTYL 0.4.2me from source

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
astfgl



Joined: 13 Jul 2007
Posts: 7

PostPosted: Mon Jul 16, 2007 10:09 pm    Post subject: Problems building snes9xTYL 0.4.2me from source Reply with quote

Hello everybody,
I'm trying to build snes9xTYL 0.4.2me from source on MacOS X (10.4.10) with the PSPSDK ('psp-gcc -v' says 4.1.0). The precompiled version runs fine on my 3.40-A OE PSP and I just replaced the eboot to run the one I compiled.

I had to make a few changes to get it to compile (IMHO Mostly caused by not using cygwin, but a real *NIX) and it does now without any errormessages. It even starts, but once I choose a game it simply crahes with that BSOD:

Quote:
Exception - Bus Error (data)
EPC - 08A08F3C
Cause - 1000001C
Status - 60008613
BadVAddr - 81810860


If someone want's to read the full dump: I took a shoot.
(btw: is there a better way than taking a camera - can I dump this into a file? The OE-screenshot-module didn't work...)

Using psp-addr2line I found the error occured in line 516 of the file tile_psp.cpp (I put a copy here), which seems to handle the "psp-accelerated"-graphicsmode. Having found that I switched to softwaremode, and found everything running - though slower, as of the nature of softwaremode.

I did some experiments then:
I started with sw-mode and then switched to psp-mode. Doing that I found there are several very similar functions in tile_psp.cpp (all named: pspDraw*Tile16) and the program crashes always in one of these on the second line:

Code:
cache_ptr=tile_insert_cache(current_bitshift,TileKey);

u=(cache_ptr->text_idx&63)<<3; //here's the crash
v=(cache_ptr->text_idx>>6)<<3;


I then had a look at tile_insert_cache() which is in the same file on line 154...

Code:

// insert a new tile in cache

INLINE tile_cache_t *tile_insert_cache(int cache_num,u32 key){   
   tile_cache_t *p=tile_cache_ptr[cache_num][key&TILE_HASH_MASK];
   tile_cache_t *q;

   //get first free cache entry
   q=tile_cache_first_free[cache_num];      
   if (!q) {//error cache full      

      //debug_log("**tile cache full!");
      return NULL;
   }
   tile_cached[cache_num]++;

   //tile_cached_line[cache_num][key]++;
   //update first free
tile_cache_first_free[cache_num]=tile_cache_first_free[cache_num]->next;   

   //update new cached tile data
   q->next=NULL;
   q->key=key;
   q->used=render_timestamp;
   if (!p) {//insert first   
      tile_cache_ptr[cache_num][key&TILE_HASH_MASK]=q;
   }else{//insert at end
      for (;;){
         if (p->next) p=p->next;
         else {p->next=q;break;}
      }
   }
   return q;
}


...and tend to think that the problem is, that the U=-call tries to derefence the pointer after the function before ran through the part marked with: debug_log("**tile cache full!"); which puts it to NULL.
(I assume that because I found a thread where someone says that cause: 1000001C means "dereferencition of a NULL-pointer". Is there a list of causes somewhere around?)


I suppose the developer did compile it as is (I already asked in his forum but didn't get an answer) - and something has been changed in the SDK. So if anybody with greater knowledge than mine could point me to what this might be, would be great!

Thanks in advance...
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group