BBC Mode 2 sprites

bbc micro/electron/atom/risc os coding queries and routines
Post Reply
wnmderek
Posts: 27
Joined: Mon Oct 15, 2018 12:31 am
Contact:

BBC Mode 2 sprites

Post by wnmderek » Mon Oct 15, 2018 7:52 am

I am trying to create a sprite routine that works in Mode 2. As I am just starting, and drawing sources from various places, I have a sprite routine that draws each line of the sprite on the same line. If I try to add to get to the next screen line for the next row of relevant data, it appears anywhere but underneath the last row drawn above it.

Also if I try to start the sprite at other screen locations then the draw routine messes up too.

I know it has to do with the strange way the video memory is drawn, I am just not sure how to get around it.

I am trying initially to create a sprite routine that I pass by whatever means sprite screen memory location (ill convert x/y to screen later if I ever get that far!) and lo/hi of the sprite data.

Has anyone done this or be able to offer any suggestions please?

User avatar
richardtoohey
Posts: 3986
Joined: Thu Dec 29, 2011 5:13 am
Location: Tauranga, New Zealand
Contact:

Re: BBC Mode 2 sprites

Post by richardtoohey » Mon Oct 15, 2018 8:44 am

Welcome. :D

I've moved your question into this forum because I think it's probably better in here.

If you have a look down the topics there may be something that helps already (e.g. the Kevin Edwards magazine articles).

Good luck!

RobC
Posts: 3000
Joined: Sat Sep 01, 2007 10:41 pm
Contact:

Re: BBC Mode 2 sprites

Post by RobC » Mon Oct 15, 2018 10:53 am

There's this.

I found Neil Beresford's shell a good starting point when developing my Bomb Jack game in Swift.

If you need something that restores the background as the sprite moves in mode 2, let me know and I'll post my sprite code.
Last edited by RobC on Mon Oct 15, 2018 10:54 am, edited 1 time in total.

wnmderek
Posts: 27
Joined: Mon Oct 15, 2018 12:31 am
Contact:

Re: BBC Mode 2 sprites

Post by wnmderek » Mon Oct 15, 2018 10:58 am

Hi thanks. I will take a look. If you have any code that may help please paste if possible?

User avatar
sydney
Posts: 2722
Joined: Wed May 18, 2005 10:09 am
Location: Newcastle upon Tyne
Contact:

Re: BBC Mode 2 sprites

Post by sydney » Mon Oct 15, 2018 4:08 pm

There is some example code over at the old retrosoftware site:
http://www.retrosoftware.co.uk/wiki/ind ... te_plotter

User avatar
Andrew_Waite
Posts: 238
Joined: Tue Aug 30, 2016 3:58 pm
Contact:

Re: BBC Mode 2 sprites

Post by Andrew_Waite » Mon Oct 15, 2018 9:23 pm

This thread might help. It describes how I built the sprite engine for the rocketman in my 'Planet Nubium' game, with lots of helpful pointers from other folk along the way (Thanks again!).

The game uses Mode 1, but it should be possible to convert the code to the other 20Kbyte modes.

viewtopic.php?f=54&t=13053

Post Reply

Return to “programming”