2020-09-16 21:04:18 +00:00
|
|
|
%import c64lib
|
|
|
|
%import c64graphics
|
2020-09-12 16:53:44 +00:00
|
|
|
%import c64textio
|
2020-09-06 15:58:05 +00:00
|
|
|
;%import c64flt
|
|
|
|
;%option enable_floats
|
2020-09-16 21:04:18 +00:00
|
|
|
%zeropage basicsafe
|
2020-09-05 00:05:28 +00:00
|
|
|
|
2020-08-27 17:47:50 +00:00
|
|
|
|
|
|
|
main {
|
2020-09-05 00:05:28 +00:00
|
|
|
|
2020-08-29 21:55:26 +00:00
|
|
|
;asmsub clear_screen (ubyte char @ A, ubyte color @ Y) clobbers(A) { ...}
|
|
|
|
; TODO dont cause name conflict if we define sub or sub with param 'color' or even a var 'color' later.
|
2020-08-28 23:44:20 +00:00
|
|
|
|
2020-08-29 21:55:26 +00:00
|
|
|
; sub color(...) {}
|
|
|
|
; sub other(ubyte color) {} ; TODO don't cause name conflict
|
2020-08-28 23:44:20 +00:00
|
|
|
|
2020-09-04 22:17:58 +00:00
|
|
|
|
2020-09-16 21:04:18 +00:00
|
|
|
sub start() {
|
2020-09-18 20:24:26 +00:00
|
|
|
|
|
|
|
ubyte edgeIdx=0
|
|
|
|
ubyte i
|
|
|
|
|
|
|
|
; TODO the following gives the correct output:
|
|
|
|
for i in 2 downto 0 {
|
|
|
|
ubyte e1
|
|
|
|
ubyte e2
|
|
|
|
e1 = edgeIdx
|
|
|
|
edgeIdx ++
|
|
|
|
e2 = edgeIdx
|
|
|
|
edgeIdx ++
|
|
|
|
txt.print_ub(e1)
|
|
|
|
c64.CHROUT(',')
|
|
|
|
txt.print_ub(e2)
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
}
|
|
|
|
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
edgeIdx=0
|
|
|
|
; TODO however with inline vardecl initializers the result is WRONG:
|
|
|
|
for i in 2 downto 0 {
|
|
|
|
ubyte e1 = edgeIdx
|
|
|
|
edgeIdx++
|
|
|
|
ubyte e2 = edgeIdx
|
|
|
|
edgeIdx++
|
|
|
|
txt.print_ub(e1)
|
|
|
|
c64.CHROUT(',')
|
|
|
|
txt.print_ub(e2)
|
|
|
|
c64.CHROUT('\n')
|
|
|
|
}
|
2020-09-16 21:04:18 +00:00
|
|
|
}
|
2020-08-27 17:47:50 +00:00
|
|
|
}
|