Dont worry about the speed, just order a mayhem accelerator ;) But yes,
redrawing the entire screen can be very slow. Ideally what you do is
more like:
Clear the grab buffers
Loop:
Set the display to page 1
Update your game logic, move the cars etc
Put the contents of grab buffer 2 back in the old
position for each sprite
Grab the area under each sprite into their grab buffer
2, remember the position for redrawing
Use the MC sprite routine to draw the sprites on page 2
in the positions
Set the display to page 2, showing the sprites in the
new position
Update your game logic, move cars etc
Put the contents of grab buffer 1 back in the old
position for each sprite
Grab the area under each sprite into their grab buffer
1, remember the position for redrawing
Use the MC sprite routine to draw the sprites on page 1
in the positions
Repeat
This is a little more tricky as you have to keep 2 copies of the grab
buffer (one for each screen, apparently some people say you can do it
with one buffer but ive not had much luck with that).
It depends on the MC routine, some do know about the Screen/display
commands, some don't, its not always that hard to alter. The grabbing
is a similar MC routine.
Adrian
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Calvin Allett
Sent: 16 May 2007 02:46
To: Adrian
Subject: RE: MC Interrupts
`Did someone call? ;) Yes it was the early issues, it was issues 1-5 i
think,
` i was only talking to colin this evening about that, now ive moved i
` really need to get on with finishing it, although i lost all my code
` when i lost the sam harddrive. Ive now got a sam in a can and have
` some new flash cards on order so ill get back to it and finish the
` little game, maybe some articles on learning mc can be arranged.
A S-I-A-Can.... Lucky Bas... erm... I mean sweet :D I haven`t got the
articles
in question, but meaning to get those issue`s, so if you`ll be hopefully
doing
more then that`s brilliant.
`To use something like that from basic, you could just do the following
` (this is off the top of my head after a bottle of wine, so it maybe
` wrong ;) ) But each frame you could do the following (its basically
` a double buffer system but from basic). When i say page 1, page 2 -
` i don't mean physical memory pages, but any particular page, again
` from memory it might have been the screen command that allowed you
` to open up and use different screens. If you don't know then ill
` try and dig up the info tomorrow.
Yeah, your right, it`s the Screen command, with also the Display
command for the flipping.. :) Would a MC routine, know which
area in RAM to draw too, if Basic was flipping screens though, just
thought. OR
could a copy of a routine be used to either draw to screen 1 or 2, so
from
Basic call the correct one? I`m never sure if you can have a small MC
routine, and a copy, because if they both need to be paged in or
whatever...
`IN BASIC:
`
` Set the display to page 1`
`
` Update your game logic, move the cars etc`
`
` Use the MC sprite routine to draw the sprites on page 2
in the positions`
`
` Set the display to page 2, showing the sprites in the
new position`
`
` Update your game logic, move cars etc
`
` Use the MC sprite routine to draw the sprites on page 1
in the positions
`
`
`
` Repeat ;)
`
`
`
`You still need to either A) handle storing what was under the sprites
` and putting it back, or B) just redraw the entire screen before you
` draw the sprites. B) is the easiest to start with but can be slow,
` but the key is to get things working then speed them up. Doing this
` you are only actually updating when you want to, you don't need
interrupts,
` you don't need anything clever in MC to do checking etc.
I`ve tried drawing the complete (well 2/3rd`s of the screen) using
double
buffering in `Jimf `n Oobs` and it knocks it to about 4 fps, so been
thinking
of for a car game, defining area`s where cars may be, since the tracks
will only be about 24 pixels high or wide and drawing that if a car/s
is in that region, this shouldn`t be much of a problem...
I`ll try and knock up a demo of what I have in mind over the next few
days,
and you can hopefully see whether or not you think a MC routine would be
possible/beneficial :)
`I might be completely off track here, so let me know J
`Adrian.
Your not ;) Oh, and `off track`.... very good, is that a pun :)
Cal...
________________________________
The all-new Yahoo! Mail
<http://us.rd.yahoo.com/mail/uk/taglines/default/nowyoucan/free_from_isp
/*http:/us.rd.yahoo.com/evt=40565/*http:/uk.docs.yahoo.com/nowyoucan.htm
l> goes wherever you go - free your email address from your Internet
provider.
APB Computer Services Ltd. Registered Address: 3 Springfield, Trevadlock,
Congdons Shop, Launceston, Cornwall, PL15 7PW. Registration Number: 4942193.
V.A.T. No: 826 0005 70
This email and any files transmitted with it are confidential and intended
solely for the use of the individual or entity to whom they are addressed. If
you have received this email in error please notify the system manager. This
message contains confidential information and is intended only for the
individual named. If you are not the named addressee you should not
disseminate, distribute or copy this e-mail. Please notify the sender
immediately by e-mail if you have received this e-mail by mistake and delete
this e-mail from your system. If you are not the intended recipient you are
notified that disclosing, copying, distributing or taking any action in
reliance on the contents of this information is strictly prohibited.