It is currently Mon Oct 20, 2014 5:47 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 9 posts ] 
Author Message
PostPosted: Wed Jun 18, 2008 9:06 am 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Hello

Anyone have any nice tips for preventing the dreaded sprite flicker?

'Forcing' to two frames?
Alternate update on frames? (eg update player one frame, enemies the next, and so on)

I seem to have forgot how little time you actually have on the BBC to do your thing :|


Top
 
PostPosted: Wed Jun 18, 2008 9:37 am 
Offline
User avatar
 Profile

Joined: Wed Jan 09, 2008 7:30 am
Posts: 406
Can't find the article now but there was some discussion on STH forums about best time and way to do your graphics for least flicker.

i.e. plotting by Y pos on screen. So plot the ones near the top first. Also perhaps setting a timer to trigger plotting at the top when the raster has just started slightly below top might give you even more time.


Top
 
PostPosted: Wed Jun 18, 2008 2:57 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
I don't know how feasible it is to do it on a BBC B, but on a Master you can double buffer the screens to reduce the flicker. In other words, do your sprite plotting on a logical (non-displayed) screen and then swap it with the physical (displayed) one.

Kind regards,

Francis.


Top
 
PostPosted: Wed Jun 18, 2008 3:04 pm 
Offline
User avatar
 Profile

Joined: Wed Jan 09, 2008 7:30 am
Posts: 406
Not possible on a standard beeb I think, as (may stand corrected here) but the screen must always end at address $7FFF, as that's how the hardware works to start wrapping around to the start of the screen again. So even if you used a 10K (or less) screen you couldn't make it swap between one that ends at &7FFF and one that doesn't.

On the Master and Beebs with shadow screen ram the circuits are designed so that when swapped in they inhabit the right part of memory and can never co-exist with the normal screen ram in main ram at the same time.


Top
 
PostPosted: Wed Jun 18, 2008 3:07 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Hmm sadly not applicable on the BBC, I can barely afford the memory for one framebuffer, let alone two :)


Top
 
PostPosted: Wed Jun 18, 2008 3:20 pm 
Offline
User avatar
 Profile

Joined: Mon Jan 07, 2008 6:46 pm
Posts: 380
Location: Málaga, Spain
Well... it's perfectly possible to do double-buffering, but of course the proviso is that you don't do any hardware scrolling. Onslaught (the game I never finished, over on Lost & Found in STH) uses two 8k Mode 5 screen buffers - one at &4000 and one at &6000 - to allow me to do a software scroll of a window and move a large number of sprites and particles with no flicker. There are other games which also do this, e.g. Repton Infinity, Bonecruncher, Predator.

All these games redraw their entire playing area each time (to account for the new scrolled position) which is an easier approach than trying to keep track of where the old sprites were two frames ago and erasing only them, but it's at the expense of speed - which is why the frame rate of these software scrolled games is normally not as good as their hardware-scrolled counterparts!


Top
 
PostPosted: Wed Jun 18, 2008 3:22 pm 
Offline
User avatar
 Profile

Joined: Wed Jan 09, 2008 7:30 am
Posts: 406
Ahh, stand corrected :) Strange as it may seem I've only ever done hardware scrolled code and knew when the 6845 hit &8000 it went back to the start. Thought that would apply elsewhere :oops:


Top
 
PostPosted: Wed Jun 18, 2008 3:26 pm 
Offline
User avatar
 WWW  Profile

Joined: Thu Apr 03, 2008 2:49 pm
Posts: 277
Location: Antarctica
Sorvad: Cheers for that STH tip, I found it and got rid of my flicker. I used the method of IRQ timers to set my 'vsync' just after I'd drawn the last bit of my game area, rather than at the end of the total frame.

Thanks really should go to Rich of course, since he posted the article!

Linkage here


Top
 
PostPosted: Wed Jun 18, 2008 3:30 pm 
Offline
User avatar
 WWW  Profile

Joined: Wed Jan 09, 2008 10:23 am
Posts: 359
Location: Glasgow, Scotland
Rather than linking code like this to various posts they should really be added to the "Sample Code" section of this site for easier reference.

Kind regards,

Francis.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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