www.retrosoftware.co.uk
http://www.retrosoftware.co.uk/forum/

moving a mode 2 sprite by an uneven number of pixels
http://www.retrosoftware.co.uk/forum/viewtopic.php?f=73&t=447
Page 1 of 1

Author:  bouncingbill [ Mon Feb 08, 2010 11:57 pm ]
Post subject:  moving a mode 2 sprite by an uneven number of pixels

Hi, new to the forum, but very interested in doing something in asm.

Lastnight i did my first Hello World program in Swift/BeebAsm.

The last time i did a 6502 Hello World program was over 20 years ago. :o

I also experimented with plotting pixels in mode 2, and i had forgotten how ropey the screen addressing is.

My heart sank a little when i realised how complicated writing a simple sprite routine would be, and looking at the example source code on this site, i'm a little daunted, as my 6502 knowledge is all but gone.

My question is, how would you even go about plotting a sprite on an uneven x coord? Given that &01 is black/red, &02 red/black, &03 red/red etc.

Just the theory behind it would be welcome, unless i've missed something in the various source.

Thanks.

Author:  RichTW [ Tue Feb 09, 2010 7:58 am ]
Post subject:  Re: moving a mode 2 sprite by an uneven number of pixels

I wouldn't particularly advise it - it's far better to just have two versions of your sprite, one with a blank column on its far right, and another offset a pixel to its right, with a blank column on its far left. If you have 4 frames of animation for movement, you can incorporate this offset into 2 of those frames for free.

It's not to say it can't be done of course - Chuckie Egg and Exile are two games which can plot Mode 2 sprites at any horizontal position, and they do so by storing the sprites in a different way. Chuckie Egg, for example, has only monochrome sprites, so it stores its sprites with 1 bit per pixel. When it plots them, it just checks each bit in turn and does a pixel plot if set. It's not particularly optimised though, and is quite slow, as you can see from the flicker! Exile is much more clever, but it still uses a similar method, building its sprites up from two bit planes (for 4 colours) instead of one.

BTW welcome to the forum! :)

Author:  SteveO [ Mon Feb 15, 2010 9:38 am ]
Post subject:  Re: moving a mode 2 sprite by an uneven number of pixels

Yes, the screen layout is a nightmare isn't it :( If you can get away with two pixel movements then that's obviously another way... Most of the demo stuff I've put up here moves 2 pixels at a time. Look at some of the videos, particular in this thread

viewtopic.php?f=8&t=366

If you can get away with it it makes things easier.

Author:  DaveJ [ Mon Feb 15, 2010 10:34 am ]
Post subject:  Re: moving a mode 2 sprite by an uneven number of pixels

ISTR in Kevin Edward's and Roland Waddilove's series on writing machine code games in The Micro User they also both said doing anything other than 2 pixel movement in Mode 2 was more trouble that it was worth.

You can get hold of a DVD with a complete set of scans of The Micro User (with both those series) from DaveE at http://www.acornelectron.co.uk/ - you may find it helpful.

Author:  DaveF [ Sat Mar 13, 2010 9:04 pm ]
Post subject:  Re: moving a mode 2 sprite by an uneven number of pixels

DaveJ wrote:
ISTR in Kevin Edward's and Roland Waddilove's series on writing machine code games in The Micro User they also both said doing anything other than 2 pixel movement in Mode 2 was more trouble that it was worth.

I'd agree with them - 2 pixels at a time is usually adequate, unless you have specific requirements in mind.

DaveJ wrote:
You can get hold of a DVD with a complete set of scans of The Micro User (with both those series) from DaveE at http://www.acornelectron.co.uk/ - you may find it helpful.

Oh - I wonder if we could just upload those particular pages to the site?

Page 1 of 1 All times are UTC [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/