It is currently Sun Oct 20, 2019 9:07 am

 All times are UTC - 7 hours

 Page 2 of 2 [ 22 posts ] Go to page Previous  1, 2
 Print view Previous topic | Next topic
Author Message
 Post subject: Re: A simple sprite demo for teachingPosted: Sat Nov 01, 2014 9:54 am

Joined: Sun Sep 30, 2012 3:44 am
Posts: 83
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!

Top

 Post subject: Re: A simple sprite demo for teachingPosted: Sat Nov 01, 2014 10:50 am

Joined: Sun Jan 22, 2012 12:03 pm
Posts: 7608
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.

Top

 Post subject: Re: A simple sprite demo for teachingPosted: Sat Nov 01, 2014 12:11 pm

Joined: Sun Sep 30, 2012 3:44 am
Posts: 83
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.

Top

 Post subject: Re: A simple sprite demo for teachingPosted: Sun Nov 09, 2014 8:08 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21643
Location: NE Indiana, USA (NTSC)
"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.

_________________
Pin Eight | Twitter | GitHub | Patreon

Top

 Post subject: Re: A simple sprite demo for teachingPosted: Fri Feb 13, 2015 4:06 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21643
Location: NE Indiana, USA (NTSC)
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.

_________________
Pin Eight | Twitter | GitHub | Patreon

Top

 Post subject: As if anybody gives a forkPosted: Tue Nov 15, 2016 6:11 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21643
Location: NE Indiana, USA (NTSC)
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 push -u origin master

_________________
Pin Eight | Twitter | GitHub | Patreon

Top

 Post subject: Re: A simple sprite demo for teachingPosted: Wed Feb 07, 2018 1:55 pm

Joined: Sun Sep 19, 2004 11:12 pm
Posts: 21643
Location: NE Indiana, USA (NTSC)
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

_________________
Pin Eight | Twitter | GitHub | Patreon

Top

 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 2 of 2 [ 22 posts ] Go to page Previous  1, 2

 All times are UTC - 7 hours

#### Who is online

Users browsing this forum: No registered users and 2 guests

 You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum

Search for:
 Jump to:  Select a forum ------------------ NES / Famicom    NESdev    NESemdev    NES Graphics    NES Music    Homebrew Projects       2019 NESdev Competition       2018 NESdev Competition       2017 NESdev Competition       2016 NESdev Competition       2014 NESdev Competition       2011 NESdev Competition    Newbie Help Center    NES Hardware and Flash Equipment       Reproduction    NESdev International       FCdev       NESdev China       NESdev Middle East Other    General Stuff    Membler Industries    Other Retro Dev       SNESdev       GBDev    Test Forum Site Issues    phpBB Issues    Web Issues    nesdevWiki