Monday, September 25, 2006

PIF fixes

It's about time I posted an update with news of some of the things I've been working on! Annoyingly the '.' key on my keyboard has decided to stop working so apologies in advance for any dodgy punctuation :)

I've been having a look at fixing a couple of issues related to the way that Daedalus handles the N64 PIF (peripheral interface) emulation. The PIF is responsible for a number of different functions, including:


  • Reading the controller status

  • Reading/writing to the eeprom

  • Reading/writing to the controller mempak



Access to the PIF is controlled through a 64 byte region of memory. Writing to this area triggers the PIF to interpret the block of data as a sequence of commands (such as those listed above), and the CPU can read back from this region to obtain the results.

Correctly handling the way the block is formatted is key to emuating the PIF accurately. Over the years I've rewritten this code several times as I've fixed bugs, each time fixing certain incorrect assumptions made during the previous version. Usually these assumptions were made on incredibly useful, but incomplete information (such as early docs from LaC (*waves*) ) which described how to use the PIF rather than how to emulate it. Unfortunately there was lots of gaps in this information and so I'd keep finding roms that used the PIF is various ways that I'd not taken into account.

A few years ago I stumbled across something rather amazing - a document which described the PIF hardware in great detail. Not only was it very thorough - including details on all the various formatting commands I'd spent hours reverse engineering - it also included an insane amount of detail on things such as the chip timings and the even method by which the PIF is used as a 'security system' to lock out pirated roms.

What was this document? Did I find it tucked away on some obscure N64 hacking site? No - it was US Patent 6,394,905, filed by Nintendo in September 2000. Genius!

There are actually a whole series of N64 patents (see 5,426,762 and 4,799,635 for a couple of other similar examples.) It's not all good news though because unfortunately they're all written in a horribly convulted form of Legalese:

There are six JoyChannels available in the present exemplary embodiment. Each Channel's transmit data and receive data byte sizes are all independently assignable by setting size parameters. In the exemplary embodiment, all six channels size parameter setups are required, whether they are used or not.


Ouch.

This is the statement I spotted a couple of weeks ago that explained why one of the previous assumptions I'd made wasn't working in all cases:

If the 64 bit CPU 100 wants to change JoyChannel's Tx/RxData assignment, a 32 bit format flag is used, where a certain bit(s) specify the desired format. For example, when Wr64B or Wr4B is issued when this flag is "1", PIF executes each JoyChannel's Tx/RxData assignment based on each channel's Tx/Rx Size. In other words, unless this flag is set to "1" with Wr64B or Wr4B, Tx/RxData area assignment does not change. After Tx/RxData assignment, this flag is reset to "0" automatically.


After painfully wading through the text, it's basically saying that if you write a '1' to the last byte of the PIF block, you need to reformat all the channels. Otherwise you just assume the same formatting as the previous command.

The bug that I've since fixed was actually caused by two problems. Firstly, I was reformatting the channels regardless of how this last byte was set. I'd assumed that it was always set to '1' by the CPU to indicate that a command was ready, and set to '0' by the PIF when it was finished executing. In a few roms I was seeing '0' being written, but I didn't know why. Quite often when I saw them do this they'd hang shortly aftwerwards.

The other problem that contributed to the bug was that I was accidentally overwritting the 'Tx/RxData assignment' area with 0 as I was processing the PIF block (actually, I was clearing the top 4 bits of each byte, rather than just the top 2). This meant that when I reformatted the Tx/RxData assigments the areas were smaller than expected, so the PIF handling code would abort and return with failure.

These two problems combined to cause certain roms to get confused and hang when trying to access the mempak. The total fix was a few dozen lines of code to separate out the PIF formatting from the command execution, and a single-line fix for the second issue. All the roms I found exhibiting this issue now make further progress (hooray!) There may well be other issues that have been resolved with this fix too :)

It's bedtime for me now (well, maybe a little Dead Rising on the 360 first :) I'll try and get back into the habit of updating a bit more often from this week on. Sorry if I've not replied to your email - it's not personal, it's just me being rubbish.

-StrmnNrmn

336 comments:

«Oldest   ‹Older   201 – 336 of 336
Mario Kart God said...

200 comments is a lot!!!!

Morgan said...

Ryan go to dcemu and find wally's v1.2 spiff up. No speed increase but alot of graphic fixes.

omgnintendo64 said...

while you wait for an update go here http://tvlinks.50webs.com/index.html its nucking futs

shallowlife said...

Thanks omg nintendo64 !! , iam off watching drawn together ^^

omgnintendo64 said...

i put 5 dollars on oct 26 for an update

kekpsp said...

man you guys must be boring the shit out of poor Strmn, he's probably reading his blog and thinking why do I bother. Come on think positively and give him some support and praise, he deserves it WELL DONE STRMN AND THANKS FOR YOUR HARD WORK
:)

milo22 said...

I put $20 on Oct. 25 because that would be the 2 month anniversary of R8.

thedman said...

100 dollors on tomrow

shallowlife said...

1 testicle on yesterday!

thedman said...

HAHAHAHAHAHA

RyanMWolfe said...

Hey guys with wally's spiff up can i save on Zelda OOT????? please let me Know

thedman said...

ya u can but its really confusing

some one wil tel u the exact way

RyanMWolfe said...

Thanks D-Man i hope someone tells me how

Sroon said...

okie Ryan...
I have found out how to save On Zelda!


1-just play the game

2-when u want to save press start and save the game

3-when the saving is finished and your back in the game press select press it again so yer back in the game, then press it 1 more time(total of 3 times)

4-then press triangle to go back to the emulator menu

5-then load Zelda again.

note: you will know that it works cuz when u load Zelda the second time the Mem stick will flash fer about 10 sex!

I hope tit helped!
Ovwar

Armen said...

http://i12.photobucket.com/albums/a224/risio/8.jpg or this http://www.emutalk.net/attachments/high-resolution-textures-projects/26849-federellis-retexture-pack-zelda-oot-mq-chest.jpg or this http://www.emutalk.net/attachments/high-resolution-textures-projects/26867-federellis-retexture-pack-zelda-oot-mq-item.jpg

thedman said...

what ? oh and i lost :(

Sroon said...

So did my little tutorial help guyz?
I hope tit did!
or do you need further instructions
if you do just go to Dc emu n PM yer email to me n il guied you through it!

PSDroideka said...

I wonder if StrmnNrmn is just waiting for 300 comments lol

eaziemart said...

Hi,
Are you looking for Unlimited PSP Game Downloads? I will expose you to the largest database network where you will find the Top Most Popular PSP Games Websites with hundreds of PSP Game Downloads.Please visit this site,PSP Game Downloads

Armen said...

Fucking piece of shit spammers get the fuck of strmn's blog and people who are supporting piracy are fags

shallowlife said...

Too bad this project has slowed down ! :(

I just wish the psp games wouldnt suck so much!

shallowlife said...

Why would I pay for those shit sites if i can get all that for free ?

f*ck off !

milo22 said...

I think strmnnrmn abandoned this project. oh well :(

Morgan said...

I am starting to lose faith, like if he was okay wouldn't he at least post something. I just hope he's okay.

salomon st said...

i bet u guys would feel pretty dumb if all of the sudden he updated saying the emulator ran almost full speed

Imtiaz said...

"I'll try and get back into the habit of updating a bit more often from this week on." I guess this habit is difficult to attain. Sucks for us.

tsurumaru said...

Real life often intervenes when we don't want it or least expect it to.

Suck it up and be patient, he'll update us when he can.

RyanMWolfe said...
This comment has been removed by a blog administrator.
thedman said...

AWSOME 230TH POST OWEND WOOT

___>>---skulz--->___ said...

Hey, not strmnnrmn, he never have abandoned the project, NEVER. But why stmnnrmn dont post a word?!?! what's the problem thath keep him away from his blog? Please Stormin UPDATE US!!! don't forget that you are my hero. You are an hero not a dumbass, plz...

jas_pollo said...

obviouly strmnnrmn has left this project....
stop posting...
boring....or say something strmnnrmn!!!!

PSDroideka said...

Hes probably still playing Dead Rising, its a pretty cool game lol. Guys just relax he wont quit without good reason or telling anyone, hes just that sort of bloke it would seem

shallowlife said...

Project is dead , I will stop posting now. I doubt he will ever update this again , cya guys! ( maybe there will be some Ps1 Emu Blog sometime) ^^

milo22 said...

Just look at the PC side of Daedalus.
http://daedalus.boob.co.uk/
He abandoned it in 2003, but he still wanted to continue.

Lodis said...

Regardless of how busy life gets, it only takes a few seconds to tell the people who have been supporting your project that you are ok but busy. I am more interested in Ps1 emulation but I really thought this project was going somewhere pretty fast. When you look at the Psp scene you will know why people's faith is lost so easily. Goodbye everyone.

Lodis said...
This comment has been removed by a blog administrator.
wally*won_kenobie said...

guys seriously strmnNrmn is probably working away as hard as possible on this emulator to try and get most of the stuff we want out.

Instead of releasing build after build week after week. WIP after WIP he might as well go all the way..

He could have even
a) Got married and honeymooning
b) moved next door to mario kart god
c) Living in monster land

Who cares!!! Hes still around somewhere and im sure soon enough he will pop back up out of the platinum case and show us what he has REALLY been up to!!

Be patient and wait!

thedman said...

YOU GUYS DID NOT QUIT NO U DIDN'T *snaps fingers* look norms busy but that dosent mean you should just give up give him like a another month and after 2 months of not posting MAYBE you can consider teh project SLOWED DOWN okay guys koolio

Morgan said...

I'm still confident StrmnNrmn is working on Daedalus and I'm hyped up to the max of the thoughts of what he's got done in 2 months. I do just wish he would update us with something though, at least saying he's alright. None the less though I'll be waiting patiently!

limp tittie said...

maybe its because r8 came out so fast, but theres been no new posts for about a month, it might be possible that daedalus has been dicountinued, but im not saying anything for sure.

limp tittie said...

but i am still confident that r9 will be released, unless something happenede to strmnnrmn, but i still must thank him for making daedalus and must comgradulate him for all his hard work.

X-Suany said...

I understand people getting paranoid, after all StrmnNrmn has been the first to apologise for not updating as often as he would like to.

This time is getting longer than we all wanted, but there must be reason have no other choice than to wait patiently...

Hope this project lives much more!
Great job so far!

thedman said...

HAPPY HOLLOWEN

RyanMWolfe said...

ITS OVER GOODBYE N64 FOR PSP

kekpsp said...

man of little faith Ryanmwolfe, look guys instead of pondering on the fate of Strmn, thank him for what he has already given us, for free, Cheers Strmn hope you are well :)

Gotwake424 said...

hope strmn is alreight mybe sony threatend him but i guess not

wally*won_kenobie said...

People stop being morons..

I followed up on strmnNrmn, emailed 71M a good friend of his..

StrmnNrmn is fine and 71M is going to pass on some information from me for him..

Please stop this crap as it makes it harder for him to check the blog when the time come s :P

Morgan said...

Thanks Wally for checking up on him, hope he posts when he can to tell us what he's up to.

jas_pollo said...

....este wn se murio....

Morgan said...

?

Morgan said...

?

PSDroideka said...

Dont worry guys, "Good things come to those who wait" so R9 will probably be bigger than R5!

Morgan said...

Oh R9 is gonna be somethin serious, I know that already.

omgnintendo64 said...

www.shooshtime.com
www.boysfood.com
www.allhotgirls.net
www.myfreepaysite.com
www.wowomg.com

i love mangina!

Disturbd1 said...

Please die... now... What's the point of spamming crap ass links?

pkmaximum said...

I don't really see the problem, with Strmmmmn just reporting on his blog "I'm fine, big news to come." Oh well good work Strmmmmn once again on R8 I expect to see good things to come on R9 (I hope)

thedman said...

mmmmmmmmmmmmmmm porn

Sroon said...

lol yeh porn good!

BigMace said...

I wish you would give us an update on your awesome emulator Strmn. Anyways I hope life is treating you well. Thanks for all your work.

RyanMWolfe said...

he is not coming back Just a rumor that he is Because he is not

hahaha

Imtiaz said...

I can't believe its over. Oh well, we had a good run.

Kramer said...

I cant believe how much spam is in here and all these kids just giving up hope and saying stuff like "ITS OVER GOODBYE N64 FOR PSP"

Have some faith, stop being idiots and spamming.

RyanMWolfe said...

ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
ITS OVER GOODBYE N64 FOR PSP
IT IS GONE NO MORe RETRO COSOLE DEV

thedman said...

im about this close to takin this site off of my bookmarks*holds up fingers to signafie*

Sroon said...

Yeh same bro!
buuut il give it till cristmas.

Disturbd1 said...

RyanMWolfe, so when did you become strmnnrmn? I seriously doubt that he would leave during a big update like this... Have you heard from SNESTYL coders in a while? Nope, a couple months back, they announced they would make one last final version... But no news! Does it mean its dead? Not yet.

Grow up... And in case you guys didn't realize, its open source... Meaning, people can pick up this project to work on whenever they want...

People have lives you know, unlike half you guys here... Why not spent the time learning C and then coding this emulator instead of sitting around bitching because you have no patience?

PSDroideka said...

Guys, We can be worried but think of what R9 IS GOING HAVE (shut up ryanmwolfe you homo)

Viewport Scaling
PIF fixers dramatically boosting compatibility and saving performance
Whatever else his brilliant mind is thinking of.

He is most likely reading this blogg thinking "Why do i bother, nearly 300 commments and none of them about what this blogg is for"

Which is DISCUSSION OF EMULATION, NOT PORN OR FLAME FESTIVALS!!!

ExtraKrispy said...

PSDroideka i have to agree with you that is why he has not said much. He has fixes he is making and, all you people bitching and moaning at him, jeez give him a break, Coding is hard as hell and i still cant buttons to work correctly, but not the point. in sum get over yourselfs the world doesnt revolve around you.

P.s. yes i am talking to you

ExtraKrispy said...

that is P.s. as in post script
and P.P.s. Thanks strmn for what you do if your still around

ukcuf16 said...

^^ u guys are sux

PSDroideka said...

ukcuf16: Did you pass first grade english? Im quite sure the proper prnunciation is "You guys suck" ive heard disabled people with better grammar than you. Anyway, what was the point of your post, ie: What does "You guys suck" have to do with emulation?

Imtiaz said...

We need you StrnmNrmn. The PSP homebrew scence is pretty much dead. As you can see, by the 200-300 or so post count people are going crazy. Playstation emulators are almost coming out but all we have is word that it will come out soon. I have supported this project from the beginning and wish to continue supporting it. If you can take just five minutes or so to just enlighten us of your whereabouts, I as well as many others will be satisfied. Your skill is something that should not be wasted. We all support you in your efforts.

Morgan said...

I agree please StrmnNrmn just take 2 minutes and at least tell us your alright, I respeect your work and amire it. Without Daedalus and looking forward to trusty StrmnNrmn to give an update, the psp scene just feels empty. Please StrmnNrmn just tell us your alright, please.

kekpsp said...

Hi Strmn, hows the PIF Fixes coming along, looks like (and I am trying hard to understand) that when you got the extra speed boost by flushing out the useless or used instructions, you were also resetting some others that were important to the smooth running of the rom or certain roms

RyanMWolfe said...
This comment has been removed by a blog administrator.
ukcuf16 said...

wow psdroideka you are a nerd with absolutely no life... as for what I said "U guys are sux" I meant SUCK UPS and u are. Discussion closed.

PSDroideka said...

ukcuf16: i'm a nerd with no life, how interesting, you got offended by something i said ON A BLOGG! and you made up some stupid abbreviation which NO ONE BUT YOU CAN UNDERSTAND.

And once again, what does flaming me have to do with emulation?Or cant you read as well as write?

kekpsp said...

Hello, msg to all you flamers and spammers, go away this is a blog on the programming of the emulator, please ask questions or comment on the emulator, progress and updates will be sent in due course, thank you :)

Sroon said...

awwww I can feel the love!

disturbed19 said...

Just face it guys hes gone, he gave up on the prject. if u check on his emulator for the pc you will notice he gave up on that project without letting anyone know.....look how long its been since his last update....its not hard to take a few minutes to tell us hes still working on the emulator......but in my opinion daedalus psp is dead. and strmnmmn left the scene......good bye strmnmmn thanx for the half finished emulator!

Morgan said...

Why would you say that stupid shit, stop being negative. People don't just give up when it's thriving and then don't say ANYTHING. StrmnNrmn is a respectable guy from what I've seen he would at least say goodbye, I do wish he would update though. StrmnNrmn I know your probably reading this, please man just say something!

flyinghippo said...

First of all, Strmnnrmn didn't even WRITE Daedalus for the PC. I'm tired of everyone being negative, and acting like little children by spamming and thinking that they're so cool. Cool it, guys.

PSDroideka said...

WHAT DID kekpsp JUST SAY!!!!
And i say x 100
And wally say x 100
and Morgan say x 100

BTW I've got an Actual Emulation question for Strmn Nrmn, How do you implement byteswapping to a ROM streamere without replicating the code from the normal rom rendering script?

PSDroideka said...

WHAT DID kekpsp JUST SAY!!!!
And i say x 100
And wally say x 100
and Morgan say x 100

BTW I've got an Actual Emulation question for Strmn Nrmn, How do you implement byteswapping to a ROM streamere without replicating the code from the normal rom rendering script?

BreathofFire said...

He is dead...

flyinghippo said...

psdroideka: You might get a faster answer by asking Strmnnrmn by email.

Also, sorry if I sounded rude in my last post. I just wanted to tell off the spammers for once.

Sroon said...

LOL i can still feel the love.
teehee
god u guys really need patientce lol
if i was coding something and just got bored of it i would also want a looong break!
its good hez taking a break too.
hopefully i dont upset anyone.

thedman said...

HUMS THE BEATLES : all we need is love : man i love that song ......oooo off topic did anyone get a ps3

Zodionic said...

obviously strmnnrmn, has taken a break and now he is working on getting the dynamic recompiler totaly finished and working on ways to touch up the code to gain speed, as eell as the PIF fixes, this is probably going to be the last release, its most likely hes waiting untill christmas, it will most likely be full speed on most games, then he will work on sound for V1.

douche_bag_dave said...

omg, this is so gay!!!

RyanMWolfe said...

i got a ps3 and it kick's ass

pkmaximum said...

Zodoniac, do you actually have proof on this from emailing him or something.... Or are you just assuming this, because information on Strmmmmn would be really nice to have right now.

Sroon said...

LOL I got a wii n Zelda is the BEST!!!!!!!!
even better than OOT!

Childress said...

You're not dead, are you? I hope not. :(

BelmontSlayer said...

flyinghippo, StrmnNrmn DID code the original version of Daedalus for the PC. Need proof? Visit the official homepage.

http://daedalus.boob.co.uk/contact.htm

And will people PLEASE STOP SPAMMING THE COMMENTS!!! I wish StrmnNrmn would turn off comments, as to stop all of this crap...

thedman said...

ha ha ha BOOB ^^

thedman said...

300TH POST WOOT WOOT

Sroon said...

HAHAHA yeh BOOB!
Teehee!

PSDroideka said...

Fricken hell, 300 posts of concentrated spam! For crying out loud. Make your own blogg and spam it up with your own crap! Not here!

Morgan said...

Hey guys on a lighter note this PSX-P v2 is nice I made a backup ISO of my RE2 and it runs alright! Check it out!

ukcuf16 said...

spam is a funny word

PSDroideka said...

mmmmmmmmmmmm spiced ham

thedman said...

anyone going any ware for thanksgiving



and also yup the project is abanded

thedman said...

giggity giggity giggity goo

flyinghippo said...
This comment has been removed by a blog administrator.
Morgan said...

Wow you guys are real mature, in a way I'm glad StrmnNrmn hasn't responded. I wouldn't want to if I had idiots posting like this on my blog.

daaka said...

Apparently strmnnrmn took a small break and will release Version 1 of daedalus by the end of the year which will have full speed on some roms including ability to enable sound and there will be other fixes. Thats the rumour i have heard from a few people.

joshrulez2 said...

I have had many problems with my internet connection and other family problems in the past few weeks, but I am still hoping to release a new Daedalus by the end of the year which will have great speed improvements.

daaka said...

that is not strmnnrmn ^^^^^^^^^^^^^^^^

But what that has been said is correct.

Suprax09 said...

Yup, That isn't strmnnrmn because that's not how you spell it HAHA. It's strmnnrmn not strmnnrrmn.

Suprax09 said...

Anyways, I hope what your saying is true daaka.

Morgan said...

Any links to supports these rumors?

PSDroideka said...

It may not be hime, but he may have had to make a new blogg spot account.

Morgan said...

No I'm sure if it was really him he would have made a new topic talking about why he was gone, not just saying a quick sentence in the comments.

tsurumaru said...

Yes I call shenanigans on this fakery!

Mario Kart God said...

Where is he? Its been a while, and rthought he would be here now.

Urkel said...
This comment has been removed by a blog administrator.
Urkel said...
This comment has been removed by a blog administrator.
Morgan said...

There's a retard born everyday.

PSDroideka said...

urkel: burn in hell
Morgen: i think he was born for at leas twelve retards im not gonna post until StrmnNrmn Posts a new thread

thedman said...

dude it took me like 10 min to scroll thru all that awsome!!!!!!!!!

Disturbd1 said...

it took me one second.... its called the "End" Key on the Keyboard

X-Suany said...

Come back for Christmas please!!! lol

Imtiaz said...

The PS1P is out... is there going to be some Nintendo competition? We'll just have to wait and see. Until then, I'm going to play with my Wii.

Rom said...

Dude, are u still working on this Project? Haven't heard from you since September, and it like almost December dude. Hope you come back because i really liked your project towards N64 to PSP. I mean the speed on your 8th version was great and I keep thinking on your next release is going to become AWESOME, like a normal n64 speed. O_O"

wally*won_kenobie said...

Guys i released Spiff up V1.3

I didnt bother comign here as urkel the unreasonable posted spam spam too many times...

Clean up or GET OUT

Chaz said...

I agree with wally, the way you people have been acting, Strmnnrmn shouldnt come back and release r9. Be ashamed!

He coming back wally says and I trust him.

thedman said...

HA Christmas is the 3 month anniversary of his last post

tsurumaru said...

Thankfully strmnnrmn is apparently fine, his friend and fellow coder 7im met up with him recently.
He is however probably pissed off with the twats on here that post 179,000 instances of the word Spam for example, and others and their constant demands and with very good reason.
All of you know who you are, pat yourselves on the back and congratulate yourselves for directly leading to the projects current "behind closed doors" status.

To the small number of genuine followers of this blog, Merry Christmas! :)

ExtraKrispy said...

merry x-mas all good to know he is still alive and still messing with the psp , hope your christmas' are better than mine, ie stabbed myself in chest, lol i didnt feel a thing nice gash,

Mario Kart God said...

Strmnrmn please come back! PLEASE, it would be awesome! Merry X-mas!

Meatwad1337 said...

Support and Best Wishes for your homebrew project.

NJisMYhome said...

STRMNNRMN!!!!!! PLEASE COME BACK!!! THE WHOLE HOMEBREW SCENE IS DEPENDING ON U!!!!!!! STRMNNRMN, DARK ALEX, FANJITA, AND ALL THE REST OF U GUYS IS WHAT MAKES THE HOMEBREW SCENE....WITHOUT U IT IS NUTTIN....PLEASE COME BACK OR JUST POST SOMETHING UP IN YOUR BLOGG......

X-Suany said...

I keep coming back here...

There's still hope in my vains :P Foolish?

MasamunesBlade said...

Thank you for your acheivment. Even if you don't update anymore it's okay. I personally wouldn't have time to do what you have done anyway so I think that it is great that you put so much effort into bringing the n64 to psp owners everywhere. Whether you hear this or not it is important for me to tell you that you have done enough. I hope others have not discouraged you in your progress if that is the reason you have not updated, or if it's just to keep the project secret. So if you are deciding to continue then good for you, it's something you enjoy doing. But if you're not then I guess it's for the best. Thank you strmnnrmn.

Gardo said...

Yo dude: the work you're doinn' is great, I´m just waiting to play mariokart and Zelda with my PSP.... simply amazing, and if we can play online, even better!

Keep up the good work,and thanx a lot for bringing back to life this emulator. Cheers mate :)

«Oldest ‹Older   201 – 336 of 336   Newer› Newest»