2019-07-16 21:56:00 +00:00
|
|
|
%import c64utils
|
|
|
|
%zeropage basicsafe
|
|
|
|
|
2019-07-29 21:11:13 +00:00
|
|
|
main {
|
2019-07-16 21:56:00 +00:00
|
|
|
|
|
|
|
struct Color {
|
|
|
|
ubyte red
|
|
|
|
ubyte green
|
|
|
|
ubyte blue
|
|
|
|
}
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
|
|
|
|
Color purple = {255, 0, 255}
|
|
|
|
|
|
|
|
Color other
|
|
|
|
|
|
|
|
other = purple
|
|
|
|
|
|
|
|
other.red /= 2
|
|
|
|
other.green = 10 + other.green / 2
|
|
|
|
other.blue = 99
|
|
|
|
|
|
|
|
c64scr.print_ub(other.red)
|
|
|
|
c64.CHROUT(',')
|
|
|
|
c64scr.print_ub(other.green)
|
|
|
|
c64.CHROUT(',')
|
|
|
|
c64scr.print_ub(other.blue)
|
|
|
|
c64.CHROUT('\n')
|
2020-03-12 23:27:33 +00:00
|
|
|
|
|
|
|
check_eval_stack()
|
2019-07-16 21:56:00 +00:00
|
|
|
}
|
2020-03-12 23:27:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
sub check_eval_stack() {
|
|
|
|
if X!=255 {
|
|
|
|
c64scr.print("stack x=")
|
|
|
|
c64scr.print_ub(X)
|
|
|
|
c64scr.print(" error!\n")
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-07-16 21:56:00 +00:00
|
|
|
}
|