Now, I should warn you, I was a bit surprised to learn you're using this for a real-time game like Solid Gunner Complete. I mean, hey, if it manages to perform well enough, that's great, but just keep in mind that ALINE is way slower than GLINE, so just be aware that it could lead to slowdowns.
This benchmark should illustrate that:
EXEC "PRG1:ALINE.LIB"
'Try making these smaller to generate shorter lines
W=400
H=240
ACLS
AVG=0
NUM=0
WHILE TRUE
LINES=0
FRAME=MAINCNT
WHILE MAINCNT==FRAME
X0=RND(W):Y0=RND(H)
X1=RND(W):Y1=RND(H)
C=RND(&HFFFFFF) OR &HFF000000
'Try replacing ALINE with ELINE or GLINE
ALINE X0,Y0,X1,Y1,C
INC LINES
WEND
AVG=(NUM*AVG+LINES)/(NUM+1)
INC NUM
CLS
COLOR #TWHITE,#TBLACK
?AVG
COLOR #TWHITE,0
WEND
This generates random lines on the screen and prints how many lines on average are drawn per frame.
On my New 3DS:
- ALINE averages about 1.6 lines per frame.
- ELINE averages about 10.6 lines per frame.
- GLINE averages a whopping 1385 lines per frame.
If I clock it down to old 3DS speeds using CFW:
- ALINE averages about 1.0 lines per frame.
- ELINE averages about 2.1 lines per frame.
- GLINE averages about 297 lines per frame.
Now, it's a little better than it looks, since longer lines
are more expensive than shorter ones, so modifying the benchmark to use a 50x50 region rather than 400x240 can get you up to about 10 lines per frame for ALINE on New 3DS.
The huge difference in performance between ALINE and GLINE is just a consequence of the fact that GLINE uses native code to draw its lines, while ALINE is forced to use SmileBASIC, with relatively slow commands like GSPOIT (for color blending) and GPSET.