Search found 8372 matches

by rainwarrior
Sat Aug 06, 2022 10:54 am
Forum: Newbie Help Center
Topic: Reserving Zeropage?
Replies: 2
Views: 138

Re: Reserving Zeropage?

All of your ROM code is in a separate memory area than the NES's RAM, so nothing in RAM is initialized at startup. If you want to initialize ZP or other RAM you have to write code to copy values to it. cc65 has a default segment "DATA" which has an associated "copydata" utility s...
by rainwarrior
Sat Aug 06, 2022 9:57 am
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

The games that use the same tables for A/B and C/D, are they perspectively accurate or are they distorted? Are they more accurate to slope-based perspective (straight lines remain straight), or by angle-based perspective (straight lines get curved)? If done right they are accurately a perspective, ...
by rainwarrior
Fri Aug 05, 2022 10:03 pm
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

Here is a formula for Mode-7 using only A, C and BGY Ah. I see what you mean now. B/D set the rotation, and moving just the Y pivot can transform B/D's scale into the position along the centre axis that you need. That is definitely easier than trying to set HOFS+VOFS. I think in the case of F-Zero ...
by rainwarrior
Thu Aug 04, 2022 2:20 pm
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

can you clarify what kind of division table you mean? I meant a table replacing the result in "scale" (i.e. the lerp+1/sl etc.) for each scanline. A set of values for one setting of the camera (excepting the rotation). Is the actual range of inputs for all camera settings narrow enough to...
by rainwarrior
Thu Aug 04, 2022 11:44 am
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

Thinking about it some more, that (1/sl) * const line wouldn't be the perspective divide equivalent, it would be this: var sl = lerp(1/topdist, 1/btmdist, scanline / 223); But I don't think that would need to be a per-scanline divide/multiplication, because it doesn't actually need to be a lerp. 1/...
by rainwarrior
Wed Aug 03, 2022 11:01 pm
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

In my solution, I believe you're correct in that the interpolation needs to be corrected with a division step, and I believe that division step happens in the getm7y function. However, that function defines a m7y value that's valid for an entire perspective plane, it doesn't need to be recalculated...
by rainwarrior
Wed Aug 03, 2022 5:12 pm
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

So I hacked Mesen-SX to visualize Mode 7 view frustums . fzero_frustum.png It changes the tilemap viewer whenever mode 7 is active. The "show scroll overlay" rectangle is replaced with pink scanlines, showing how they have been rendered out of the tilemap. It keeps a record of the last ren...
by rainwarrior
Wed Aug 03, 2022 1:31 pm
Forum: NESemdev
Topic: Wrong palette on a few Donkey Kong squares (SOLVED)
Replies: 2
Views: 287

Re: Wrong palette on a few Donkey Kong squares

BIG CAVEAT: I'm not doing real scanline emulation and instead I'm directly reading the nametable. Is the choice of palette 2 some timing thing that happens once you do the real PPU rendering? The nametable should have sufficient/correct data for this case. There is no mid-screen trickery going on i...
by rainwarrior
Wed Aug 03, 2022 12:00 pm
Forum: SNESdev
Topic: Two simultaneous mode 7 textures?
Replies: 39
Views: 1233

Re: Two simultaenous mode 7 textures?

...while also having a little bit of undulation on the ground as seen in this rather nice Mode 7 example: (Super Empire Strikes Back) That's a really interesting one. Having a road with changing vertical was done in many earlier games (e.g. Super Hang-On, Rad Racer), but combining that idea with mo...
by rainwarrior
Wed Aug 03, 2022 10:58 am
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

I had been meaning to make this diagram illustrating how I think about this problem. Maybe now is a good time for it: mode7_trapezoid.png This is an overview of the perspective plane rendering, visualized in the space of the tilemap texture. We're rasterizing a trapezoid from the tilemap. So, scale ...
by rainwarrior
Wed Aug 03, 2022 10:44 am
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

Have one HDMA channel set to controlling Matrix A and Matrix B, while having another HDMA channel controlling BG1Y? I believe you need to do 2 things per scanline: 1. Set the u,v increment for each pixel along the row (matrix A and C). 2. Set the position of the the line of texels on the map (two w...
by rainwarrior
Wed Aug 03, 2022 9:45 am
Forum: SNESdev
Topic: Two simultaneous mode 7 textures?
Replies: 39
Views: 1233

Re: Two simultaenous mode 7 textures?

A texel is just what a pixel from the map looks like. It's comes out in the render as an oddly shaped rectangle. Small texels in the distance are just single pixels. At the bottom of the frame they get large and are bigger grainy rectangles. So, roughly speaking, if you try to fit two separate maps ...
by rainwarrior
Wed Aug 03, 2022 8:58 am
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

All 4 of the SNES games I mentioned can dynamically change the tilt. I don't think it's unreasonable to ask of the SNES... but if you allow a dynamic perspective, I don't think there's a practical way to use a table to bypass the divide. Tilt would be pitch, not FOV. Dynamic FOV would be something ...
by rainwarrior
Wed Aug 03, 2022 12:13 am
Forum: SNESdev
Topic: Two simultaneous mode 7 textures?
Replies: 39
Views: 1233

Re: Two simultaneous mode 7 textures?

This was probably done with a tilemap with 2 different textures Is that not just the same cloud texture twice? The interlacing does make it seem like 2 layers together, sort of. I couldn't find the game by that name... I did discover a BS game called Treasure Conflix, though it doesn't seem to run ...
by rainwarrior
Tue Aug 02, 2022 9:49 pm
Forum: SNESdev
Topic: Kulor's Guide to Mode 7 Perspective Planes
Replies: 57
Views: 3450

Re: Kulor's Guide to Mode 7 Perspective Planes

Thinking some more about how you might optimize this, and...I think there might only be 2 actual multiplications per-scanline needed in my implementation? I haven't gone over your calculations in detail, though I've been working on something similar myself. Generally speaking, for it to be perspect...