mirror of
https://github.com/irmen/prog8.git
synced 2025-01-11 13:29:45 +00:00
doc
This commit is contained in:
parent
50213f146a
commit
787f52d1f8
@ -33,10 +33,10 @@ graphics {
|
|||||||
|
|
||||||
sub line(uword @zp x1, ubyte @zp y1, uword @zp x2, ubyte @zp y2) {
|
sub line(uword @zp x1, ubyte @zp y1, uword @zp x2, ubyte @zp y2) {
|
||||||
; Bresenham algorithm.
|
; Bresenham algorithm.
|
||||||
; This code special cases various quadrant loops to allow simple ++ and -- operations.
|
; This code special-cases various quadrant loops to allow simple ++ and -- operations.
|
||||||
; TODO rewrite this in optimized assembly
|
; TODO rewrite this in optimized assembly
|
||||||
if y1>y2 {
|
if y1>y2 {
|
||||||
; make sure dy is always positive to avoid 8 instead of just 4 special cases
|
; make sure dy is always positive to have only 4 instead of 8 special cases
|
||||||
swap(x1, x2)
|
swap(x1, x2)
|
||||||
swap(y1, y2)
|
swap(y1, y2)
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,10 @@ with Prog8 are written like this.
|
|||||||
You can ``%import`` and use these modules explicitly, but the compiler may also import one or more
|
You can ``%import`` and use these modules explicitly, but the compiler may also import one or more
|
||||||
of these library modules automatically as required.
|
of these library modules automatically as required.
|
||||||
|
|
||||||
|
For full details on what is available in the libraries, look at their source code here:
|
||||||
|
https://github.com/irmen/prog8/tree/master/compiler/res/prog8lib
|
||||||
|
|
||||||
|
|
||||||
.. caution::
|
.. caution::
|
||||||
The resulting compiled binary program *only works on the target machine it was compiled for*.
|
The resulting compiled binary program *only works on the target machine it was compiled for*.
|
||||||
You must recompile the program for every target you want to run it on.
|
You must recompile the program for every target you want to run it on.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user