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

A simple sprite demo for teaching
http://forums.nesdev.com/viewtopic.php?f=22&t=7991
Page 2 of 2

Author:  DoNotWant [ Sat Nov 01, 2014 9:54 am ]
Post subject:  Re: A simple sprite demo for teaching

I understand the logic of the inertia effect, but I'm having a real hard time understanding the use of signed numbers and fixed-point arithmetic. I haven't really found anything good about it from the POV of the 6502 on google, anyone here got anything good?

I can add/subtract 8n-bit unsigned numbers, and it would be great to know how to do it
with signed fixed-point numbers, so I could extend this to use 16-bit velocity.

I tried handling inertia with unsigned numbers, but that turned into an unholy mess pretty quick.

Thanks!

Author:  rainwarrior [ Sat Nov 01, 2014 10:50 am ]
Post subject:  Re: A simple sprite demo for teaching

Addition and subtraction of signed numbers the exactly the same as unsigned numbers, on the 6502. The same set of instructions works for both.

The part that is significantly different is making comparisons. Here is a good article to read:
http://www.6502.org/tutorials/compare_beyond.html

Another thing that is different is the bitwise right shift. You will want to copy the sign bit as you shift, like instead of LSR, perhaps use CMP #$80, ROR.

Author:  DoNotWant [ Sat Nov 01, 2014 12:11 pm ]
Post subject:  Re: A simple sprite demo for teaching

rainwarrior wrote:
Addition and subtraction of signed numbers the exactly the same as unsigned numbers, on the 6502. The same set of instructions works for both.

The part that is significantly different is making comparisons. Here is a good article to read:
http://www.6502.org/tutorials/compare_beyond.html

Another thing that is different is the bitwise right shift. You will want to copy the sign bit as you shift, like instead of LSR, perhaps use CMP #$80, ROR.


Thanks!
I think the problem is the fixed-point part. I tried to edit a little more of tepples code, but it turned into another mess. I'm getting tierd, so I'm gonna give it another try tomorrow.

Author:  tepples [ Sun Nov 09, 2014 8:08 pm ]
Post subject:  Re: A simple sprite demo for teaching

"tierd"? I thought tires don exits :p

In any case, version 4 is out with new build environment setup instructions courtesy of the Super NES version's thread.

Author:  tepples [ Fri Feb 13, 2015 4:06 pm ]
Post subject:  Re: A simple sprite demo for teaching

I've released version 0.05 incorporating improvements based on the suggestions made by koitsu and Espozo. One new feature in the MMC1 template is a driver for UNROM/UOROM that's a drop-in replacement.

Author:  tepples [ Tue Nov 15, 2016 6:11 pm ]
Post subject:  As if anybody gives a fork

I put the NROM version on GitHub so that you can create new NES projects by forking pinobatch/nrom-template. One change was made: PNG to CHR conversion was ported to Python 3.

EDIT (2016-11-16): UNROM, UOROM, SGROM, and SNROM version as well at pinobatch/snrom-template. I forked it from the nrom-template repository so that changes that I make in the NROM version can be reflected in this version.

If you cannot use GitHub's fork functionality for some reason, such as if you prefer Savannah, GitLab, or BitBucket for whatever reason, you can create an empty repository on your Git host of choice and then clone manually:
Code:
git clone https://github.com/pinobatch/nrom-template.git PROJECT
cd PROJECT
git remote rename origin upstream
git remote add origin https://github.com/USERNAME/PROJECT.git
git push -u origin master

Author:  tepples [ Wed Feb 07, 2018 1:55 pm ]
Post subject:  Re: A simple sprite demo for teaching

Now ported to BNROM, so people can get started with the 32K PRG ROM bankswitching model of BNROM, AOROM, Color Dreams, and GTROM

pinobatch/bnrom-template

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