|
Post by minsoft on Sept 20, 2020 13:16:09 GMT -5
Has anyone written a dot drawing routine that uses less CPU cycles than the BIOS functions?
I'm using 'Dot_d' but when drawing numerous dots (especially at different intensities) it uses a lot of cycles. I've tried the other BIOS functions but have found I get best results with Dot_d.
I am guessing it is feasible to write a better routine than the BIOS ones, although it's beyond me.
|
|
|
Post by Peer on Sept 21, 2020 13:00:29 GMT -5
Has anyone written a dot drawing routine that uses less CPU cycles than the BIOS functions?
I'm using 'Dot_d' but when drawing numerous dots (especially at different intensities) it uses a lot of cycles. I've tried the other BIOS functions but have found I get best results with Dot_d.
I am guessing it is feasible to write a better routine than the BIOS ones, although it's beyond me.
Hi there, I have used those routines some time ago for drawing a star field, and that actually worked pretty well.
As far as I recall, the number of cycles used by the BIOS dot drawing routines essentially depends on the current value of Vec_Dot_Dwell ($C828) which basically works like a counter. It determines the number of loops in which the on-beam rests at its current position before switching off.
The resulting brightness of the dot on the screen is influenced by two factors: the current intensity of the vector beam (as set in the usual way) and the value of Vec_Dot_Dwell. So a constant value of Vec_Dot_Dwell combined with varying intensities gives dots of different brightness, and a constant intensity combined with varying values of Vec_Dot_Dwell also gives dots of different brightness. And some high value of Vec_Dot_Dwell + some low intensity can result in the very same optical result on the screen as some low value of Vec_Dot_Dwell + some high intensity of the vector beam.
The best performance is obtained by setting Vec_Dot_Dwell to 1 and then varying the vector beam intensity. I do not clearly remember which specific routine I used and if all of the BIOS dot drawing routines respect Vec_Dot_Dwell, but at least some of them do. But that can easily be checked either by trial or by looking ab the BIOS code. Hope this helps in some way. Cheers, Peer
|
|
|
Post by minsoft on Sept 22, 2020 17:36:24 GMT -5
Hi Peer,
Many thanks for your reply. That's interesting, I realised some of the dot drawing functions relied on Vec_Dot_Dwell, but hadn't thought of varying that as well as the intensity.
I have been using dots for (among other things) a background star field like yourself, but really can't spare many CPU cycles to draw it. I have since discovered Malban's macro equivalents of the bios routines so I think aside from drawing I can save some cycles by using MOVE_TO_D instead of Moveto_d.
I will have a play around with your suggestion and see how it goes.
Thanks again,
Steve
|
|
|
Post by minsoft on Sept 24, 2020 16:01:44 GMT -5
Just to follow up, I found that setting Vec_Dot_Dwell to 1 prior to drawing my (8) stars has saved ~150 cycles.
Using:
MOVE_TO_D (Malban's macro) JSR Dot_here
...instead of:
JSR Dot_d
...has saved ~400 cycles.
However I'm still using ~2500 cycles just to draw 8 dots which is much more than I'd like. MOVE_TO_D accounts for more than half of that. I think I'll try drawing half of them in one frame and the other half the next...
|
|