Waiting routine in assembly

Basic and Machine Language

Moderator: Moderators

Post Reply
Programmer
Vic 20 Newbie
Posts: 1
Joined: Wed Apr 24, 2019 5:05 am

Waiting routine in assembly

Post by Programmer »

I am stuck with a problem. In my game, which I write in assembler, I have to slow down the speed, which is also flexible. However, this routine sometimes interferes with the joystick query. How can I solve this without interrupt?
User avatar
J.E.E.K.
Vic 20 Drifter
Posts: 23
Joined: Wed Jan 25, 2017 12:31 pm
Website: http://klasek.at/8bit
Location: AT

Re: Waiting routine in assembly

Post by J.E.E.K. »

Programmer wrote: Wed Apr 24, 2019 5:11 am I am stuck with a problem. In my game, which I write in assembler, I have to slow down the speed, which is also flexible. However, this routine sometimes interferes with the joystick query. How can I solve this without interrupt?
In case you are using a delay routine which only burns cpu cycles it might be better to put the joytick query into the loop, optional with a condition to temporarily leave the loop as soon as a joystick action is recognized (at least to store the joystick state for later movements) ... Simply to prevent some reaction lag for joystick movements during delay loops. Just an idea ...
User avatar
Noizer
Vic 20 Devotee
Posts: 297
Joined: Tue May 15, 2018 12:00 pm
Location: Europa

Re: Waiting routine in assembly

Post by Noizer »

yes J.E.E.K, show the source code 😅
Valid rule today as earlier: 1 Byte = 8 Bits
-._/classes instead of masses\_.-
groepaz
Vic 20 Scientist
Posts: 1187
Joined: Wed Aug 25, 2010 5:30 pm

Re: Waiting routine in assembly

Post by groepaz »

the most common way to do this is to set up an interrupt (synced to the screen refresh might be a good idea), and then have a frame counter. once you have that, you can use the frame counter to make things happen every Nth frame
I'm just a Software Guy who has no Idea how the Hardware works. Don't listen to me.
Post Reply