It is currently Mon Oct 20, 2014 4:49 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Mon Feb 08, 2010 11:57 pm 
Offline
 Profile

Joined: Mon Feb 08, 2010 11:36 pm
Posts: 1
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.


Top
 
PostPosted: Tue Feb 09, 2010 7:58 am 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
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! :)


Top
 
PostPosted: Mon Feb 15, 2010 9:38 am 
Offline
User avatar
 Profile

Joined: Wed Jan 09, 2008 7:30 am
Posts: 406
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.


Top
 
PostPosted: Mon Feb 15, 2010 10:34 am 
Offline
User avatar
 WWW  Profile

Joined: Thu Jan 10, 2008 7:45 pm
Posts: 472
Location: Treddle's Wharf, Chigley
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.


Top
 
PostPosted: Sat Mar 13, 2010 9:04 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
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?


Top
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


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

Search for:
Jump to:  
cron