prog8/examples/test.p8

63 lines
1.4 KiB
Plaintext
Raw Normal View History

2019-07-01 21:41:30 +00:00
%import c64utils
%zeropage basicsafe
2019-03-29 01:13:28 +00:00
~ main {
2019-07-08 13:13:24 +00:00
sub start() {
uword derp
2019-07-12 12:38:37 +00:00
ubyte[] v = [22,33,44]
2019-07-12 12:38:37 +00:00
Color foreground
Color foreground2 = [11,22,33]
foreground.red = 111
; foreground2.red = 111
}
2019-07-12 12:38:37 +00:00
; sub test() {
; Color foreground ; = [0,1,2] ;@todo init values
; Color background
; Color cursor
;
; foreground.red=99
; background.blue=foreground.red
;
; cursor = [1,2,3] ; assign all members at once
; cursor = v
; cursor=foreground ; @todo memberwise assignment
;
; c64scr.print_ub(foreground.red)
; c64.CHROUT(':')
; c64scr.print_ub(foreground.green)
; c64.CHROUT(':')
; c64scr.print_ub(foreground.blue)
; c64.CHROUT('\n')
; c64scr.print_ub(background.red)
; c64.CHROUT(':')
; c64scr.print_ub(background.green)
; c64.CHROUT(':')
; c64scr.print_ub(background.blue)
; c64.CHROUT('\n')
; c64scr.print_ub(cursor.red)
; c64.CHROUT(':')
; c64scr.print_ub(cursor.green)
; c64.CHROUT(':')
; c64scr.print_ub(cursor.blue)
; c64.CHROUT('\n')
;
; return
; }
2019-07-12 04:14:59 +00:00
struct Color {
ubyte red
ubyte green
ubyte blue
}
2019-07-12 04:14:59 +00:00
; @todo structs as sub args. After strings and arrays as sub-args.
; sub foo(Color arg) -> ubyte {
; return arg.red+arg.green+arg.blue
; }
}