Original Post

m7_demo for Virtual Boy

http://www.netyaroze.pwp.blueyonder.co.uk/mode7.html

Refs:

http://www.coranac.com/tonc/text/mode7.htm
http://www.goliathindustries.com/vb/download/affine_1.pdf

Controls:

D-pad: move left/right, forward/back
A, B: move up/down
L, R: rotate left/right
Start: reset
Select: switch between the three Mode 7 calculation methods, A, B, and C

dasi

  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 13 years, 3 months ago by dasi.
  • This topic was modified 11 months, 1 week ago by dasi.
Attachments:
4 Replies

Can you elaborate? How is the method different than before? I ran the demo and I see the center looks the best and both edges are equally somewhat bad, compared to the old ones where the left looks good and gets progressively worse as it goes right. Does it work similar to how I suggested by computing the center, then subtracting the half the screen width times the incremental part?

I guess I should change my Kart code to look better, so I’d just like to make sure I understand what I should change, since I’ve done a bunch of optimizing and can’t really just copy/paste other code.

Hmm… now that I think about it, it’s probably possible to get it looking better by doing multiple Affines for smaller chunks of the screen, although of course that’d be a little more processing, code, and memory… but you could get it looking nearly perfect across the entire screen that way (3 would probably look really good, 6 would probably be nearly perfect). Just compute the offsets at multiple places across the screen in higher precision, then round to the lower precision at the centers of each Affine world, and subtract half the width times dx and dy of lower precision for the start of each. Once again, it’s just in head, so there may be some reason it won’t work… but I think it’d work great. You might use too much memory, so maybe just do that for the closest 50 lines or so, since you wouldn’t notice it on the distant ones.

DogP

Sorry, yeah, that’s basically it: calculate the background coordinates at the center of the screen; then calculate the source-coordinate offsets (zoom * rotation) and multiply by 192 to get the offset-correction; then subtract the offset-correction from your background coordinates to get the source coordinates for the horizontal line to be displayed.

The offset-correction must be calculated in the same fixed point format as the source-coordinate offsets, and shifted down before multiplying by 192, otherwise you won’t get rid of the jaggies.

That’s how things work for Mode 7 type C in the demo, anyway. In type B (and I’m guessing your code?), the offset-correction isn’t calculated separately, which is what causes the problems. Does that make sense?

  • This reply was modified 12 years, 12 months ago by dasi.

Yup… that’s exactly what I was thinking. My current code is based on David Tucker’s code, which I believe is like your type B.

DogP

m7_ex

Mode 7 with horizon and variable pitch.

Refs:

http://www.coranac.com/tonc/text/mode7ex.htm

Controls:

D-pad: look around
A, B: move forward/back
L, R: strafe left/right
Select + A/B: move up/down

dasi

  • This reply was modified 13 years, 1 month ago by dasi.
  • This reply was modified 13 years, 1 month ago by dasi.
  • This reply was modified 13 years, 1 month ago by dasi.
  • This reply was modified 13 years, 1 month ago by dasi.
  • This reply was modified 13 years, 1 month ago by dasi.
  • This reply was modified 12 years, 12 months ago by dasi.
  • This reply was modified 12 years, 12 months ago by dasi.
  • This reply was modified 12 years, 12 months ago by dasi.
  • This reply was modified 11 months, 1 week ago by dasi.

 

Write a reply

You must be logged in to reply to this topic.