View Full Version: On what is stored in hardware register $fa20 or $fa21

camerahacks >>Camera Discussions >>On what is stored in hardware register $fa20 or $fa21


<< Prev | Next >>

zapped- 06-13-2007
On what is stored in hardware register $fa20 or $fa21
if R4 = zero then $fa20 = (R2 / $20) * $20 | ((VAR_36cf / $20) * $04) | VAR_36d0 / $40 else $fa21 = (R2 / $20) * $20 | ((VAR_36cf / $20) * $04) | VAR_36d0 / $40 Is there a better way to state the above function? Any ideas what it is trying to accomplish?

brite_eye- 06-13-2007

From Jack and the Beanstalk to Gulliver's Travels? The choice of big-endian vs. little endian has been the subject of flame wars. The very term big-endian comes from Jonathan Swift's satiric novel Gulliver’s Travels, where tensions are described in Lilliput and Blefuscu because a faction called the Big-endians prefer to crack open their soft-boiled eggs from the big end, contrary to Lilliputian royal edict http://en.wikipedia.org/wiki/Endianness Just a guess - no desire to flip flop ends due to a hard boiled egg head from too much java jive at work.

zapped- 06-13-2007

The function is called with input of $36cf, $36d0, and R2 set to $ff and R4=$00 This results in $fa20 set to $ff (or brought high?) and $fa21 untouched. After returning, from this function, $36cf and $36d0 are set to $00 and R2 is set to $ff, and R4 is set to $01 and the function is called again. The result this time is that $fa21 is set to $fe and $fa20 is untouched. Not sure this is Gulliver's Travels as I don't see how this is anything to do with endianness. Maybe I climbed too high on the Beanstalk and am Lost in Space. Anyone have any insight on this. Seems like a lot of trouble to go to just to set $fa20 to $ff and $fa21 to $fe. Another time it is called just once with the input the same as the first call above.

BillW- 06-14-2007
Re: On what is stored in hardware register $fa20 or $fa21
Well, the first few parts between the ORs remind me of of scaling functions. Eg. if you want to express a value that changes from 0-255 as a percentage, you use PER=(value/255)*100 I have no idea why these would get OR'ed together though.

Forumer™ is Voted #1 Free Forum Hosting provider
Build your own community today with the largest message board hosting company.