Calvin Allett wrote:
> so would it seem feasable to be able to alter the routine 
> with a flag, so that it jumps straight back every other frame 
> and only draws the other frames?

"`Assuming you don't need to worry about redrawing them if they haven't 
`moved
`you could simply add your own interrupt handler to check whether the
`positions are the same and don't call the sprite routine if they are.
`
`If your BASIC program _is_ changing the display then you will have to 
`call
`them every frame anyway, since the masks will go horribly wrong 
`otherwise
`(in fact, won't they anyway?)"

The game I`m thinking is a simplistic Super Sprint type game, and
they`d be travelling over road graphics that wouldn`t be changing,
so that`s not a problem, but I see what you mean.

i hadn`t thought of actually adding in anything to the routine, apart
from wondering if it could be slowed down to not run as often, and give
more speed to Basic, but your idea sounds even better, checking the coords
and only changing/drawing if they change :) that sounds to be the best.

----------
 
`I'm confused why you'd want to fake hardware sprites with interrupts 
`anyway,
`why not just write some MC to blat the sprite and call it from your 
`BASIC
`routine? That gives much more fine-grained control.

I don`t know :D I`m loving the extra speed of the Put command
in MasterBasic, and just wanting/needing more speed than the generic
routine offers, and coming across this little 4 `sprite` routine
just got me excited (even if it`s only 8*8 graphics)... It would
actually be better to use a routine that I could Call when required,
and not waste time though... never been a fan of interrupts in Basic,
as they slow it down terribly :)


`Anyway, something like:
` 
`MyInt:
`      PUSH HL
`      PUSH BC
`Sprite1:
`            LD BC, 0000
`            LD HL, (SpritePos1)
`            SBC HL, BC
`            JP Z, GoSprites
`Sprite2:
`            LD BC, 0000
`            LD HL, (SpritePos2)
`            SBC HL, BC
`            JP NZ, GoSprites
`Sprite3:
`            LD BC, 0000
`            LD HL, (SpritePos3)
`            SBC HL, BC
`            JP NZ, GoSprites
`Sprite4:
`            LD BC, 0000
`            LD HL, (SpritePos4)
`            SBC HL, BC
`            JP NZ, GoSprites
`      POP BC
`      POP HL
`            reti
`GoSprites:
`            LD HL, (SpritePos1)
`            LD (Sprite1+1), HL
`            LD HL, (SpritePos2)
`            LD (Sprite2+1), HL
`            LD HL, (SpritePos3)
`            LD (Sprite3+1), HL
`            LD HL, (SpritePos4)
`            LD (Sprite4+1), HL
`      POP BC
`      POP HL
`            JP OldHandler
`
`It's not exactly optimal but it's fairly obvious what it does.
`

hehe, cheers for the example Geoff, but I`m afraid I`m still
to learn MC, I can understand the LD commands, and i think I`ve
got the general idea of what POPs and JP`s do, but as soon
as I start to think about having to have graphics in special formats
etc it puts me off learning MC... I have dl`d some MC books from
WoSpec recently though *_+

thanks again :)

Cal...


       
---------------------------------
 Yahoo! Answers - Got a question? Someone out there knows the answer. Tryit now.

Reply via email to