Path: chuka.playstation.co.uk!news From: Developer Support Newsgroups: scee.yaroze.beginners Subject: Re: Memory address selection? Date: Wed, 09 Jul 1997 08:56:54 +0100 Organization: PlayStation Net Yaroze (SCEE) Lines: 54 Message-ID: <33C34446.520@interactive.sony.com> References: <33C3449A.34EB@hotmail.com> NNTP-Posting-Host: 194.203.13.10 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Mailer: Mozilla 3.01 (Win95; I) wardster1@hotmail.com wrote: > > Hi there... > > I got the Yaroze only a few days ago, but something has got me confused. > Why do I have to choose hexadecimal value memory addressed for any data > files that I choose to use (seq, vab, 3d objects etc.). The convention on PlayStation is to use hexadecimal addressing; the PC programs that directly communicate with the PlayStation will use them, so it's easiest to stick with them throughout rather than converting to decimal. > > Does anyone have any information regarding the choice of memory adresses, > for example, what is the top/bottom address, do I have to allocate a > certain amount of memory etc. > > Any comments would be appreciated.... > > See ya. The Yaroze memory is 2Mb of main RAM from 0x80000000 - 0x801fffff. The video RAM and sound RAM are 1Mb and 0.5Mb each respectively, and the addresses for them are not disclosed as they are acccessed via library calls. The Yaroze kernal and base library take up the memory from 0x80000000 - 0x8008ffff, so Never load anything before 0x80090000; this is effectively the starting address. The top address is 0x801fffff, but the stack grows down from that point, so best to leave it some space; hence you can take values like 0x801f0000 or 0x801ff000 as the top-most address. As regards allocation, you can use whatever bits of RAM you like, as long as you avoid conflict with data files (TIM, TMD, SEQ, VH, VB, etc) and with program space; you can use dynamic memory allocation, or static allocation (eg declaring global arrays) or you can directly set where you want a buffer to be, e.g. u_long *memoryBuffer1; // pointer: // treatable as base of array memoryBuffer1 = (u_long*) 0x80090000; // set the memory location of memory buffer you can define memory buffer areas quite easily, and if you define a bottom and top address for each, and check against these values when getting memory, all will be fine. Note: in the makefile of a project, specify the linker option that forces generation of a mapfile (lots of the SCEE samples do this). The mapfile shows you exactly where things are and how much space various parts of your program are consuming; very useful for spotting subtle conflicts. Lewis