nesdev.com
http://forums.nesdev.com/

Is rotation possible on nes?
http://forums.nesdev.com/viewtopic.php?f=2&t=16365
Page 1 of 2

Author:  MartsINY [ Mon Aug 14, 2017 6:09 pm ]
Post subject:  Is rotation possible on nes?

I saw a video of this game boy game: https://www.youtube.com/watch?v=AyjU4MtonZM

At 0:46 I think they rotate a sprite (or they have every possible sprite)?

Is it possibile to do so on nes?

Author:  rainwarrior [ Mon Aug 14, 2017 6:21 pm ]
Post subject:  Re: Is rotation possible on nes?

Battletoads' intro "software renders" the flying spaceship into CHR-RAM with a scaling operation. (Check the CHR pattern pages in a debugger to watch it in action.)

A rotation would be similarly feasible. (Could probably scale at the same time as rotating too without extra complexity.)

Author:  tepples [ Mon Aug 14, 2017 6:24 pm ]
Post subject:  Re: Is rotation possible on nes?

True sprite rotation is very slow without a coprocessor. In some cases, a small amount of rotation can be faked with shearing. But usually, pre-defined rotations are stored in the ROM.

Scaling without rotation is faster because it can be done with lookup tables.

Author:  rainwarrior [ Mon Aug 14, 2017 6:39 pm ]
Post subject:  Re: Is rotation possible on nes?

tepples wrote:
True sprite rotation is very slow without a coprocessor.

Hmm, doing a quick estimate, I think a naive fixed point 32x32 rasterizing could probably be done at 30fps?

You could keep up with a vblank bandwidth of 128 bytes per frame, I believe.

Author:  Bregalad [ Mon Aug 14, 2017 11:37 pm ]
Post subject:  Re: Is rotation possible on nes?

MartsINY wrote:
I saw a video of this game boy game: https://www.youtube.com/watch?v=AyjU4MtonZM

At 0:46 I think they rotate a sprite (or they have every possible sprite)?

Is it possibile to do so on nes?

What is shown in this video is wireframe graphics. This is perfectly on a NES. Elite is a game released only with those. I did a demos myself using that, and so did other nesdev people.

My demo does not look really 3D, but I have another one on my hard disk with pre-calcluated 3D shapes and it works and looks impressive. I wanted to save it for a real game so I didn't publish this but since I don't know if I'll ever release a real game...

Another approach to rotating sprites is simply to pre-render it. Usually pre-rendering is the key of success when it comes to this stuff :p

Author:  pubby [ Tue Aug 15, 2017 6:27 am ]
Post subject:  Re: Is rotation possible on nes?

It's 1000 times easier to bake rotation into sprites than it is to generate them on the fly.

Author:  psycopathicteen [ Tue Aug 15, 2017 12:33 pm ]
Post subject:  Re: Is rotation possible on nes?

Say you are using a mapper with 16kB of memory per bank. In that bank you can store a 256x64 8-bit bitmap image. Have all the rotatable sprites located in the middle of that 256x64 bitmap, with extra space between them. Then you can calculate the ROM address for each pixel by having X location as the low byte, and Y location as the high byte. Then fetch the pixels and convert them to planar format.

Author:  tepples [ Tue Aug 15, 2017 1:32 pm ]
Post subject:  Re: Is rotation possible on nes?

A 64x64 pixel 2bpp graphic is 1 KiB. A 256x64 pixel 8bpp graphic is 16 KiB. If you'll be wasting 94% of each bank on 8bpp sprites with huge blank spaces between them, you might as well just use the space for 16 pre-baked rotations that you can scale using a shrinking LUT.

Author:  Fisher [ Tue Aug 15, 2017 2:52 pm ]
Post subject:  Re: Is rotation possible on nes?

Little Samson's character select screen have the selected character rotating.
I think it's a prerendered rotation, not made on the fly.
But it's a nice effect!!

Author:  Pokun [ Tue Aug 15, 2017 3:18 pm ]
Post subject:  Re: Is rotation possible on nes?

Heh yeah it's nice but I don't think the topic is about that kind of rotation. That's just normal animation.

Author:  tokumaru [ Tue Aug 15, 2017 3:34 pm ]
Post subject:  Re: Is rotation possible on nes?

You'd need 3D models to do Little Samson's rotation in real time...

Author:  Sumez [ Wed Aug 16, 2017 3:38 am ]
Post subject:  Re: Is rotation possible on nes?

Pretty sure all of Little Samson is prerendered :D

Author:  zeroone [ Wed Aug 16, 2017 7:41 am ]
Post subject:  Re: Is rotation possible on nes?

http://imgur.com/9U0safd

Author:  tepples [ Wed Aug 16, 2017 7:51 am ]
Post subject:  Re: Is rotation possible on nes?

The effect seen in Super Spy Hunter is shearing, the overhead counterpart to how Pole Position and Rad Racer draw their roads.

Author:  psycopathicteen [ Wed Aug 16, 2017 12:24 pm ]
Post subject:  Re: Is rotation possible on nes?

tepples wrote:
A 64x64 pixel 2bpp graphic is 1 KiB. A 256x64 pixel 8bpp graphic is 16 KiB. If you'll be wasting 94% of each bank on 8bpp sprites with huge blank spaces between them, you might as well just use the space for 16 pre-baked rotations that you can scale using a shrinking LUT.


You can composite 4 sprites into the 8bpp bitmap, and even rotate all 4 at once that way.

Page 1 of 2 All times are UTC - 7 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/