Path: chuka.playstation.co.uk!tjs From: tjs@cs.monash.edu.au (Toby Sargeant) Newsgroups: scee.yaroze.freetalk.english Subject: Re: openGl from yaroze conversion Date: 29 Jun 1999 23:38:37 GMT Organization: PlayStation Net Yaroze (SCEE) Lines: 31 Message-ID: References: <37702400.7AFE4B6B@breathemail.net> <930348110.639671215@www.netyaroze-europe.com> <7lb3ih$11116@chuka.playstation.co.uk> NNTP-Posting-Host: longford.cs.monash.edu.au X-Newsreader: slrn (0.9.4.3 UNIX) On Tue, 29 Jun 1999 19:20:34 +0100, Graeme Evans wrote: >Hmm and if you could do a graphics interface library then the biggest hurdle >to compiling yaroze code on the pc is pointers to fixed locations in memory. >I was daydreaming about that for a while, and i realised the easiest way >round that is to use the R3000 compilers and emulate the R3000 code and >memory, trap out the most common function calls to the static library and >route them to PC native versions (stuff like abs() and the like). bout six >months ago i thought that would be cool and wrote an R3000 emulator but i >really cant be bothered doing the function trapping. It might make a nice >summer conversation piece project and turn into a real cool debugger, if >anyone wants the code i'll mail you a copy. > >your HAckER DUde friend > >graeme A lot of R3K instructions are register relative. The coolest way to do this would be to convert the MIPS back into GCC RTL, and then have GCC recompile it, performing x86 optimisation as it goes. Then you just mprotect() all the read/writeable memory on the PSX, and then on the first trap, do on the fly recompilation to turn the invalid memory access to a valid access (in the case of ram) or a function call (in the case of ROM or HW access). Because relatively few instructions refer directly to main memory (i.e. generally only the lui/addiu pairs that make 32 bit addresses for indexed addressing) When you perform one adjust, you'll get rid of whole swathes of invalid accesses, so the partial recompiles should be relatively infrequent. Of course, having said this, I think it'd be insanely difficult, and noone in their right mind would _really_ want to do it... Toby.