Path: chuka.playstation.co.uk!news From: Alex Herbert Newsgroups: scee.yaroze.programming.2d_graphics Subject: Re: I can't stand it anymore! Date: Wed, 03 Jun 1998 15:36:13 +0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 51 Message-ID: <35755F5D.539FD4FE@ndirect.co.uk> References: <35736e0f.13097051@news.scea.sony.com> Reply-To: aherbert@ndirect.co.uk NNTP-Posting-Host: dialin0-57.ndirect.co.uk Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 4.04 [en] (Win95; I) To: Antony Arciuolo Antony Arciuolo wrote: > For the longest time I tried to load a TIM picture and printf its > properties to the console. I always get noise, not proper data. I was > so thankful when I stripped the code down to nothing but the loading > code. Now I'm trying to put other code back in, and I finally think I > figured out what was wrong... It seems that the allocation of all > those ordering tables is OVERWRITING the data of the TIM files! I > can't come up with any other explanation! > > I load the code at 0x80090000, > then a 4-bit TIM at 0x800A0000, > then a 8-bit TIM at 0x800B0000, > then a 24-bit TIM at 0x800C0000 > > and it doesn't work. > > I comment out the global variables for the ordering tables stuff and > it does work. I leave the code in, but > > I load a 4-bit TIM at 0x80090000, > then a 8-bit TIM at 0x800A0000, > then a 24-bit TIM at 0x800B0000 > then the code at0x800D0000. > > and it works, kind of (it freezes 1/2-way through the code). > > WHAT THE HELL IS WRONG?! > > I will ask the stupid question. How do you load files into main memory > and prevent them from being overwritten by the code allocating memory? Right, the other members on this group obviously know what they're talking about, and I'm sure it's quite simple once you know the answers. However, I use Code Warrior 2, and have done since day 1 with my Yaroze. I've never even loaded the GNU stuff! CW really does make things simple (once you've got over the initial setup). Just click on the Complile/Debug button and the program is transfered. Then your program can safely allocate memory with malloc() and load files from the PC dynamically. This solves all sorts of memory issues. I like CW2 and I don't know why more people don't use it. (No need to get into the CW vs. GNU argument again folks!). Herbs.