NESDev and Strangulation Records messageboards
Forum Index | FAQ | New User | Login | Search

Previous ThreadView All ThreadsNext ThreadShow in Flat Mode*


SubjectRe: Mode 7  
Posted byneviksti
Posted on11/11/02 10:34 PM
From IP129.22.168.202  



You're asking a very big question. So, I'll just give a quick over view.

Normal backgrounds are like maps that can be shifted horizontally or vertically on the screen. The one background in Mode7 however can do more than just shifting, you can scale/rotate/warp it however you want with matrix operations.

How does the PPU know which pixel to display where? It puts the (x1,y1) coordinates of the pixel on the screen into the equation below. Which tells it what pixel (x2,y2) to take from the 'BG map'.

There are registers to allow you to set all the values in this matrix equation (a,b,c,d,x0,y0).

from the nintendo documentation:

/ x2 \ / a b \ / x1-x0 \ / x0 \
| | = | | | | + | |
\ y2 / \ c d / \ y1-y0 / \ y0 /

x0&y0: center coordinate
x1&y1: display coordinate
x2&y2: coordinate before calculation

an example matrix transformation from nintendo:
to scale and rotate the picture -

a=cos(gamma)*(1/alpha), b=sin(gamma)*(1/alpha)
c=-sin(gamma)*(1/beta), d=cos(gamma)*(1/beta)

gamma: rotation angle
alpha: reduction rates for x(h)
beta : reduction rates for y(v)


You can also change the settings in the matrix calculation every scanline. Therefore allowing you to do even more neat tricks on the screen.

If you want to know some more, just ask away. If you have any specific questions though, it will be a little easier to help.



-
Entire Thread
Subject  Posted byPosted On
*Mode 7  abonetochew11/11/02 5:17 PM
..Re: Mode 7  neviksti11/11/02 10:34 PM
..*Re: Mode 7  Master Mew 0079/30/03 9:37 PM
...*Re: Mode 7  Memblers10/1/03 04:07 AM
....*Re: Mode 7  Master Mew 00710/1/03 11:15 AM
.....*Re: Mode 7  Memblers10/1/03 9:14 PM
......*Re: Mode 7  Master Mew 00710/2/03 8:23 PM
.......*Re: Mode 7  Memblers10/3/03 02:06 AM
........*Re: Mode 7  Master Mew 00710/3/03 8:01 PM
.........*Re: Mode 7  quietust10/3/03 9:15 PM
..........*Re: Mode 7  Master Mew 00710/4/03 2:18 PM
Jump to

Memblers' homepage             Contact Me

Forums powered by WWWThreads Demo