Re: Is SBASIC programming on SMSQE difficult?
Posted: Tue Jan 11, 2022 9:46 am
SET_PRIORITY or SPJOB and the like won't change much (or anything at all) in the behaviour of a system that runs only one job. Whether you set the priority to 1 or 127, doesn't really matter, that one job will still receive all of the CPU. You won't see an effect.
Priority of a job is only relevant with regards to a job's runtime when there is more than one active job competing for CPU time because it is only used by the OS to determine the amount of CPU to distribute to jobs relative to each other. So, all in all, setting the priority of a job is not really usable to adjust the responsitivity of a game.
Sending a job to sleep with SUSJB can actually change responsitivity. The problem is that the original QL gets pretty busy with the overhead of re-scheduling (even if there is only a limited number of jobs running) jobs on a SUSJB, so the granularity available for adjustment is pretty coarse. In my experience, the difference between suspending a job for zero frames (SUSJB -1, 0) (which only does a re-scheduling) and suspending a job for one frame (SUSJB -1,1) is absolutely neglectable, the difference between not suspending at all and SUSJB -1,0 is huge. (That is, re-scheduling after a SUSJB by the system takes much longer than any of the small wait times you might possibly want to wait for) Alltogether, SUSJB is also not a very usable method to time a game.
I think:
For a beginner like you, Tiny, the only timing aid that really makes sense (and will make you see results quickly) is delay loops (but please make them adjustable). Once more advanced, you might be wanting to look into PAUSE with a timeout, then into Dilwyn's timer extension. Note all timing on the QL is still pretty coarse-grained due to the limited QL hardware - The smallest delay you can build is 20ms (I think you've asked for that in an earlier question), because that is the most fine-grained timing source the QL has (Note that is, in comparison, not particularily bad - The IBM PC's smalled timing granularity used to be 18.2ms for a very long time)
Priority of a job is only relevant with regards to a job's runtime when there is more than one active job competing for CPU time because it is only used by the OS to determine the amount of CPU to distribute to jobs relative to each other. So, all in all, setting the priority of a job is not really usable to adjust the responsitivity of a game.
Sending a job to sleep with SUSJB can actually change responsitivity. The problem is that the original QL gets pretty busy with the overhead of re-scheduling (even if there is only a limited number of jobs running) jobs on a SUSJB, so the granularity available for adjustment is pretty coarse. In my experience, the difference between suspending a job for zero frames (SUSJB -1, 0) (which only does a re-scheduling) and suspending a job for one frame (SUSJB -1,1) is absolutely neglectable, the difference between not suspending at all and SUSJB -1,0 is huge. (That is, re-scheduling after a SUSJB by the system takes much longer than any of the small wait times you might possibly want to wait for) Alltogether, SUSJB is also not a very usable method to time a game.
I think:
For a beginner like you, Tiny, the only timing aid that really makes sense (and will make you see results quickly) is delay loops (but please make them adjustable). Once more advanced, you might be wanting to look into PAUSE with a timeout, then into Dilwyn's timer extension. Note all timing on the QL is still pretty coarse-grained due to the limited QL hardware - The smallest delay you can build is 20ms (I think you've asked for that in an earlier question), because that is the most fine-grained timing source the QL has (Note that is, in comparison, not particularily bad - The IBM PC's smalled timing granularity used to be 18.2ms for a very long time)