Zsnes

bridged with qdn.public.qnxrtp.games
Post Reply
Kosta K

Zsnes

Post by Kosta K » Mon May 21, 2001 6:29 pm

Ok, i am determined to have a goood sns emulator on QNX6. I need hints,
how-tos... anything, that would help on porting something like this.

Can anyone offer me any tips especially since i've never ported aplications
before?

Thanks,
Kosta.

--

Webpage: http://members.nbci.com/gwurb/

Travis Coady

Re: Zsnes

Post by Travis Coady » Mon May 21, 2001 8:53 pm

Hi,

Me and a nd a few other people at irc.qnxstart.com #qnx have been
working on getting ZSNES working, and there have already been some patches
sent to the CVS for inclusion, so we may see a working version of ZSNES on
QNX6 soon (assuming SDL gets fixed soon ;)). The tweeks that were done were
quite minimal, for example:

....
void MakeCodeWriteable (unsigned long startaddr, unsigned long length)
{
int r;
unsigned int addr;
int psize = getpagesize();


//fprintf(stderr, "Unprotecting 0x%x to 0x%x\n", startaddr,
startaddr+length);
addr = (startaddr & ~(psize -1)) - psize;

r = mprotect ((char *) addr, length + startaddr - addr + psize, 7);

if (r < 0)
fprintf (stderr, "Error! Memory *NOT* unprotected.\n");

}
....

This was a landmind of issues for QNX6 for two reasons, one getpagesize()
was commented out of unistd.h (meaning ZSNES couldnt get the systems page
size), and two the following line would only work in linux:

r = mprotect ((char *) addr, length + startaddr - addr + psize, 7);

Nottice the 7? Not a very posix-compliant thing to do, however, this was
quickly corrected by changing it to this:

r = mprotect ((char *) addr, length + startaddr - addr + psize, PROT_READ |
PROT_WRITE | PROT_EXEC);

As for the getpagesize() issue, we used the following quick hack:

#ifdef __QNXNTO__
#define getpagesize() 4096
#endif

Yes, it is sometimes just that simple ;)

Other little things had to be done, for example, it was littered with
#ifdef __LINUX__, which ment a great deal of code would not be compiled,
simply adding #define __LINUX__ fixed it rather quickly. Emmm... I think
thats about it, if you have any questions just ask ;)

Travis "TheAlien" Coady
smallfri@bigfoot.com

"Kosta K" <kosta_k@phreaker.net> wrote in message
news:9ebmgg$p4l$1@inn.qnx.com...
Ok, i am determined to have a goood sns emulator on QNX6. I need hints,
how-tos... anything, that would help on porting something like this.

Can anyone offer me any tips especially since i've never ported
aplications
before?

Thanks,
Kosta.

--

Webpage: http://members.nbci.com/gwurb/


Kosta K

Re: Zsnes

Post by Kosta K » Tue May 22, 2001 2:21 am

oops, i might have just replied to you instead of the group.

I apologize for that.

If you wish, please post it back up here, it might help out someone else
too. Thanks

Apologize,
Kosta.

--

Webpage: http://members.nbci.com/gwurb/

Sir Charles

Re: Zsnes

Post by Sir Charles » Tue May 22, 2001 6:23 am

Ok, i am determined to have a goood sns emulator on QNX6. I need hints,
how-tos... anything, that would help on porting something like this.

Can anyone offer me any tips especially since i've never ported
aplications
before?
if I recall, there's something like 'Snes9x' around somewhere. I haven't
tried it out yet. I think I got it from the qnxstart FTP site (which I've
been unable to get into as of late).

--Charles

Travis Coady

Re: Zsnes

Post by Travis Coady » Tue May 22, 2001 9:45 am

Hi,


Snes9x has been broken for awhile....

Travis "TheAlien" Coady



"Sir Charles" <nospam@chalz-of-internetusa.net> wrote in message
news:9ed0em$in1$1@inn.qnx.com...
Ok, i am determined to have a goood sns emulator on QNX6. I need hints,
how-tos... anything, that would help on porting something like this.

Can anyone offer me any tips especially since i've never ported
aplications
before?
if I recall, there's something like 'Snes9x' around somewhere. I
haven't
tried it out yet. I think I got it from the qnxstart FTP site (which I've
been unable to get into as of late).

--Charles

Post Reply

Return to “qdn.public.qnxrtp.games”