Dead Hackers Society
Other BBSes »
 
 
Demoscene  Coding  CT60  Buy/sell

Atari coding BBS
 
jsr (a0) from within vbl
Posted by: Per Almered (XiA) Jul,23.2009-18:51 

Me again with another "why doesn't this work?" question... 8-)

I'd like to be able to call different subroutines at the end of the VBL to make it easy to have precalcing stuff going on in the background, so I figured this would be a good idea:

[normal code]
lea blankextra,a0
move.l a0,extraroutine

vbl: ; hooked at $70
[...all sorts of stuff]
move.l extraroutine,a0
jsr (a0)
rts

blankextra
rts

extraroutine dc.l 0

...and then I could just switch in different routines by placing their addresses at the address of the "extraroutine" label.

In "regular code" this works fine, but not from within the vbl, which might be because it's an exception thing (but I *DO* have an RTS at the end of the vbl, not an RTE!)

Is there a good solution to this problem? Apart from making lots of different VBL routines?


Thanks in advance,

Per.







[All messages in this thread]    [Start new thread]

Topic Posted by  Date 
jsr (a0) from within vbl Per Almered (XiA) Jul,23.2009-18:51
  Re: jsr (a0) from within vbl PeP Jul,23.2009-19:28
    Re: jsr (a0) from within vbl Per Almered (XiA) Jul,23.2009-21:38
      Re: jsr (a0) from within vbl PeP Jul,24.2009-01:46
        Re: jsr (a0) from within vbl Per Almered/XiA Jul,24.2009-06:39
  Re: jsr (a0) from within vbl mikro Jul,24.2009-08:40
    Re: jsr (a0) from within vbl mikro Jul,24.2009-08:44
    Re: jsr (a0) from within vbl Per Almered (XiA) Jul,24.2009-09:26
      Re: jsr (a0) from within vbl mikro Jul,24.2009-10:35
        Re: jsr (a0) from within vbl PeP Jul,24.2009-15:40
          Re: jsr (a0) from within vbl Per Almered (XiA) Jul,24.2009-22:13


Reply to this message
Name:
Topic:
Anti-troll code:

Message:

What's the anti-troll code?
That's your personal code to be able to add comments and messages on the dhs.nu site.
Don't have a code or forgot it? Fix it here.
© 1994-2024 Dead Hackers Society Contact: Anders Eriksson