A little while back, someone pointed out to me that Theme Park still wasn't quire right. So i look, and sure enough the alignment isn't quote right between BG1 and the other BGs and OBJ. Recall that Theme Park writes $ff then $03 to $2110, then writes $00 to $210d exactly once and yet expects BG1HOFS to have the value $0000, not $0003. Previous investigation had discovered that changing the ROM to write $83 to $2110 would make the real SNES have BG1HOFS=$0080, at the time mistakenly interpreted as $0083.

Further investigation reveals that the value jumps by 8s: any of $80-$87 leads to BG1HOFS being $0080, while $88 suddenly jumps to $0088. A little more testing reveals that the real formula for BGnxOFS registers is:

Code:

Current = (Byte<<8) | (Prev&~7) | ((Current>>8)&7);

with Prev shared among all 8 registers.

OTOH, the M7* registers still seem to use the old formula:

Code:

Current = (Byte<<8) | M7Prev;

with M7Prev again shared. OTOH, we still don't know the exact details of the Mode 7 calculations, particularly the observed offset quantization under extreme magnification, a few details of offsets ourside the standard -1024 to 1023 range, and the bit-accuracy of the scaling formulas...

Sun Jun 19, 2005 3:38 am

Lord Nightmare

Rookie

Joined: Fri Nov 26, 2004 7:50 pmPosts: 14Location: PA, USA

anomie: US. Patent 5,327,158
Has to do with mode 7 calculations and stuff...
It scares the hell out of me...

Lord Nightmare

_________________"When life gives you zombies... *CHA-CHIK* ...you make zombie-ade!"

Sun Jun 19, 2005 4:59 am

byuu

Well, luckily (if you will), it says at the bottom that this was just a reference design, and that the final implementation could be (and probably is) different.

Quote:

Current = (Byte<<8) | (Prev&~7) | ((Current>>8)&7);

Ugh ... have to change those things again ...
Nice find.

Sun Jun 19, 2005 2:13 pm

anomie

Lurker

Joined: Tue Dec 07, 2004 1:40 amPosts: 151

Lord Nightmare wrote:

anomie: US. Patent 5,327,158Has to do with mode 7 calculations and stuff...It scares the hell out of me...

Even if the patent has detailed enough technical details, the interesting corner cases are still probably different...