Jump to content
IGNORED

Tricky XB Commands .. need a timer.


Retrospect

Recommended Posts

@fabrice montupet Yes I'd like to test that method too.  I did do a test , unrelated to this game, of the VDP timer in some other code I was doing but I wasn't happy with the results, unless I did it wrong.  I always assume the latter, first, because 9 times out of 10, that is the case :)
 

 

 

Link to comment
Share on other sites

6 hours ago, SteveB said:

I use the hidden sprite frequently and had no reason to look for alternatives yet.

The only way I've seen that fail is if there's been too many things going on and the checks have been missed, but if we use position 248 instead of 255 it probably won't fail.

 

Link to comment
Share on other sites

This program counts down from 30 seconds to 0 seconds. It keeps good time. Or would if my Classic99 ran at 60 frames per second. It is running at around 70 frames per second for some reason.

All this does is check the byte at >8379 and obviously your program will be doing many  other things. As long as you do the CALL PEEK more than once per second you should be OK.


100 CALL CLEAR :: SEC=30 :: CALL LOAD(-31879,0)
110 CALL PEEK(-31879,X):: IF X<60 THEN 110
120 X=X-60 :: CALL LOAD(-31879,X):: SEC=SEC-1 :: DISPLAY AT(10,13):SEC :: IF SEC>0 THEN 110

 

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, senior_falcon said:

This program counts down from 30 seconds to 0 seconds. It keeps good time. Or would if my Classic99 ran at 60 frames per second. It is running at around 70 frames per second for some reason.

All this does is check the byte at >8379 and obviously your program will be doing many  other things. As long as you do the CALL PEEK more than once per second you should be OK.


100 CALL CLEAR :: SEC=30 :: CALL LOAD(-31879,0)
110 CALL PEEK(-31879,X):: IF X<60 THEN 110
120 X=X-60 :: CALL LOAD(-31879,X):: SEC=SEC-1 :: DISPLAY AT(10,13):SEC :: IF SEC>0 THEN 110

 

Thanks @senior_falcon I'll put that code in.  
 

Link to comment
Share on other sites

4 hours ago, Retrospect said:

The only way I've seen that fail is if there's been too many things going on and the checks have been missed, but if we use position 248 instead of 255 it probably won't fail.

 

In my Timer subprogram I use the value 248 because the main program branches to many other subprograms so have many things to do. In the Timer subprogram I also added the check for the automotion projectile sprites to be prevent appearing on the other side of the screen when they have reached a border.

  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...