SteveB Posted March 3, 2023 Share Posted March 3, 2023 3 minutes ago, fabrice montupet said: Focusing on the subject of the thread, is someone uses some other tricks to get a timer on XB? I use the hidden sprite frequently and had no reason to look for alternatives yet. 1 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 3, 2023 Share Posted March 3, 2023 2 minutes ago, SteveB said: I use the hidden sprite frequently and had no reason to look for alternatives yet. Seems that it is the best solution that we use 🙂 The other solution proposed by Harry is really clever too, I will make some tests using it to see the pro and cons of these each tricks. 2 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 4, 2023 Author Share Posted March 4, 2023 @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 Classic99 QI399.063 2023-03-04 03-49-36.mp4 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 4, 2023 Author Share Posted March 4, 2023 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. Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 4, 2023 Author Share Posted March 4, 2023 I think the timer needs to decrement somewhat faster which will eventually mean I end up asking the VDP for the time as the sprite routine might miss?? Classic99 QI399.063 2023-03-04 04-38-07.mp4 1 Quote Link to comment Share on other sites More sharing options...
senior_falcon Posted March 4, 2023 Share Posted March 4, 2023 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 1 1 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 4, 2023 Author Share Posted March 4, 2023 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. Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 4, 2023 Author Share Posted March 4, 2023 Nice! Classic99 QI399.063 2023-03-04 05-37-57.mp4 Quote Link to comment Share on other sites More sharing options...
Retrospect Posted March 4, 2023 Author Share Posted March 4, 2023 works good in the game, just gotta get rest of code sorted out later. need to get off the computer for a bit , Classic99 QI399.063 2023-03-04 06-05-23.mp4 Quote Link to comment Share on other sites More sharing options...
fabrice montupet Posted March 4, 2023 Share Posted March 4, 2023 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. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.